Adds the pressure medipen and adds the emergency suit to emergency lockers (#7880)
* Implement pressure medipen Add the emergency suit to emergency lockers Increase leporazine temperature change * Fix typo in translation file * Fix ignored component name * Address reviews * Revert changes to submodule commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
namespace Content.Server.Atmos.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class PressureImmunityComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -25,6 +25,10 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
SubscribeLocalEvent<PressureProtectionComponent, HighPressureEvent>(OnHighPressureEvent);
|
||||
SubscribeLocalEvent<PressureProtectionComponent, LowPressureEvent>(OnLowPressureEvent);
|
||||
|
||||
SubscribeLocalEvent<PressureImmunityComponent, HighPressureEvent>(OnHighPressureImmuneEvent);
|
||||
SubscribeLocalEvent<PressureImmunityComponent, LowPressureEvent>(OnLowPressureImmuneEvent);
|
||||
|
||||
}
|
||||
|
||||
private void OnHighPressureEvent(EntityUid uid, PressureProtectionComponent component, HighPressureEvent args)
|
||||
@@ -39,6 +43,24 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
args.Multiplier *= component.LowPressureMultiplier;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Completely prevent high pressure damage
|
||||
/// </summary>
|
||||
private void OnHighPressureImmuneEvent(EntityUid uid, PressureImmunityComponent component, HighPressureEvent args)
|
||||
{
|
||||
args.Multiplier = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Completely prevent low pressure damage
|
||||
/// </summary>
|
||||
private void OnLowPressureImmuneEvent(EntityUid uid, PressureImmunityComponent component, LowPressureEvent args)
|
||||
{
|
||||
args.Modifier = 100;
|
||||
args.Multiplier = 10000;
|
||||
}
|
||||
|
||||
public float GetFeltLowPressure(BarotraumaComponent baro, float environmentPressure)
|
||||
{
|
||||
var modifier = float.MaxValue;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Chemistry.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -13,6 +14,15 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
SubscribeLocalEvent<HyposprayComponent, AfterInteractEvent>(OnAfterInteract);
|
||||
SubscribeLocalEvent<HyposprayComponent, ClickAttackEvent>(OnClickAttack);
|
||||
SubscribeLocalEvent<HyposprayComponent, SolutionChangedEvent>(OnSolutionChange);
|
||||
SubscribeLocalEvent<HyposprayComponent, UseInHandEvent>(OnUseInHand);
|
||||
}
|
||||
|
||||
private void OnUseInHand(EntityUid uid, HyposprayComponent component, UseInHandEvent args)
|
||||
{
|
||||
if (args.Handled) return;
|
||||
|
||||
component.TryDoInject(args.User, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OnSolutionChange(EntityUid uid, HyposprayComponent component, SolutionChangedEvent args)
|
||||
|
||||
Reference in New Issue
Block a user