36950ca21d
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>
32 lines
1.5 KiB
C#
32 lines
1.5 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|