Files
Project-M/Assets/_Project/Scripts/Simulation/Combat/ReelState.cs
T
kronic 36950ca21d LANTERN P1 Group B: 5-Spark systems — Aoe/Hitscan dispatch + reel/zone/decoy
Aoe/Hitscan archetype dispatch in AbilityFireSystem (both-worlds cooldown;
server-only ecb.Instantiate — the client-never-instantiates invariant; ZoneEffect
vs DecoyTag chosen by prefab membership). Harpooner REEL as a homing state
(ReelState + ReelSystem re-aim the hit Husk's KnockbackState toward the caster's
live position each tick; EnemyAISystem stays sole Position writer), stamped by
ProjectileDamageSystem on a Reel-flag hit. ZonePulseSystem (enemy-only periodic
AoE, caster attribution, no friendly fire, Vortex pull, born-0 lazy-stamp).
Decoy aggro in EnemyAISystem + DecoySystem despawn. AbilityDefBlob gains
EffectFlags (Reel) + DurationTicks. +3 ZonePulseSystem EditMode tests (497 green).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 00:00:41 -07:00

29 lines
1.7 KiB
C#

using Unity.Entities;
namespace ProjectM.Simulation
{
/// <summary>
/// SERVER-ONLY homing reel on a Husk hit by a Reel-flagged (HookPull) projectile — the Harpooner's signature
/// verb. A sibling of <see cref="KnockbackState"/>/<see cref="LungeState"/> (NOT a <c>[GhostField]</c>: the
/// reeled position replicates via the stock LocalTransform variant, so it adds no replicated surface). Unlike
/// the frozen-Dir pull flag, this HOMES: <c>ReelSystem</c> re-aims the Husk's <see cref="KnockbackState"/>
/// toward the caster's CURRENT position every server tick until the target is within release range or
/// <see cref="ExpireTick"/> elapses — <c>EnemyAISystem</c> stays the SOLE Position writer (it drives the
/// re-aimed knockback; ReelSystem only writes the Dir/Speed/UntilTick). Baked inert on Husk variants
/// (EnemyAuthoring). Stores the caster's <see cref="Unity.NetCode.NetworkId"/> (not an Entity) so ReelSystem
/// resolves the live caster position via a per-tick player-by-NetworkId gather. Ticks via
/// <see cref="TickUtil.NonZero"/>; compared with <see cref="Unity.NetCode.NetworkTick"/> only.
/// </summary>
public struct ReelState : IComponentData
{
/// <summary>NetworkId of the reeling caster; ReelSystem homes toward this player's live position.</summary>
public int CasterNetworkId;
/// <summary>Reel pull speed (world units/sec) written into KnockbackState.Speed each tick.</summary>
public float Speed;
/// <summary>Raw tick the reel leash ends (NonZero). <c>0</c> = not reeling; active while .IsNewerThan(serverTick).</summary>
public uint ExpireTick;
}
}