use [remove_object] over [remove_unit_overlay] if possible

this just prevents the units wml from getting cuttered with many [objects]
(generated by the [unit_overlay] implementation) that cancel each other out.
(in the cases here it shouldn't really be a problem though, i still did it
because it feels clener this way)
This commit is contained in:
gfgtdf 2019-08-16 12:09:28 +02:00
parent a86df6c984
commit 26c2f941f2
5 changed files with 52 additions and 50 deletions

View file

@ -240,11 +240,6 @@
y=8
[/filter]
[then]
[unit_overlay]
x=15
y=8
image=overlays/arcane-icon.png
[/unit_overlay]
[remove_item]
x,y=15,8
[/remove_item]
@ -264,6 +259,10 @@
range=melee
set_type=arcane
[/effect]
[effect]
apply_to=overlay
add="overlays/arcane-icon.png"
[/effect]
[/object]
[/event]
[/event]

View file

@ -17,11 +17,6 @@
y={Y}
[/filter]
[then]
[unit_overlay]
x={X}
y={Y}
image=overlays/storm-trident-icon.png
[/unit_overlay]
[remove_item]
x={X}
y={Y}
@ -41,6 +36,10 @@
damage=14
number=2
[/effect]
[effect]
apply_to=overlay
add="overlays/storm-trident-icon.png"
[/effect]
{LIGHTNING_ANIMATION "storm trident" 1}
{LIGHTNING_ANIMATION "storm trident" 2}
@ -60,11 +59,6 @@
y={Y}
[/filter]
[then]
[unit_overlay]
x={X}
y={Y}
image=overlays/flame-sword-icon.png
[/unit_overlay]
[remove_item]
x={X}
y={Y}
@ -83,6 +77,10 @@
damage=8
number=4
[/effect]
[effect]
apply_to=overlay
add="overlays/flame-sword-icon.png"
[/effect]
[/object]
#enddef
@ -98,11 +96,6 @@
y={Y}
[/filter]
[then]
[unit_overlay]
x={X}
y={Y}
image=overlays/arcane-icon.png
[/unit_overlay]
[remove_item]
x={X}
y={Y}
@ -116,6 +109,10 @@
arcane=30
[/resistance]
[/effect]
[effect]
apply_to="overlay"
add="overlays/arcane-icon.png"
[/effect]
[/object]
#enddef
@ -313,11 +310,6 @@
y=$ring_y
[/filter]
[then]
[unit_overlay]
x=$ring_x
y=$ring_y
image=overlays/silver-ring-icon.png
[/unit_overlay]
[remove_item]
x=$ring_x
y=$ring_y
@ -332,6 +324,10 @@
increase_total=3
increase=3
[/effect]
[effect]
apply_to=overlay
add="overlays/silver-ring-icon.png"
[/effect]
[/object]
{CLEAR_VARIABLE get_ring}
{CLEAR_VARIABLE seen_ring_description}

View file

@ -180,23 +180,21 @@
x,y=2,26
[/recall]
[store_unit]
[remove_trait]
id=Darken Volk
trait_id="loyal"
[/remove_trait]
[modify_unit]
[filter]
id=Darken Volk
[/filter]
kill=yes
variable=stored_Darken
[/store_unit]
{VARIABLE stored_Darken.side 2}
{VARIABLE stored_Darken.canrecruit yes}
{VARIABLE stored_Darken.role book_carrier}
# Removes the loyal trait and other misc stuff
{CLEAR_VARIABLE stored_Darken.modifications.trait[0]}
{CLEAR_VARIABLE stored_Darken.overlays}
{CLEAR_VARIABLE stored_Darken.ellipse}
side=2
canrecruit=yes
role=book_carrier
[/modify_unit]
[unstore_unit]
variable=stored_Darken
@ -258,6 +256,7 @@
[unit_overlay]
id=Darken Volk
image="misc/book-icon.png"
object_id="book_icon"
[/unit_overlay]
{MODIFY_UNIT (id=Darken Volk) facing ne}
@ -794,6 +793,7 @@
[unit_overlay]
x,y=$x1,$y1
image="misc/book-icon.png"
object_id="book_icon"
[/unit_overlay]
[if]
@ -907,10 +907,10 @@
[/filter_location]
[/filter]
[remove_unit_overlay]
[remove_object]
role=book_carrier
image="misc/book-icon.png"
[/remove_unit_overlay]
object_id="book_icon"
[/remove_object]
{MOVE_UNIT (id=Malin Keshar) 1 8}

View file

@ -328,6 +328,8 @@
[unit_overlay]
x,y={POSITION}
image=items/gold-coins-small.png
duration=scenario
object_id="gold_icon"
[/unit_overlay]
[/then]
[/object]
@ -423,10 +425,10 @@
y=22
[/filter]
[remove_unit_overlay]
[remove_object]
role=gold_carrier
image=items/gold-coins-small.png
[/remove_unit_overlay]
object_id="gold_icon"
[/remove_object]
[endlevel]
result=victory

View file

@ -691,6 +691,7 @@
[unit_overlay]
x,y=$x1,$y1
image=misc/coal-icon.png
object_id="coal_icon"
[/unit_overlay]
[remove_item]
x,y=$x1,$y1
@ -728,6 +729,7 @@
[unit_overlay]
x,y=$x1,$y1
image=misc/coal-icon.png
object_id="coal_icon"
[/unit_overlay]
[remove_item]
x,y=$x1,$y1
@ -785,6 +787,7 @@
[unit_overlay]
x,y=$x1,$y1
image=misc/gold-icon.png
object_id="gold_icon"
[/unit_overlay]
[remove_item]
x,y=$x1,$y1
@ -852,6 +855,7 @@
[unit_overlay]
x,y=$x1,$y1
image=misc/coal-icon.png
object_id="coal_icon"
[/unit_overlay]
[remove_item]
@ -926,6 +930,7 @@
[unit_overlay]
x,y=$x1,$y1
image=misc/gold-icon.png
object_id="gold_icon"
[/unit_overlay]
[remove_item]
@ -964,10 +969,10 @@
find_vacant=no
[/unstore_unit]
[remove_unit_overlay]
[remove_object]
x,y=$x1,$y1
image=misc/coal-icon.png
[/remove_unit_overlay]
object_id="coal_icon"
[/remove_object]
[set_variable]
name=coalin
@ -1029,10 +1034,10 @@
find_vacant=no
[/unstore_unit]
[remove_unit_overlay]
[remove_object]
x,y=$x1,$y1
image=misc/gold-icon.png
[/remove_unit_overlay]
object_id="gold_icon"
[/remove_object]
[set_variable]
name=goldin