Code: Select all
class SpitterAcidItem : Inventory
{
int eDelay;
property EffectDelay : eDelay;
Default
{
// How long it takes for the effect to go away. This is measured in tics.
SpitterAcidItem.EffectDelay 64;
}
override void AttachToOwner (Actor other)
{
Super.AttachToOwner(other);
}
override void DoEffect ()
{
if (owner)
{
//deal damage here
if (eDelay-- == 0)
{
// The effect is over;
Destroy();
}
}
}
}
- owner.health = owner.health -1 (obviously a very bad and hacky way, but actually the only one that sorta worked! Only that nothing happens if the healths hits 0.
- Thing_Damage(owner.tid, 1, 0);//nothing happens
- A_DamageSelf(25);//the wiki page has an example of an item that uses this function in it's PickUp state, so only one-time damage dealing. Nothing happens when used inside DoEffect().
Any ideas?