Mon 07 Jan 2008 02:45:49 AM UTC, original submission:
Right now there are, by my count, three possible unit statuses, which can be combined into eight possible variations - stoned on/off, poison on/off, slowed on/off. All of these are hardwired into the game and are completely unmodifiable using the WML - for example, the code for the "poisons" weapon special, which inflicts the "poisoned" status, is:
#define WEAPON_SPECIAL_POISON
# Canned definition of the Poison ability to be included in a
# [specials] clause.
[poison]
id=poison
name= _ "poison"
description= _ "Poison:
This attack poisons living targets. Poisoned units lose 8 HP every turn until they are cured or are reduced to 1 HP. Poison can not, of itself, kill a unit."
[/poison]
#enddef
It would be much more useful if statuses were more malleable. I imagine it would work something like this:
[inflict] #the poisons weapons special
id=poison
name= _ "poison"
status=poisoned #which references a predefined status, poisoned
description= _ "Poison:
This attack poisons living targets. Poisoned units lose 8 HP every turn until they are cured or are reduced to 1 HP. Poison can not, of itself, kill a unit."
[/inflict]
[status] #the poisoned status, which would be found elsewhere in the code
id=poisoned #how it is referenced outside the game
name= _ "poisoned" #
duration=level #when the status wears off - can always be removed by other events such as curing, of course
description= _ "Poisoned units lose 8 HP every turn until they are cured or are reduced to 1 HP. Poison can not, of itself, kill a unit." #appears in a tooltip
image=misc/poisoned.png #determines the small icon that appears in the sidebar
[effect]
apply_to=hitpoints #deals damage
add=-8 #eight, exactly
minimum=1 #but can't kill you
frequency=turn #takes effect every turn - could take effect every time the unit moved, or every time it attacked, or even every time it was selected. >)
[/effect]
[effect]
apply_to=rgb #to get that lovely green shade
shift=work color-manipulating voodoo #it should be possible using RColor or whatever it's called to make a sprite entirely green
[/effect]
[/status]
I used a few attributes in that [effect] tag that aren't currently available - but that [effect] tag should have the capability to do anything else an [effect] tag can normally do. Slows, then, would be defined by saying [effect] apply_to=attacks multiply=.5 [/effect].
This probably won't be easy, but it's something that has been desired for a long time and I didn't see a feature request for it, so I'm submitting one now. I don't particularly expect it to be done any time soon.
|