- Added two new PlayerPawn properties:

* GruntSpeed: The minimum speed a player must be falling at the time of landing to play *grunt.
  * FallingScreamSpeed: When a player is falling within this range of speeds, they will play *falling.

SVN r3829 (trunk)
This commit is contained in:
Randy Heit 2012-08-14 03:24:59 +00:00
parent 166b4dbb75
commit 100391507e
5 changed files with 37 additions and 3 deletions

View File

@ -130,6 +130,8 @@ public:
// [GRB] Player class properties
fixed_t JumpZ;
fixed_t GruntSpeed;
fixed_t FallingScreamMinSpeed, FallingScreamMaxSpeed;
fixed_t ViewHeight;
fixed_t ForwardMove1, ForwardMove2;
fixed_t SideMove1, SideMove2;

View File

@ -2476,7 +2476,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
{
grunted = false;
// Why should this number vary by gravity?
if (mo->velz < (fixed_t)(800.f /*level.gravity * mo->Sector->gravity*/ * -983.04f) && mo->health > 0)
if (mo->health > 0 && mo->velz < -mo->player->mo->GruntSpeed)
{
S_Sound (mo, CHAN_VOICE, "*grunt", 1, ATTN_NORM);
grunted = true;

View File

@ -463,6 +463,16 @@ void APlayerPawn::Serialize (FArchive &arc)
<< DamageFade
<< PlayerFlags
<< FlechetteType;
if (SaveVersion < 3829)
{
GruntSpeed = 12*FRACUNIT;
FallingScreamMinSpeed = 35*FRACUNIT;
FallingScreamMaxSpeed = 40*FRACUNIT;
}
else
{
arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed;
}
}
//===========================================================================
@ -2383,8 +2393,8 @@ void P_PlayerThink (player_t *player)
P_PlayerInSpecialSector (player);
}
P_PlayerOnSpecialFlat (player, P_GetThingFloorType (player->mo));
if (player->mo->velz <= -35*FRACUNIT &&
player->mo->velz >= -40*FRACUNIT && !player->morphTics &&
if (player->mo->velz <= -player->mo->FallingScreamMinSpeed &&
player->mo->velz >= -player->mo->FallingScreamMaxSpeed && !player->morphTics &&
player->mo->waterlevel == 0)
{
int id = S_FindSkinnedSound (player->mo, "*falling");

View File

@ -2237,6 +2237,26 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, jumpz, F, PlayerPawn)
defaults->JumpZ = z;
}
//==========================================================================
//
//==========================================================================
DEFINE_CLASS_PROPERTY_PREFIX(player, GruntSpeed, F, PlayerPawn)
{
PROP_FIXED_PARM(z, 0);
defaults->GruntSpeed = z;
}
//==========================================================================
//
//==========================================================================
DEFINE_CLASS_PROPERTY_PREFIX(player, FallingScreamSpeed, FF, PlayerPawn)
{
PROP_FIXED_PARM(minz, 0);
PROP_FIXED_PARM(maxz, 0);
defaults->FallingScreamMinSpeed = minz;
defaults->FallingScreamMaxSpeed = maxz;
}
//==========================================================================
//
//==========================================================================

View File

@ -21,6 +21,8 @@ Actor PlayerPawn : Actor native
+NOBLOCKMONST
Player.AttackZOffset 8
Player.JumpZ 8
Player.GruntSpeed 12
Player.FallingScreamSpeed 35,40
Player.ViewHeight 41
Player.ForwardMove 1,1
Player.SideMove 1,1