Stamina damage (#9230)

This commit is contained in:
metalgearsloth
2022-07-06 18:06:12 +10:00
committed by GitHub
parent 305cdc02cb
commit 40eecdd78a
129 changed files with 703 additions and 778 deletions

View File

@@ -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)