Explosive grenade sound (#15582)
This commit is contained in:
@@ -22,7 +22,4 @@ public sealed class ActiveTimerTriggerComponent : Component
|
||||
|
||||
[DataField("beepSound")]
|
||||
public SoundSpecifier? BeepSound;
|
||||
|
||||
[DataField("beepParams")]
|
||||
public AudioParams BeepParams = AudioParams.Default;
|
||||
}
|
||||
|
||||
@@ -29,9 +29,6 @@ namespace Content.Server.Explosion.Components
|
||||
[DataField("beepInterval")]
|
||||
public float BeepInterval = 1;
|
||||
|
||||
[DataField("beepParams")]
|
||||
public AudioParams BeepParams = AudioParams.Default.WithVolume(-2f);
|
||||
|
||||
/// <summary>
|
||||
/// Should timer be started when it was stuck to another entity.
|
||||
/// Used for C4 charges and similar behaviour.
|
||||
|
||||
@@ -28,8 +28,7 @@ public sealed partial class TriggerSystem
|
||||
timerTrigger.Delay,
|
||||
timerTrigger.BeepInterval,
|
||||
timerTrigger.InitialBeepDelay,
|
||||
timerTrigger.BeepSound,
|
||||
timerTrigger.BeepParams);
|
||||
timerTrigger.BeepSound);
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
@@ -31,8 +31,7 @@ public sealed partial class TriggerSystem
|
||||
component.Delay,
|
||||
component.BeepInterval,
|
||||
component.InitialBeepDelay,
|
||||
component.BeepSound,
|
||||
component.BeepParams);
|
||||
component.BeepSound);
|
||||
}
|
||||
|
||||
private void OnExamined(EntityUid uid, OnUseTimerTriggerComponent component, ExaminedEvent args)
|
||||
@@ -150,8 +149,7 @@ public sealed partial class TriggerSystem
|
||||
component.Delay,
|
||||
component.BeepInterval,
|
||||
component.InitialBeepDelay,
|
||||
component.BeepSound,
|
||||
component.BeepParams);
|
||||
component.BeepSound);
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly BodySystem _body = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -155,7 +156,7 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
return triggerEvent.Handled;
|
||||
}
|
||||
|
||||
public void HandleTimerTrigger(EntityUid uid, EntityUid? user, float delay , float beepInterval, float? initialBeepDelay, SoundSpecifier? beepSound, AudioParams beepParams)
|
||||
public void HandleTimerTrigger(EntityUid uid, EntityUid? user, float delay , float beepInterval, float? initialBeepDelay, SoundSpecifier? beepSound)
|
||||
{
|
||||
if (delay <= 0)
|
||||
{
|
||||
@@ -198,7 +199,6 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
var active = AddComp<ActiveTimerTriggerComponent>(uid);
|
||||
active.TimeRemaining = delay;
|
||||
active.User = user;
|
||||
active.BeepParams = beepParams;
|
||||
active.BeepSound = beepSound;
|
||||
active.BeepInterval = beepInterval;
|
||||
active.TimeUntilBeep = initialBeepDelay == null ? active.BeepInterval : initialBeepDelay.Value;
|
||||
@@ -222,15 +222,16 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
private void UpdateTimer(float frameTime)
|
||||
{
|
||||
HashSet<EntityUid> toRemove = new();
|
||||
foreach (var timer in EntityQuery<ActiveTimerTriggerComponent>())
|
||||
var query = EntityQueryEnumerator<ActiveTimerTriggerComponent>();
|
||||
while (query.MoveNext(out var uid, out var timer))
|
||||
{
|
||||
timer.TimeRemaining -= frameTime;
|
||||
timer.TimeUntilBeep -= frameTime;
|
||||
|
||||
if (timer.TimeRemaining <= 0)
|
||||
{
|
||||
Trigger(timer.Owner, timer.User);
|
||||
toRemove.Add(timer.Owner);
|
||||
Trigger(uid, timer.User);
|
||||
toRemove.Add(uid);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -238,8 +239,7 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
continue;
|
||||
|
||||
timer.TimeUntilBeep += timer.BeepInterval;
|
||||
var filter = Filter.Pvs(timer.Owner, entityManager: EntityManager);
|
||||
SoundSystem.Play(timer.BeepSound.GetSound(), filter, timer.Owner, timer.BeepParams);
|
||||
_audio.PlayPvs(timer.BeepSound, uid, timer.BeepSound.Params);
|
||||
}
|
||||
|
||||
foreach (var uid in toRemove)
|
||||
|
||||
@@ -74,8 +74,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
timerTrigger.Delay,
|
||||
timerTrigger.BeepInterval,
|
||||
timerTrigger.InitialBeepDelay,
|
||||
timerTrigger.BeepSound,
|
||||
timerTrigger.BeepParams);
|
||||
timerTrigger.BeepSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,3 +27,8 @@
|
||||
license: "CC0-1.0"
|
||||
copyright: "Taken from felix.blume via freesound.org and cropped + mixed from stereo to mono."
|
||||
source: "https://freesound.org/people/felix.blume/sounds/414093/"
|
||||
|
||||
- files: ["beep1.ogg"]
|
||||
license: "CC0-1.0"
|
||||
copyright: "Taken from thisusernameis via freesound.org + mixed from stereo to mono."
|
||||
source: "https://freesound.org/people/thisusernameis/sounds/426891/"
|
||||
BIN
Resources/Audio/Effects/beep1.ogg
Normal file
BIN
Resources/Audio/Effects/beep1.ogg
Normal file
Binary file not shown.
@@ -1232,6 +1232,8 @@
|
||||
delay: 10
|
||||
beepSound:
|
||||
path: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg #funny sfx use
|
||||
params:
|
||||
volume: -2
|
||||
beepInterval: 1
|
||||
- type: Explosive
|
||||
explosionType: Default
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
delayOptions: [3, 5, 10, 15, 30]
|
||||
initialBeepDelay: 0
|
||||
beepSound: /Audio/Machines/Nuke/general_beep.ogg
|
||||
params:
|
||||
volume: -2
|
||||
- type: StaticPrice
|
||||
price: 40
|
||||
|
||||
|
||||
@@ -178,6 +178,8 @@
|
||||
delay: 7
|
||||
initialBeepDelay: 0
|
||||
beepSound: /Audio/Machines/Nuke/general_beep.ogg
|
||||
params:
|
||||
volume: -2
|
||||
- type: ExplodeOnTrigger
|
||||
- type: GibOnTrigger
|
||||
deleteItems: true
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
- type: OnUseTimerTrigger
|
||||
delay: 180
|
||||
beepSound: /Audio/Machines/Nuke/general_beep.ogg
|
||||
params:
|
||||
volume: -2
|
||||
- type: ExplodeOnTrigger
|
||||
- type: Explosive
|
||||
explosionType: Default
|
||||
|
||||
@@ -45,6 +45,13 @@
|
||||
intensitySlope: 3
|
||||
totalIntensity: 120 # about a ~4 tile radius
|
||||
canCreateVacuum: false
|
||||
- type: OnUseTimerTrigger
|
||||
beepSound:
|
||||
path: "/Audio/Effects/beep1.ogg"
|
||||
params:
|
||||
volume: 5
|
||||
initialBeepDelay: 0
|
||||
beepInterval: 2 # 2 beeps total (at 0 and 2)
|
||||
|
||||
- type: entity
|
||||
name: flashbang
|
||||
|
||||
Reference in New Issue
Block a user