fix(ui): restore radar, retail wield switching, and protection meshes
Late-bind radar snapshots to the canonical LiveEntityRuntime maps so the retained radar survives bootstrap and session replacement instead of capturing empty sentinels. Route paperdoll drops through the retail AutoWield blocker transaction. Move conflicting held weapons, shields, explicit jewelry destinations, and mismatched ammo to the backpack one authoritative confirmation at a time; preserve compatible arrows when switching to melee. Render mode-1 and no-degrade particle GfxObjs as their authored modern-pipeline meshes, retain Always2D billboards, interleave both paths back-to-front, balance emitter mesh ownership, and fail safely on corrupt DAT material metadata. This restores the closed apex on Armor Self/protection effects. Retain Studio fixture controller lifetimes, add installed-DAT and adversarial regression coverage, synchronize retail research/divergence bookkeeping, and pass all three review tracks plus the full Release suite. Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
parent
8d63e5c28a
commit
b26f84cc69
26 changed files with 1361 additions and 141 deletions
|
|
@ -23,6 +23,7 @@ public sealed class ItemInteractionControllerTests
|
|||
public readonly List<(uint Item, uint Amount)> SplitDrops = new();
|
||||
public readonly List<(uint Target, uint Item, uint Amount)> Gives = new();
|
||||
public readonly List<string> Toasts = new();
|
||||
public readonly List<string> SystemMessages = new();
|
||||
public readonly StackSplitQuantityState SplitQuantity = new();
|
||||
public uint SelectedObject;
|
||||
public bool NonCombatMode;
|
||||
|
|
@ -63,7 +64,8 @@ public sealed class ItemInteractionControllerTests
|
|||
sendPutItemInContainer: (item, container, placement) =>
|
||||
Puts.Add((item, container, placement)),
|
||||
sendGive: (target, item, amount) => Gives.Add((target, item, amount)),
|
||||
dragOnPlayerOpensSecureTrade: () => DragOnPlayerOpensSecureTrade);
|
||||
dragOnPlayerOpensSecureTrade: () => DragOnPlayerOpensSecureTrade,
|
||||
systemMessage: SystemMessages.Add);
|
||||
}
|
||||
|
||||
public ItemInteractionController Controller { get; }
|
||||
|
|
@ -661,6 +663,209 @@ public sealed class ItemInteractionControllerTests
|
|||
Assert.Equal(new[] { (bow, (uint)EquipMask.MissileWeapon) }, h.Wields);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PaperdollWeaponSwitch_toSword_keepsEquippedArrows()
|
||||
{
|
||||
var h = new Harness();
|
||||
const uint bow = 0x50000B51u;
|
||||
const uint arrows = 0x50000B52u;
|
||||
const uint sword = 0x50000B53u;
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = bow,
|
||||
Name = "Shortbow",
|
||||
Type = ItemType.MissileWeapon,
|
||||
CombatUse = 2,
|
||||
AmmoType = 1,
|
||||
ValidLocations = EquipMask.MissileWeapon,
|
||||
});
|
||||
h.Objects.MoveItem(bow, Player, -1, EquipMask.MissileWeapon);
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = arrows,
|
||||
Name = "Arrows",
|
||||
Type = ItemType.MissileWeapon,
|
||||
CombatUse = 3,
|
||||
AmmoType = 1,
|
||||
ValidLocations = EquipMask.MissileAmmo,
|
||||
});
|
||||
h.Objects.MoveItem(arrows, Player, -1, EquipMask.MissileAmmo);
|
||||
h.AddContained(sword, item =>
|
||||
{
|
||||
item.Name = "Katar";
|
||||
item.Type = ItemType.MeleeWeapon;
|
||||
item.CombatUse = 1;
|
||||
item.ValidLocations = EquipMask.MeleeWeapon;
|
||||
});
|
||||
|
||||
Assert.True(h.Controller.WieldFromPaperdoll(sword, EquipMask.MeleeWeapon));
|
||||
Assert.Equal(new[] { (bow, Player, 0) }, h.Puts);
|
||||
Assert.Empty(h.Wields);
|
||||
Assert.Equal(new[] { "Moving Shortbow to your backpack" }, h.SystemMessages);
|
||||
|
||||
h.Objects.MoveItem(bow, Player, 0, EquipMask.None);
|
||||
|
||||
Assert.Equal(new[] { (sword, (uint)EquipMask.MeleeWeapon) }, h.Wields);
|
||||
Assert.Equal(EquipMask.MissileAmmo,
|
||||
h.Objects.Get(arrows)!.CurrentlyEquippedLocation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PaperdollWeaponSwitch_fromWandToSword_movesHeldCasterFirst()
|
||||
{
|
||||
var h = new Harness();
|
||||
const uint wand = 0x50000B54u;
|
||||
const uint sword = 0x50000B55u;
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = wand,
|
||||
Name = "Wand",
|
||||
Type = ItemType.Caster,
|
||||
ValidLocations = EquipMask.Held,
|
||||
});
|
||||
h.Objects.MoveItem(wand, Player, -1, EquipMask.Held);
|
||||
h.AddContained(sword, item =>
|
||||
{
|
||||
item.Name = "Katar";
|
||||
item.Type = ItemType.MeleeWeapon;
|
||||
item.CombatUse = 1;
|
||||
item.ValidLocations = EquipMask.MeleeWeapon;
|
||||
});
|
||||
|
||||
Assert.True(h.Controller.WieldFromPaperdoll(sword, EquipMask.MeleeWeapon));
|
||||
Assert.Equal(new[] { (wand, Player, 0) }, h.Puts);
|
||||
Assert.Empty(h.Wields);
|
||||
Assert.Equal(new[] { "Moving Wand to your backpack" }, h.SystemMessages);
|
||||
|
||||
h.Objects.MoveItem(wand, Player, 0, EquipMask.None);
|
||||
|
||||
Assert.Equal(new[] { (sword, (uint)EquipMask.MeleeWeapon) }, h.Wields);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PaperdollWeaponSwitch_toCrossbow_movesIncompatibleArrowsAfterBow()
|
||||
{
|
||||
var h = new Harness();
|
||||
const uint bow = 0x50000B61u;
|
||||
const uint arrows = 0x50000B62u;
|
||||
const uint crossbow = 0x50000B63u;
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = bow,
|
||||
Name = "Shortbow",
|
||||
Type = ItemType.MissileWeapon,
|
||||
CombatUse = 2,
|
||||
AmmoType = 1,
|
||||
ValidLocations = EquipMask.MissileWeapon,
|
||||
});
|
||||
h.Objects.MoveItem(bow, Player, -1, EquipMask.MissileWeapon);
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = arrows,
|
||||
Name = "Arrows",
|
||||
Type = ItemType.MissileWeapon,
|
||||
CombatUse = 3,
|
||||
AmmoType = 1,
|
||||
ValidLocations = EquipMask.MissileAmmo,
|
||||
});
|
||||
h.Objects.MoveItem(arrows, Player, -1, EquipMask.MissileAmmo);
|
||||
h.AddContained(crossbow, item =>
|
||||
{
|
||||
item.Name = "Heavy Crossbow";
|
||||
item.Type = ItemType.MissileWeapon;
|
||||
item.CombatUse = 2;
|
||||
item.AmmoType = 2;
|
||||
item.ValidLocations = EquipMask.MissileWeapon;
|
||||
});
|
||||
|
||||
Assert.True(h.Controller.WieldFromPaperdoll(
|
||||
crossbow, EquipMask.MissileWeapon));
|
||||
Assert.Equal(new[] { (bow, Player, 0) }, h.Puts);
|
||||
|
||||
h.Objects.MoveItem(bow, Player, 0, EquipMask.None);
|
||||
|
||||
Assert.Equal(
|
||||
new[] { (bow, Player, 0), (arrows, Player, 0) },
|
||||
h.Puts);
|
||||
Assert.Empty(h.Wields);
|
||||
|
||||
h.Objects.MoveItem(arrows, Player, 0, EquipMask.None);
|
||||
|
||||
Assert.Equal(
|
||||
new[] { (crossbow, (uint)EquipMask.MissileWeapon) },
|
||||
h.Wields);
|
||||
Assert.Equal(
|
||||
new[]
|
||||
{
|
||||
"Moving Shortbow to your backpack",
|
||||
"Moving Arrows to your backpack",
|
||||
},
|
||||
h.SystemMessages);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PaperdollDrop_relocatesAlreadyEquippedItemToExplicitCompatibleSlot()
|
||||
{
|
||||
var h = new Harness();
|
||||
const uint ring = 0x50000B71u;
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = ring,
|
||||
Name = "Ring",
|
||||
Type = ItemType.Jewelry,
|
||||
ValidLocations = EquipMask.FingerWearLeft | EquipMask.FingerWearRight,
|
||||
});
|
||||
h.Objects.MoveItem(ring, Player, -1, EquipMask.FingerWearLeft);
|
||||
|
||||
Assert.True(h.Controller.WieldFromPaperdoll(ring, EquipMask.FingerWearRight));
|
||||
|
||||
Assert.Equal(
|
||||
new[] { (ring, (uint)EquipMask.FingerWearRight) },
|
||||
h.Wields);
|
||||
Assert.Equal(
|
||||
EquipMask.FingerWearRight,
|
||||
h.Objects.Get(ring)!.CurrentlyEquippedLocation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PaperdollDrop_movesExplicitDestinationBlockerBeforeRelocatingEquippedItem()
|
||||
{
|
||||
var h = new Harness();
|
||||
const uint leftRing = 0x50000B72u;
|
||||
const uint rightRing = 0x50000B73u;
|
||||
EquipMask valid = EquipMask.FingerWearLeft | EquipMask.FingerWearRight;
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = leftRing,
|
||||
Name = "Left Ring",
|
||||
Type = ItemType.Jewelry,
|
||||
ValidLocations = valid,
|
||||
});
|
||||
h.Objects.MoveItem(leftRing, Player, -1, EquipMask.FingerWearLeft);
|
||||
h.Objects.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = rightRing,
|
||||
Name = "Right Ring",
|
||||
Type = ItemType.Jewelry,
|
||||
ValidLocations = valid,
|
||||
});
|
||||
h.Objects.MoveItem(rightRing, Player, -1, EquipMask.FingerWearRight);
|
||||
|
||||
Assert.True(h.Controller.WieldFromPaperdoll(leftRing, EquipMask.FingerWearRight));
|
||||
Assert.Equal(new[] { (rightRing, Player, 0) }, h.Puts);
|
||||
Assert.Empty(h.Wields);
|
||||
Assert.Equal(new[] { "Moving Right Ring to your backpack" }, h.SystemMessages);
|
||||
|
||||
h.Objects.MoveItem(rightRing, Player, 0, EquipMask.None);
|
||||
|
||||
Assert.Equal(
|
||||
new[] { (leftRing, (uint)EquipMask.FingerWearRight) },
|
||||
h.Wields);
|
||||
Assert.Equal(
|
||||
EquipMask.FingerWearRight,
|
||||
h.Objects.Get(leftRing)!.CurrentlyEquippedLocation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BlocksUseOfShield_matchesRetailCombatUseAndAmmoRules()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue