Equipment: weapon-granted abilities + gear mods (DR-027 Phase 1)

Equipment slots reusing the AbilityRef/StatModifier machinery: EquipmentSlot [GhostField] buffer (index=slot), server-only event-driven EquipSystem (RPC). Weapon -> AbilityRef.Id swaps the attack (prefab + base stats, prediction-correct); gear -> StatModifiers tagged a reserved per-slot EquipSourceId, stripped target-agnostically via RemoveBySourceId. Item mods are INLINE on ItemDefBlob (a nested BlobArray reads empty under the by-value TryGetItem copy). Atomic equip-over swap (no item loss); DefaultAbility restores the unarmed ability on weapon-unequip. Client keys + build-safe hooks; HUD equipment panel + click-to-equip. 4 catalog weapon/gear items wired + re-baked.

Play-validated host+client: weapon equip swaps AbilityRef on both worlds, gear folds into EffectiveCharacterStats, unequip reverses + restores DefaultAbility, all replicated to the owner. See DR-027.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 11:09:25 -07:00
parent 510c12a980
commit 43f355c06b
28 changed files with 709 additions and 6 deletions
@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 84295e2f852afac4fa4b7384857281d9, type: 3}
m_Name: Item_AetherVest
m_EditorClassIdentifier: ProjectM.Authoring::ProjectM.Authoring.ItemDefinition
ItemId: 22
DisplayName: Aether Vest
Category: 3
Tier: 1
StackMax: 1
EquipSlot: 1
GrantedAbilityId: 0
Mods:
- Target: 6
Op: 1
Value: 0.15
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b37686ead19d68d45b84e031bfe99f59
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 84295e2f852afac4fa4b7384857281d9, type: 3}
m_Name: Item_HeavyCannon
m_EditorClassIdentifier: ProjectM.Authoring::ProjectM.Authoring.ItemDefinition
ItemId: 21
DisplayName: Heavy Cannon
Category: 2
Tier: 1
StackMax: 1
EquipSlot: 0
GrantedAbilityId: 3
Mods:
- Target: 0
Op: 0
Value: 10
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 441dbd6676662a2459607f3b75ee821b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 84295e2f852afac4fa4b7384857281d9, type: 3}
m_Name: Item_PowerSigil
m_EditorClassIdentifier: ProjectM.Authoring::ProjectM.Authoring.ItemDefinition
ItemId: 23
DisplayName: Power Sigil
Category: 3
Tier: 1
StackMax: 1
EquipSlot: 2
GrantedAbilityId: 0
Mods:
- Target: 0
Op: 1
Value: 0.2
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c09dc2c47feaa784486e21a3b7e4cb10
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,22 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 84295e2f852afac4fa4b7384857281d9, type: 3}
m_Name: Item_RapidBlaster
m_EditorClassIdentifier: ProjectM.Authoring::ProjectM.Authoring.ItemDefinition
ItemId: 20
DisplayName: Rapid Blaster
Category: 2
Tier: 1
StackMax: 1
EquipSlot: 0
GrantedAbilityId: 2
Mods: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b69a26c8de798624b82e6799f8130291
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant: