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

+18
View File
@@ -24,6 +24,24 @@ public sealed class SceneInventory
public void SetState(int group, int item, int state) => states[Offset(group, item)] = state;
/// <summary>
/// Jimmy PostLoad423DEF..423EC1: enable these eight owned gadgets, then
/// disable them in numeric VR01..VR08. State4 is unavailable ownership,
/// distinct from unowned0. Other wire values and item8 remain unchanged.
/// </summary>
public void ApplyLevelAvailability(string levelCode)
{
ArgumentNullException.ThrowIfNull(levelCode);
ReadOnlySpan<int> items = [7, 3, 0, 5, 1, 6, 2, 4];
foreach (var item in items)
if (states[item] == 4) states[item] = 1;
// Exactly the eight original FourCC values in the source numeric range.
if (levelCode.Length == 4 && levelCode.StartsWith("VR0", StringComparison.Ordinal)
&& levelCode[3] is >= '1' and <= '8')
foreach (var item in items)
if (states[item] == 1) states[item] = 4;
}
public void SelectGadget(int item)
{
if (item != -1 && (item is < 0 or >= 9 || State(0, item) == 0))