* StunLock

* DisarmMalus

* Баланс
This commit is contained in:
Spatison
2024-07-21 20:55:01 +03:00
committed by GitHub
parent 0b1f2a208e
commit 06b4a48b8f
9 changed files with 26 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
using System.Linq; using System.Linq;
using Content.Shared._White.StaminaProtection; using Content.Shared._White.StaminaProtection;
using Content.Shared._White.StunLock;
using Content.Shared.Administration.Logs; using Content.Shared.Administration.Logs;
using Content.Shared.Alert; using Content.Shared.Alert;
using Content.Shared.CombatMode; using Content.Shared.CombatMode;
@@ -15,6 +16,7 @@ using Content.Shared.Rounding;
using Content.Shared.Stunnable; using Content.Shared.Stunnable;
using Content.Shared.Throwing; using Content.Shared.Throwing;
using Content.Shared.Weapons.Melee.Events; using Content.Shared.Weapons.Melee.Events;
using Content.Shared.StatusEffect;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
@@ -35,6 +37,7 @@ public sealed partial class StaminaSystem : EntitySystem
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!; [Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly SharedStunSystem _stunSystem = default!; [Dependency] private readonly SharedStunSystem _stunSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; // WD EDIT
/// <summary> /// <summary>
/// How much of a buffer is there between the stun duration and when stuns can be re-applied. /// How much of a buffer is there between the stun duration and when stuns can be re-applied.
@@ -209,7 +212,7 @@ public sealed partial class StaminaSystem : EntitySystem
damage = modifyEv.Damage; damage = modifyEv.Damage;
} }
TakeStaminaDamage(target, damage, source: uid, sound: component.Sound); TakeStaminaDamage(target, damage, with: uid, sound: component.Sound);
// WD EDIT END // WD EDIT END
} }
@@ -256,7 +259,11 @@ public sealed partial class StaminaSystem : EntitySystem
// Have we already reached the point of max stamina damage? // Have we already reached the point of max stamina damage?
if (component.Critical) if (component.Critical)
{
if (TryComp<StunLockComponent>(with, out _)) // WD EDIT
_stunSystem.TryParalyze(uid, component.StunTime, true);
return; return;
}
var oldDamage = component.StaminaDamage; var oldDamage = component.StaminaDamage;
component.StaminaDamage = MathF.Max(0f, component.StaminaDamage + value); component.StaminaDamage = MathF.Max(0f, component.StaminaDamage + value);
@@ -349,7 +356,7 @@ public sealed partial class StaminaSystem : EntitySystem
continue; continue;
// We were in crit so come out of it and continue. // We were in crit so come out of it and continue.
if (comp.Critical) if (!_statusEffectsSystem.HasStatusEffect(uid, "Stun") && comp.Critical) // WD EIT
{ {
ExitStamCrit(uid, comp); ExitStamCrit(uid, comp);
continue; continue;

View File

@@ -202,6 +202,9 @@ public abstract class SharedStunSystem : EntitySystem
if (!Resolve(uid, ref status, false)) if (!Resolve(uid, ref status, false))
return false; return false;
if (_statusEffect.HasStatusEffect(uid, "Stun"))
time = TimeSpan.FromSeconds(6);
return TryKnockdown(uid, time, refresh, status) && TryStun(uid, time, refresh, status); return TryKnockdown(uid, time, refresh, status) && TryStun(uid, time, refresh, status);
} }

View File

@@ -20,7 +20,7 @@ public sealed class StaminaProtectionSystem : EntitySystem
args.Args.Damage = MathF.Max(0f, args.Args.Damage - flat); args.Args.Damage = MathF.Max(0f, args.Args.Damage - flat);
if (modifiers.Coefficients.TryGetValue("Blunt", out var coefficient)) if (modifiers.Coefficients.TryGetValue("Blunt", out var coefficient))
args.Args.Damage *= coefficient; args.Args.Damage *= coefficient / 1.5f;
} }
} }

View File

@@ -0,0 +1,7 @@
namespace Content.Shared._White.StunLock;
[RegisterComponent]
public sealed partial class StunLockComponent : Component
{
}

View File

@@ -59,6 +59,7 @@
max: 2 max: 2
- type: StaticPrice - type: StaticPrice
price: 50 price: 50
- type: DisarmMalus
#Security Shields #Security Shields

View File

@@ -32,7 +32,7 @@
Blunt: 3 Blunt: 3
- type: StaminaDamageOnCollide - type: StaminaDamageOnCollide
ignoreResistances: false ignoreResistances: false
damage: 35 # 3 hits to stun cuz revolver damage: 45 # 3 hits to stun cuz revolver
- type: entity - type: entity
id: BulletMagnumIncendiary id: BulletMagnumIncendiary

View File

@@ -27,7 +27,7 @@
Blunt: 10 Blunt: 10
- type: StaminaDamageOnCollide - type: StaminaDamageOnCollide
ignoreResistances: false ignoreResistances: false
damage: 60 damage: 80
- type: entity - type: entity
id: PelletShotgun id: PelletShotgun

View File

@@ -122,7 +122,7 @@
path: /Audio/Weapons/Guns/Hits/snap.ogg path: /Audio/Weapons/Guns/Hits/snap.ogg
- type: StaminaDamageOnCollide - type: StaminaDamageOnCollide
ignoreResistances: false ignoreResistances: false
damage: 22 # 5 hits to stun sounds reasonable damage: 33 # Wd EDIT
- type: entity - type: entity
id: BaseBulletIncendiary id: BaseBulletIncendiary
@@ -756,6 +756,7 @@
- state: grenade - state: grenade
- type: FlashOnTrigger - type: FlashOnTrigger
range: 7 range: 7
forceStun: true # WD EDIT
- type: SpawnOnTrigger - type: SpawnOnTrigger
proto: GrenadeFlashEffect proto: GrenadeFlashEffect
- type: ActiveTimerTrigger - type: ActiveTimerTrigger

View File

@@ -87,6 +87,7 @@
- type: GuideHelp - type: GuideHelp
guides: guides:
- Security - Security
- type: StunLock # Wd EDIT
- type: entity - type: entity
name: truncheon name: truncheon