2021-07-31 04:50:32 -07:00
|
|
|
|
using System.Collections.Generic;
|
2021-11-08 15:33:45 -07:00
|
|
|
|
using Content.Shared.Chemistry.Components;
|
2021-07-31 04:50:32 -07:00
|
|
|
|
using Content.Shared.Chemistry.Reagent;
|
2021-11-10 03:11:28 -07:00
|
|
|
|
using Content.Shared.FixedPoint;
|
2021-11-08 15:33:45 -07:00
|
|
|
|
using JetBrains.Annotations;
|
2021-07-31 04:50:32 -07:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Chemistry.Reagent
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Reagent effects describe behavior that occurs when a reagent is ingested and metabolized by some
|
2021-11-08 15:33:45 -07:00
|
|
|
|
/// organ. They only trigger when all of <see cref="Conditions"/> are satisfied.
|
2021-07-31 04:50:32 -07:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ImplicitDataDefinitionForInheritors]
|
2021-11-08 15:33:45 -07:00
|
|
|
|
[MeansImplicitUse]
|
2021-07-31 04:50:32 -07:00
|
|
|
|
public abstract class ReagentEffect
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The list of conditions required for the effect to activate. Not required.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("conditions")]
|
|
|
|
|
|
public ReagentEffectCondition[]? Conditions;
|
|
|
|
|
|
|
2021-11-10 03:11:28 -07:00
|
|
|
|
public abstract void Metabolize(ReagentEffectArgs args);
|
2021-07-31 04:50:32 -07:00
|
|
|
|
}
|
2021-11-10 03:11:28 -07:00
|
|
|
|
|
|
|
|
|
|
public enum ReactionMethod
|
|
|
|
|
|
{
|
|
|
|
|
|
Touch,
|
|
|
|
|
|
Injection,
|
|
|
|
|
|
Ingestion,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public readonly record struct ReagentEffectArgs(
|
|
|
|
|
|
EntityUid SolutionEntity,
|
|
|
|
|
|
EntityUid? OrganEntity,
|
|
|
|
|
|
Solution? Source,
|
|
|
|
|
|
ReagentPrototype Reagent,
|
|
|
|
|
|
FixedPoint2 Metabolizing,
|
|
|
|
|
|
IEntityManager EntityManager,
|
|
|
|
|
|
ReactionMethod? Method
|
|
|
|
|
|
);
|
2021-07-31 04:50:32 -07:00
|
|
|
|
}
|