fix(items): port retail useability and autowear rejection

Use the exact low USEABLE_NO-bit predicate so reset/zero-valued direct-use items such as Blackmoor's Favor reach the ordinary Use request. Port AutoWear's clothing-priority blocker lookup and exact named system notice through the shared activation owner.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-23 08:33:31 +02:00
parent 60387668d0
commit f71f947475
13 changed files with 289 additions and 57 deletions

View file

@ -78,6 +78,30 @@ public sealed class ItemInteractionPolicyTests
Determine(owned with { Useability = ItemUseability.Contained }));
}
[Fact]
public void DetermineUseResult_zeroValuedOwnedGem_isRetailItemUse()
{
var favor = Obj(0x6002) with
{
Type = ItemType.Gem,
ContainerId = Player,
OwnedByPlayer = true,
Flags = PublicWeenieFlags.RequiresPackSlot,
Useability = ItemUseability.Undef,
};
Assert.Equal(ItemPrimaryUseResult.ItemUse, Determine(favor));
var decision = ItemInteractionPolicy.DecideUse(Use(favor));
Assert.Equal(
new[]
{
ItemPolicyActionKind.SendUse,
ItemPolicyActionKind.IncrementBusy,
},
decision.Actions.Select(action => action.Kind));
}
[Fact]
public void DetermineUseResult_nonOwnedGameAndPlayerPaths_areDistinct()
{
@ -259,7 +283,7 @@ public sealed class ItemInteractionPolicyTests
CombatUse: 0,
ItemsCapacity: 0,
ContainersCapacity: 0,
Useability: 0,
Useability: ItemUseability.No,
TargetType: 0,
OwnedByPlayer: false,
IsContainer: false,