Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added FlyBob Multiplier for Player
  • Loading branch information
Boondorl authored and coelckers committed Jan 2, 2023
1 parent 73159da commit 0d23816
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/namedef_custom.h
Expand Up @@ -284,6 +284,7 @@ xx(SideMove2)
xx(Face)
xx(Slot)
xx(SoundClass)
xx(FlyBob)
xx(ViewBob)
xx(WaterClimbSpeed)
xx(DamageFade)
Expand Down
2 changes: 1 addition & 1 deletion src/playsim/p_mobj.cpp
Expand Up @@ -2418,7 +2418,7 @@ static void P_ZMovement (AActor *mo, double oldfloorz)

if (!mo->IsNoClip2() && fViewBob)
{
mo->AddZ(DAngle::fromDeg(360 / 80.f * mo->Level->maptime).Sin() / 8);
mo->AddZ(DAngle::fromDeg(360 / 80.f * mo->Level->maptime).Sin() / 8 * mo->FloatVar(NAME_FlyBob));
}

if (!(mo->flags8 & MF8_NOFRICTION))
Expand Down
5 changes: 4 additions & 1 deletion wadsrc/static/zscript/actors/player/player.zs
Expand Up @@ -46,6 +46,7 @@ class PlayerPawn : Actor
double AirCapacity; // Multiplier for air supply underwater.
Class<Inventory> FlechetteType;
color DamageFade; // [CW] Fades for when you are being damaged.
double FlyBob; // [B] Fly bobbing mulitplier
double ViewBob; // [SP] ViewBob Multiplier
double WaterClimbSpeed; // [B] Speed when climbing up walls in water
double FullHeight;
Expand Down Expand Up @@ -76,6 +77,7 @@ class PlayerPawn : Actor
property FlechetteType: FlechetteType;
property Portrait: Portrait;
property TeleportFreezeTime: TeleportFreezeTime;
property FlyBob: FlyBob;
property ViewBob: ViewBob;
property WaterClimbSpeed : WaterClimbSpeed;

Expand Down Expand Up @@ -119,6 +121,7 @@ class PlayerPawn : Actor
Player.MugShotMaxHealth 0;
Player.FlechetteType "ArtiPoisonBag3";
Player.AirCapacity 1;
Player.FlyBob 1;
Player.ViewBob 1;
Player.WaterClimbSpeed 3.5;
Player.TeleportFreezeTime 18;
Expand Down Expand Up @@ -563,7 +566,7 @@ class PlayerPawn : Actor
}
else if (bNoGravity && !player.onground)
{
player.bob = 0.5;
player.bob = min(abs(0.5 * FlyBob), MAXBOB);
}
else
{
Expand Down

0 comments on commit 0d23816

Please sign in to comment.