Spirit possession - combining the Poison and Plague specials

The place to post your WML questions and answers.

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.
Post Reply
Amantari
Posts: 2
Joined: April 14th, 2009, 7:39 am

Spirit possession - combining the Poison and Plague specials

Post by Amantari »

Hello Wesnoth,

I'm starting work on a new scenario where evil spirits and such are rampant, and for this I'm envisioning a new special attack: possession. This is hardly a new idea, and I've searched the forums for ideas, but didn't really find anything so decided to post. For earlier ideas, take a look at

http://www.wesnoth.org/forum/viewtopic. ... it=possess
http://www.wesnoth.org/forum/viewtopic. ... it=possess

Now, my idea of Spirit Possession would combine the Poison and Plague attacks. A successful attack would cause a unit to become "possessed" and start losing 8hp each turn just like poison (but remaining in the original owner's control). Then, the final damage would indeed kill the victim, but like plague, instead of simply killing it, it would turn into a walking corpse.

I'm not sure if it is possible, but it would be nice if the possessed unit would have a gray hue instead of the Poison green hue.

Optionally, the evil spirit which used the attack with "possess" special successfully would disappear itself (being now housed in the victim's flesh).

I think it would make it pretty cool if this condition would be uncurable by any unit; or at least any unit that can be recruited (leaving some scenario special units).

Now, mind you, I'm looking for a WML solution for making this a special attack, not a scripted scenario "special effect" like in the (very cool) campaign Under the Burning Suns!

I've posted this idea here since I'm really after some ideas how to implement this in WML, my scenario doesn't have a good name yet. If you have any pointers how I should proceed implementing this idea, please post your ideas!

Thanks,
Amantari
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

Re: Spirit possession - combining the Poison and Plague specials

Post by Mist »

You want to have a look at :
events inside unit_type definitions
attacker_hits and defender_hits events to trigger the consequences
above two should set a flag inside [variables] section of the unit to avoid stacking the special and following events filtering on unit id
side_turn event to simulate (I assume unhealable) poison
die event to spawn WC in the correct place

If you want a different color hue you should have a look at ImagePathFunction WML

Other useful bits of general knowledge when implementing specials would be [filter_wml], [filter_weapon] an SUF (Standart Unit Filter)

It should be fairly easy to implement once you get a hang of the above stuff.
Somewhere, between the sacred silence and sleep.
Disorder.
Amantari
Posts: 2
Joined: April 14th, 2009, 7:39 am

Re: Spirit possession - combining the Poison and Plague specials

Post by Amantari »

Great, thanks Mist!
Post Reply