feat(mosstank): add VTank-style automation PoC

This commit is contained in:
Erik 2026-08-27 18:57:21 +02:00
parent f6fe0f2a4f
commit 4e6e9bc9d9
212 changed files with 49462 additions and 416 deletions

View file

@ -424,6 +424,63 @@ public sealed class PlayerMouseLookMovementTests
Assert.False(controller.PrepareForAttackRequest());
}
[Fact]
public void PersistentCommandRetakesTurnAfterServerPostureAcknowledgement()
{
var controller = CreateController();
var command = new MovementInput(
TurnRight: true,
IsPersistentCommand: true);
MovementResult started = controller.Update(1f / 60f, command);
Assert.Equal(MotionCommand.TurnRight, started.TurnCommand);
// The live MossTank failure: ACE acknowledges an explicit combat-mode
// change with a non-autonomous Magic + Ready movement event after the
// plugin has already begun facing its target.
controller.SetLastMoveWasAutonomous(false);
controller.Motion.MoveToInterpretedState(new InboundInterpretedState
{
CurrentStyle = 0x80000049u,
ForwardCommand = MotionCommand.Ready,
ForwardSpeed = 1f,
TurnCommand = 0u,
TurnSpeed = 1f,
});
Assert.Equal(0u, controller.Motion.InterpretedState.TurnCommand);
MovementResult resumed = controller.Update(1f / 60f, command);
Assert.True(resumed.ShouldSendMovementEvent);
Assert.Equal(
MotionCommand.TurnRight,
controller.Motion.InterpretedState.TurnCommand);
Assert.Equal(MotionCommand.TurnRight, resumed.TurnCommand);
}
[Fact]
public void PhysicalHeldKeyKeepsRetailEdgeBehaviorAfterServerPosture()
{
var controller = CreateController();
var physical = new MovementInput(TurnRight: true);
_ = controller.Update(1f / 60f, physical);
controller.SetLastMoveWasAutonomous(false);
controller.Motion.MoveToInterpretedState(new InboundInterpretedState
{
CurrentStyle = 0x80000049u,
ForwardCommand = MotionCommand.Ready,
ForwardSpeed = 1f,
TurnCommand = 0u,
TurnSpeed = 1f,
});
MovementResult held = controller.Update(1f / 60f, physical);
Assert.False(held.ShouldSendMovementEvent);
Assert.Equal(0u, controller.Motion.InterpretedState.TurnCommand);
}
private static PlayerMovementController CreateController()
{
var engine = new PhysicsEngine();