Skip to content

Commit

Permalink
add new macors to replace loyal trait.
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Aug 25, 2019
1 parent f4ad4f1 commit aa07ec7
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 16 deletions.
8 changes: 1 addition & 7 deletions data/campaigns/Liberty/scenarios/08_Glory.cfg
Expand Up @@ -320,13 +320,7 @@
id=Harper
[/recall]

{UNMAKE_HERO Harper}

# He's still a loyal unit with dialogue when he dies
[unit_overlay]
id=Harper
image=misc/loyal-icon.png
[/unit_overlay]
{MAKE_LOYAL_NORMAL Harper}

[message]
speaker=Baldras
Expand Down
Expand Up @@ -965,14 +965,15 @@
[foreach]
array=new_companions
[do]
## TODO: does this still work after the overlays= change?
{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}
{CLEAR_VARIABLE this_item.overlays}
{CLEAR_VARIABLE this_item.ellipse}
# 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.
Expand All @@ -982,7 +983,6 @@
equals=Stalrag
[/variable]
[then]
{VARIABLE this_item.overlays misc/loyal-icon.png}
[set_variables]
name=this_item.modifications
mode=replace
Expand All @@ -993,8 +993,6 @@
[/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
Expand Down
Expand Up @@ -593,11 +593,7 @@
speaker=Thursagan
message= _ "Well, now we are in the caves again! Come on, back south, to the city."
[/message]
{UNMAKE_HERO Baglur}
[unit_overlay]
id=Baglur
image=misc/loyal-icon.png
[/unit_overlay]
{MAKE_LOYAL_NORMAL Baglur}
{CLEAR_VARIABLE thur_x,thur_y}
[endlevel]
result=victory
Expand Down
51 changes: 51 additions & 0 deletions data/core/macros/image-utils.cfg
Expand Up @@ -175,6 +175,57 @@
[/object]
#enddef

#define MAKE_NONLOYAL ID_STRING
[remove_trait]
id={ID_STRING}
trait_id=loyal
[/remove_trait]
#enddef

#define MAKE_LOYAL_HERO ID_STRING
## remove previous loyal trait if they exist.
[remove_trait]
id={ID_STRING}
trait_id=loyal
[/remove_trait]
[modify_unit]
[filter]
id={ID_STRING}
[/filter]
{TRAIT_LOYAL_HERO}
canrecruit=no
[/modify_unit]
#enddef

#define MAKE_LOYAL_NORMAL ID_STRING
## remove previous loyal trait if they exist.
[remove_trait]
id={ID_STRING}
trait_id=loyal
[/remove_trait]
[modify_unit]
[filter]
id={ID_STRING}
[/filter]
{TRAIT_LOYAL}
canrecruit=no
[/modify_unit]
#enddef

#define MAKE_LOYAL_LEADER ID_STRING
## remove previous loyal trait if they exist.
[remove_trait]
id={ID_STRING}
trait_id=loyal
[/remove_trait]
[modify_unit]
[filter]
id={ID_STRING}
[/filter]
canrecruit=yes
[/modify_unit]
#enddef

#define MAKE_HERO ID_STRING
# Give an existing unit a hero overlay
[unit_overlay]
Expand Down

0 comments on commit aa07ec7

Please sign in to comment.