* Sedin * almost forgot this. * what * Did a few fixes, tried to readd popup * Fix popup, ready for merge * minor change * Generalize seed removal/destruction system, add popups in general. * fix * fix (again) * deadcode is no more * Sedin buff (nerfing the recipe soon) * godont * webedit moment ok listen I had to nuke my setup because my computer was being Dumb As Shit so let me do this ONE webedit * CRIKEY * Revert "CRIKEY" This reverts commit 1c6959ffd9ba8bb1e97ccf2eb0b37b3ff4ec82ee. I was not supposed to commit that >:/ * Alright, it should be good now but I havent tested it * ready for merge/review * prob -> probability * Requested changes nodoc * Review nodoc * documento * thumb up emoji
29 lines
883 B
C#
29 lines
883 B
C#
using Content.Server.Botany.Systems;
|
|
using Content.Shared.EntityEffects;
|
|
|
|
namespace Content.Server.EntityEffects.Effects.PlantMetabolism;
|
|
|
|
/// <summary>
|
|
/// Handles increase or decrease of plant potency.
|
|
/// </summary>
|
|
|
|
public sealed partial class PlantAdjustPotency : PlantAdjustAttribute
|
|
{
|
|
public override string GuidebookAttributeName { get; set; } = "plant-attribute-potency";
|
|
|
|
public override void Effect(EntityEffectBaseArgs args)
|
|
{
|
|
if (!CanMetabolize(args.TargetEntity, out var plantHolderComp, args.EntityManager))
|
|
return;
|
|
|
|
if (plantHolderComp.Seed == null)
|
|
return;
|
|
|
|
var plantHolder = args.EntityManager.System<PlantHolderSystem>();
|
|
|
|
plantHolder.EnsureUniqueSeed(args.TargetEntity, plantHolderComp);
|
|
|
|
plantHolderComp.Seed.Potency = Math.Max(plantHolderComp.Seed.Potency + Amount, 1);
|
|
}
|
|
}
|