mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
- added a callback for when damage is drained from a target.
This commit is contained in:
parent
356144a537
commit
d36f656caf
2 changed files with 11 additions and 0 deletions
|
@ -1415,6 +1415,12 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
|
|||
}
|
||||
}
|
||||
|
||||
IFVIRTUALPTR(source, AActor, OnDrain)
|
||||
{
|
||||
VMValue params[] = { source, target, draindamage, mod.GetIndex() };
|
||||
VMReturn ret(&draindamage);
|
||||
GlobalVMStack.Call(func, params, countof(params), &ret, 1);
|
||||
}
|
||||
if ( P_GiveBody( source, int(draindamage * damage)))
|
||||
{
|
||||
S_Sound(source, CHAN_ITEM, "*drainhealth", 1, ATTN_NORM );
|
||||
|
|
|
@ -489,6 +489,11 @@ class Actor : Thinker native
|
|||
return Obituary;
|
||||
}
|
||||
|
||||
virtual int OnDrain(Actor victim, int damage, Name dmgtype)
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
|
||||
native virtual bool OkayToSwitchTarget(Actor other);
|
||||
native static class<Actor> GetReplacement(class<Actor> cls);
|
||||
native static class<Actor> GetReplacee(class<Actor> cls);
|
||||
|
|
Loading…
Reference in a new issue