Fix defibs resetting rot timer + slimes not having perishable (#23340)

* Fix defibs resetting rot timer + slimes not having perishable

* fix the sound too
This commit is contained in:
Nemanja
2024-01-01 21:12:32 -05:00
committed by GitHub
parent d8e4cd1d22
commit 8d9a76c95d
9 changed files with 12 additions and 10 deletions

View File

@@ -214,6 +214,7 @@ public sealed class DefibrillatorSystem : EntitySystem
ICommonSession? session = null; ICommonSession? session = null;
var dead = true;
if (_rotting.IsRotten(target)) if (_rotting.IsRotten(target))
{ {
_chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-rotten"), _chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-rotten"),
@@ -223,9 +224,16 @@ public sealed class DefibrillatorSystem : EntitySystem
{ {
if (_mobState.IsDead(target, mob)) if (_mobState.IsDead(target, mob))
_damageable.TryChangeDamage(target, component.ZapHeal, true, origin: uid); _damageable.TryChangeDamage(target, component.ZapHeal, true, origin: uid);
_mobState.ChangeMobState(target, MobState.Critical, mob, uid);
if (_mind.TryGetMind(target, out var mindId, out var mind) && if (_mobThreshold.TryGetThresholdForState(target, MobState.Dead, out var threshold) &&
TryComp<DamageableComponent>(target, out var damageableComponent) &&
damageableComponent.TotalDamage < threshold)
{
_mobState.ChangeMobState(target, MobState.Critical, mob, uid);
dead = false;
}
if (_mind.TryGetMind(target, out _, out var mind) &&
mind.Session is { } playerSession) mind.Session is { } playerSession)
{ {
session = playerSession; session = playerSession;
@@ -242,7 +250,7 @@ public sealed class DefibrillatorSystem : EntitySystem
} }
} }
var sound = _mobState.IsDead(target, mob) || session == null var sound = dead || session == null
? component.FailureSound ? component.FailureSound
: component.SuccessSound; : component.SuccessSound;
_audio.PlayPvs(sound, uid); _audio.PlayPvs(sound, uid);

View File

@@ -27,7 +27,6 @@
- FootstepSound - FootstepSound
- DoorBumpOpener - DoorBumpOpener
- SpiderCraft - SpiderCraft
- type: Perishable
- type: Butcherable - type: Butcherable
butcheringType: Spike butcheringType: Spike
spawned: spawned:

View File

@@ -284,6 +284,7 @@
shiveringHeatRegulation: 2000 shiveringHeatRegulation: 2000
normalBodyTemperature: 310.15 normalBodyTemperature: 310.15
thermalRegulationTemperatureThreshold: 25 thermalRegulationTemperatureThreshold: 25
- type: Perishable
- type: Butcherable - type: Butcherable
butcheringType: Spike # TODO human. butcheringType: Spike # TODO human.
spawned: spawned:

View File

@@ -28,7 +28,6 @@
Brute: Brute:
sprite: Mobs/Effects/brute_damage.rsi sprite: Mobs/Effects/brute_damage.rsi
color: "#75b1f0" color: "#75b1f0"
- type: Perishable
- type: Butcherable - type: Butcherable
butcheringType: Spike butcheringType: Spike
spawned: spawned:

View File

@@ -28,7 +28,6 @@
- type: Body - type: Body
prototype: Dwarf prototype: Dwarf
requiredLegs: 2 requiredLegs: 2
- type: Perishable
- type: Butcherable - type: Butcherable
butcheringType: Spike butcheringType: Spike
spawned: spawned:

View File

@@ -14,7 +14,6 @@
sprite: Mobs/Species/Human/parts.rsi sprite: Mobs/Species/Human/parts.rsi
state: full state: full
- type: Thirst - type: Thirst
- type: Perishable
- type: Butcherable - type: Butcherable
butcheringType: Spike butcheringType: Spike
spawned: spawned:

View File

@@ -28,7 +28,6 @@
speechVerb: Moth speechVerb: Moth
- type: TypingIndicator - type: TypingIndicator
proto: moth proto: moth
- type: Perishable
- type: Butcherable - type: Butcherable
butcheringType: Spike butcheringType: Spike
spawned: spawned:

View File

@@ -21,7 +21,6 @@
- type: Body - type: Body
prototype: Reptilian prototype: Reptilian
requiredLegs: 2 requiredLegs: 2
- type: Perishable
- type: Butcherable - type: Butcherable
butcheringType: Spike butcheringType: Spike
spawned: spawned:

View File

@@ -97,7 +97,6 @@
- type: Inventory - type: Inventory
speciesId: vox speciesId: vox
- type: InventorySlots - type: InventorySlots
- type: Perishable
- type: Butcherable - type: Butcherable
butcheringType: Spike butcheringType: Spike
spawned: spawned: