mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-02-15 03:32:07 +01:00
* EnsureUniqueSeed * mfw * aaaaaaaaaaaaa --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
30 lines
1001 B
C#
30 lines
1001 B
C#
using Content.Server.Botany.Components;
|
|
using Content.Server.Botany.Systems;
|
|
using Content.Server.Popups;
|
|
using Content.Shared.EntityEffects;
|
|
using Content.Shared.EntityEffects.Effects.Botany.PlantAttributes;
|
|
using Content.Shared.Popups;
|
|
|
|
namespace Content.Server.EntityEffects.Effects.Botany.PlantAttributes;
|
|
|
|
public sealed partial class PlantDestroySeedsEntityEffectSystem : EntityEffectSystem<PlantHolderComponent, PlantDestroySeeds>
|
|
{
|
|
[Dependency] private readonly PopupSystem _popup = default!;
|
|
|
|
protected override void Effect(Entity<PlantHolderComponent> entity, ref EntityEffectEvent<PlantDestroySeeds> args)
|
|
{
|
|
if (entity.Comp.Seed == null || entity.Comp.Dead || entity.Comp.Seed.Immutable)
|
|
return;
|
|
|
|
if (entity.Comp.Seed.Seedless)
|
|
return;
|
|
|
|
_popup.PopupEntity(
|
|
Loc.GetString("botany-plant-seedsdestroyed"),
|
|
entity,
|
|
PopupType.SmallCaution
|
|
);
|
|
entity.Comp.Seed.Seedless = true;
|
|
}
|
|
}
|