add new macors to replace loyal trait.

This commit is contained in:
gfgtdf 2019-08-16 14:46:43 +02:00
parent f4ad4f11c7
commit aa07ec7915
4 changed files with 55 additions and 16 deletions

View file

@ -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

View file

@ -965,7 +965,6 @@
[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.
@ -973,6 +972,8 @@
{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.
@ -982,7 +983,6 @@
equals=Stalrag
[/variable]
[then]
{VARIABLE this_item.overlays misc/loyal-icon.png}
[set_variables]
name=this_item.modifications
mode=replace
@ -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

View file

@ -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

View file

@ -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]