mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-02-14 19:29:57 +01:00
* EnsureUniqueSeed * mfw * aaaaaaaaaaaaa --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
29 lines
910 B
C#
29 lines
910 B
C#
using Content.Server.Botany.Components;
|
|
using Content.Server.Botany.Systems;
|
|
using Content.Shared.EntityEffects;
|
|
using Content.Shared.EntityEffects.Effects.Botany.PlantAttributes;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Server.EntityEffects.Effects.Botany.PlantAttributes;
|
|
|
|
public sealed partial class PlantDiethylamineEntityEffectSystem : EntityEffectSystem<PlantHolderComponent, PlantDiethylamine>
|
|
{
|
|
[Dependency] private readonly IRobustRandom _random = default!;
|
|
|
|
protected override void Effect(Entity<PlantHolderComponent> entity, ref EntityEffectEvent<PlantDiethylamine> args)
|
|
{
|
|
if (entity.Comp.Seed == null || entity.Comp.Dead || entity.Comp.Seed.Immutable)
|
|
return;
|
|
|
|
if (_random.Prob(0.1f))
|
|
{
|
|
entity.Comp.Seed!.Lifespan++;
|
|
}
|
|
|
|
if (_random.Prob(0.1f))
|
|
{
|
|
entity.Comp.Seed!.Endurance++;
|
|
}
|
|
}
|
|
}
|