Files
Project-M/Assets/_Project/Scripts/Simulation/Combat/EffectiveSocketStats.cs
T
kronic b143eb6bb5 LANTERN P1 step 1b: per-socket effective-stats fold (additive)
Per Phase1_Combat_Gym_Build_Spec §7 (additive; legacy single EffectiveAbilityStats + its
fold stay until steps 2/2.5 migrate readers, then retired):
- EffectiveSocketStats: 4-wide derived (non-replicated) per-socket effective-stats buffer.
- PlayerAuthoring bakes it (4 rows).
- StatRecomputeSystem: a SECOND fold loop (separate query, under the 7-arg cap) folds each
  socket's SparkId blob base with the SHARED StatModifier band (uniform; per-Spark warping =
  Phase 4) into EffectiveSocketStats[i]; empty socket (SparkId 0) -> zeroed default.
  Fixed CS1654 by writing through a mutable local copy of the buffer handle.
L1 clean; L2 489/489 (new SocketFold_Folds_Per_Socket_With_Uniform_Band).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 10:43:31 -07:00

28 lines
1.4 KiB
C#

using Unity.Entities;
namespace ProjectM.Simulation
{
/// <summary>
/// Per-SOCKET effective ability stats for the LANTERN 4-socket kit — one row per socket (buffer index =
/// socket 0..3), each the authored base of that socket's <see cref="AbilitySocket.SparkId"/> (from the
/// AbilityDatabase blob) folded with the player's shared <see cref="StatModifier"/> band by
/// <c>StatRecomputeSystem</c> every predicted tick. The 4-wide analog of the single
/// <see cref="EffectiveAbilityStats"/> (which is retired once <c>AbilityFireSystem</c> + the feel layer
/// migrate to this in steps 2/2.5). Derived/local, NOT replicated — both worlds recompute it
/// deterministically from the replicated socket loadout + modifier band, so it matches under prediction
/// without being in the snapshot. The per-player <see cref="EffectiveCharacterStats"/> stays single.
/// <para>Band semantics (Phase 1): the single per-player <see cref="StatModifier"/> band (class traits +
/// boons) applies UNIFORMLY to all 4 sockets; per-socket/per-Spark warping is Phase 4.</para>
/// </summary>
[InternalBufferCapacity(4)]
public struct EffectiveSocketStats : IBufferElementData
{
public float Damage;
public float ProjectileSpeed;
public float Range;
public float AutoTargetRange;
public float AutoTargetConeRadians;
public int CooldownTicks;
}
}