- 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 139 additions and 131 deletions
|
|
@ -102,6 +102,36 @@ class PlayerPawn : Actor native
|
|||
virtual void MorphPlayerThink()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void OnRespawn()
|
||||
{
|
||||
if (sv_respawnprotect && (multiplayer || alwaysapplydmflags))
|
||||
{
|
||||
let invul = Powerup(Spawn("PowerInvulnerable"));
|
||||
invul.EffectTics = 3 * TICRATE;
|
||||
invul.BlendColor = 0; // don't mess with the view
|
||||
invul.bUndroppable = true; // Don't drop this
|
||||
bRespawnInvul = true; // [RH] special effect
|
||||
}
|
||||
}
|
||||
|
||||
// This is for SBARINFO.
|
||||
int/*, int*/ GetEffectTicsForItem(class<Inventory> item)
|
||||
{
|
||||
let pg = (class<PowerupGiver>)(item);
|
||||
if (pg != null)
|
||||
{
|
||||
let powerupType = (class<Powerup>)(GetDefaultByType(pg).PowerupType);
|
||||
let powerup = Powerup(FindInventory(powerupType));
|
||||
if(powerup != null)
|
||||
{
|
||||
let maxtics = GetDefaultByType(powerupType).EffectTics;
|
||||
if (maxtics == 0) maxtics = powerup.default.EffectTics;
|
||||
return powerup.EffectTics/*, maxtics*/;
|
||||
}
|
||||
}
|
||||
return 0/*, 0*/;
|
||||
}
|
||||
|
||||
native int GetMaxHealth();
|
||||
native bool ResetAirSupply (bool playgasp = false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue