Implement original gadget panel and playable shrink ray

This commit is contained in:
UnixNight committed 2026-10-27 12:18:45 -04:00
1 parent 0272f7bef7
commit 7b5230ceb8
57 files changed
+3545 -48

No files matched your search

+12 -4
View File
@@ -4,8 +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);
public enum PlayerPose { Idle, Run, Backpedal, Jump, Fall, Fly }
bool Rise = false, bool Descend = false, bool StrafeLeft = false, bool StrafeRight = false, bool Fast = false, bool Fire = false);
public enum PlayerPose { Idle, Run, Backpedal, Jump, Fall, Fly, Shoot }
/// <summary>
/// Walking, airborne steering and jetpack checkpoint. Recovered arithmetic is described in
@@ -39,6 +39,8 @@ public sealed class LabSimulation
//predates source-body integration; burst100 is not an interaction-only size.
public float InteractionRadius { get; private set; } = 60;
public bool JetpackEffectVisible { get; private set; }
public Action<PlayerInput>? InputActions { get; set; }
public bool Shooting { get; private set; }
public float JetpackRemaining => jumpState.EffectRemaining;
public int JumpState => jumpState.JumpState;
public float JumpHoldSeconds => jumpState.HoldSeconds;
@@ -59,7 +61,7 @@ public sealed class LabSimulation
public bool Grounded { get; private set; }
public PlayerPose Pose => Noclip ? Velocity.LengthSquared() > 0 ? PlayerPose.Fly : PlayerPose.Idle
: pendingImpulse.Y > 0 ? PlayerPose.Jump
: Grounded ? Speed < -1 ? PlayerPose.Backpedal : Speed > 1 ? PlayerPose.Run : PlayerPose.Idle
: Grounded ? Shooting ? PlayerPose.Shoot : Speed < -1 ? PlayerPose.Backpedal : Speed > 1 ? PlayerPose.Run : PlayerPose.Idle
: jumpState.JumpState == 3 && jumpState.EffectRemaining > 0 ? PlayerPose.Fly
: !forceFall && Velocity.Y > 0 ? PlayerPose.Jump : PlayerPose.Fall;
public int Steps { get; private set; }
@@ -113,6 +115,7 @@ public sealed class LabSimulation
lateralContribution = 0; pendingImpulse = Vector3.Zero; movementMode = 0;
jumpState = default;
forceFall = JetpackEffectVisible = false;
Shooting = false;
InteractionRadius = 60; Bursts = 0;
Grounded = true;
Noclip = HasNoclipEntry = false;
@@ -168,7 +171,7 @@ public sealed class LabSimulation
StepPhysics();
if (controlled && !InputAfterPlayerUpdate) StepInput(input);
//42469F..4246DC reasserts ordinary grounded radius before ownership
//checks. The scooter's separate radius160 policy remains unimplemented.
//checks. Bubble mode0's separate radius160 policy remains unimplemented.
if (Grounded) InteractionRadius = 60;
//424BE0..424C34 runs this wrapper before437940's ownership gate.
StepCeiling();
@@ -187,6 +190,9 @@ public sealed class LabSimulation
Speed = 0; Velocity = Vector3.Zero;
}
public void StopForPrimaryFire() => Speed = 0;
public void SetShooting(bool shooting) => Shooting = shooting;
private void StepCeiling()
{
if (Velocity.Y <= 0 || ceilingRay == null
@@ -228,6 +234,7 @@ public sealed class LabSimulation
public void StopDebugMotion()
{
Shooting = false;
Velocity = pendingImpulse = Vector3.Zero;
Speed = PublishedSpeed = TurnRate = extraAirAcceleration = lateralContribution = 0;
jumpState = default; movementMode = 0; forceFall = JetpackEffectVisible = false;
@@ -285,6 +292,7 @@ public sealed class LabSimulation
targetYaw = Yaw;
}
StepCamera(); //438BC0/439900 input path owns follow; still provisional geometry/state.
InputActions?.Invoke(input);
}
private void StepPlayer(PlayerInput input)