Epinephrine + epipen (#5444)

* add sprite and basic entity, no reagent or testing

* actually implement epinephrine and add it to the box

* allow creating it

* add it to nanomed

* fig
This commit is contained in:
mirrorcult
2021-11-22 23:51:51 -07:00
committed by GitHub
parent 732baa56a9
commit e2205e418b
39 changed files with 311 additions and 32 deletions

View File

@@ -11,7 +11,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Chemistry.ReagentEffects
{
[UsedImplicitly]
public class RemoveReagent : ReagentEffect
public class AdjustReagent : ReagentEffect
{
/// <summary>
/// The reagent ID to remove. Only one of this and <see cref="Group"/> should be active.
@@ -34,9 +34,12 @@ namespace Content.Server.Chemistry.ReagentEffects
if (args.Source != null)
{
var solutionSys = args.EntityManager.EntitySysManager.GetEntitySystem<SolutionContainerSystem>();
if (Reagent != null && args.Source.ContainsReagent(Reagent))
if (Reagent != null)
{
solutionSys.TryRemoveReagent(args.SolutionEntity, args.Source, Reagent, Amount);
if (Amount < 0 && args.Source.ContainsReagent(Reagent))
solutionSys.TryRemoveReagent(args.SolutionEntity, args.Source, Reagent, -Amount);
if (Amount > 0)
solutionSys.TryAddReagent(args.SolutionEntity, args.Source, Reagent, Amount, out _);
}
else if (Group != null)
{
@@ -45,7 +48,12 @@ namespace Content.Server.Chemistry.ReagentEffects
{
var proto = prototypeMan.Index<ReagentPrototype>(quant.ReagentId);
if (proto.Metabolisms != null && proto.Metabolisms.ContainsKey(Group))
solutionSys.TryRemoveReagent(args.SolutionEntity, args.Source, quant.ReagentId, Amount);
{
if (Amount < 0)
solutionSys.TryRemoveReagent(args.SolutionEntity, args.Source, quant.ReagentId, Amount);
if (Amount > 0)
solutionSys.TryAddReagent(args.SolutionEntity, args.Source, quant.ReagentId, Amount, out _);
}
}
}
}