- Increased the duration of respawn invulnerability by one second.

- DF2_YES_RESPAWN_INVUL and DF_FORCE_RESPAWN now apply to all multiplayer 
  games, not just deathmatch, without the need for turning on
  alwaysapplydmflags.
- Fixed: DF2_YES_RESPAWN_INVUL only worked in deathmatch, even with
  alwaysapplydmflags turned on.
- Fixed: DF_COOP_LOSE_ARMOR did not empty the starting armor items.


SVN r1035 (trunk)
This commit is contained in:
Randy Heit 2008-06-15 03:46:04 +00:00
parent 9e42cdaf08
commit 7c40cf9ce0
5 changed files with 35 additions and 15 deletions

View file

@ -1,4 +1,11 @@
June 14, 2008 June 14, 2008
- Increased the duration of respawn invulnerability by one second.
- DF2_YES_RESPAWN_INVUL and DF_FORCE_RESPAWN now apply to all multiplayer
games, not just deathmatch, without the need for turning on
alwaysapplydmflags.
- Fixed: DF2_YES_RESPAWN_INVUL only worked in deathmatch, even with
alwaysapplydmflags turned on.
- Fixed: DF_COOP_LOSE_ARMOR did not empty the starting armor items.
- Replaced the naive area sound implementation with one that takes into - Replaced the naive area sound implementation with one that takes into
consideration the size and shape of the sector producing the sound. See consideration the size and shape of the sector producing the sound. See
the lifts on Doom 2 MAP30 and compare with previous versions. the lifts on Doom 2 MAP30 and compare with previous versions.

View file

@ -1222,15 +1222,6 @@ void G_PlayerReborn (int player)
bglobal.CleanBotstuff (p); bglobal.CleanBotstuff (p);
else else
p->isbot = false; p->isbot = false;
// [BC] Handle temporary invulnerability when respawned
if ((dmflags2 & DF2_YES_RESPAWN_INVUL) && (deathmatch || alwaysapplydmflags))
{
APowerup *invul = static_cast<APowerup*>(actor->GiveInventoryType (RUNTIME_CLASS(APowerInvulnerable)));
invul->EffectTics = 2*TICRATE;
invul->BlendColor = 0; // don't mess with the view
actor->effects |= FX_RESPAWNINVUL; // [RH] special effect
}
} }
// //

View file

@ -98,7 +98,7 @@ enum
IF_KEEPDEPLETED = 1<<13, // Items with this flag are retained even when they run out. IF_KEEPDEPLETED = 1<<13, // Items with this flag are retained even when they run out.
IF_IGNORESKILL = 1<<14, // Ignores any skill related multiplicators when giving this item. IF_IGNORESKILL = 1<<14, // Ignores any skill related multiplicators when giving this item.
IF_CREATECOPYMOVED = 1<<15, // CreateCopy changed the owner (copy's Owner field holds new owner). IF_CREATECOPYMOVED = 1<<15, // CreateCopy changed the owner (copy's Owner field holds new owner).
IF_INITEFFECTFAILED = 1<<16 // CreateCopy tried to activate a powerup and activation failed (can happen with PowerMorph) IF_INITEFFECTFAILED = 1<<16, // CreateCopy tried to activate a powerup and activation failed (can happen with PowerMorph)
}; };
struct vissprite_t; struct vissprite_t;

View file

@ -3682,6 +3682,16 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
// it above, but the other modes don't. // it above, but the other modes don't.
oldactor->DestroyAllInventory(); oldactor->DestroyAllInventory();
} }
// [BC] Handle temporary invulnerability when respawned
if ((state == PST_REBORN || state == PST_ENTER) &&
(dmflags2 & DF2_YES_RESPAWN_INVUL) &&
(multiplayer || alwaysapplydmflags))
{
APowerup *invul = static_cast<APowerup*>(p->mo->GiveInventoryType (RUNTIME_CLASS(APowerInvulnerable)));
invul->EffectTics = 3*TICRATE;
invul->BlendColor = 0; // don't mess with the view
p->mo->effects |= FX_RESPAWNINVUL; // [RH] special effect
}
if (StatusBar != NULL && (playernum == consoleplayer || StatusBar->GetPlayer() == playernum)) if (StatusBar != NULL && (playernum == consoleplayer || StatusBar->GetPlayer() == playernum))
{ {

View file

@ -748,8 +748,6 @@ void APlayerPawn::FilterCoopRespawnInventory (APlayerPawn *oldplayer)
return; return;
} }
// If we don't want to lose anything, then we don't need to bother checking
// the old inventory.
if (dmflags & (DF_COOP_LOSE_KEYS | if (dmflags & (DF_COOP_LOSE_KEYS |
DF_COOP_LOSE_WEAPONS | DF_COOP_LOSE_WEAPONS |
DF_COOP_LOSE_AMMO | DF_COOP_LOSE_AMMO |
@ -781,10 +779,24 @@ void APlayerPawn::FilterCoopRespawnInventory (APlayerPawn *oldplayer)
item->Destroy(); item->Destroy();
} }
else if ((dmflags & DF_COOP_LOSE_ARMOR) && else if ((dmflags & DF_COOP_LOSE_ARMOR) &&
defitem == NULL &&
item->IsKindOf(RUNTIME_CLASS(AArmor))) item->IsKindOf(RUNTIME_CLASS(AArmor)))
{ {
item->Destroy(); if (defitem != NULL)
{
item->Destroy();
}
else if (item->IsKindOf(RUNTIME_CLASS(ABasicArmor)))
{
static_cast<ABasicArmor*>(item)->SavePercent = static_cast<ABasicArmor*>(defitem)->SavePercent;
item->Amount = defitem->Amount;
}
else if (item->IsKindOf(RUNTIME_CLASS(AHexenArmor)))
{
static_cast<AHexenArmor*>(item)->Slots[0] = static_cast<AHexenArmor*>(defitem)->Slots[0];
static_cast<AHexenArmor*>(item)->Slots[1] = static_cast<AHexenArmor*>(defitem)->Slots[1];
static_cast<AHexenArmor*>(item)->Slots[2] = static_cast<AHexenArmor*>(defitem)->Slots[2];
static_cast<AHexenArmor*>(item)->Slots[3] = static_cast<AHexenArmor*>(defitem)->Slots[3];
}
} }
else if ((dmflags & DF_COOP_LOSE_POWERUPS) && else if ((dmflags & DF_COOP_LOSE_POWERUPS) &&
defitem == NULL && defitem == NULL &&
@ -1853,7 +1865,7 @@ void P_DeathThink (player_t *player)
} }
if ((player->cmd.ucmd.buttons & BT_USE || if ((player->cmd.ucmd.buttons & BT_USE ||
((deathmatch || alwaysapplydmflags) && (dmflags & DF_FORCE_RESPAWN))) && !(dmflags2 & DF2_NO_RESPAWN)) ((multiplayer || alwaysapplydmflags) && (dmflags & DF_FORCE_RESPAWN))) && !(dmflags2 & DF2_NO_RESPAWN))
{ {
if (level.time >= player->respawn_time || ((player->cmd.ucmd.buttons & BT_USE) && !player->isbot)) if (level.time >= player->respawn_time || ((player->cmd.ucmd.buttons & BT_USE) && !player->isbot))
{ {