2022-12-18 13:12:28 -05:00
|
|
|
|
using Content.Server.Botany.Systems;
|
|
|
|
|
|
using Content.Shared.Chemistry.Reagent;
|
2021-11-08 15:33:45 -07:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
|
|
|
|
|
{
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class PlantAdjustHealth : PlantAdjustAttribute
|
2021-11-08 15:33:45 -07:00
|
|
|
|
{
|
2021-11-21 00:35:02 -07:00
|
|
|
|
public override void Effect(ReagentEffectArgs args)
|
2021-11-08 15:33:45 -07:00
|
|
|
|
{
|
2021-11-10 03:11:28 -07:00
|
|
|
|
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
|
2021-11-08 15:33:45 -07:00
|
|
|
|
return;
|
|
|
|
|
|
|
2022-12-18 13:12:28 -05:00
|
|
|
|
var plantHolder = args.EntityManager.System<PlantHolderSystem>();
|
|
|
|
|
|
|
2021-11-08 15:33:45 -07:00
|
|
|
|
plantHolderComp.Health += Amount;
|
2022-12-18 13:12:28 -05:00
|
|
|
|
plantHolder.CheckHealth(args.SolutionEntity, plantHolderComp);
|
2021-11-08 15:33:45 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|