using Unity.Entities; using Unity.NetCode; namespace ProjectM.Simulation { /// /// Phase 1.7 mechanic-changer boon state on a player — the run-scoped counterpart to the flat-stat /// band. Stackable counts (//) /// and boolean (see ) that combat systems read to alter behaviour. /// /// Replicated (matching BoonOffer): rollback-correctness is /// provided by the [GhostField]s themselves — the owner is the sole predicting client and needs the /// replicated Fork/Pierce/Chain so its OWN predict-spawned projectiles (in AbilityFireSystem, which /// filters .WithAll<Simulate>()) don't mispredict. Non-owning clients render forked/pierced/chained /// projectiles as interpolated server ghosts and never read the shooter's effects; every other read is /// server-only. NOT — the send type is not what enables rollback, the /// [GhostField] is. /// /// Baked INERT (all 0) on the player prefab (the BoonOffer idiom) so a pick is a non-structural mutate; /// zeroed on the Returning edge in RunDirectorSystem alongside the StatModifier band strips. /// [GhostComponent(OwnerSendType = SendToOwnerType.SendToOwner)] public struct BoonEffects : IComponentData { /// Extra enemy hits a projectile survives before despawning (stacks). [GhostField] public byte Pierce; /// Extra spread projectiles spawned per shot (stacks). [GhostField] public byte Fork; /// Targets a projectile chains to after a hit (stacks). [GhostField] public byte Chain; /// Boolean effect bits — see . [GhostField] public byte Flags; } /// Bit masks for . Plain byte consts (never an enum compared in Burst). public static class BoonFlag { public const byte DashTrail = 1; // dashing damages enemies passed through public const byte FinisherDetonate = 2; // the melee combo finisher blasts an AoE public const byte KnockToPull = 4; // this player's knockback pulls enemies IN instead of away public const byte Siphon = 8; // killing an enemy heals this player public const byte Frenzy = 16; // a kill grants a short cooldown-reduction surge } /// /// Stable byte discriminator for a BoonDefBlob mechanic-changer effect (0 = a plain stat boon). /// Bytes only — Burst-safe, never an enum compared inside a Bursted system. /// public static class BoonEffectKind { public const byte None = 0; public const byte Pierce = 1; public const byte Fork = 2; public const byte Chain = 3; public const byte DashTrail = 4; public const byte FinisherDetonate = 5; public const byte KnockToPull = 6; public const byte Siphon = 7; public const byte Frenzy = 8; } }