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:
@@ -22,15 +22,15 @@ namespace Content.Server.Chemistry.Components
|
||||
[RegisterComponent]
|
||||
public sealed class HyposprayComponent : SharedHyposprayComponent
|
||||
{
|
||||
[DataField("ClumsyFailChance")]
|
||||
[DataField("clumsyFailChance")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float ClumsyFailChance { get; set; } = 0.5f;
|
||||
|
||||
[DataField("TransferAmount")]
|
||||
[DataField("transferAmount")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public FixedPoint2 TransferAmount { get; set; } = FixedPoint2.New(5);
|
||||
|
||||
[DataField("InjectSound")]
|
||||
[DataField("injectSound")]
|
||||
private SoundSpecifier _injectSound = new SoundPathSpecifier("/Audio/Items/hypospray.ogg");
|
||||
|
||||
protected override void Initialize()
|
||||
|
||||
@@ -26,9 +26,6 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
|
||||
public override bool Condition(ReagentEffectArgs args)
|
||||
{
|
||||
if (args.Reagent == null)
|
||||
return false;
|
||||
|
||||
if (Reagent == null)
|
||||
Reagent = args.Reagent.ID;
|
||||
|
||||
|
||||
@@ -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 _);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user