Skip to content

Commit

Permalink
NR S7a: revert 182efc0, add alternative fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sevu committed Nov 8, 2018
1 parent 9fa9c01 commit 7974592
Showing 1 changed file with 60 additions and 20 deletions.
80 changes: 60 additions & 20 deletions data/campaigns/Northern_Rebirth/scenarios/07a_Settling_Disputes.cfg
Expand Up @@ -753,7 +753,6 @@
amount=1
[/heal_unit]
{CLEAR_VARIABLE heal_amount}
[message]
speaker=Tallin
Expand Down Expand Up @@ -938,30 +937,71 @@
[event]
name=victory
[modify_unit]
[filter]
id=Stalrag
[/filter]
# This complex code is used instead of [modify_unit] because it
# - allows to add the loyal trait at first place in the trait list
# - leaves the units on the field as is, the changes are only visible in the next scenario
side=1
canrecruit=no
overlays="misc/loyal-icon.png"
{TRAIT_LOYAL}
[/modify_unit]
[modify_unit]
[store_unit]
# Get references to the new companions joining us next scenario.
[filter]
id=Ro'Arthian,Ro'Sothian
id="Stalrag,Ro'Arthian,Ro'Sothian"
[/filter]
variable=new_companions
kill=no # Leave them visible on the field during linger mode.
[/store_unit]
side=1
canrecruit=no
overlays="misc/hero-icon.png"
ellipse="misc/ellipse-hero"
{TRAIT_LOYAL}
[/modify_unit]
[foreach]
array=new_companions
[do]
{VARIABLE this_item.side 1}
{VARIABLE this_item.canrecruit no}
# We'll be unstoring these units onto the recall list, which won't heal them automatically, so we do it here.
{CLEAR_VARIABLE this_item.attacks_left}
{CLEAR_VARIABLE this_item.moves}
{CLEAR_VARIABLE this_item.hitpoints}
{CLEAR_VARIABLE this_item.status}
# Must be cleared too, otherwise the loyal trait won't change it
{CLEAR_VARIABLE this_item.upkeep}
# Stalrag gains the loyal and healthy traits, while Ro'Arthian and Ro'Sothian get loyal and undead.
[if]
[variable]
name=this_item.id
equals=Stalrag
[/variable]
[then]
{VARIABLE this_item.overlays misc/loyal-icon.png}
[set_variables]
name=this_item.modifications
mode=replace
[literal]
{TRAIT_LOYAL}
{TRAIT_HEALTHY}
[/literal]
[/set_variables]
[/then]
[else]
{VARIABLE this_item.overlays misc/hero-icon.png}
{VARIABLE this_item.ellipse misc/ellipse-hero}
[set_variables]
name=this_item.modifications
mode=replace
[literal]
{TRAIT_LOYAL}
{TRAIT_UNDEAD}
[/literal]
[/set_variables]
[/else]
[/if]

[unstore_unit]
# Put our referenced units onto the recall list so we have them in the next scenario.
variable=this_item
x,y=recall,recall
[/unstore_unit]
[/do]
[/foreach]

{CLEAR_VARIABLE defeat_arthian}
{CLEAR_VARIABLE new_companions,defeat_arthian}
[/event]

# And if the allied AI dies player loses
Expand Down

0 comments on commit 7974592

Please sign in to comment.