Wire client VTOL/arc HUD & inputs and add Cut 3a tests

This commit is contained in:
Meta Vens 2026-12-04 19:11:33 +01:00
commit eb579a6ede
10 changed files with 552 additions and 86 deletions

View file

@ -131,6 +131,14 @@ namespace RustToDust.Tests
var player = session.State.Player;
var rival = session.State.Contenders[1];
// Ensure rival is a low-profile ground vehicle shorter than the 4m ruin cover wall
if (rival.Grid.Spec.IsVtol || rival.Grid.Spec.HalfHeight * 2f >= box.HalfY * 2f)
{
session.SetContenderPose(rival.Id, box.X, box.Z + box.HalfZ + 4f);
session.State.SpawnChassisDrop(box.X, box.Z + box.HalfZ + 4f, Catalog.Jackal);
Assert.True(session.State.TrySwapNearbyChassis(rival.Id));
}
session.SetContenderPose(player.Id, box.X, box.Z - box.HalfZ - 4f);
session.SetContenderPose(rival.Id, box.X, box.Z + box.HalfZ + 4f);
@ -227,7 +235,14 @@ namespace RustToDust.Tests
var provokedSpec = tourists[0];
var clearedSpec = tourists[1];
// Keep AI contenders safely inside the safe circle and other spectators far away so they don't kill player or steal clearance
// Place player on the side of the mesa further from center (strictly outside SafeRadius)
float xNeg = mesa.X - mesa.RadiusX - 18f;
float xPos = mesa.X + mesa.RadiusX + 18f;
bool negIsFurther = (xNeg * xNeg + mesa.Z * mesa.Z) >= (xPos * xPos + mesa.Z * mesa.Z);
float occludedX = negIsFurther ? xNeg : xPos;
float specSideX = negIsFurther ? (mesa.X + mesa.RadiusX + 45f) : (mesa.X - mesa.RadiusX - 45f);
// Keep AI contenders safely inside the safe circle and other spectators behind the mesa shadow so they don't peek around the flank
for (int i = 1; i < session.State.Contenders.Count; i++)
{
session.SetContenderPose(session.State.Contenders[i].Id, (i - 6) * 12f, 0f);
@ -237,17 +252,12 @@ namespace RustToDust.Tests
var other = session.State.Spectators.Spectators[i];
if (other.Id != provokedSpec.Id && other.Id != clearedSpec.Id)
{
session.SetSpectatorPose(other.Id, -mesa.X, -mesa.Z);
float farX = (mesa.X >= 0f ? -1f : 1f) * 680f;
float farZ = (mesa.Z >= 0f ? -1f : 1f) * 680f;
session.SetSpectatorPose(other.Id, farX, farZ);
}
}
// Place player on the side of the mesa further from center (strictly outside SafeRadius)
float xNeg = mesa.X - mesa.RadiusX - 18f;
float xPos = mesa.X + mesa.RadiusX + 18f;
bool negIsFurther = (xNeg * xNeg + mesa.Z * mesa.Z) >= (xPos * xPos + mesa.Z * mesa.Z);
float occludedX = negIsFurther ? xNeg : xPos;
float specSideX = negIsFurther ? (mesa.X + mesa.RadiusX + 45f) : (mesa.X - mesa.RadiusX - 45f);
// Briefly establish visual contact for provokedSpec at initial spot, then move player behind the mesa
session.SetContenderPose(player.Id, specSideX - (negIsFurther ? 12f : -12f), mesa.Z);
session.SetSpectatorPose(provokedSpec.Id, specSideX, mesa.Z);