using Content.Shared.Destructible; using Robust.Shared.Prototypes; namespace Content.Shared.EntityEffects.Effects.MetaData; /// public sealed partial class DestructibleActEntityEffectSystem : EntityEffectSystem { [Dependency] private readonly SharedDestructibleSystem _destructible = default!; protected override void Effect(Entity entity, ref EntityEffectEvent args) { if ((args.Effect.Acts & ThresholdActs.Breakage) != 0) _destructible.BreakEntity(entity); if ((args.Effect.Acts & ThresholdActs.Destruction) != 0) _destructible.DestroyEntity(entity.AsNullable()); } } /// /// Destroys or breaks an entity. /// public sealed partial class DestructibleAct : EntityEffectBase { /// /// What acts should be triggered upon activation. /// [DataField] public ThresholdActs Acts; public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { if ((Acts & ThresholdActs.Destruction) != 0) return Loc.GetString("entity-effect-guidebook-destroy", ("chance", Probability)); return Loc.GetString("entity-effect-guidebook-break", ("chance", Probability)); } }