using Content.Shared.Botany.Components;
using Content.Shared.Botany.Systems;
using Content.Shared.Random.Helpers;
using Robust.Shared.Random;
using Robust.Shared.Timing;
namespace Content.Shared.EntityEffects.Effects.Botany;
///
/// Changes the planted plant's species by replacing the plant entity with a new entity spawned from one
/// of the current plant's .
///
///
public sealed partial class PlantMutateSpeciesChangeEntityEffectSystem : EntityEffectSystem
{
[Dependency] private IGameTiming _timing = default!;
[Dependency] private PlantMutationSystem _mutation = default!;
protected override void Effect(Entity entity, ref EntityEffectEvent args)
{
if (entity.Comp.MutationPrototypes.Count == 0)
return;
var random = SharedRandomExtensions.PredictedRandom(_timing, GetNetEntity(entity));
var newPlantEnt = random.Pick(entity.Comp.MutationPrototypes);
_mutation.SpeciesChange(entity.Owner, newPlantEnt);
}
}
///
public sealed partial class PlantMutateSpeciesChange : EntityEffectBase;