defib tweaks (#17167)
This commit is contained in:
@@ -156,7 +156,7 @@ public sealed class DefibrillatorSystem : EntitySystem
|
||||
if (_timing.CurTime < component.NextZapTime)
|
||||
return false;
|
||||
|
||||
if (!TryComp<MobStateComponent>(target, out var mobState) || _rotting.IsRotten(target))
|
||||
if (!TryComp<MobStateComponent>(target, out var mobState))
|
||||
return false;
|
||||
|
||||
if (!_powerCell.HasActivatableCharge(uid, user: user))
|
||||
@@ -203,19 +203,27 @@ public sealed class DefibrillatorSystem : EntitySystem
|
||||
if (!_powerCell.TryUseActivatableCharge(uid, user: user))
|
||||
return;
|
||||
|
||||
_mobThreshold.SetAllowRevives(target, true, thresholds);
|
||||
_audio.PlayPvs(component.ZapSound, uid);
|
||||
_electrocution.TryDoElectrocution(target, null, component.ZapDamage, component.WritheDuration, true, ignoreInsulation: true);
|
||||
|
||||
if (_mobState.IsIncapacitated(target, mob))
|
||||
_damageable.TryChangeDamage(target, component.ZapHeal, true, origin: uid);
|
||||
|
||||
component.NextZapTime = _timing.CurTime + component.ZapDelay;
|
||||
_appearance.SetData(uid, DefibrillatorVisuals.Ready, false);
|
||||
|
||||
IPlayerSession? session = null;
|
||||
|
||||
if (_rotting.IsRotten(target))
|
||||
{
|
||||
_chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-rotten"),
|
||||
InGameICChatType.Speak, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_mobState.IsDead(target, mob))
|
||||
_damageable.TryChangeDamage(target, component.ZapHeal, true, origin: uid);
|
||||
|
||||
_mobThreshold.SetAllowRevives(target, true, thresholds);
|
||||
_mobState.ChangeMobState(target, MobState.Critical, mob, uid);
|
||||
_mobThreshold.SetAllowRevives(target, false, thresholds);
|
||||
|
||||
IPlayerSession? session = null;
|
||||
if (TryComp<MindComponent>(target, out var mindComp) &&
|
||||
mindComp.Mind?.UserId != null &&
|
||||
_playerManager.TryGetSessionById(mindComp.Mind.UserId.Value, out session))
|
||||
@@ -233,10 +241,11 @@ public sealed class DefibrillatorSystem : EntitySystem
|
||||
_chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-no-mind"),
|
||||
InGameICChatType.Speak, true);
|
||||
}
|
||||
}
|
||||
|
||||
var sound = _mobState.IsAlive(target, mob) && session != null
|
||||
? component.SuccessSound
|
||||
: component.FailureSound;
|
||||
var sound = _mobState.IsDead(target, mob) || session == null
|
||||
? component.FailureSound
|
||||
: component.SuccessSound;
|
||||
_audio.PlayPvs(sound, uid);
|
||||
|
||||
// if we don't have enough power left for another shot, turn it off
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
defibrillator-not-on = The defibrillator isn't turned on.
|
||||
defibrillator-no-mind = No intelligence pattern can be detected in patient's brain. Further attempts futile
|
||||
defibrillator-no-mind = No intelligence pattern can be detected in patient's brain. Further attempts futile.
|
||||
defibrillator-ghosted = Resuscitation failed - Mental interface error. Further attempts may be successful.
|
||||
defibrillator-rotten = Body decomposition detected: resuscitation failed.
|
||||
|
||||
Reference in New Issue
Block a user