Add ESwords (now Inventory refactor compliant!) (#6000)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Júlio César Ueti
2022-01-24 09:55:48 -03:00
committed by GitHub
parent bfa270e91f
commit 6d5eee0d4c
22 changed files with 577 additions and 8 deletions

View File

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