Apply recovered player phases, static camera query and level availability

This commit is contained in:
UnixNight committed 2026-10-25 19:56:44 -04:00
1 parent 117db77c7b
commit 09cf1172bf
33 files changed
+1500 -99

No files matched your search

@@ -155,6 +155,34 @@ inventory.SetState(0, 3, 0); Throws(() => inventory.SelectGadget(3));
inventory.SetState(0, 3, 1); inventory.SelectGadget(3); Check(inventory.SelectedGadget == 3, "Owned gadget selection");
Console.WriteLine("PASS inventory bounds, ownership, unknown-state preservation and gadget availability");
foreach (var state in new[] { int.MinValue, -1, 0, 1, 2, 3, 4, 5, int.MaxValue })
{
foreach (var tutorial in Enumerable.Range(1, 8).Select(i => "VR0" + i))
{
var availability = new SceneInventory(Enumerable.Repeat(state, 19));
availability.ApplyLevelAvailability(tutorial);
var disabled = state is 1 or 4 ? 4 : state;
Check(Enumerable.Range(0, 8).All(i => availability.State(0, i) == disabled),
"Tutorial PostLoad only disables owned states1/4");
Check(availability.State(0, 8) == state && Enumerable.Range(0, 10).All(i => availability.State(1, i) == state),
"PostLoad availability preserves gadget8 and the independent inventory group");
var carried = OriginalSave.Parse((original with { InventoryStates = availability.Snapshot() }).Encode());
var returned = new SceneInventory(carried.InventoryStates);
returned.ApplyLevelAvailability("LV1B");
Check(Enumerable.Range(0, 8).All(i => returned.State(0, i) == (state is 1 or 4 ? 1 : state)),
"Serialized tutorial state returns to enabled owned gadgets in lab");
}
}
foreach (var normal in new[] { "LV1B", "LEV1", "VR00", "VR09", "vr04" })
{
var availability = new SceneInventory(Enumerable.Repeat(4, 19));
availability.ApplyLevelAvailability(normal);
Check(availability.State(0, 3) == 1 && availability.State(0, 8) == 4,
"Normal/fourcc-boundary PostLoad enables selected owned gadgets only");
}
Check(JetpackBurst.CanStart("VR04", -1, 4, 20), "Tutorial jetpack bypass still works with disabled inventory state4");
Console.WriteLine("PASS source PostLoad gadget availability, tutorial boundaries and lab RETURN round-trip");
// Independently recover the original SCENE setter's two dispatch tables rather
// than testing the port's switch against another manually copied switch.
var exe = File.ReadAllBytes(AssetPath.Resolve(root, "Neutron.exe"));