UtBS: added hero icon to ally

This commit is contained in:
Asa Swain 2006-04-11 03:33:51 +00:00
parent 928cd0acf4
commit 9a05b68329
2 changed files with 63 additions and 5 deletions

View file

@ -591,7 +591,7 @@ name=prestart
[/else]
[/if]
#recall heroes
# recall heroes
# this is a placeholder unit, used to make sure heroes recall
# in encampment hexes
{UNIT_ (Desert Hero) (Test) 1 51 41}
@ -603,8 +603,8 @@ name=prestart
description=Nym
[/recall]
#recall dwarf/troll
#name is Grog/Nog or Rogrimir/Jarl
# recall dwarf/troll
# name is Grog/Nog or Rogrimir/Jarl
[recall]
description=Rogrimir
@ -619,6 +619,7 @@ name=prestart
description=Nog
[/recall]
# kill placeholder unit
[kill]
x,y=51,41
animate=no
@ -704,9 +705,11 @@ name=prestart
[/then]
[/if]
#to do: put hero icon on troll/dwarf ally
# put hero icon on troll/dwarf ally
#initialize starting variables
{UNIT_OVERLAY description=$ally_name misc/hero-icon.png}
# initialize starting variables
[set_variable]
name=ally_must_live
@ -4902,6 +4905,10 @@ name=elf-land.ogg
immediate=yes
[/music]
# remove hero icon from troll/dwarf ally
{REMOVE_UNIT_OVERLAY description=$ally_name misc/hero-icon.png}
[/event]

View file

@ -95,3 +95,54 @@ multiply=-1
[/then]
[/if]
#enddef
# UNIT_OVERLAY adds an overlay to a unit, taking in a standard filter
#
# Example that gives all spearmen a book:
# {UNIT_OVERLAY type=Spearman items/book1.png}
#define UNIT_OVERLAY FILTER IMG
[store_unit]
[filter]
{FILTER}
[/filter]
variable=UNIT_OVERLAY_store
kill=no
[/store_unit]
{FOREACH UNIT_OVERLAY_store UNIT_OVERLAY_i}
{VARIABLE_OP UNIT_OVERLAY_tempx format
$UNIT_OVERLAY_store[$UNIT_OVERLAY_i].x}
{VARIABLE_OP UNIT_OVERLAY_tempy format
$UNIT_OVERLAY_store[$UNIT_OVERLAY_i].y}
[unit_overlay]
x=$UNIT_OVERLAY_tempx
y=$UNIT_OVERLAY_tempy
image={IMG}
[/unit_overlay]
{NEXT UNIT_OVERLAY_i}
{CLEAR_VARIABLE UNIT_OVERLAY_store}
#enddef
#define REMOVE_UNIT_OVERLAY FILTER IMG
[store_unit]
[filter]
{FILTER}
[/filter]
variable=UNIT_OVERLAY_store
kill=no
[/store_unit]
{FOREACH UNIT_OVERLAY_store UNIT_OVERLAY_i}
{VARIABLE_OP UNIT_OVERLAY_tempx format
$UNIT_OVERLAY_store[$UNIT_OVERLAY_i].x}
{VARIABLE_OP UNIT_OVERLAY_tempy format
$UNIT_OVERLAY_store[$UNIT_OVERLAY_i].y}
[remove_unit_overlay]
x=$UNIT_OVERLAY_tempx
y=$UNIT_OVERLAY_tempy
image={IMG}
[/remove_unit_overlay]
{NEXT UNIT_OVERLAY_i}
{CLEAR_VARIABLE UNIT_OVERLAY_store}
#enddef