@@ -104,7 +104,7 @@ namespace Content.Server.Body.Components
|
||||
/// The sound to be played when a weapon instantly deals blood loss damage.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public SoundSpecifier InstantBloodSound = new SoundCollectionSpecifier("blood");
|
||||
public SoundSpecifier InstantBloodSound = new SoundCollectionSpecifier("BloodLossRun");
|
||||
|
||||
/// <summary>
|
||||
/// The sound to be played when some damage actually heals bleeding rather than starting it.
|
||||
@@ -181,6 +181,12 @@ namespace Content.Server.Body.Components
|
||||
/// </summary>
|
||||
public bool IsBleeding => BleedAmount > 0;
|
||||
|
||||
public readonly AudioParams DefaultParams = AudioParams.Default.WithVolume(-1f);
|
||||
|
||||
public SoundSpecifier? BloodLossSound = new SoundCollectionSpecifier("BloodLoss");
|
||||
|
||||
//public SoundSpecifier? BloodLossRunSound = new SoundCollectionSpecifier("");
|
||||
|
||||
//WD-EDIT
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Damage;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
using Robust.Shared.Audio; // WD
|
||||
|
||||
@@ -51,10 +53,16 @@ namespace Content.Server.Body.Components
|
||||
public DamageSpecifier DamageRecovery = default!;
|
||||
|
||||
[DataField]
|
||||
public TimeSpan GaspPopupCooldown = TimeSpan.FromSeconds(8);
|
||||
public TimeSpan GaspEmoteCooldown = TimeSpan.FromSeconds(8);
|
||||
|
||||
[ViewVariables]
|
||||
public TimeSpan LastGaspPopupTime;
|
||||
public TimeSpan LastGaspEmoteTime;
|
||||
|
||||
/// <summary>
|
||||
/// The emote when gasps
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public ProtoId<EmotePrototype> GaspEmote = "Gasp";
|
||||
|
||||
/// <summary>
|
||||
/// How many cycles in a row has the mob been under-saturated?
|
||||
|
||||
@@ -13,9 +13,12 @@ using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Reaction;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.Drunk;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Popups;
|
||||
@@ -44,7 +47,7 @@ public sealed class BloodstreamSystem : EntitySystem
|
||||
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
|
||||
[Dependency] private readonly ForensicsSystem _forensicsSystem = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _speed = default!; // WD
|
||||
[Dependency] private readonly BloodLossAccent _bloodLossAccent = default!;
|
||||
[Dependency] private readonly BloodLossAccent _bloodLossAccent = default!; // WD
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -383,6 +386,13 @@ public sealed class BloodstreamSystem : EntitySystem
|
||||
}
|
||||
|
||||
tempSolution.RemoveAllSolution();
|
||||
|
||||
// WD edit start
|
||||
if (TryComp<MobStateComponent>(uid, out var mobState) && TryComp<StaminaComponent>(uid, out var stamina))
|
||||
if (mobState.CurrentState != MobState.Critical && !stamina.Critical)
|
||||
_audio.PlayPvs(component.BloodLossSound, uid, component.DefaultParams);
|
||||
|
||||
// WD edit end
|
||||
}
|
||||
|
||||
_solutionContainerSystem.UpdateChemicals(component.TemporarySolution.Value);
|
||||
|
||||
@@ -2,6 +2,7 @@ using Content.Server.Administration.Logs;
|
||||
using Content.Server.Atmos;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Chemistry.Containers.EntitySystems;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Nutrition.Components; // WD
|
||||
@@ -42,14 +43,16 @@ public sealed class RespiratorSystem : EntitySystem
|
||||
[Dependency] private readonly BodySystem _bodySystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSys = default!;
|
||||
[Dependency] private readonly LungSystem _lungSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly ChatSystem _chat = default!;
|
||||
[Dependency] private readonly InventorySystem _inventorySystem = default!; // WD
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!; // WD
|
||||
[Dependency] private readonly AudioSystem _audio = default!; // WD
|
||||
[Dependency] private readonly DoAfterSystem _doAfter = default!; // WD
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!; // WD
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!; // WD
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -116,10 +119,10 @@ public sealed class RespiratorSystem : EntitySystem
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_gameTiming.CurTime >= respirator.LastGaspPopupTime + respirator.GaspPopupCooldown)
|
||||
if (_gameTiming.CurTime >= respirator.LastGaspEmoteTime + respirator.GaspEmoteCooldown)
|
||||
{
|
||||
respirator.LastGaspPopupTime = _gameTiming.CurTime;
|
||||
_popupSystem.PopupEntity($"{Name(Identity.Entity(uid, EntityManager))} задыхается!", uid);
|
||||
respirator.LastGaspEmoteTime = _gameTiming.CurTime;
|
||||
_chat.TryEmoteWithChat(uid, respirator.GaspEmote, ignoreActionBlocker: true);
|
||||
}
|
||||
|
||||
TakeSuffocationDamage((uid, respirator));
|
||||
|
||||
Reference in New Issue
Block a user