Skip to content

Commit

Permalink
change a bit 3
Browse files Browse the repository at this point in the history
  • Loading branch information
pheenty committed Nov 16, 2024
1 parent ae50675 commit 725183b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions Content.Server/Stories/Garrote/GarroteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private void OnGarroteAttempt(EntityUid uid, GarroteComponent comp, ref AfterInt
return;
}

if (!(mobstate.CurrentState == MobState.Alive && TryComp<RespiratorComponent>(args.Target, out var respirator)))
if (!(mobstate.CurrentState == MobState.Alive && HasComp<RespiratorComponent>(args.Target)))
{
var message = Loc.GetString("garrote-component-doesnt-breath", ("target", args.Target));
_popupSystem.PopupEntity(message, uid, args.User);
Expand Down Expand Up @@ -101,9 +101,6 @@ private void OnGarroteAttempt(EntityUid uid, GarroteComponent comp, ref AfterInt
AddComp<MutedComponent>(args.Target.Value);
}

var saturationDelta = respirator.MinSaturation - respirator.Saturation;
_respirator.UpdateSaturation(args.Target.Value, saturationDelta, respirator);

comp.Busy = true;
}

Expand Down Expand Up @@ -137,7 +134,9 @@ private void OnGarroteDone(EntityUid uid, GarroteComponent comp, GarroteDoneEven

if (args.Cancelled || mobstate.CurrentState != MobState.Alive) return;

var damage = _mobThresholdSystem.GetThresholdForState(args.Target.Value, MobState.Critical, thresholds) - damageable.TotalDamage;
var critthreshold = _mobThresholdSystem.GetThresholdForState(args.Target.Value, MobState.Critical, thresholds);
var deadthreshold = _mobThresholdSystem.GetThresholdForState(args.Target.Value, MobState.Dead, thresholds);
var damage = critthreshold + 0.1 * (deadthreshold - critthreshold) - damageable.TotalDamage;
DamageSpecifier damageDealt = new(_prototypeManager.Index<DamageTypePrototype>("Asphyxiation"), damage);
_damageable.TryChangeDamage(args.Target, damageDealt, false, origin: args.User);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- type: entity
parent: BaseItem
id: Garrote
name: Удавка
name: удавка
description: Приспособление, используемое не иначе, как для скрытных убийств.
components:
- type: Sprite
Expand Down

0 comments on commit 725183b

Please sign in to comment.