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>
This commit is contained in:
2026-07-15 00:00:41 -07:00
parent 8f070ff83c
commit 36950ca21d
24 changed files with 738 additions and 20 deletions
@@ -0,0 +1,34 @@
using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
/// <summary>
/// Authoring for a player-cast ZONE ghost (Vortex / LightZone — the LANTERN Aoe/zone Sparks). Bakes an inert
/// <see cref="ZoneEffect"/>; the runtime values (caster / radius / damage / lifetime) are stamped at spawn by
/// <c>AbilityFireSystem</c> — only the Vortex FLAG is authored here (so <c>AbilityFireSystem</c> can pick
/// ZoneEffect vs DecoyTag by prefab membership, and the pull behaviour is baked-in). The prefab's ghost setup
/// (GhostAuthoringComponent: interpolated, ownerless) is inherited by DUPLICATING an existing ownerless
/// interpolated ghost, so it replicates to all clients via the stock LocalTransform variant (no hand-written
/// <c>[GhostField]</c>). <c>GetEntity(Dynamic)</c> gives a runtime-mutable LocalTransform for the spawn override.
/// </summary>
public class ZoneAuthoring : MonoBehaviour
{
[Tooltip("Vortex: pull enemies toward the zone centre each tick (in addition to the periodic damage).")]
public bool Vortex = false;
private class ZoneBaker : Baker<ZoneAuthoring>
{
public override void Bake(ZoneAuthoring authoring)
{
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
AddComponent(entity, new ZoneEffect
{
Flags = authoring.Vortex ? ZoneEffectFlag.Vortex : (byte)0,
// caster / radius / damage / NextTick / ExpireTick are seeded at spawn by AbilityFireSystem.
});
}
}
}
}