CanResurrect(Actor other, bool passive)
Coded similarly to CanCollideWith, meaning it comes after all the other checks: a Raise state and either -1 tics or CanRaise keyword are still required.
Unlike CanCollideWith, other CAN be null, or it can be self (active only - the code doesn't even bother with pointlessly running twice).
This zombieman will print stuff based on who raised it. It will lay dead for five seconds before resurrecting itself so you can summon an archvile and have it resurrect to print something else.
Code: Select all
Class RZ : Zombieman
{
override bool CanResurrect(Actor other, bool passive)
{
if (!passive)
{
if (other == null || other == self)
Console.Printf("Actively reviving self");
else
Console.Printf("Reviving someone else");
}
else
{
if (other == null)
Console.Printf("Being revived by The Powers That May Be!");
else
Console.Printf("Being revived by a monster");
}
return true;
}
Default
{
Health 1;
}
States
{
XDeath:
Death:
POSS H 5;
POSS I 5 A_Scream;
POSS J 5 A_NoBlocking;
POSS K 5 CanRaise;
POSS L 175 CanRaise;
POSS L -1 A_RaiseSelf(RF_NOCHECKPOSITION);
Stop;
}
}
Spoiler: Old post