- added Player.Aircapacity property which is used as a multiplier for the level's air supply.

This commit is contained in:
Christoph Oelckers 2013-08-09 11:57:14 +02:00
parent a0c214104d
commit 34b71baad1
5 changed files with 17 additions and 2 deletions

View file

@ -141,6 +141,7 @@ public:
FNameNoInit MorphWeapon;
fixed_t AttackZOffset; // attack height, relative to player center
fixed_t UseRange; // [NS] Distance at which player can +use
fixed_t AirCapacity; // Multiplier for air supply underwater.
const PClass *FlechetteType;
// [CW] Fades for when you are being damaged.

View file

@ -477,6 +477,10 @@ void APlayerPawn::Serialize (FArchive &arc)
{
arc << UseRange;
}
if (SaveVersion >= 4503)
{
arc << AirCapacity;
}
}
//===========================================================================
@ -1066,7 +1070,7 @@ bool APlayerPawn::ResetAirSupply (bool playgasp)
{
S_Sound (this, CHAN_VOICE, "*gasp", 1, ATTN_NORM);
}
if (level.airsupply> 0) player->air_finished = level.time + level.airsupply;
if (level.airsupply> 0 && player->mo->AirCapacity > 0) player->air_finished = level.time + FixedMul(level.airsupply, player->mo->AirCapacity);
else player->air_finished = INT_MAX;
return wasdrowning;
}

View file

@ -2419,6 +2419,15 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, userange, F, PlayerPawn)
defaults->UseRange = z;
}
//==========================================================================
//
//==========================================================================
DEFINE_CLASS_PROPERTY_PREFIX(player, aircapacity, F, PlayerPawn)
{
PROP_FIXED_PARM(z, 0);
defaults->AirCapacity = z;
}
//==========================================================================
//
//==========================================================================

View file

@ -76,7 +76,7 @@ const char *GetVersionString();
// Use 4500 as the base git save version, since it's higher than the
// SVN revision ever got.
#define SAVEVER 4502
#define SAVEVER 4503
#define SAVEVERSTRINGIFY2(x) #x
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)

View file

@ -32,6 +32,7 @@ Actor PlayerPawn : Actor native
Player.DamageScreenColor "ff 00 00"
Player.MugShotMaxHealth 0
Player.FlechetteType "ArtiPoisonBag3"
Player.AirCapacity 1
Obituary "$OB_MPDEFAULT"
}