While working on a magitech tech extension that adds necromancers, monks and the like, wciow and I discussed how cool it would be if units could cast spells on other units that would have a temporary effect like adding extra regeneration, slowing them down, blinding them, making them attack faster or draining away their life. The Glest code nicely accommodates such alterations, so I took it upon myself to give it a try.
I hadn't used STL in years, so after eventually rediscovering that you iterate through a vector with for(iterator i = v.begin(); i != v.end(); i)) rather than "i < v.end()" (which pissed me off to no end until I caught it), I got a nicely working modification.
The basics work as follows. You just add an <effects> section to each skill. Although it only effects attack skills, your attack skill can have one or more effects on it. If another skill type for "cast spell" or similar is implemented, then arbitrary effects can be applied to friendlies. An effect could also be applied to the repair skill, but I can't think of any particular reason to do so.
<effects>
<effect name="burning_bastard" bias="detrimental">
<image path="images/burning_bastard.bmp"/>
<duration value="5.0"/>
<max-hp value="0" regeneration="-75"/>
<max-ep value="0" regeneration="0"/>
<armor value="0"/>
<sight value="0"/>
<movement-speed value="1.5"/>
<attack-speed value="1.0"/>
<attack-damage value="0"/>
<fields-added/>
<fields-removed/>
<light enabled="false"/>
<sound enabled="false" start-time="0.0" loop="false" path="sounds/burning_bastard.wav"/>
<particle value="false" path="burning_bastard_particle.xml"/>
</effect>
</effects>
Currently, there is no icon or even description that shows that an effect is active in the unit description, and attack-damage, adding/removing fields (for levitation, swimming, etc), sound, light and particles are not implemented, but the rest appears to be working. Additionally, there is probably a need for effect stacking management of some sort. The above effect lasts for 5 seconds and causes the recipient to take 75 damage per second (in addition to whatever the initial attack did), and allows him or her to traverse at 150% of his original walk speed while they slowly sizzle.
The idea of the sound, light and particles is to have a visual and/or auditory indication that something is different like a sizzling sound, red glow, sparks flying off of him, etc. The effects should continue after they die (until they are undertaken) but still remove when the effect wears off (even if that's after they die). I also got it updating kills appropriately as well as faction kills when the target dies from the effect.
Anyway, I hope I can convince Martiño to consider it for eventually being merged
)
Daniel