WashCreamPieReaction.cs 867 B

12345678910111213141516171819202122
  1. using Content.Server.Nutrition.EntitySystems;
  2. using Content.Shared.Chemistry.Reagent;
  3. using Content.Shared.EntityEffects;
  4. using Content.Shared.Nutrition.Components;
  5. using JetBrains.Annotations;
  6. using Robust.Shared.Prototypes;
  7. namespace Content.Server.EntityEffects.Effects;
  8. [UsedImplicitly]
  9. public sealed partial class WashCreamPieReaction : EntityEffect
  10. {
  11. protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
  12. => Loc.GetString("reagent-effect-guidebook-wash-cream-pie-reaction", ("chance", Probability));
  13. public override void Effect(EntityEffectBaseArgs args)
  14. {
  15. if (!args.EntityManager.TryGetComponent(args.TargetEntity, out CreamPiedComponent? creamPied)) return;
  16. args.EntityManager.System<CreamPieSystem>().SetCreamPied(args.TargetEntity, creamPied, false);
  17. }
  18. }