Remake gasp popup to emote (#27736)
This commit is contained in:
parent
f2e5a9d693
commit
16c0dae7cb
|
|
@ -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;
|
||||
|
||||
namespace Content.Server.Body.Components
|
||||
|
|
@ -50,10 +52,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?
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ 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.Popups;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Body.Components;
|
||||
|
|
@ -25,9 +25,9 @@ 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!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
|
@ -84,10 +84,10 @@ public sealed class RespiratorSystem : EntitySystem
|
|||
|
||||
if (respirator.Saturation < respirator.SuffocationThreshold)
|
||||
{
|
||||
if (_gameTiming.CurTime >= respirator.LastGaspPopupTime + respirator.GaspPopupCooldown)
|
||||
if (_gameTiming.CurTime >= respirator.LastGaspEmoteTime + respirator.GaspEmoteCooldown)
|
||||
{
|
||||
respirator.LastGaspPopupTime = _gameTiming.CurTime;
|
||||
_popupSystem.PopupEntity(Loc.GetString("lung-behavior-gasp"), uid);
|
||||
respirator.LastGaspEmoteTime = _gameTiming.CurTime;
|
||||
_chat.TryEmoteWithChat(uid, respirator.GaspEmote, ignoreActionBlocker: true);
|
||||
}
|
||||
|
||||
TakeSuffocationDamage((uid, respirator));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
- files:
|
||||
- deathgasp_1.ogg
|
||||
- deathgasp_2.ogg
|
||||
- female_deathgasp_1.ogg
|
||||
- female_deathgasp_2.ogg
|
||||
- female_deathgasp_3.ogg
|
||||
- female_deathgasp_4.ogg
|
||||
- female_deathgasp_5.ogg
|
||||
- male_deathgasp_1.ogg
|
||||
- male_deathgasp_2.ogg
|
||||
- male_deathgasp_3.ogg
|
||||
- male_deathgasp_4.ogg
|
||||
- male_deathgasp_5.ogg
|
||||
license: "CC-BY-SA-3.0"
|
||||
copyright: "Taken from Paradise at https://github.com/ParadiseSS13/Paradise/commit/4397f13c72998aa7e6ce192215c9f77b9d62eee2"
|
||||
source: "https://github.com/ParadiseSS13/Paradise/tree/4397f13c72998aa7e6ce192215c9f77b9d62eee2/sound/goonstation/voice"
|
||||
|
||||
- files:
|
||||
- gasp_female1.ogg
|
||||
- gasp_female2.ogg
|
||||
- gasp_female3.ogg
|
||||
- gasp_male1.ogg
|
||||
- gasp_male2.ogg
|
||||
license: "CC-BY-SA-3.0"
|
||||
copyright: "Taken from tgstation at https://github.com/tgstation/tgstation/commit/f7a49c4068f1277e6857baf0892d355f1c055974"
|
||||
source: "https://github.com/tgstation/tgstation/tree/f7a49c4068f1277e6857baf0892d355f1c055974/sound/voice/human"
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
lung-behavior-gasp = Gasp
|
||||
|
|
@ -12,6 +12,7 @@ chat-emote-name-click = Click
|
|||
chat-emote-name-clap = Clap
|
||||
chat-emote-name-snap = Snap
|
||||
chat-emote-name-salute = Salute
|
||||
chat-emote-name-gasp = Gasp
|
||||
chat-emote-name-deathgasp = Deathgasp
|
||||
chat-emote-name-buzz = Buzz
|
||||
chat-emote-name-weh = Weh
|
||||
|
|
@ -43,6 +44,7 @@ chat-emote-msg-click = clicks.
|
|||
chat-emote-msg-clap = claps!
|
||||
chat-emote-msg-snap = snaps {POSS-ADJ($entity)} fingers.
|
||||
chat-emote-msg-salute = salutes.
|
||||
chat-emote-msg-gasp = gasps.
|
||||
chat-emote-msg-deathgasp = seizes up and falls limp, {POSS-ADJ($entity)} eyes dead and lifeless...
|
||||
chat-emote-msg-deathgasp-monkey = lets out a faint chimper as {SUBJECT($entity)} collapses and stops moving...
|
||||
chat-emote-msg-buzz = buzzes!
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
- type: soundCollection
|
||||
id: MaleDeathGasp
|
||||
files:
|
||||
- /Audio/Effects/Gasp/male_deathgasp_1.ogg
|
||||
- /Audio/Effects/Gasp/male_deathgasp_2.ogg
|
||||
- /Audio/Effects/Gasp/male_deathgasp_3.ogg
|
||||
- /Audio/Effects/Gasp/male_deathgasp_4.ogg
|
||||
- /Audio/Effects/Gasp/male_deathgasp_5.ogg
|
||||
|
||||
- type: soundCollection
|
||||
id: FemaleDeathGasp
|
||||
files:
|
||||
- /Audio/Effects/Gasp/female_deathgasp_1.ogg
|
||||
- /Audio/Effects/Gasp/female_deathgasp_2.ogg
|
||||
- /Audio/Effects/Gasp/female_deathgasp_3.ogg
|
||||
- /Audio/Effects/Gasp/female_deathgasp_4.ogg
|
||||
- /Audio/Effects/Gasp/female_deathgasp_5.ogg
|
||||
|
||||
- type: soundCollection
|
||||
id: DeathGasp
|
||||
files:
|
||||
- /Audio/Effects/Gasp/deathgasp_1.ogg
|
||||
- /Audio/Effects/Gasp/deathgasp_2.ogg
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
- type: soundCollection
|
||||
id: MaleGasp
|
||||
files:
|
||||
- /Audio/Effects/Gasp/gasp_male1.ogg
|
||||
- /Audio/Effects/Gasp/gasp_male2.ogg
|
||||
|
||||
- type: soundCollection
|
||||
id: FemaleGasp
|
||||
files:
|
||||
- /Audio/Effects/Gasp/gasp_female1.ogg
|
||||
- /Audio/Effects/Gasp/gasp_female2.ogg
|
||||
- /Audio/Effects/Gasp/gasp_female3.ogg
|
||||
|
|
@ -34,6 +34,10 @@
|
|||
collection: Whistles
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: MaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: MaleDeathGasp
|
||||
|
||||
- type: emoteSounds
|
||||
id: FemaleHuman
|
||||
|
|
@ -70,6 +74,10 @@
|
|||
collection: Whistles
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: FemaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: FemaleDeathGasp
|
||||
|
||||
- type: emoteSounds
|
||||
id: MaleReptilian
|
||||
|
|
@ -88,6 +96,10 @@
|
|||
collection: MaleCry
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: MaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: DeathGasp
|
||||
|
||||
- type: emoteSounds
|
||||
id: FemaleReptilian
|
||||
|
|
@ -142,6 +154,10 @@
|
|||
collection: Whistles
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: MaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: MaleDeathGasp
|
||||
params:
|
||||
variation: 0.125
|
||||
|
||||
|
|
@ -180,6 +196,10 @@
|
|||
collection: Whistles
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: FemaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: FemaleDeathGasp
|
||||
params:
|
||||
variation: 0.125
|
||||
|
||||
|
|
@ -205,6 +225,10 @@
|
|||
collection: BikeHorn
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: MaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: DeathGasp
|
||||
params:
|
||||
variation: 0.125
|
||||
|
||||
|
|
@ -223,6 +247,10 @@
|
|||
path: /Audio/Voice/Arachnid/arachnid_click.ogg
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: MaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: DeathGasp
|
||||
|
||||
- type: emoteSounds
|
||||
id: UnisexDwarf
|
||||
|
|
@ -257,6 +285,10 @@
|
|||
collection: Whistles
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: MaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: MaleDeathGasp
|
||||
params:
|
||||
variation: 0.125
|
||||
pitch: 0.75
|
||||
|
|
@ -294,6 +326,10 @@
|
|||
collection: Whistles
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: FemaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: FemaleDeathGasp
|
||||
params:
|
||||
variation: 0.125
|
||||
pitch: 0.75
|
||||
|
|
@ -315,6 +351,10 @@
|
|||
path: /Audio/Voice/Moth/moth_squeak.ogg
|
||||
Weh:
|
||||
collection: Weh
|
||||
Gasp:
|
||||
collection: MaleGasp
|
||||
DefaultDeathgasp:
|
||||
collection: DeathGasp
|
||||
|
||||
- type: emoteSounds
|
||||
id: UnisexSilicon
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# vocal emotes
|
||||
# vocal emotes
|
||||
- type: emote
|
||||
id: Scream
|
||||
name: chat-emote-name-scream
|
||||
|
|
@ -338,6 +338,14 @@
|
|||
- salutes.
|
||||
- salutes!
|
||||
|
||||
- type: emote
|
||||
id: Gasp
|
||||
name: chat-emote-name-gasp
|
||||
whitelist:
|
||||
components:
|
||||
- Respirator
|
||||
chatMessages: ["chat-emote-msg-gasp"]
|
||||
|
||||
- type: emote
|
||||
id: DefaultDeathgasp
|
||||
name: chat-emote-name-deathgasp
|
||||
|
|
|
|||
Loading…
Reference in New Issue