Fix missing sounds (#4466)
* Fix missing sounds * Make SoundHitSpecies fallback to SoundHit * Fix crayon YAML * Update PlaySoundBehavior YAML * Fix required
This commit is contained in:
@@ -55,14 +55,21 @@ namespace Content.Client.Light.Visualizers
|
||||
switch (state)
|
||||
{
|
||||
case ExpendableLightState.Lit:
|
||||
{
|
||||
TryStopStream(expendableLight.PlayingStream);
|
||||
expendableLight.PlayingStream = SoundSystem.Play(Filter.Local(), expendableLight.LoopedSound,
|
||||
expendableLight.Owner, SharedExpendableLightComponent.LoopedSoundParams.WithLoop(true));
|
||||
if (expendableLight.LoopedSound != null)
|
||||
{
|
||||
expendableLight.PlayingStream = SoundSystem.Play(Filter.Local(),
|
||||
expendableLight.LoopedSound, expendableLight.Owner,
|
||||
SharedExpendableLightComponent.LoopedSoundParams.WithLoop(true));
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
case ExpendableLightState.Dead:
|
||||
{
|
||||
TryStopStream(expendableLight.PlayingStream);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Client.Trigger
|
||||
{
|
||||
private const string AnimationKey = "priming_animation";
|
||||
|
||||
[DataField("countdown_sound")]
|
||||
[DataField("countdown_sound", required: true)]
|
||||
private SoundSpecifier _countdownSound = default!;
|
||||
|
||||
private Animation PrimingAnimation = default!;
|
||||
|
||||
@@ -29,9 +29,8 @@ namespace Content.Server.Crayon
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
//TODO: useSound
|
||||
[DataField("useSound", required: true)]
|
||||
private SoundSpecifier _useSound = default!;
|
||||
[DataField("useSound")]
|
||||
private SoundSpecifier? _useSound = null;
|
||||
|
||||
[ViewVariables]
|
||||
public Color Color { get; set; }
|
||||
@@ -139,7 +138,8 @@ namespace Content.Server.Crayon
|
||||
appearance.SetData(CrayonVisuals.Rotation, eventArgs.User.Transform.LocalRotation);
|
||||
}
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _useSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
|
||||
if (_useSound != null)
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _useSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
|
||||
|
||||
// Decrease "Ammo"
|
||||
Charges--;
|
||||
|
||||
@@ -100,6 +100,7 @@ namespace Content.Server.Light.Components
|
||||
switch (CurrentState)
|
||||
{
|
||||
case ExpendableLightState.Lit:
|
||||
{
|
||||
SoundSystem.Play(Filter.Pvs(Owner), LitSound.GetSound(), Owner);
|
||||
|
||||
if (IconStateLit != string.Empty)
|
||||
@@ -110,18 +111,21 @@ namespace Content.Server.Light.Components
|
||||
|
||||
sprite.LayerSetVisible(1, true);
|
||||
break;
|
||||
|
||||
}
|
||||
case ExpendableLightState.Fading:
|
||||
{
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
case ExpendableLightState.Dead:
|
||||
SoundSystem.Play(Filter.Pvs(Owner), DieSound.GetSound(), Owner);
|
||||
{
|
||||
if (DieSound != null) SoundSystem.Play(Filter.Pvs(Owner), DieSound.GetSound(), Owner);
|
||||
|
||||
sprite.LayerSetState(0, IconStateSpent);
|
||||
sprite.LayerSetShader(0, "shaded");
|
||||
sprite.LayerSetVisible(1, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Shared.Notification.Managers;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -25,7 +26,7 @@ namespace Content.Server.Light.Components
|
||||
{
|
||||
public override string Name => "LightReplacer";
|
||||
|
||||
[DataField("sound")] private string _sound = "/Audio/Weapons/click.ogg";
|
||||
[DataField("sound")] private SoundSpecifier _sound = new SoundPathSpecifier("/Audio/Weapons/click.ogg");
|
||||
|
||||
// bulbs that were inside light replacer when it spawned
|
||||
[DataField("contents")] private List<LightReplacerEntity> _contents = new();
|
||||
@@ -82,8 +83,8 @@ namespace Content.Server.Light.Components
|
||||
var wasReplaced = fixture.ReplaceBulb(bulb);
|
||||
if (wasReplaced)
|
||||
{
|
||||
EntitySystem.Get<AudioSystem>().Play(Filter.Broadcast(), _sound,
|
||||
Owner, AudioParams.Default.WithVolume(-4f));
|
||||
SoundSystem.Play(Filter.Pvs(Owner), _sound.GetSound(), Owner,
|
||||
AudioParams.Default.WithVolume(-4f));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.Projectiles.Components
|
||||
|
||||
// Get that juicy FPS hit sound
|
||||
[DataField("soundHit", required: true)] public SoundSpecifier SoundHit = default!;
|
||||
[DataField("soundHitSpecies", required: true)] public SoundSpecifier SoundHitSpecies = default!;
|
||||
[DataField("soundHitSpecies")] public SoundSpecifier? SoundHitSpecies = null;
|
||||
|
||||
public bool DamagedEntity;
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ namespace Content.Server.Projectiles
|
||||
var coordinates = args.OtherFixture.Body.Owner.Transform.Coordinates;
|
||||
var playerFilter = Filter.Pvs(coordinates);
|
||||
|
||||
if (!otherEntity.Deleted && otherEntity.HasComponent<SharedBodyComponent>())
|
||||
if (!otherEntity.Deleted && component.SoundHitSpecies != null &&
|
||||
otherEntity.HasComponent<SharedBodyComponent>())
|
||||
{
|
||||
SoundSystem.Play(playerFilter, component.SoundHitSpecies.GetSound(), coordinates);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||
private SoundSpecifier _soundMagInsert = default!;
|
||||
[DataField("soundMagEject", required: true)]
|
||||
private SoundSpecifier _soundMagEject = default!;
|
||||
[DataField("soundAutoEject", required: true)]
|
||||
[DataField("soundAutoEject")]
|
||||
private SoundSpecifier _soundAutoEject = new SoundPathSpecifier("/Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg");
|
||||
|
||||
private List<MagazineType> GetMagazineTypes()
|
||||
|
||||
@@ -73,11 +73,11 @@ namespace Content.Shared.Light.Component
|
||||
protected SoundSpecifier LitSound { get; set; } = default!;
|
||||
|
||||
[ViewVariables]
|
||||
[DataField("loopedSound", required: true)]
|
||||
public string LoopedSound { get; set; } = string.Empty;
|
||||
[DataField("loopedSound")]
|
||||
public string? LoopedSound { get; set; } = null;
|
||||
|
||||
[ViewVariables]
|
||||
[DataField("dieSound")]
|
||||
protected SoundSpecifier DieSound { get; set; } = default!;
|
||||
protected SoundSpecifier? DieSound { get; set; } = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
damage: 5
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpillBehavior { }
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
# damage: 10
|
||||
# behaviors:
|
||||
# - !type:PlaySoundBehavior
|
||||
# collection:: desecration
|
||||
# collection: desecration
|
||||
# - !type:SpawnEntitiesBehavior
|
||||
# spawn:
|
||||
# EggBoxBroken:
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
damage: 5
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
FoodPlateTrash:
|
||||
@@ -67,7 +68,8 @@
|
||||
damage: 5
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
FoodPlateSmallTrash:
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
damage: 6
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: canOpenSounds
|
||||
sound:
|
||||
collection: canOpenSounds
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
FoodTinPeachesOpen:
|
||||
@@ -104,7 +105,8 @@
|
||||
damage: 6
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: canOpenSounds
|
||||
sound:
|
||||
collection: canOpenSounds
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
FoodTinPeachesMaintOpen:
|
||||
@@ -152,7 +154,8 @@
|
||||
damage: 6
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: canOpenSounds
|
||||
sound:
|
||||
collection: canOpenSounds
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
FoodTinBeansOpen:
|
||||
@@ -202,7 +205,8 @@
|
||||
damage: 6
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: canOpenSounds
|
||||
sound:
|
||||
collection: canOpenSounds
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
FoodTinMREOpen:
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
damage: 1
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: desecration
|
||||
sound:
|
||||
collection: desecration
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
Eggshells:
|
||||
|
||||
@@ -60,7 +60,8 @@
|
||||
damage: 2
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: desecration
|
||||
sound:
|
||||
collection: desecration
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PuddleFlour:
|
||||
@@ -95,7 +96,8 @@
|
||||
damage: 2
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: desecration
|
||||
sound:
|
||||
collection: desecration
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PuddleFlour:
|
||||
|
||||
@@ -258,7 +258,8 @@
|
||||
damage: 1
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: desecration
|
||||
sound:
|
||||
collection: desecration
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PuddleTomato:
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
damage: 5
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpillBehavior { }
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
damage: 5
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpillBehavior { }
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
damage: 5
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpillBehavior { }
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
interfaces:
|
||||
- key: enum.CrayonUiKey.Key
|
||||
type: CrayonBoundUserInterface
|
||||
- type: Crayon
|
||||
capacity: 5
|
||||
|
||||
- type: entity
|
||||
parent: Crayon
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
damage: 5
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Breakage" ]
|
||||
- trigger:
|
||||
@@ -25,7 +26,8 @@
|
||||
damage: 10
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlass:
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
damage: 5
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection:: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpillBehavior { }
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
- type: Projectile
|
||||
damages:
|
||||
Blunt: 1
|
||||
soundHit:
|
||||
path: /Audio/Weapons/Guns/Hits/bullet_hit.ogg
|
||||
|
||||
- type: entity
|
||||
id: BulletDonkSoft
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
ammoPrototype: RedLaser
|
||||
soundGunshot:
|
||||
path: /Audio/Weapons/Guns/Gunshots/laser.ogg
|
||||
soundPowerCellInsert:
|
||||
path: /Audio/Weapons/Guns/MagIn/revolver_magin.ogg
|
||||
soundPowerCellEject:
|
||||
path: /Audio/Weapons/Guns/MagOut/revolver_magout.ogg
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: MagVisualizer
|
||||
@@ -71,6 +75,10 @@
|
||||
ammoPrototype: RedHeavyLaser
|
||||
soundGunshot:
|
||||
path: /Audio/Weapons/Guns/Gunshots/laser_cannon.ogg
|
||||
soundPowerCellInsert:
|
||||
path: /Audio/Weapons/Guns/MagIn/revolver_magin.ogg
|
||||
soundPowerCellEject:
|
||||
path: /Audio/Weapons/Guns/MagOut/revolver_magout.ogg
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: MagVisualizer
|
||||
@@ -93,7 +101,6 @@
|
||||
- state: mag-unshaded-0
|
||||
map: ["enum.RangedBarrelVisualLayers.MagUnshaded"]
|
||||
shader: unshaded
|
||||
|
||||
- type: Item
|
||||
size: 24
|
||||
sprite: Objects/Weapons/Guns/Battery/xray.rsi
|
||||
@@ -113,6 +120,10 @@
|
||||
ammoPrototype: XrayLaser
|
||||
soundGunshot:
|
||||
path: /Audio/Weapons/Guns/Gunshots/laser3.ogg
|
||||
soundPowerCellInsert:
|
||||
path: /Audio/Weapons/Guns/MagIn/revolver_magin.ogg
|
||||
soundPowerCellEject:
|
||||
path: /Audio/Weapons/Guns/MagOut/revolver_magout.ogg
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: MagVisualizer
|
||||
@@ -160,6 +171,10 @@
|
||||
ammoPrototype: BulletTaser
|
||||
soundGunshot:
|
||||
path: /Audio/Weapons/Guns/Gunshots/taser.ogg
|
||||
soundPowerCellInsert:
|
||||
path: /Audio/Weapons/Guns/MagIn/revolver_magin.ogg
|
||||
soundPowerCellEject:
|
||||
path: /Audio/Weapons/Guns/MagOut/revolver_magout.ogg
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: MagVisualizer
|
||||
@@ -200,6 +215,10 @@
|
||||
ammoPrototype: RedLaser
|
||||
soundGunshot:
|
||||
path: /Audio/Weapons/Guns/Gunshots/laser.ogg
|
||||
soundPowerCellInsert:
|
||||
path: /Audio/Weapons/Guns/MagIn/revolver_magin.ogg
|
||||
soundPowerCellEject:
|
||||
path: /Audio/Weapons/Guns/MagOut/revolver_magout.ogg
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: MagVisualizer
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
- type: InteractionOutline
|
||||
- type: MovedByPressure
|
||||
- type: DamageOnHighSpeedImpact
|
||||
soundHit:
|
||||
path: /Audio/Effects/hit_kick.ogg
|
||||
- type: CollisionWake
|
||||
- type: TileFrictionModifier
|
||||
modifier: 0.5
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
damage: 100
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:ChangeConstructionNodeBehavior
|
||||
node: monitorBroken
|
||||
- !type:DoActsBehavior
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
damage: 200
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlassPlasma:
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
damage: 150
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlassReinforced:
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
damage: 15
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
collection: GlassBreak
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlass:
|
||||
|
||||
Reference in New Issue
Block a user