Implement evidence-backed VR02 Rocketship flight and ownership
This commit is contained in:
1 parent
312efccb77
commit
e77add5fdf
50 files changed
+4326
-66
No files matched your search
@@ -4,7 +4,8 @@ using GamePort.Assets;
|
||||
namespace GamePort.Game;
|
||||
|
||||
public readonly record struct PlayerInput(bool Forward, bool Backward, bool Left, bool Right, bool Jump,
|
||||
bool Rise = false, bool Descend = false, bool StrafeLeft = false, bool StrafeRight = false, bool Fast = false, bool Fire = false);
|
||||
bool Rise = false, bool Descend = false, bool StrafeLeft = false, bool StrafeRight = false, bool Fast = false, bool Fire = false,
|
||||
bool RocketTurn = false, bool RocketRoll = false, bool RocketMouseRise = false);
|
||||
public enum PlayerPose { Idle, Run, Backpedal, Jump, Fall, Fly, Shoot }
|
||||
|
||||
/// <summary>
|
||||
@@ -226,7 +227,7 @@ public sealed class LabSimulation
|
||||
return ((float)Math.Sin(radians), (float)Math.Cos(radians));
|
||||
}
|
||||
|
||||
public void Step(PlayerInput input, bool controlled = true, bool? anyControlled = null)
|
||||
public void Step(PlayerInput input, bool controlled = true, bool? anyControlled = null, Action? afterPhysics = null)
|
||||
{
|
||||
if (Noclip)
|
||||
{
|
||||
@@ -238,6 +239,7 @@ public sealed class LabSimulation
|
||||
// This reconstructs the player/input/fire partial order, not the full
|
||||
// scene registry, original cadence or original collision response.
|
||||
StepPhysics();
|
||||
afterPhysics?.Invoke();
|
||||
if (controlled && !InputAfterPlayerUpdate) StepInput(input);
|
||||
//42469F..4246DC runs independently of raw ownership.
|
||||
if (Grounded)
|
||||
@@ -268,6 +270,18 @@ public sealed class LabSimulation
|
||||
Speed = 0; Velocity = Vector3.Zero;
|
||||
}
|
||||
|
||||
public void LeaveRocketship(Vector3 sharedEye)
|
||||
{
|
||||
//4285..4286 cleanup leaves the last copied root and enters air/FALL.
|
||||
Velocity=Vector3.Zero;extraAirAcceleration=0;Speed=0;movementMode=1;
|
||||
forceFall=true;CameraEye=sharedEye;
|
||||
}
|
||||
|
||||
public void RocketImpact()
|
||||
{
|
||||
AdjustEnergy(-1);ScoreChanged?.Invoke(-1);CancelPoweredFlight();
|
||||
}
|
||||
|
||||
public void StopForPrimaryFire() => Speed = 0;
|
||||
public void SetShooting(bool shooting) => Shooting = shooting;
|
||||
public void AdjustEnergy(float delta) => energy.Adjust(delta, LevelCode, id => EnergySound?.Invoke(id));
|
||||
|
||||
Reference in new issue
Block a user