LANTERN purge B6: delete the legacy single-ability path (sockets are THE ability model)

AbilityRef, AbilityCooldown, EffectiveAbilityStats, DefaultAbility deleted.
GoInGameServerSystem seeds the per-frame 4-socket Spark loadout UNCONDITIONALLY
(was gym-only); ClassSelectReceiveSystem + DebugOp.SetClass swap FrameId +
re-seed sockets + zero SocketCooldown; ClassSwapUtil.Apply drops newAbilityId;
EquipSystem weapons become stat-sticks (GrantedAbilityId removed from the item
blob/authoring); StatRecomputeSystem folds CharacterStatsRef + sockets only;
HUD cooldown bar reads socket 0 of SocketCooldown/EffectiveSocketStats; class
HUD readers are FrameId-only (ClassForAbility/AbilityFor deleted);
DebugModifierInjectionSystem drops CycleAbility.

390 tests green; Play-verified: a non-gym spawn gets frame=2 with Sparks
[7,8,6,9] and no console errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 15:47:12 -07:00
parent b34945c2d2
commit 4a8220ad3e
27 changed files with 137 additions and 275 deletions
@@ -41,7 +41,6 @@ namespace ProjectM.Authoring
Tier = def.Tier,
StackMax = def.StackMax,
EquipSlot = def.EquipSlot,
GrantedAbilityId = def.GrantedAbilityId,
Mod0 = ModAt(def, 0),
Mod1 = ModAt(def, 1),
Mod2 = ModAt(def, 2),
@@ -33,9 +33,6 @@ namespace ProjectM.Authoring
[Tooltip("EquipSlotId byte: 0=Weapon, 1=Armor, 2=Trinket, 3=Tool, 255=not equippable.")]
public byte EquipSlot = 255;
[Tooltip("AbilityId granted when equipped in the Weapon slot (0=none): 1=Primary, 2=FastLight, 3=SlowHeavy.")]
public byte GrantedAbilityId = 0;
[Tooltip("Stat modifiers granted while equipped (first 4 used).")]
public List<ItemModAuthoring> Mods = new List<ItemModAuthoring>();
}
@@ -19,9 +19,6 @@ namespace ProjectM.Authoring
[Tooltip("Character-stats definition (move speed, turn rate, max health). Single source of those values.")]
public CharacterStatsDefinition Character;
[Tooltip("Ability definition occupying the player's primary slot.")]
public AbilityDefinition PrimaryAbility;
[Header("Fallbacks (used only if a definition above is unassigned)")]
[Min(0f)] public float FallbackMaxHealth = 100f;
@@ -42,14 +39,11 @@ namespace ProjectM.Authoring
{
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
// Re-bake when a referenced definition's serialized values change.
// Re-bake when the referenced definition's serialized values change.
if (authoring.Character != null) DependsOn(authoring.Character);
if (authoring.PrimaryAbility != null) DependsOn(authoring.PrimaryAbility);
byte characterId = authoring.Character != null
? (byte)authoring.Character.Id : (byte)CharacterId.Default;
byte abilityId = authoring.PrimaryAbility != null
? (byte)authoring.PrimaryAbility.Id : (byte)AbilityId.Primary;
float maxHealth = authoring.Character != null
? authoring.Character.MaxHealth : authoring.FallbackMaxHealth;
@@ -57,14 +51,11 @@ namespace ProjectM.Authoring
AddComponent<PlayerFacing>(entity);
AddComponent<PlayerInput>(entity);
// Data-driven stat refs (replace M2's inlined PlayerMoveStats / AbilityStats values).
// Data-driven stat ref (replaces M2's inlined PlayerMoveStats values); the ability model is the
// 4-socket kit below (the legacy AbilityRef/DefaultAbility/EffectiveAbilityStats bakes are deleted).
AddComponent(entity, new CharacterStatsRef { Id = characterId });
AddComponent(entity, new AbilityRef { Id = abilityId });
// Unarmed/base ability restored on weapon-unequip (AbilityRef.Id mutates when a weapon is equipped).
AddComponent(entity, new DefaultAbility { Id = abilityId });
// Effective stats: zeroed at bake, recomputed every predicted tick by StatRecomputeSystem.
AddComponent(entity, new EffectiveAbilityStats());
AddComponent(entity, new EffectiveCharacterStats());
// Empty replicated modifier stack (grown by upgrades/pickups/debug hook, server-authoritative).
@@ -82,7 +73,6 @@ namespace ProjectM.Authoring
// damageable hit radius, predicted cooldown state, and the per-tick damage inbox.
AddComponent(entity, new Health { Current = maxHealth, Max = maxHealth });
AddComponent(entity, new HitRadius { Value = authoring.HitRadius });
AddComponent<AbilityCooldown>(entity);
AddBuffer<DamageEvent>(entity);
// MC-1 dash: predicted dash window (derived from PlayerInput.Dash) + cooldown gate, baked idle/ready.
AddComponent<DashState>(entity);
@@ -110,17 +100,17 @@ namespace ProjectM.Authoring
// the Returning edge) + the server-only Blade-Dash per-dash dedup accumulator (non-replicated).
AddComponent<BoonEffects>(entity);
AddComponent<DashTrailState>(entity);
// LANTERN Phase 1 (Step 1): 4-socket kit data model - parallels AbilityRef/AbilityCooldown
// (both kept until the AbilityFireSystem migration in Step 2). AbilitySocket = cold per-socket
// loadout (EquipmentSlot-modelled, 4 empty rows); SocketCooldown = hot owner-predicted per-socket
// cooldown; FrameId = replicated frame/class signal (baked 0, written server-side at frame select).
// LANTERN Phase 1 (Step 1): 4-socket kit data model — THE ability model (the legacy single
// AbilityRef/AbilityCooldown path is deleted). AbilitySocket = cold per-socket loadout
// (EquipmentSlot-modelled, 4 empty rows; GoInGameServerSystem seeds the frame loadout at spawn);
// SocketCooldown = hot owner-predicted per-socket cooldown; FrameId = replicated frame/class signal
// (baked 0, written server-side at frame select).
var sockets = AddBuffer<AbilitySocket>(entity);
for (int sk = 0; sk < SocketId.Count; sk++)
sockets.Add(new AbilitySocket { SparkId = 0 });
AddComponent<SocketCooldown>(entity);
AddComponent<FrameId>(entity);
// Step 1b: per-socket effective-stats buffer (4 rows), folded each predicted tick by
// StatRecomputeSystem (additive; the legacy single EffectiveAbilityStats stays until steps 2/2.5).
// Step 1b: per-socket effective-stats buffer (4 rows), folded each predicted tick by StatRecomputeSystem.
var effSockets = AddBuffer<EffectiveSocketStats>(entity);
for (int sk2 = 0; sk2 < SocketId.Count; sk2++)
effSockets.Add(new EffectiveSocketStats());