[Dependency] private readonly IOverlayManager _overlayMan = default!;
[Dependency] private readonly SharedPointLightSystem _lights = default!;
- /// <summary>
- /// For how many seconds should an explosion stay on-screen once it has finished expanding?
- /// </summary>
- public float ExplosionPersistence = 0.3f;
-
public override void Initialize()
{
base.Initialize();
/// </summary>
public const ushort DefaultTileSize = 1;
- private AudioParams _audioParams = AudioParams.Default.WithVolume(-3f);
+ public const int MaxExplosionAudioRange = 30;
/// <summary>
/// The "default" explosion prototype.
var visualEnt = CreateExplosionVisualEntity(epicenter, type.ID, spaceMatrix, spaceData, gridData.Values, iterationIntensity);
// camera shake
- CameraShake(iterationIntensity.Count * 2.5f, epicenter, totalIntensity);
+ CameraShake(iterationIntensity.Count * 4f, epicenter, totalIntensity);
//For whatever bloody reason, sound system requires ENTITY coordinates.
var mapEntityCoords = EntityCoordinates.FromMap(EntityManager, _mapManager.GetMapEntityId(epicenter.MapId), epicenter);
// play sound.
- var audioRange = iterationIntensity.Count * 5;
+ // for the normal audio, we want everyone in pvs range
+ // + if the bomb is big enough, people outside of it too
+ // this is capped to 30 because otherwise really huge bombs
+ // will attempt to play regular audio for people who can't hear it anyway because the epicenter is so far away
+ var audioRange = Math.Min(iterationIntensity.Count * 2, MaxExplosionAudioRange);
var filter = Filter.Pvs(epicenter).AddInRange(epicenter, audioRange);
- _audio.PlayStatic(type.Sound.GetSound(), filter, mapEntityCoords, true, _audioParams);
+ var sound = iterationIntensity.Count < type.SmallSoundIterationThreshold
+ ? type.SmallSound
+ : type.Sound;
+
+ _audio.PlayStatic(sound, filter, mapEntityCoords, true, sound.Params);
+
+ // play far sound
+ // far sound should play for anyone who wasn't in range of any of the effects of the bomb
+ var farAudioRange = iterationIntensity.Count * 5;
+ var farFilter = Filter.Empty().AddInRange(epicenter, farAudioRange).RemoveInRange(epicenter, audioRange);
+ var farSound = iterationIntensity.Count < type.SmallSoundIterationThreshold
+ ? type.SmallSoundFar
+ : type.SoundFar;
+
+ _audio.PlayGlobal(farSound, farFilter, true, farSound.Params);
return new Explosion(this,
type,
/// The sound plays when an anomaly goes supercritical
/// </summary>
[DataField]
- public SoundSpecifier? SupercriticalSound = new SoundCollectionSpecifier("explosion");
+ public SoundSpecifier? SupercriticalSound = new SoundCollectionSpecifier("Explosion");
#endregion
/// <summary>
CVarDef.Create("discord.ahelp_avatar", string.Empty, CVar.SERVERONLY);
/// <summary>
- /// URL of the Discord webhook which will relay all custom votes. If left empty, disables the webhook.
+ /// URL of the Discord webhook which will relay all custom votes. If left empty, disables the webhook.
/// </summary>
public static readonly CVarDef<string> DiscordVoteWebhook =
CVarDef.Create("discord.vote_webhook", string.Empty, CVar.SERVERONLY);
/// This determines for how many seconds an explosion should stay visible once it has finished expanding.
/// </summary>
public static readonly CVarDef<float> ExplosionPersistence =
- CVarDef.Create("explosion.persistence", 0.3f, CVar.SERVERONLY);
+ CVarDef.Create("explosion.persistence", 1.0f, CVar.SERVERONLY);
/// <summary>
/// If an explosion covers a larger area than this number, the damaging/processing will always start during
[DataField("fireColor")]
public Color? FireColor;
- [DataField("Sound")]
- public SoundSpecifier Sound = new SoundCollectionSpecifier("explosion");
+ /// <summary>
+ /// If an explosion finishes in less than this many iterations, play a small sound instead.
+ /// </summary>
+ /// <remarks>
+ /// This value is tuned such that a minibomb is considered small, but just about anything larger is normal
+ /// </remarks>
+ [DataField("smallSoundIterationThreshold")]
+ public int SmallSoundIterationThreshold = 6;
+
+ [DataField("sound")]
+ public SoundSpecifier Sound = new SoundCollectionSpecifier("Explosion");
+
+ [DataField("smallSound")]
+ public SoundSpecifier SmallSound = new SoundCollectionSpecifier("ExplosionSmall");
+
+ [DataField("soundFar")]
+ public SoundSpecifier SoundFar = new SoundCollectionSpecifier("ExplosionFar", AudioParams.Default.WithVolume(2f));
+
+ [DataField("smallSoundFar")]
+ public SoundSpecifier SmallSoundFar = new SoundCollectionSpecifier("ExplosionSmallFar", AudioParams.Default.WithVolume(2f));
[DataField("texturePath")]
public ResPath TexturePath = new("/Textures/Effects/fire.rsi");
/// </summary>
[DataField("breakSound")]
[ViewVariables(VVAccess.ReadWrite)]
- public SoundSpecifier BreakSound = new SoundCollectionSpecifier("GlassBreak");
+ public SoundSpecifier BreakSound = new SoundCollectionSpecifier("GlassBreak", AudioParams.Default.WithVolume(-6f));
#region Appearance
copyright: '"jumps from reason.3.Rev.wav" by martian of Freesound.org. Modified by reversing and altering volume.'
license: CC0-1.0
source: https://freesound.org/people/martian/sounds/19261/
+
+- files: ["explosion_small1.ogg", "explosion_small2.ogg", "explosion_small3.ogg", "explosion1.ogg", "explosion2.ogg", "explosion3.ogg", "explosion4.ogg", "explosion5.ogg", "explosion6.ogg", "explosionfar.ogg", "explosionsmallfar.ogg"]
+ copyright: "vgstation at c5edbfd7179288080f081e2b8ac2496b7e4455db"
+ license: CC-BY-SA-3.0
+ source: https://github.com/vgstation-coders/vgstation13/tree/c5edbfd7179288080f081e2b8ac2496b7e4455db/sound/effects
damage: 300
behaviors:
- !type:PlaySoundBehavior
- sound: /Audio/Effects/metalbreak.ogg
+ sound:
+ path: /Audio/Effects/metalbreak.ogg
- !type:EmptyContainersBehaviour
containers:
- borg_brain
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -8
- !type:SpawnEntitiesBehavior
spawn:
FoodPlateTrash:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -8
- !type:SpawnEntitiesBehavior
spawn:
FoodPlateSmallTrash:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -8
- !type:SpillBehavior { }
- !type:SpawnEntitiesBehavior
spawn:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -4
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -4
- !type:SpawnEntitiesBehavior
spawn:
ShardGlassReinforced:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -4
- !type:SpawnEntitiesBehavior
spawn:
ShardGlassPlasma:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -4
- !type:SpawnEntitiesBehavior
spawn:
ShardGlassUranium:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -4
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
thresholds:
- trigger:
!type:DamageTrigger
- damage: 40
+ damage: 30
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
damage: 20
behaviors:
- !type:PlaySoundBehavior
- sound: /Audio/Effects/metalbreak.ogg
+ sound:
+ path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -8
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: DamageOnLand
- FloorMiningLight
- type: Stack
stackType: FloorTileMiningLight
-
+
# Departamental
- type: entity
name: freezer tile
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -8
- !type:DoActsBehavior
acts: [ "Breakage" ]
- trigger:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -8
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -4
- !type:SpillBehavior { }
- !type:SpawnEntitiesBehavior
spawn:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -4
- !type:SpillBehavior
solution: beaker
- !type:SpawnEntitiesBehavior
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
+ params:
+ volume: -4
- !type:SpawnEntitiesBehavior
spawn:
PartRodMetal1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
PartRodMetal1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -8
- !type:SpawnEntitiesBehavior
spawn:
GasPipeBroken:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -4
- type: entity
id: AirAlarmAssembly
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -4
placement:
mode: SnapgridCenter
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -4
placement:
mode: SnapgridCenter
snap:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -4
- type: GenericVisualizer
visuals:
enum.PowerDeviceVisuals.Powered:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -8
placement:
mode: SnapgridCenter
snap:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -8
- type: entity
id: ApcNetSwitch
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
PartRodMetal1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
PartRodMetal1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
PartRodMetal1:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -6
- !type:SpawnEntitiesBehavior
spawn:
PartRodMetal1:
path: /Audio/Effects/metalbreak.ogg
- !type:DoActsBehavior
acts: ["Destruction"]
- destroySound:
- path: /Audio/Effects/metalbreak.ogg
- type: Construction
graph: Girder
node: diagonalshuttleWall
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/metalbreak.ogg
+ params:
+ volume: -4
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
- type: soundCollection
- id: explosion
+ id: Explosion
files:
- /Audio/Effects/explosion1.ogg
- /Audio/Effects/explosion2.ogg
- /Audio/Effects/explosion4.ogg
- /Audio/Effects/explosion5.ogg
- /Audio/Effects/explosion6.ogg
+
+- type: soundCollection
+ id: ExplosionSmall
+ files:
+ - /Audio/Effects/explosion_small1.ogg
+ - /Audio/Effects/explosion_small2.ogg
+ - /Audio/Effects/explosion_small3.ogg
+
+- type: soundCollection
+ id: ExplosionFar
+ files:
+ - /Audio/Effects/explosionfar.ogg
+
+- type: soundCollection
+ id: ExplosionSmallFar
+ files:
+ - /Audio/Effects/explosionsmallfar.ogg