using ProjectM.Simulation; using Unity.Entities; using UnityEngine; namespace ProjectM.Authoring { /// /// Authoring for a decoy-wisp ghost (the LANTERN Aoe/spawn Spark). Bakes an inert /// (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. DecoySystem 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. /// 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 { public override void Bake(DecoyAuthoring authoring) { var entity = GetEntity(authoring, TransformUsageFlags.Dynamic); AddComponent(entity); // ExpireTick stamped at spawn by AbilityFireSystem AddComponent(entity, new Health { Current = authoring.MaxHealth, Max = authoring.MaxHealth }); AddBuffer(entity); } } } }