* basic system + convert all plantmetabolism * stragglers * convert all old metabolisms over * fix YAML errors + dumb serialization issue * remove unused thingy * reimplement * add organ type condition * organtype condition but real * cleanups + test fix * metabolismtype -> metabolizertype * solution resilience * fixes * serializer + use entityuid + hashset * this is apparently an entirely different thing * turns out it just works * oops
28 lines
940 B
C#
28 lines
940 B
C#
using Content.Shared.Chemistry.Components;
|
|
using Content.Shared.Chemistry.Reagent;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
|
using Content.Shared.Damage;
|
|
using JetBrains.Annotations;
|
|
|
|
namespace Content.Server.Chemistry.ReagentEffects
|
|
{
|
|
/// <summary>
|
|
/// Default metabolism for medicine reagents.
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
public class HealthChange : ReagentEffect
|
|
{
|
|
/// <summary>
|
|
/// Damage to apply every metabolism cycle. Damage Ignores resistances.
|
|
/// </summary>
|
|
[DataField("damage", required: true)]
|
|
public DamageSpecifier Damage = default!;
|
|
|
|
public override void Metabolize(EntityUid solutionEntity, EntityUid organEntity, Solution.ReagentQuantity reagent, IEntityManager entityManager)
|
|
{
|
|
EntitySystem.Get<DamageableSystem>().TryChangeDamage(solutionEntity, Damage, true);
|
|
}
|
|
}
|
|
}
|