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:
@@ -0,0 +1,31 @@
|
||||
using ProjectM.Simulation;
|
||||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ProjectM.Authoring
|
||||
{
|
||||
/// <summary>
|
||||
/// Authoring for a decoy-wisp ghost (the LANTERN Aoe/spawn Spark). Bakes an inert <see cref="DecoyTag"/>
|
||||
/// (lifetime stamped at spawn) plus the damageable set (Health + DamageEvent buffer) so Husks path to and
|
||||
/// "kill" it — drawing aggro off the players (EnemyAISystem targets DecoyTag entities). NO HitRadius: the
|
||||
/// decoy is NOT a projectile target, so the caster's own shots pass through it. <c>DecoySystem</c> despawns
|
||||
/// it on Health <= 0 or lifetime elapse. Ghost setup (interpolated, ownerless) is inherited by duplicating
|
||||
/// an existing ownerless interpolated ghost, so position replicates via the stock LocalTransform variant.
|
||||
/// </summary>
|
||||
public class DecoyAuthoring : MonoBehaviour
|
||||
{
|
||||
[Min(1f), Tooltip("Decoy hit points — how much aggro/melee it soaks before popping.")]
|
||||
public float MaxHealth = 60f;
|
||||
|
||||
private class DecoyBaker : Baker<DecoyAuthoring>
|
||||
{
|
||||
public override void Bake(DecoyAuthoring authoring)
|
||||
{
|
||||
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
|
||||
AddComponent<DecoyTag>(entity); // ExpireTick stamped at spawn by AbilityFireSystem
|
||||
AddComponent(entity, new Health { Current = authoring.MaxHealth, Max = authoring.MaxHealth });
|
||||
AddBuffer<DamageEvent>(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user