Remove clonexadone (#11253)

This commit is contained in:
Kara
2022-09-13 12:51:31 -07:00
committed by GitHub
parent 15a75d5db3
commit eaa4bc4aea
4 changed files with 6 additions and 37 deletions

View File

@@ -0,0 +1,30 @@
using Content.Server.Botany.Components;
using Content.Shared.Chemistry.Reagent;
using JetBrains.Annotations;
using Robust.Shared.Random;
namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
{
[UsedImplicitly]
[DataDefinition]
public sealed class PlantCryoxadone : ReagentEffect
{
public override void Effect(ReagentEffectArgs args)
{
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out PlantHolderComponent? plantHolderComp)
|| plantHolderComp.Seed == null || plantHolderComp.Dead)
return;
var deviation = 0;
var seed = plantHolderComp.Seed;
var random = IoCManager.Resolve<IRobustRandom>();
if (plantHolderComp.Age > seed.Maturation)
deviation = (int) Math.Max(seed.Maturation - 1, plantHolderComp.Age - random.Next(7, 10));
else
deviation = (int) (seed.Maturation / seed.GrowthStages);
plantHolderComp.Age -= deviation;
plantHolderComp.SkipAging++;
plantHolderComp.ForceUpdate = true;
}
}
}