Weapon special "Dissolve"
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Weapon special "Dissolve"
I want one of my Free Saurian Units to have the a Weapon special called Dissolve. Whenever he kills a unit with dissolve all adjacent allies(of the Saurian) are healed by a Value. But the problem is, that I don't know how to do it. This is what i have so far:If I make a die event I can't filter for the attack used, but I can't think of a event making this possible.
Code: Select all
#define WEAPON_SPECIAL_DISSOLVE UNIT_TYPE HEAL_VALUE
[berserk]
name=_ "dissolve"
name_inactive=_ "dissolve"
description=_ "This Weapon special does s.th."
description_inactive=_ "This Weapon special does s.th."
value=1
[/berserk]
[/specials]
[event]
[/event]
[+specials]
#enddef
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: Weapon special "Dissolve"
Try something like this (1.4.x WML, untested) :
Code: Select all
#define WEAPON_SPECIAL_DISSOLVE RACE HEAL_VALUE
[dummy]
id=dissolve
name=_ "dissolve"
description=_ "This Weapon special does s.th."
[/dummy]
[/abilities]
[event]
name=die
first_time_only=no
# don't "disolve" if we kill a not living unit
[filter]
[not]
[wml_filter]
[status]
not_living="yes"
[/status]
[/wml_filter]
[/not]
[/filter]
[filter_second]
ability=dissolve
[/filter_second]
[store_unit]
variable=neighbour_ally
kill=no
[filter]
[filter_adjacent]
x,y=$x2,$y2
is_enemy=no
[/filter_adjacent]
race={RACE}
[/filter]
[/store_unit]
# this is for proper internationalisation (never call a macro inside a translatable string !)
[set_variable]
name=disolve_amount
value={HEAL_VALUE}
[/set_variable]
# send the heal message(s)
[unstore_unit]
{COLOR_HEAL}
text= _ "+$disolve_amount HP"
find_vacant=no
variable=neighbour_ally
[/unstore_unit]
[clear_variable]
name=neighbour_ally
[/clear_variable]
[clear_variable]
name=disolve_amount
[/clear_variable]
# heal
[object]
silent=yes
duration=forever
[filter]
[filter_adjacent]
x,y=$x2,$y2
is_enemy=no
[/filter_adjacent]
race={RACE}
[/filter]
[effect]
apply_to=hitpoints
increase={HEAL_VALUE}
violate_maximum=no
[/effect]
[/object]
[/event]
[+abilities]
#enddef
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" -- xtifr
Re: Weapon special "Dissolve"
Opps, i made an ability, not a weapon special
For the weapon special version, replace [/abilities] and [+abilities] with [/specials] and [+specials] and replace :
by
For the weapon special version, replace [/abilities] and [+abilities] with [/specials] and [+specials] and replace :
Code: Select all
[filter_second]
ability=dissolve
[/filter_second]
Code: Select all
[special_filter_second]
special=dissolve
[/special_filter_second]
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" -- xtifr
Re: Weapon special "Dissolve"
This is what I currently have, but it does nothing
Code: Select all
#define WEAPON_SPECIAL_DISSOLVE RACE HEAL_VALUE
[dummy]
id=dissolve
name=_ "dissolve"
description=_ "This Weapon special does s.th."
[/dummy]
[/specials]
[event]
name=die
first_time_only=no
# don't "disolve" if we kill a not living unit
[filter]
[not]
[wml_filter]
[status]
not_living="yes"
[/status]
[/wml_filter]
[/not]
[/filter]
[special_filter_second]
special=dissolve
[/special_filter_second]
[store_unit]
variable=neighbour_ally
kill=no
[filter]
[filter_adjacent]
x,y=$x2,$y2
is_enemy=no
[/filter_adjacent]
race={RACE}
[/filter]
[/store_unit]
# this is for proper internationalisation (never call a macro inside a translatable string !)
[set_variable]
name=disolve_amount
value={HEAL_VALUE}
[/set_variable]
# send the heal message(s)
[unstore_unit]
{COLOR_HEAL}
text= _ "+$disolve_amount HP"
find_vacant=no
variable=neighbour_ally
[/unstore_unit]
[clear_variable]
name=neighbour_ally
[/clear_variable]
[clear_variable]
name=disolve_amount
[/clear_variable]
# heal
[object]
silent=yes
duration=forever
[filter]
[filter_adjacent]
x,y=$x2,$y2
is_enemy=no
[/filter_adjacent]
race={RACE}
[/filter]
[effect]
apply_to=hitpoints
increase={HEAL_VALUE}
violate_maximum=no
[/effect]
[/object]
[/event]
[+specials]
#enddef
Code: Select all
[attack]
name=ice_ball
description= _"Ice Ball"
icon=attacks/iceball.png
type=cold
range=ranged
[specials]
{WEAPON_SPECIAL_MAGICAL}
{WEAPON_SPECIAL_DISSOLVE lizard 8}
[/specials]
damage=8
number=3
[/attack]
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Re: Weapon special "Dissolve"
The wiki says only one [specials] entry is supported, try removing the "{WEAPON_SPECIAL_MAGICAL}".
EDIT: Never mind. As megane says, the wiki was wrong. It just got fixed about the time I posted that.
EDIT: Never mind. As megane says, the wiki was wrong. It just got fixed about the time I posted that.
Last edited by doofus-01 on April 20th, 2008, 3:37 pm, edited 1 time in total.
-
- Art Contributor
- Posts: 410
- Joined: October 30th, 2006, 4:55 am
- Location: The Big Ö (a.k.a. Austria)
Re: Weapon special "Dissolve"
Well, the wiki is incorrect on that point. I've personally made units whose attacks have multiple specials.doofus-01 wrote:The wiki says only one [specials] entry is supported, try removing the "{WEAPON_SPECIAL_MAGICAL}".
that little girl's parents were attacked by ninjas - generic npc
hee hee! - little girl
hee hee! - little girl
Re: Weapon special "Dissolve"
It might be an issue with special filtering. Does the ability version works ?Lizard wrote:This is what I currently have, but it does nothing
Btw since i didn't even test it there might be some bugs in my code too.
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" -- xtifr