mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
- Added: PlayerPawn property "Player.ViewBob" which acts as a MoveBob/StillBob multiplier.
This commit is contained in:
parent
513f8312b3
commit
e0efdd97b3
5 changed files with 32 additions and 5 deletions
|
@ -168,6 +168,9 @@ public:
|
||||||
// [CW] Fades for when you are being damaged.
|
// [CW] Fades for when you are being damaged.
|
||||||
PalEntry DamageFade;
|
PalEntry DamageFade;
|
||||||
|
|
||||||
|
// [SP] ViewBob Multiplier
|
||||||
|
double ViewBob;
|
||||||
|
|
||||||
bool UpdateWaterLevel (bool splash);
|
bool UpdateWaterLevel (bool splash);
|
||||||
bool ResetAirSupply (bool playgasp = true);
|
bool ResetAirSupply (bool playgasp = true);
|
||||||
|
|
||||||
|
|
|
@ -582,8 +582,9 @@ void P_BobWeapon (player_t *player, float *x, float *y, double ticfrac)
|
||||||
|
|
||||||
if (curbob != 0)
|
if (curbob != 0)
|
||||||
{
|
{
|
||||||
float bobx = float(player->bob * Rangex);
|
//[SP] Added in decorate player.viewbob checks
|
||||||
float boby = float(player->bob * Rangey);
|
float bobx = float(player->bob * Rangex * (float)player->mo->ViewBob);
|
||||||
|
float boby = float(player->bob * Rangey * (float)player->mo->ViewBob);
|
||||||
switch (bobstyle)
|
switch (bobstyle)
|
||||||
{
|
{
|
||||||
case AWeapon::BobNormal:
|
case AWeapon::BobNormal:
|
||||||
|
|
|
@ -651,7 +651,8 @@ void APlayerPawn::Serialize(FSerializer &arc)
|
||||||
("fallingscreammaxn", FallingScreamMaxSpeed, def->FallingScreamMaxSpeed)
|
("fallingscreammaxn", FallingScreamMaxSpeed, def->FallingScreamMaxSpeed)
|
||||||
("userange", UseRange, def->UseRange)
|
("userange", UseRange, def->UseRange)
|
||||||
("aircapacity", AirCapacity, def->AirCapacity)
|
("aircapacity", AirCapacity, def->AirCapacity)
|
||||||
("viewheight", ViewHeight, def->ViewHeight);
|
("viewheight", ViewHeight, def->ViewHeight)
|
||||||
|
("viewbob", ViewBob, def->ViewBob);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
@ -1844,11 +1845,12 @@ void P_CalcHeight (player_t *player)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//[SP] Added (x*player->mo->ViewBob) to allow DECORATE changes to view bobbing speed.
|
||||||
if (still)
|
if (still)
|
||||||
{
|
{
|
||||||
if (player->health > 0)
|
if (player->health > 0)
|
||||||
{
|
{
|
||||||
angle = level.time / (120 * TICRATE / 35.) * 360.;
|
angle = level.time / (120 * TICRATE / 35.) * 360. * player->mo->ViewBob;
|
||||||
bob = player->userinfo.GetStillBob() * angle.Sin();
|
bob = player->userinfo.GetStillBob() * angle.Sin();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1858,7 +1860,7 @@ void P_CalcHeight (player_t *player)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
angle = level.time / (20 * TICRATE / 35.) * 360.;
|
angle = level.time / (20 * TICRATE / 35.) * 360. * player->mo->ViewBob;
|
||||||
bob = player->bob * angle.Sin() * (player->mo->waterlevel > 1 ? 0.25f : 0.5f);
|
bob = player->bob * angle.Sin() * (player->mo->waterlevel > 1 ? 0.25f : 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2945,6 +2945,26 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, weaponslot, ISsssssssssssssssssssssssssssss
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// [SP] Player.Viewbob
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
DEFINE_CLASS_PROPERTY_PREFIX(player, viewbob, F, PlayerPawn)
|
||||||
|
{
|
||||||
|
PROP_DOUBLE_PARM(z, 0);
|
||||||
|
// [SP] Hard limits. This is to prevent terrywads from making players sick.
|
||||||
|
// Remember - this messes with a user option who probably has it set a
|
||||||
|
// certain way for a reason. I think a 1.5 limit is pretty generous, but
|
||||||
|
// it may be safe to increase it. I really need opinions from people who
|
||||||
|
// could be affected by this.
|
||||||
|
if (z < 0.0 || z > 1.5)
|
||||||
|
{
|
||||||
|
I_Error("ViewBob must be between 0.0 and 1.5.");
|
||||||
|
}
|
||||||
|
defaults->ViewBob = z;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -33,6 +33,7 @@ Actor PlayerPawn : Actor native
|
||||||
Player.MugShotMaxHealth 0
|
Player.MugShotMaxHealth 0
|
||||||
Player.FlechetteType "ArtiPoisonBag3"
|
Player.FlechetteType "ArtiPoisonBag3"
|
||||||
Player.AirCapacity 1
|
Player.AirCapacity 1
|
||||||
|
Player.ViewBob 1
|
||||||
Obituary "$OB_MPDEFAULT"
|
Obituary "$OB_MPDEFAULT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue