Stamina damage (#9230)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Damage.Systems;
|
||||
using Content.Server.Projectiles.Components;
|
||||
using Content.Server.Weapon.Melee;
|
||||
using Content.Server.Weapon.Ranged.Components;
|
||||
@@ -24,6 +25,7 @@ namespace Content.Server.Weapon.Ranged.Systems;
|
||||
public sealed partial class GunSystem : SharedGunSystem
|
||||
{
|
||||
[Dependency] private readonly EffectSystem _effects = default!;
|
||||
[Dependency] private readonly StaminaSystem _stamina = default!;
|
||||
|
||||
public const float DamagePitchVariation = MeleeWeaponSystem.DamagePitchVariation;
|
||||
|
||||
@@ -116,6 +118,9 @@ public sealed partial class GunSystem : SharedGunSystem
|
||||
var distance = result.Distance;
|
||||
FireEffects(fromCoordinates, distance, entityDirection.ToAngle(), hitscan, result.HitEntity);
|
||||
|
||||
if (hitscan.StaminaDamage > 0f)
|
||||
_stamina.TakeStaminaDamage(result.HitEntity, hitscan.StaminaDamage);
|
||||
|
||||
var dmg = hitscan.Damage;
|
||||
|
||||
if (dmg != null)
|
||||
|
||||
Reference in New Issue
Block a user