1
0

PlantMutateHarvest.cs 980 B

123456789101112131415161718192021222324252627282930
  1. using Content.Server.Botany;
  2. using Content.Server.Botany.Components;
  3. using Content.Shared.EntityEffects;
  4. using Robust.Shared.Prototypes;
  5. namespace Content.Server.EntityEffects.Effects;
  6. /// <summary>
  7. /// Upgrades a plant's harvest type.
  8. /// </summary>
  9. public sealed partial class PlantMutateHarvest : EntityEffect
  10. {
  11. public override void Effect(EntityEffectBaseArgs args)
  12. {
  13. var plantholder = args.EntityManager.GetComponent<PlantHolderComponent>(args.TargetEntity);
  14. if (plantholder.Seed == null)
  15. return;
  16. if (plantholder.Seed.HarvestRepeat == HarvestType.NoRepeat)
  17. plantholder.Seed.HarvestRepeat = HarvestType.Repeat;
  18. else if (plantholder.Seed.HarvestRepeat == HarvestType.Repeat)
  19. plantholder.Seed.HarvestRepeat = HarvestType.SelfHarvest;
  20. }
  21. protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
  22. {
  23. return "TODO";
  24. }
  25. }