remove [advancefrom] from mainline

See issue #3955
the intention is to deprecate [advancefrom] in
favour of [modify_unit_type], because it was a
common source of OOS errors, and it is less flexible.

As a secondary effect this also fixes issue #4402 :
"changing units via extra_defines sometimes not working
because extra_defines had bugs".
Now we no longer use extra_defines for that.

Addon authors should now no longer use these extra_defines,
instead put the new core marcos with the same name directly
into [campaign].
This commit is contained in:
gfgtdf 2020-03-08 00:32:07 +01:00
parent 0b8ec8de68
commit 3950f40f3f
16 changed files with 91 additions and 65 deletions

View file

@ -71,6 +71,10 @@
{campaigns/Dead_Water/units}
[/units]
[+campaign]
{ENABLE_KRAKEN}
[/campaign]
{campaigns/Dead_Water/scenarios}
[lua]

View file

@ -1,5 +1,13 @@
#textdomain wesnoth-dw
#define ENABLE_KRAKEN
[modify_unit_type]
id="Cuttle Fish"
add_advancement="Kraken"
set_experience=80
[/modify_unit_type]
#enddef
[unit_type]
id=Kraken
name= _ "Kraken"
@ -12,10 +20,6 @@
level=3
alignment=neutral
advances_to=null
[advancefrom]
unit=Cuttle Fish
experience=80
[/advancefrom]
attacks=1
{AMLA_DEFAULT}
cost=62

View file

@ -24,7 +24,6 @@
#endif
[campaign]
extra_defines=ENABLE_DWARVISH_RUNESMITH
id=LOW
define=CAMPAIGN_LOW
rank=160
@ -48,6 +47,7 @@
" + _"(Hard level, 18 scenarios.)"
{ENABLE_DWARVISH_RUNESMITH}
{CAMPAIGN_DIFFICULTY EASY "units/elves-wood/fighter.png~RC(magenta>brown)" ( _ "Soldier") ( _ "Easy")}
{CAMPAIGN_DIFFICULTY NORMAL "units/elves-wood/lord.png~RC(magenta>brown)" ( _ "Lord") ( _ "Normal")} {DEFAULT_DIFFICULTY}
{CAMPAIGN_DIFFICULTY HARD "units/elves-wood/high-lord.png~RC(magenta>brown)" ( _ "High Lord") ( _ "Challenging")}

View file

@ -14,9 +14,9 @@
start_year="25 YW"
end_year="40 YW"
define="CAMPAIGN_SCEPTRE_FIRE"
extra_defines=ENABLE_DWARVISH_RUNESMITH
first_scenario="1_A_Bargain_is_Struck"
{ENABLE_DWARVISH_RUNESMITH}
{CAMPAIGN_DIFFICULTY EASY "units/dwarves/fighter.png~RC(magenta>red)" ( _ "Fighter") ( _ "Normal")}
{CAMPAIGN_DIFFICULTY NORMAL "units/dwarves/steelclad.png~RC(magenta>red)" ( _ "Steelclad") ( _ "Challenging")} {DEFAULT_DIFFICULTY}
{CAMPAIGN_DIFFICULTY HARD "units/dwarves/lord.png~RC(magenta>red)" ( _ "Lord") ( _ "Difficult")}

View file

@ -13,7 +13,8 @@
start_year="22 YW"
end_year="23 YW"
first_scenario=01_Slipping_Away
extra_defines=ENABLE_ANCIENT_LICH,ENABLE_DEATH_KNIGHT
{ENABLE_DEATH_KNIGHT}
{ENABLE_ANCIENT_LICH}
{CAMPAIGN_DIFFICULTY EASY "units/undead-skeletal/skeleton/skeleton-idle-2.png~RC(magenta>red)"( _ "Unpleasant") ( _ "Normal")}
{CAMPAIGN_DIFFICULTY NORMAL "units/undead-skeletal/revenant/revenant-defend-2.png~RC(magenta>red)" ( _ "Corrupt") ( _ "Challenging")} {DEFAULT_DIFFICULTY}
{CAMPAIGN_DIFFICULTY HARD "units/undead-skeletal/deathknight.png~RC(magenta>red)" ( _ "Diabolic") ( _ "Difficult")}

View file

@ -0,0 +1,75 @@
#define ENABLE_ARMAGEDDON_DRAKE
[modify_unit_type]
id="Inferno Drake"
add_advancement="Armageddon Drake"
set_experience=220
[/modify_unit_type]
#enddef
#define ENABLE_DWARVISH_ARCANISTER
[modify_unit_type]
id="Dwarvish Runemaster"
add_advancement="Dwarvish Arcanister"
set_experience=210
[/modify_unit_type]
#enddef
#define ENABLE_DWARVISH_RUNESMITH
[modify_unit_type]
id="Dwarvish Fighter"
add_advancement="Dwarvish Runesmith"
[/modify_unit_type]
#enddef
#define ENABLE_WOLF_ADVANCEMENT
[modify_unit_type]
id="Wolf"
add_advancement="Great Wolf"
set_experience=30
[/modify_unit_type]
[modify_unit_type]
id="Great Wolf"
add_advancement="Direwolf"
set_experience=65
[/modify_unit_type]
#enddef
#define ENABLE_NIGHTBLADE
[modify_unit_type]
id="Orcish Slayer"
add_advancement="Orcish Nightblade"
set_experience=100
[/modify_unit_type]
#enddef
#define ENABLE_TROLL_SHAMAN
[modify_unit_type]
id="Troll Whelp"
add_advancement="Troll Shaman"
[/modify_unit_type]
#enddef
#define ENABLE_ANCIENT_LICH
[modify_unit_type]
id="Lich"
add_advancement="Ancient Lich"
set_experience=250
[/modify_unit_type]
#enddef
#define ENABLE_DEATH_KNIGHT
[modify_unit_type]
id="Revenant"
add_advancement="Death Knight"
set_experience=85
[/modify_unit_type]
#enddef
#define ENABLE_WOSE_SHAMAN
[modify_unit_type]
id="Wose"
add_advancement="Wose Shaman"
set_experience=80
[/modify_unit_type]
#enddef

View file

@ -12,12 +12,6 @@
level=4
alignment=lawful
advances_to=null
#ifdef ENABLE_ARMAGEDDON_DRAKE
[advancefrom]
unit=Inferno Drake
experience=220
[/advancefrom]
#endif
{AMLA_DEFAULT}
cost=85
usage=archer

View file

@ -20,12 +20,6 @@
usage=fighter
advances_to=null
experience=200
#ifdef ENABLE_DWARVISH_ARCANISTER
[advancefrom]
unit=Dwarvish Runemaster
experience=210
[/advancefrom]
#endif
{AMLA_DEFAULT}
description= _ "The most powerful of all the runecrafters, the Dwarvish Arcanister destroys wounded enemies almost instantly, and rarely fails to cause a wound when that is his intent. His skill in runecrafting is unrivaled, and the glyphs he carves into his weapons and armor deflect the blows of his enemies."
{NOTE_MAGICAL}

View file

@ -20,11 +20,6 @@
usage=fighter
experience=86
advances_to=Dwarvish Runemaster
#ifdef ENABLE_DWARVISH_RUNESMITH
[advancefrom]
unit=Dwarvish Fighter
[/advancefrom]
#endif
description= _ "Dwarvish runesmiths, now practiced at their craft, carve arcane runes into their weapons and armor. These runes infuse the runesmiths blows with power and accuracy, and disrupt the blows of their enemies, causing them to strike softly, weakly and on the armor of the defender."
{NOTE_MAGICAL}
{DEFENSE_ANIM "units/dwarves/runesmith-defend-2.png" "units/dwarves/runesmith-defend-1.png" {SOUND_LIST:DWARF_HIT} }

View file

@ -14,12 +14,6 @@
level=3
alignment=neutral
advances_to=null
#ifdef ENABLE_WOLF_ADVANCEMENT
[advancefrom]
unit=Great Wolf
experience=65
[/advancefrom]
#endif
cost=36
usage=scout
description=_ "Wolves are aggressive animals that hunt in packs. Although weak individually, a wolf pack can kill even the strongest man in minutes."

View file

@ -14,12 +14,6 @@
level=2
alignment=neutral
advances_to=null
#ifdef ENABLE_WOLF_ADVANCEMENT
[advancefrom]
unit=Wolf
experience=30
[/advancefrom]
#endif
cost=30
usage=scout
description=_ "Wolves are aggressive animals that hunt in packs. Although weak individually, a wolf pack can kill even the strongest man in minutes."

View file

@ -15,12 +15,6 @@
level=3
alignment=chaotic
advances_to=null
#ifdef ENABLE_NIGHTBLADE
[advancefrom]
unit=Orcish Slayer
experience=100
[/advancefrom]
#endif
{AMLA_DEFAULT}
cost=43
usage=mixed fighter

View file

@ -18,11 +18,6 @@
level=2
alignment=chaotic
advances_to=null
#ifdef ENABLE_TROLL_SHAMAN
[advancefrom]
unit=Troll Whelp
[/advancefrom]
#endif
{AMLA_DEFAULT}
cost=32
usage=mixed fighter

View file

@ -12,12 +12,6 @@
level=4
alignment=chaotic
advances_to=null
#ifdef ENABLE_ANCIENT_LICH
[advancefrom]
unit=Lich
experience=250
[/advancefrom]
#endif
{AMLA_DEFAULT}
cost=100
usage=mixed fighter

View file

@ -19,12 +19,6 @@
level=3
alignment=chaotic
advances_to=null
#ifdef ENABLE_DEATH_KNIGHT
[advancefrom]
unit=Revenant
experience=85
[/advancefrom]
#endif
{AMLA_DEFAULT}
cost=45
usage=fighter

View file

@ -8,12 +8,6 @@
{ABILITY_AMBUSH}
{ABILITY_REGENERATES}
[/abilities]
#ifdef ENABLE_WOSE_SHAMAN
[advancefrom]
unit=Wose
experience=80
[/advancefrom]
#endif
hitpoints=50
movement_type=treefolk
movement=3