PlantPhalanximine.cs 910 B

1234567891011121314151617181920212223
  1. using Content.Server.Botany.Components;
  2. using Content.Shared.EntityEffects;
  3. using JetBrains.Annotations;
  4. using Robust.Shared.Prototypes;
  5. namespace Content.Server.EntityEffects.Effects.PlantMetabolism;
  6. [UsedImplicitly]
  7. [DataDefinition]
  8. public sealed partial class PlantPhalanximine : EntityEffect
  9. {
  10. public override void Effect(EntityEffectBaseArgs args)
  11. {
  12. if (!args.EntityManager.TryGetComponent(args.TargetEntity, out PlantHolderComponent? plantHolderComp)
  13. || plantHolderComp.Seed == null || plantHolderComp.Dead ||
  14. plantHolderComp.Seed.Immutable)
  15. return;
  16. plantHolderComp.Seed.Viable = true;
  17. }
  18. protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-plant-phalanximine", ("chance", Probability));
  19. }