Skip to content

Commit

Permalink
use [modify_unit] over store+unstore
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Aug 25, 2019
1 parent ef06634 commit 8610cc0
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 115 deletions.
22 changes: 3 additions & 19 deletions data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg
Expand Up @@ -603,28 +603,12 @@
[/variable]

[then]
[store_unit]
[modify_unit]
[filter]
side=2
[/filter]
kill=yes
variable=orcs
[/store_unit]
[foreach]
array=orcs
[do]
[set_variable]
name=this_item.moves
value=0
[/set_variable]
[unstore_unit]
variable=this_item
[/unstore_unit]
[/do]
[/foreach]
[clear_variable]
name=orcs
[/clear_variable]
moves=0
[/modify_unit]
[/then]
[/if]
[/event]
Expand Down
18 changes: 3 additions & 15 deletions data/campaigns/Dead_Water/scenarios/06_Uncharted_Islands.cfg
Expand Up @@ -218,24 +218,12 @@
id=Growloff
[/filter]

[store_unit]
variable=Growloff_stored
[modify_unit]
[filter]
id=Growloff
[/filter]
kill=yes
[/store_unit]

[set_variable]
name=Growloff_stored.hitpoints
value=1
[/set_variable]

[unstore_unit]
variable=Growloff_stored
[/unstore_unit]

{CLEAR_VARIABLE Growloff_stored}
hitpoints=1
[/modify_unit]

[message]
speaker=Growloff
Expand Down
22 changes: 4 additions & 18 deletions data/campaigns/Dead_Water/scenarios/11_Getting_Help.cfg
Expand Up @@ -112,33 +112,19 @@
message= _ "No matter. He was a fool. Now, you have done as I asked, grandson, so I will travel with you to your home and help you rid it of restless spirits. My priestesses will come as well, and will be at your disposal."
[/message]
# Switch Tyegea to side 1:
[store_unit]
[modify_unit]
[filter]
id=Tyegea
[/filter]
variable=Tyegea_stored
kill=yes
[/store_unit]
[set_variable]
name=Tyegea_stored.canrecruit
value=no
[/set_variable]
[set_variable]
name=Tyegea_stored.side
value=1
[/set_variable]
[unstore_unit]
variable=Tyegea_stored
[/unstore_unit]
side=1
canrecruit=no
[/modify_unit]
## TODO: im not sure what happens here, why is he getting the loyal overlay but not the real trait?
[unit_overlay]
x=$Tyegea_stored.x
y=$Tyegea_stored.y
image=misc/loyal-icon.png
[/unit_overlay]
[clear_variable]
name=Tyegea_stored
[/clear_variable]

[allow_recruit]
type=Mermaid Priestess
Expand Down
32 changes: 6 additions & 26 deletions data/campaigns/Dead_Water/scenarios/12_Revenge.cfg
Expand Up @@ -291,20 +291,12 @@
[/variable]

[then]
[store_unit]
[modify_unit]
[filter]
id=Mal-Kevek
[/filter]
variable=bad_guy_stored
kill=yes
[/store_unit]
[set_variable]
name=bad_guy_stored.name
value=Mal-Necross
[/set_variable]
[unstore_unit]
variable=bad_guy_stored
[/unstore_unit]
name="Mal-Necross"
[/modify_unit]
[/then]
[/if]

Expand All @@ -315,26 +307,14 @@
[/variable]

[then]
[store_unit]
[modify_unit]
[filter]
id=Mel Daveth
[/filter]
variable=bad_guy_stored
kill=yes
[/store_unit]
[set_variable]
name=bad_guy_stored.name
value=Mal-Verloth
[/set_variable]
[unstore_unit]
variable=bad_guy_stored
[/unstore_unit]
name="Mal-Verloth"
[/modify_unit]
[/then]
[/if]

[clear_variable]
name=bad_guy_stored
[/clear_variable]
[/event]

# This event shows KK on the edge of the map for a second, moves
Expand Down
21 changes: 5 additions & 16 deletions data/campaigns/Dead_Water/units/Brawler.cfg
Expand Up @@ -168,25 +168,14 @@
name=side turn end
first_time_only=no

[store_unit]
[modify_unit]
[filter]
side=$side_number
status=stunned
[/filter]
variable=stunned
[/store_unit]

[foreach]
array=stunned
[do]
{CLEAR_VARIABLE this_item.status.stunned}

[unstore_unit]
variable=this_item
[/unstore_unit]
[/do]
[/foreach]

{CLEAR_VARIABLE stunned}
[status]
stunned=no
[/status]
[/modify_unit]
[/event]
[/unit_type]
Expand Up @@ -374,6 +374,7 @@
[foreach]
array=units_inside_manor
[do]
# TODO: whats the point of killing it and then unstoring it here without changes?
[unstore_unit]
variable=this_item
find_vacant=no
Expand Down
Expand Up @@ -375,24 +375,13 @@
x,y=26,16
[/recall]

[store_unit]
[modify_unit]
[filter]
id=Darken Volk
[/filter]
kill=yes
variable=stored_Darken
[/store_unit]

{VARIABLE stored_Darken.side 3}
{VARIABLE stored_Darken.canrecruit yes}

{CLEAR_VARIABLE stored_Darken.ellipse}

[unstore_unit]
variable=stored_Darken
[/unstore_unit]

{CLEAR_VARIABLE stored_Darken}
side=3
canrecruit=yes
[/modify_unit]

[lock_view][/lock_view]
[/event]
Expand Down
Expand Up @@ -195,12 +195,6 @@
canrecruit=yes
role=book_carrier
[/modify_unit]

[unstore_unit]
variable=stored_Darken
[/unstore_unit]

{CLEAR_VARIABLE stored_Darken}
[/event]

[event]
Expand Down

0 comments on commit 8610cc0

Please sign in to comment.