mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-06-04 19:10:59 +00:00
- eliminated the native PowerupGiver class.
- scriptified the respawn invulnerability code into a virtual OnRespawn function for PlayerPawn so that custom effects can be implemented.
This commit is contained in:
parent
98f9219334
commit
232b64d332
17 changed files with 138 additions and 130 deletions
|
@ -5381,15 +5381,13 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
oldactor->DestroyAllInventory();
|
||||
}
|
||||
// [BC] Handle temporary invulnerability when respawned
|
||||
if ((state == PST_REBORN || state == PST_ENTER) &&
|
||||
(dmflags2 & DF2_YES_RESPAWN_INVUL) &&
|
||||
(multiplayer || alwaysapplydmflags))
|
||||
if (state == PST_REBORN || state == PST_ENTER)
|
||||
{
|
||||
APowerup *invul = static_cast<APowerup*>(p->mo->GiveInventoryType (PClass::FindActor(NAME_PowerInvulnerable)));
|
||||
invul->EffectTics = 3*TICRATE;
|
||||
invul->BlendColor = 0; // don't mess with the view
|
||||
invul->ItemFlags |= IF_UNDROPPABLE; // Don't drop this
|
||||
p->mo->effects |= FX_RESPAWNINVUL; // [RH] special effect
|
||||
IFVIRTUALPTR(p->mo, APlayerPawn, OnRespawn)
|
||||
{
|
||||
VMValue param = p->mo;
|
||||
GlobalVMStack.Call(func, ¶m, 1, nullptr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (StatusBar != NULL && (playernum == consoleplayer || StatusBar->GetPlayer() == playernum))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue