Add ESwords (now Inventory refactor compliant!) (#6000)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -9,6 +9,8 @@ using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Cooldown;
|
||||
using Content.Server.Weapon.Melee.Components;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Hands;
|
||||
using Content.Shared.Interaction;
|
||||
@@ -107,7 +109,14 @@ namespace Content.Server.Weapon.Melee
|
||||
$"{ToPrettyString(args.User):user} melee attacked {ToPrettyString(args.Target.Value):target} using {ToPrettyString(args.Used):used} and dealt {damageResult.Total:damage} damage");
|
||||
}
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(owner), comp.HitSound.GetSound(), target);
|
||||
if (hitEvent.HitSoundOverride != null)
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(owner), hitEvent.HitSoundOverride.GetSound(), target, AudioHelpers.WithVariation(0.25f));
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(owner), comp.HitSound.GetSound(), target);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -320,6 +329,12 @@ namespace Content.Server.Weapon.Melee
|
||||
/// </summary>
|
||||
public IEnumerable<EntityUid> HitEntities { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Used to define a new hit sound in case you want to override the default GenericHit.
|
||||
/// Also gets a pitch modifier added to it.
|
||||
/// </summary>
|
||||
public SoundSpecifier? HitSoundOverride {get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// The user who attacked with the melee weapon.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user