PlantAffectGrowth.cs 695 B

12345678910111213141516171819202122
  1. using Content.Server.Botany.Systems;
  2. using Content.Shared.EntityEffects;
  3. using JetBrains.Annotations;
  4. namespace Content.Server.EntityEffects.Effects.PlantMetabolism;
  5. [UsedImplicitly]
  6. public sealed partial class PlantAffectGrowth : PlantAdjustAttribute
  7. {
  8. public override string GuidebookAttributeName { get; set; } = "plant-attribute-growth";
  9. public override void Effect(EntityEffectBaseArgs args)
  10. {
  11. if (!CanMetabolize(args.TargetEntity, out var plantHolderComp, args.EntityManager))
  12. return;
  13. var plantHolder = args.EntityManager.System<PlantHolderSystem>();
  14. plantHolder.AffectGrowth(args.TargetEntity, (int) Amount, plantHolderComp);
  15. }
  16. }