removed TryGetSound + made some SoundSpecifier datafields required

This commit is contained in:
Galactic Chimp
2021-07-31 19:52:33 +02:00
parent 8ff703c338
commit 57016d14b4
114 changed files with 519 additions and 785 deletions

View File

@@ -59,10 +59,7 @@ namespace Content.Client.Disposal.Visualizers
var sound = new AnimationTrackPlaySound(); var sound = new AnimationTrackPlaySound();
_flushAnimation.AnimationTracks.Add(sound); _flushAnimation.AnimationTracks.Add(sound);
if (_flushSound.TryGetSound(out var flushSound)) sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_flushSound.GetSound(), 0));
{
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(flushSound, 0));
}
} }
private void ChangeState(AppearanceComponent appearance) private void ChangeState(AppearanceComponent appearance)

View File

@@ -55,10 +55,7 @@ namespace Content.Client.Doors
var sound = new AnimationTrackPlaySound(); var sound = new AnimationTrackPlaySound();
CloseAnimation.AnimationTracks.Add(sound); CloseAnimation.AnimationTracks.Add(sound);
if (_closeSound.TryGetSound(out var closeSound)) sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_closeSound.GetSound(), 0));
{
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(closeSound, 0));
}
} }
OpenAnimation = new Animation {Length = TimeSpan.FromSeconds(_delay)}; OpenAnimation = new Animation {Length = TimeSpan.FromSeconds(_delay)};
@@ -81,10 +78,7 @@ namespace Content.Client.Doors
var sound = new AnimationTrackPlaySound(); var sound = new AnimationTrackPlaySound();
OpenAnimation.AnimationTracks.Add(sound); OpenAnimation.AnimationTracks.Add(sound);
if (_openSound.TryGetSound(out var openSound)) sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_openSound.GetSound(), 0));
{
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(openSound, 0));
}
} }
DenyAnimation = new Animation {Length = TimeSpan.FromSeconds(0.3f)}; DenyAnimation = new Animation {Length = TimeSpan.FromSeconds(0.3f)};
@@ -97,10 +91,7 @@ namespace Content.Client.Doors
var sound = new AnimationTrackPlaySound(); var sound = new AnimationTrackPlaySound();
DenyAnimation.AnimationTracks.Add(sound); DenyAnimation.AnimationTracks.Add(sound);
if (_denySound.TryGetSound(out var denySound)) sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_denySound.GetSound(), 0, () => AudioHelpers.WithVariation(0.05f)));
{
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(denySound, 0, () => AudioHelpers.WithVariation(0.05f)));
}
} }
} }

View File

@@ -18,7 +18,7 @@ namespace Content.Client.Light.Visualizers
{ {
[DataField("minBlinkingTime")] private float _minBlinkingTime = 0.5f; [DataField("minBlinkingTime")] private float _minBlinkingTime = 0.5f;
[DataField("maxBlinkingTime")] private float _maxBlinkingTime = 2; [DataField("maxBlinkingTime")] private float _maxBlinkingTime = 2;
[DataField("blinkingSound")] private SoundSpecifier _blinkingSound = default!; [DataField("blinkingSound", required: true)] private SoundSpecifier _blinkingSound = default!;
private bool _wasBlinking; private bool _wasBlinking;
@@ -125,16 +125,13 @@ namespace Content.Client.Light.Visualizers
} }
}; };
if (_blinkingSound.TryGetSound(out var blinkingSound))
{
blinkingAnim.AnimationTracks.Add(new AnimationTrackPlaySound() blinkingAnim.AnimationTracks.Add(new AnimationTrackPlaySound()
{ {
KeyFrames = KeyFrames =
{ {
new AnimationTrackPlaySound.KeyFrame(blinkingSound, 0.5f) new AnimationTrackPlaySound.KeyFrame(_blinkingSound.GetSound(), 0.5f)
} }
}); });
}
return blinkingAnim; return blinkingAnim;
} }

View File

@@ -24,16 +24,14 @@ namespace Content.Client.PDA
public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel, ICommonSession? session = null) public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel, ICommonSession? session = null)
{ {
base.HandleNetworkMessage(message, netChannel, session); base.HandleNetworkMessage(message, netChannel, session);
switch(message) switch (message)
{ {
case PDAUplinkBuySuccessMessage: case PDAUplinkBuySuccessMessage:
if(BuySuccessSound.TryGetSound(out var buySuccessSound)) SoundSystem.Play(Filter.Local(), BuySuccessSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Local(), buySuccessSound, Owner, AudioParams.Default.WithVolume(-2f));
break; break;
case PDAUplinkInsufficientFundsMessage: case PDAUplinkInsufficientFundsMessage:
if(InsufficientFundsSound.TryGetSound(out var insufficientFundsSound)) SoundSystem.Play(Filter.Local(), InsufficientFundsSound.GetSound(), Owner, AudioParams.Default);
SoundSystem.Play(Filter.Local(), insufficientFundsSound, Owner, AudioParams.Default);
break; break;
} }
} }

View File

@@ -15,7 +15,7 @@ namespace Content.Client.Trigger
{ {
private const string AnimationKey = "priming_animation"; private const string AnimationKey = "priming_animation";
[DataField("countdown_sound", required: true)] [DataField("countdown_sound")]
private SoundSpecifier _countdownSound = default!; private SoundSpecifier _countdownSound = default!;
private Animation PrimingAnimation = default!; private Animation PrimingAnimation = default!;
@@ -29,12 +29,9 @@ namespace Content.Client.Trigger
flick.LayerKey = TriggerVisualLayers.Base; flick.LayerKey = TriggerVisualLayers.Base;
flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("primed", 0f)); flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("primed", 0f));
if (_countdownSound.TryGetSound(out var countdownSound))
{
var sound = new AnimationTrackPlaySound(); var sound = new AnimationTrackPlaySound();
PrimingAnimation.AnimationTracks.Add(sound); PrimingAnimation.AnimationTracks.Add(sound);
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(countdownSound, 0)); sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_countdownSound.GetSound(), 0));
}
} }
} }

View File

@@ -75,7 +75,7 @@ namespace Content.Server.AME.Components
internal void OnUpdate(float frameTime) internal void OnUpdate(float frameTime)
{ {
if(!_injecting) if (!_injecting)
{ {
return; return;
} }
@@ -88,11 +88,11 @@ namespace Content.Server.AME.Components
} }
var jar = _jarSlot.ContainedEntity; var jar = _jarSlot.ContainedEntity;
if(jar is null) if (jar is null)
return; return;
jar.TryGetComponent<AMEFuelContainerComponent>(out var fuelJar); jar.TryGetComponent<AMEFuelContainerComponent>(out var fuelJar);
if(fuelJar != null && _powerSupplier != null) if (fuelJar != null && _powerSupplier != null)
{ {
var availableInject = fuelJar.FuelAmount >= InjectionAmount ? InjectionAmount : fuelJar.FuelAmount; var availableInject = fuelJar.FuelAmount >= InjectionAmount ? InjectionAmount : fuelJar.FuelAmount;
_powerSupplier.MaxSupply = group.InjectFuel(availableInject, out var overloading); _powerSupplier.MaxSupply = group.InjectFuel(availableInject, out var overloading);
@@ -105,7 +105,7 @@ namespace Content.Server.AME.Components
UpdateDisplay(_stability); UpdateDisplay(_stability);
if(_stability <= 0) { group.ExplodeCores(); } if (_stability <= 0) { group.ExplodeCores(); }
} }
@@ -229,7 +229,7 @@ namespace Content.Server.AME.Components
return; return;
var jar = _jarSlot.ContainedEntity; var jar = _jarSlot.ContainedEntity;
if(jar is null) if (jar is null)
return; return;
_jarSlot.Remove(jar); _jarSlot.Remove(jar);
@@ -262,7 +262,7 @@ namespace Content.Server.AME.Components
private void UpdateDisplay(int stability) private void UpdateDisplay(int stability)
{ {
if(_appearance == null) { return; } if (_appearance == null) { return; }
_appearance.TryGetData<string>(AMEControllerVisuals.DisplayState, out var state); _appearance.TryGetData<string>(AMEControllerVisuals.DisplayState, out var state);
@@ -291,7 +291,7 @@ namespace Content.Server.AME.Components
private bool IsMasterController() private bool IsMasterController()
{ {
if(GetAMENodeGroup()?.MasterController == this) if (GetAMENodeGroup()?.MasterController == this)
{ {
return true; return true;
} }
@@ -315,14 +315,12 @@ namespace Content.Server.AME.Components
private void ClickSound() private void ClickSound()
{ {
if(_clickSound.TryGetSound(out var clickSound)) SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), clickSound, Owner, AudioParams.Default.WithVolume(-2f));
} }
private void InjectSound(bool overloading) private void InjectSound(bool overloading)
{ {
if(_injectSound.TryGetSound(out var injectSound)) SoundSystem.Play(Filter.Pvs(Owner), _injectSound.GetSound(), Owner, AudioParams.Default.WithVolume(overloading ? 10f : 0f));
SoundSystem.Play(Filter.Pvs(Owner), injectSound, Owner, AudioParams.Default.WithVolume(overloading ? 10f : 0f));
} }
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs args) async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs args)

View File

@@ -51,8 +51,7 @@ namespace Content.Server.AME.Components
var ent = _serverEntityManager.SpawnEntity("AMEShielding", mapGrid.GridTileToLocal(snapPos)); var ent = _serverEntityManager.SpawnEntity("AMEShielding", mapGrid.GridTileToLocal(snapPos));
ent.Transform.LocalRotation = Owner.Transform.LocalRotation; ent.Transform.LocalRotation = Owner.Transform.LocalRotation;
if(_unwrapSound.TryGetSound(out var unwrapSound)) SoundSystem.Play(Filter.Pvs(Owner), _unwrapSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), unwrapSound, Owner);
Owner.Delete(); Owner.Delete();

View File

@@ -78,8 +78,7 @@ namespace Content.Server.Actions.Actions
if (random.Prob(_failProb)) if (random.Prob(_failProb))
{ {
if(PunchMissSound.TryGetSound(out var punchMissSound)) SoundSystem.Play(Filter.Pvs(args.Performer), PunchMissSound.GetSound(), args.Performer, AudioHelpers.WithVariation(0.025f));
SoundSystem.Play(Filter.Pvs(args.Performer), punchMissSound, args.Performer, AudioHelpers.WithVariation(0.025f));
args.Performer.PopupMessageOtherClients(Loc.GetString("disarm-action-popup-message-other-clients", args.Performer.PopupMessageOtherClients(Loc.GetString("disarm-action-popup-message-other-clients",
("performerName", args.Performer.Name), ("performerName", args.Performer.Name),
@@ -90,9 +89,9 @@ namespace Content.Server.Actions.Actions
return; return;
} }
system.SendAnimation("disarm", angle, args.Performer, args.Performer, new []{ args.Target }); system.SendAnimation("disarm", angle, args.Performer, args.Performer, new[] { args.Target });
var eventArgs = new DisarmedActEventArgs() {Target = args.Target, Source = args.Performer, PushProbability = _pushProb}; var eventArgs = new DisarmedActEventArgs() { Target = args.Target, Source = args.Performer, PushProbability = _pushProb };
// Sort by priority. // Sort by priority.
Array.Sort(disarmedActs, (a, b) => a.Priority.CompareTo(b.Priority)); Array.Sort(disarmedActs, (a, b) => a.Priority.CompareTo(b.Priority));
@@ -103,8 +102,7 @@ namespace Content.Server.Actions.Actions
return; return;
} }
if(DisarmSuccessSound.TryGetSound(out var disarmSuccessSound)) SoundSystem.Play(Filter.Pvs(args.Performer), DisarmSuccessSound.GetSound(), args.Performer.Transform.Coordinates, AudioHelpers.WithVariation(0.025f));
SoundSystem.Play(Filter.Pvs(args.Performer), disarmSuccessSound, args.Performer.Transform.Coordinates, AudioHelpers.WithVariation(0.025f));
} }
} }
} }

View File

@@ -26,9 +26,9 @@ namespace Content.Server.Actions.Actions
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
[DataField("male")] private SoundSpecifier _male = default!; [DataField("male", required: true)] private SoundSpecifier _male = default!;
[DataField("female")] private SoundSpecifier _female = default!; [DataField("female", required: true)] private SoundSpecifier _female = default!;
[DataField("wilhelm")] private SoundSpecifier _wilhelm = default!; [DataField("wilhelm", required: true)] private SoundSpecifier _wilhelm = default!;
/// seconds /// seconds
[DataField("cooldown")] private float _cooldown = 10; [DataField("cooldown")] private float _cooldown = 10;
@@ -44,21 +44,19 @@ namespace Content.Server.Actions.Actions
if (!args.Performer.TryGetComponent<HumanoidAppearanceComponent>(out var humanoid)) return; if (!args.Performer.TryGetComponent<HumanoidAppearanceComponent>(out var humanoid)) return;
if (!args.Performer.TryGetComponent<SharedActionsComponent>(out var actions)) return; if (!args.Performer.TryGetComponent<SharedActionsComponent>(out var actions)) return;
if (_random.Prob(.01f) && _wilhelm.TryGetSound(out var wilhelm)) if (_random.Prob(.01f))
{ {
SoundSystem.Play(Filter.Pvs(args.Performer), wilhelm, args.Performer, AudioParams.Default.WithVolume(Volume)); SoundSystem.Play(Filter.Pvs(args.Performer), _wilhelm.GetSound(), args.Performer, AudioParams.Default.WithVolume(Volume));
} }
else else
{ {
switch (humanoid.Sex) switch (humanoid.Sex)
{ {
case Sex.Male: case Sex.Male:
if (_male.TryGetSound(out var male)) SoundSystem.Play(Filter.Pvs(args.Performer), _male.GetSound(), args.Performer, AudioHelpers.WithVariation(Variation).WithVolume(Volume));
SoundSystem.Play(Filter.Pvs(args.Performer), male, args.Performer, AudioHelpers.WithVariation(Variation).WithVolume(Volume));
break; break;
case Sex.Female: case Sex.Female:
if (_female.TryGetSound(out var female)) SoundSystem.Play(Filter.Pvs(args.Performer), _female.GetSound(), args.Performer, AudioHelpers.WithVariation(Variation).WithVolume(Volume));
SoundSystem.Play(Filter.Pvs(args.Performer), female, args.Performer, AudioHelpers.WithVariation(Variation).WithVolume(Volume));
break; break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();

View File

@@ -28,7 +28,7 @@ namespace Content.Server.Actions.Spells
[ViewVariables] [DataField("cooldown")] public float CoolDown { get; set; } = 1f; [ViewVariables] [DataField("cooldown")] public float CoolDown { get; set; } = 1f;
[ViewVariables] [DataField("spellItem")] public string ItemProto { get; set; } = default!; [ViewVariables] [DataField("spellItem")] public string ItemProto { get; set; } = default!;
[ViewVariables] [DataField("castSound")] public SoundSpecifier CastSound { get; set; } = default!; [ViewVariables] [DataField("castSound", required: true)] public SoundSpecifier CastSound { get; set; } = default!;
//Rubber-band snapping items into player's hands, originally was a workaround, later found it works quite well with stuns //Rubber-band snapping items into player's hands, originally was a workaround, later found it works quite well with stuns
//Not sure if needs fixing //Not sure if needs fixing
@@ -69,8 +69,7 @@ namespace Content.Server.Actions.Spells
handsComponent.PutInHandOrDrop(itemComponent); handsComponent.PutInHandOrDrop(itemComponent);
if (CastSound.TryGetSound(out var castSound)) SoundSystem.Play(Filter.Pvs(caster), CastSound.GetSound(), caster);
SoundSystem.Play(Filter.Pvs(caster), castSound, caster);
} }
} }
} }

View File

@@ -45,18 +45,26 @@ namespace Content.Server.Arcade.Components
[DataField("winSound")] private SoundSpecifier _winSound = new SoundPathSpecifier("/Audio/Effects/Arcade/win.ogg"); [DataField("winSound")] private SoundSpecifier _winSound = new SoundPathSpecifier("/Audio/Effects/Arcade/win.ogg");
[DataField("gameOverSound")] private SoundSpecifier _gameOverSound = new SoundPathSpecifier("/Audio/Effects/Arcade/gameover.ogg"); [DataField("gameOverSound")] private SoundSpecifier _gameOverSound = new SoundPathSpecifier("/Audio/Effects/Arcade/gameover.ogg");
[ViewVariables(VVAccess.ReadWrite)] [DataField("possibleFightVerbs")] private List<string> _possibleFightVerbs = new List<string>() [ViewVariables(VVAccess.ReadWrite)]
[DataField("possibleFightVerbs")]
private List<string> _possibleFightVerbs = new List<string>()
{"Defeat", "Annihilate", "Save", "Strike", "Stop", "Destroy", "Robust", "Romance", "Pwn", "Own"}; {"Defeat", "Annihilate", "Save", "Strike", "Stop", "Destroy", "Robust", "Romance", "Pwn", "Own"};
[ViewVariables(VVAccess.ReadWrite)] [DataField("possibleFirstEnemyNames")] private List<string> _possibleFirstEnemyNames = new List<string>(){ [ViewVariables(VVAccess.ReadWrite)]
[DataField("possibleFirstEnemyNames")]
private List<string> _possibleFirstEnemyNames = new List<string>(){
"the Automatic", "Farmer", "Lord", "Professor", "the Cuban", "the Evil", "the Dread King", "the Automatic", "Farmer", "Lord", "Professor", "the Cuban", "the Evil", "the Dread King",
"the Space", "Lord", "the Great", "Duke", "General" "the Space", "Lord", "the Great", "Duke", "General"
}; };
[ViewVariables(VVAccess.ReadWrite)] [DataField("possibleLastEnemyNames")] private List<string> _possibleLastEnemyNames = new List<string>() [ViewVariables(VVAccess.ReadWrite)]
[DataField("possibleLastEnemyNames")]
private List<string> _possibleLastEnemyNames = new List<string>()
{ {
"Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid", "Melonoid", "Murdertron", "Sorcerer", "Ruin", "Jeff", "Ectoplasm", "Crushulon", "Uhangoid",
"Vhakoid", "Peteoid", "slime", "Griefer", "ERPer", "Lizard Man", "Unicorn" "Vhakoid", "Peteoid", "slime", "Griefer", "ERPer", "Lizard Man", "Unicorn"
}; };
[ViewVariables(VVAccess.ReadWrite)] [DataField("possibleRewards")] private List<string> _possibleRewards = new List<string>() [ViewVariables(VVAccess.ReadWrite)]
[DataField("possibleRewards")]
private List<string> _possibleRewards = new List<string>()
{ {
"ToyMouse", "ToyAi", "ToyNuke", "ToyAssistant", "ToyGriffin", "ToyHonk", "ToyIan", "ToyMouse", "ToyAi", "ToyNuke", "ToyAssistant", "ToyGriffin", "ToyHonk", "ToyIan",
"ToyMarauder", "ToyMauler", "ToyGygax", "ToyOdysseus", "ToyOwlman", "ToyDeathRipley", "ToyMarauder", "ToyMauler", "ToyGygax", "ToyOdysseus", "ToyOwlman", "ToyDeathRipley",
@@ -65,10 +73,10 @@ namespace Content.Server.Arcade.Components
void IActivate.Activate(ActivateEventArgs eventArgs) void IActivate.Activate(ActivateEventArgs eventArgs)
{ {
if(!Powered || !eventArgs.User.TryGetComponent(out ActorComponent? actor)) if (!Powered || !eventArgs.User.TryGetComponent(out ActorComponent? actor))
return; return;
if(!EntitySystem.Get<ActionBlockerSystem>().CanInteract(eventArgs.User)) if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(eventArgs.User))
return; return;
_game ??= new SpaceVillainGame(this); _game ??= new SpaceVillainGame(this);
@@ -76,7 +84,8 @@ namespace Content.Server.Arcade.Components
if (_wiresComponent?.IsPanelOpen == true) if (_wiresComponent?.IsPanelOpen == true)
{ {
_wiresComponent.OpenInterface(actor.PlayerSession); _wiresComponent.OpenInterface(actor.PlayerSession);
} else }
else
{ {
UserInterface?.Toggle(actor.PlayerSession); UserInterface?.Toggle(actor.PlayerSession);
} }
@@ -105,7 +114,7 @@ namespace Content.Server.Arcade.Components
private void OnOnPowerStateChanged(PowerChangedMessage e) private void OnOnPowerStateChanged(PowerChangedMessage e)
{ {
if(e.Powered) return; if (e.Powered) return;
UserInterface?.CloseAll(); UserInterface?.CloseAll();
} }
@@ -130,8 +139,7 @@ namespace Content.Server.Arcade.Components
_game?.ExecutePlayerAction(msg.PlayerAction); _game?.ExecutePlayerAction(msg.PlayerAction);
break; break;
case PlayerAction.NewGame: case PlayerAction.NewGame:
if(_newGameSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _newGameSound.GetSound(), Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default.WithVolume(-4f));
_game = new SpaceVillainGame(this); _game = new SpaceVillainGame(this);
UserInterface?.SendMessage(_game.GenerateMetaDataMessage()); UserInterface?.SendMessage(_game.GenerateMetaDataMessage());
@@ -260,7 +268,7 @@ namespace Content.Server.Arcade.Components
private string _latestPlayerActionMessage = ""; private string _latestPlayerActionMessage = "";
private string _latestEnemyActionMessage = ""; private string _latestEnemyActionMessage = "";
public SpaceVillainGame(SpaceVillainArcadeComponent owner) : this(owner, owner.GenerateFightVerb(), owner.GenerateEnemyName()){} public SpaceVillainGame(SpaceVillainArcadeComponent owner) : this(owner, owner.GenerateFightVerb(), owner.GenerateEnemyName()) { }
public SpaceVillainGame(SpaceVillainArcadeComponent owner, string fightVerb, string enemyName) public SpaceVillainGame(SpaceVillainArcadeComponent owner, string fightVerb, string enemyName)
{ {
@@ -277,7 +285,7 @@ namespace Content.Server.Arcade.Components
/// </summary> /// </summary>
private void ValidateVars() private void ValidateVars()
{ {
if(_owner._overflowFlag) return; if (_owner._overflowFlag) return;
if (_playerHp > _playerHpMax) _playerHp = _playerHpMax; if (_playerHp > _playerHpMax) _playerHp = _playerHpMax;
if (_playerMp > _playerMpMax) _playerMp = _playerMpMax; if (_playerMp > _playerMpMax) _playerMp = _playerMpMax;
@@ -300,9 +308,8 @@ namespace Content.Server.Arcade.Components
_latestPlayerActionMessage = Loc.GetString("space-villain-game-player-attack-message", _latestPlayerActionMessage = Loc.GetString("space-villain-game-player-attack-message",
("enemyName", _enemyName), ("enemyName", _enemyName),
("attackAmount", attackAmount)); ("attackAmount", attackAmount));
if(_owner._playerAttackSound.TryGetSound(out var playerAttackSound)) SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._playerAttackSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), playerAttackSound, _owner.Owner, AudioParams.Default.WithVolume(-4f)); if (!_owner._enemyInvincibilityFlag)
if(!_owner._enemyInvincibilityFlag)
_enemyHp -= attackAmount; _enemyHp -= attackAmount;
_turtleTracker -= _turtleTracker > 0 ? 1 : 0; _turtleTracker -= _turtleTracker > 0 ? 1 : 0;
break; break;
@@ -312,18 +319,16 @@ namespace Content.Server.Arcade.Components
_latestPlayerActionMessage = Loc.GetString("space-villain-game-player-heal-message", _latestPlayerActionMessage = Loc.GetString("space-villain-game-player-heal-message",
("magicPointAmount", pointAmount), ("magicPointAmount", pointAmount),
("healAmount", healAmount)); ("healAmount", healAmount));
if(_owner._playerHealSound.TryGetSound(out var playerHealSound)) SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._playerHealSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), playerHealSound, _owner.Owner, AudioParams.Default.WithVolume(-4f)); if (!_owner._playerInvincibilityFlag)
if(!_owner._playerInvincibilityFlag)
_playerMp -= pointAmount; _playerMp -= pointAmount;
_playerHp += healAmount; _playerHp += healAmount;
_turtleTracker++; _turtleTracker++;
break; break;
case PlayerAction.Recharge: case PlayerAction.Recharge:
var chargeAmount = _random.Next(4, 7); var chargeAmount = _random.Next(4, 7);
_latestPlayerActionMessage = Loc.GetString("space-villain-game-player-recharge-message",("regainedPoints", chargeAmount)); _latestPlayerActionMessage = Loc.GetString("space-villain-game-player-recharge-message", ("regainedPoints", chargeAmount));
if(_owner._playerChargeSound.TryGetSound(out var playerChargeSound)) SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._playerChargeSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), playerChargeSound, _owner.Owner, AudioParams.Default.WithVolume(-4f));
_playerMp += chargeAmount; _playerMp += chargeAmount;
_turtleTracker -= _turtleTracker > 0 ? 1 : 0; _turtleTracker -= _turtleTracker > 0 ? 1 : 0;
break; break;
@@ -355,10 +360,9 @@ namespace Content.Server.Arcade.Components
{ {
_running = false; _running = false;
UpdateUi(Loc.GetString("space-villain-game-player-wins-message"), UpdateUi(Loc.GetString("space-villain-game-player-wins-message"),
Loc.GetString("space-villain-game-enemy-dies-message",("enemyName", _enemyName)), Loc.GetString("space-villain-game-enemy-dies-message", ("enemyName", _enemyName)),
true); true);
if(_owner._winSound.TryGetSound(out var winSound)) SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._winSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), winSound, _owner.Owner, AudioParams.Default.WithVolume(-4f));
_owner.ProcessWin(); _owner.ProcessWin();
return false; return false;
} }
@@ -369,10 +373,9 @@ namespace Content.Server.Arcade.Components
{ {
_running = false; _running = false;
UpdateUi(Loc.GetString("space-villain-game-player-loses-message"), UpdateUi(Loc.GetString("space-villain-game-player-loses-message"),
Loc.GetString("space-villain-game-enemy-cheers-message",("enemyName", _enemyName)), Loc.GetString("space-villain-game-enemy-cheers-message", ("enemyName", _enemyName)),
true); true);
if(_owner._gameOverSound.TryGetSound(out var gameOverSound)) SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._gameOverSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), gameOverSound, _owner.Owner, AudioParams.Default.WithVolume(-4f));
return false; return false;
} }
if (_enemyHp <= 0 || _enemyMp <= 0) if (_enemyHp <= 0 || _enemyMp <= 0)
@@ -381,8 +384,7 @@ namespace Content.Server.Arcade.Components
UpdateUi(Loc.GetString("space-villain-game-player-loses-message"), UpdateUi(Loc.GetString("space-villain-game-player-loses-message"),
Loc.GetString("space-villain-game-enemy-dies-with-player-message ", ("enemyName", _enemyName)), Loc.GetString("space-villain-game-enemy-dies-with-player-message ", ("enemyName", _enemyName)),
true); true);
if (_owner._gameOverSound.TryGetSound(out var gameOverSound)) SoundSystem.Play(Filter.Pvs(_owner.Owner), _owner._gameOverSound.GetSound(), _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), gameOverSound, _owner.Owner, AudioParams.Default.WithVolume(-4f));
return false; return false;
} }
@@ -419,7 +421,8 @@ namespace Content.Server.Arcade.Components
if (_owner._playerInvincibilityFlag) return; if (_owner._playerInvincibilityFlag) return;
_playerHp -= boomAmount; _playerHp -= boomAmount;
_turtleTracker--; _turtleTracker--;
}else if (_enemyMp <= 5 && _random.Prob(0.7f)) }
else if (_enemyMp <= 5 && _random.Prob(0.7f))
{ {
var stealAmount = _random.Next(2, 3); var stealAmount = _random.Next(2, 3);
_latestEnemyActionMessage = Loc.GetString("space-villain-game-enemy-steals-player-power-message", _latestEnemyActionMessage = Loc.GetString("space-villain-game-enemy-steals-player-power-message",
@@ -428,7 +431,8 @@ namespace Content.Server.Arcade.Components
if (_owner._playerInvincibilityFlag) return; if (_owner._playerInvincibilityFlag) return;
_playerMp -= stealAmount; _playerMp -= stealAmount;
_enemyMp += stealAmount; _enemyMp += stealAmount;
}else if (_enemyHp <= 10 && _enemyMp > 4) }
else if (_enemyHp <= 10 && _enemyMp > 4)
{ {
_enemyHp += 4; _enemyHp += 4;
_enemyMp -= 4; _enemyMp -= 4;

View File

@@ -284,8 +284,7 @@ namespace Content.Server.Atmos.Components
if(environment != null) if(environment != null)
atmosphereSystem.Merge(environment, Air); atmosphereSystem.Merge(environment, Air);
if(_ruptureSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _ruptureSound.GetSound(), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.125f));
Owner.QueueDelete(); Owner.QueueDelete();
return; return;

View File

@@ -104,8 +104,7 @@ namespace Content.Server.Body
{ {
base.Gib(gibParts); base.Gib(gibParts);
if(_gibSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _gibSound.GetSound(), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.025f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.025f));
if (Owner.TryGetComponent(out ContainerManagerComponent? container)) if (Owner.TryGetComponent(out ContainerManagerComponent? container))
{ {

View File

@@ -723,10 +723,7 @@ namespace Content.Server.Botany.Components
sprayed = true; sprayed = true;
amount = ReagentUnit.New(1); amount = ReagentUnit.New(1);
if (spray.SpraySound.TryGetSound(out var spraySound)) SoundSystem.Play(Filter.Pvs(usingItem), spray.SpraySound.GetSound(), usingItem, AudioHelpers.WithVariation(0.125f));
{
SoundSystem.Play(Filter.Pvs(usingItem), spraySound, usingItem, AudioHelpers.WithVariation(0.125f));
}
} }
var split = solution.Drain(amount); var split = solution.Drain(amount);

View File

@@ -199,7 +199,7 @@ namespace Content.Server.Buckle.Components
{ {
var message = Loc.GetString(Owner == user var message = Loc.GetString(Owner == user
? "buckle-component-already-buckled-message" ? "buckle-component-already-buckled-message"
: "buckle-component-other-already-buckled-message",("owner", Owner)); : "buckle-component-other-already-buckled-message", ("owner", Owner));
Owner.PopupMessage(user, message); Owner.PopupMessage(user, message);
return false; return false;
@@ -212,7 +212,7 @@ namespace Content.Server.Buckle.Components
{ {
var message = Loc.GetString(Owner == user var message = Loc.GetString(Owner == user
? "buckle-component-cannot-buckle-message" ? "buckle-component-cannot-buckle-message"
: "buckle-component-other-cannot-buckle-message",("owner", Owner)); : "buckle-component-other-cannot-buckle-message", ("owner", Owner));
Owner.PopupMessage(user, message); Owner.PopupMessage(user, message);
return false; return false;
@@ -225,7 +225,7 @@ namespace Content.Server.Buckle.Components
{ {
var message = Loc.GetString(Owner == user var message = Loc.GetString(Owner == user
? "buckle-component-cannot-fit-message" ? "buckle-component-cannot-fit-message"
: "buckle-component-other-cannot-fit-message",("owner", Owner)); : "buckle-component-other-cannot-fit-message", ("owner", Owner));
Owner.PopupMessage(user, message); Owner.PopupMessage(user, message);
return false; return false;
@@ -241,16 +241,13 @@ namespace Content.Server.Buckle.Components
return false; return false;
} }
if(strap.BuckleSound.TryGetSound(out var buckleSound)) SoundSystem.Play(Filter.Pvs(Owner), strap.BuckleSound.GetSound(), Owner);
{
SoundSystem.Play(Filter.Pvs(Owner), buckleSound, Owner);
}
if (!strap.TryAdd(this)) if (!strap.TryAdd(this))
{ {
var message = Loc.GetString(Owner == user var message = Loc.GetString(Owner == user
? "buckle-component-cannot-buckle-message" ? "buckle-component-cannot-buckle-message"
: "buckle-component-other-cannot-buckle-message",("owner", Owner)); : "buckle-component-other-cannot-buckle-message", ("owner", Owner));
Owner.PopupMessage(user, message); Owner.PopupMessage(user, message);
return false; return false;
} }
@@ -352,10 +349,7 @@ namespace Content.Server.Buckle.Components
UpdateBuckleStatus(); UpdateBuckleStatus();
oldBuckledTo.Remove(this); oldBuckledTo.Remove(this);
if (oldBuckledTo.UnbuckleSound.TryGetSound(out var unbuckleSound)) SoundSystem.Play(Filter.Pvs(Owner), oldBuckledTo.UnbuckleSound.GetSound(), Owner);
{
SoundSystem.Play(Filter.Pvs(Owner), unbuckleSound, Owner);
}
SendMessage(new UnbuckleMessage(Owner, oldBuckledTo.Owner)); SendMessage(new UnbuckleMessage(Owner, oldBuckledTo.Owner));

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Cabinet
/// Sound to be played when the cabinet door is opened. /// Sound to be played when the cabinet door is opened.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("doorSound")] [DataField("doorSound", required: true)]
public SoundSpecifier DoorSound { get; set; } = default!; public SoundSpecifier DoorSound { get; set; } = default!;
/// <summary> /// <summary>

View File

@@ -36,7 +36,7 @@ namespace Content.Server.Cabinet
comp.ItemContainer = comp.ItemContainer =
owner.EnsureContainer<ContainerSlot>("item_cabinet", out _); owner.EnsureContainer<ContainerSlot>("item_cabinet", out _);
if(comp.SpawnPrototype != null) if (comp.SpawnPrototype != null)
comp.ItemContainer.Insert(EntityManager.SpawnEntity(comp.SpawnPrototype, owner.Transform.Coordinates)); comp.ItemContainer.Insert(EntityManager.SpawnEntity(comp.SpawnPrototype, owner.Transform.Coordinates));
UpdateVisuals(comp); UpdateVisuals(comp);
@@ -146,10 +146,7 @@ namespace Content.Server.Cabinet
private static void ClickLatchSound(ItemCabinetComponent comp) private static void ClickLatchSound(ItemCabinetComponent comp)
{ {
if(comp.DoorSound.TryGetSound(out var doorSound)) SoundSystem.Play(Filter.Pvs(comp.Owner), comp.DoorSound.GetSound(), comp.Owner, AudioHelpers.WithVariation(0.15f));
{
SoundSystem.Play(Filter.Pvs(comp.Owner), doorSound, comp.Owner, AudioHelpers.WithVariation(0.15f));
}
} }
} }

View File

@@ -115,10 +115,9 @@ namespace Content.Server.Cargo.Components
} }
if (!_cargoConsoleSystem.AddOrder(orders.Database.Id, msg.Requester, msg.Reason, msg.ProductId, if (!_cargoConsoleSystem.AddOrder(orders.Database.Id, msg.Requester, msg.Reason, msg.ProductId,
msg.Amount, _bankAccount.Id) && msg.Amount, _bankAccount.Id))
_errorSound.TryGetSound(out var errorSound))
{ {
SoundSystem.Play(Filter.Local(), errorSound, Owner, AudioParams.Default); SoundSystem.Play(Filter.Local(), _errorSound.GetSound(), Owner, AudioParams.Default);
} }
break; break;
} }
@@ -146,11 +145,9 @@ namespace Content.Server.Cargo.Components
|| !_cargoConsoleSystem.CheckBalance(_bankAccount.Id, (-product.PointCost) * order.Amount) || !_cargoConsoleSystem.CheckBalance(_bankAccount.Id, (-product.PointCost) * order.Amount)
|| !_cargoConsoleSystem.ApproveOrder(orders.Database.Id, msg.OrderNumber) || !_cargoConsoleSystem.ApproveOrder(orders.Database.Id, msg.OrderNumber)
|| !_cargoConsoleSystem.ChangeBalance(_bankAccount.Id, (-product.PointCost) * order.Amount)) || !_cargoConsoleSystem.ChangeBalance(_bankAccount.Id, (-product.PointCost) * order.Amount))
&&
_errorSound.TryGetSound(out var errorSound)
) )
{ {
SoundSystem.Play(Filter.Local(), errorSound, Owner, AudioParams.Default); SoundSystem.Play(Filter.Local(), _errorSound.GetSound(), Owner, AudioParams.Default);
break; break;
} }
UpdateUIState(); UpdateUIState();

View File

@@ -74,8 +74,7 @@ namespace Content.Server.Cargo.Components
{ {
if (!Deleted && !Owner.Deleted && _currentState == CargoTelepadState.Teleporting && _teleportQueue.Count > 0) if (!Deleted && !Owner.Deleted && _currentState == CargoTelepadState.Teleporting && _teleportQueue.Count > 0)
{ {
if (_teleportSound.TryGetSound(out var teleportSound)) SoundSystem.Play(Filter.Pvs(Owner), _teleportSound.GetSound(), Owner, AudioParams.Default.WithVolume(-8f));
SoundSystem.Play(Filter.Pvs(Owner), teleportSound, Owner, AudioParams.Default.WithVolume(-8f));
Owner.EntityManager.SpawnEntity(_teleportQueue[0].Product, Owner.Transform.Coordinates); Owner.EntityManager.SpawnEntity(_teleportQueue[0].Product, Owner.Transform.Coordinates);
_teleportQueue.RemoveAt(0); _teleportQueue.RemoveAt(0);
if (Owner.TryGetComponent<SpriteComponent>(out var spriteComponent) && spriteComponent.LayerCount > 0) if (Owner.TryGetComponent<SpriteComponent>(out var spriteComponent) && spriteComponent.LayerCount > 0)

View File

@@ -420,8 +420,7 @@ namespace Content.Server.Chemistry.Components
private void ClickSound() private void ClickSound()
{ {
if(_clickSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default.WithVolume(-2f));
} }
[Verb] [Verb]

View File

@@ -72,8 +72,7 @@ namespace Content.Server.Chemistry.Components
meleeSys.SendLunge(angle, user); meleeSys.SendLunge(angle, user);
} }
if(_injectSound.TryGetSound(out var injectSound)) SoundSystem.Play(Filter.Pvs(user), _injectSound.GetSound(), user);
SoundSystem.Play(Filter.Pvs(user), injectSound, user);
var targetSolution = target.GetComponent<SolutionContainerComponent>(); var targetSolution = target.GetComponent<SolutionContainerComponent>();

View File

@@ -23,7 +23,7 @@ namespace Content.Server.Chemistry.Components
public override string Name => "Pill"; public override string Name => "Pill";
[ViewVariables] [ViewVariables]
[DataField("useSound")] [DataField("useSound", required: true)]
protected override SoundSpecifier UseSound { get; set; } = default!; protected override SoundSpecifier UseSound { get; set; } = default!;
[ViewVariables] [ViewVariables]
@@ -99,10 +99,7 @@ namespace Content.Server.Chemistry.Components
firstStomach.TryTransferSolution(split); firstStomach.TryTransferSolution(split);
if (UseSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(trueTarget), UseSound.GetSound(), trueTarget, AudioParams.Default.WithVolume(-1f));
{
SoundSystem.Play(Filter.Pvs(trueTarget), sound, trueTarget, AudioParams.Default.WithVolume(-1f));
}
trueTarget.PopupMessage(user, Loc.GetString("pill-component-swallow-success-message")); trueTarget.PopupMessage(user, Loc.GetString("pill-component-swallow-success-message"));

View File

@@ -47,7 +47,8 @@ namespace Content.Server.Chemistry.Components
[ViewVariables] private ContainerSlot _beakerContainer = default!; [ViewVariables] private ContainerSlot _beakerContainer = default!;
[ViewVariables] [DataField("pack")] private string _packPrototypeId = ""; [ViewVariables] [DataField("pack")] private string _packPrototypeId = "";
[DataField("clickSound")] private SoundSpecifier _clickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg"); [DataField("clickSound")]
private SoundSpecifier _clickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
[ViewVariables] private bool HasBeaker => _beakerContainer.ContainedEntity != null; [ViewVariables] private bool HasBeaker => _beakerContainer.ContainedEntity != null;
[ViewVariables] private ReagentUnit _dispenseAmount = ReagentUnit.New(10); [ViewVariables] private ReagentUnit _dispenseAmount = ReagentUnit.New(10);
@@ -361,8 +362,7 @@ namespace Content.Server.Chemistry.Components
private void ClickSound() private void ClickSound()
{ {
if(_clickSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default.WithVolume(-2f));
} }
[Verb] [Verb]

View File

@@ -12,8 +12,7 @@ namespace Content.Server.Chemistry.EntitySystems
{ {
base.OnReaction(reaction, owner, unitReactions); base.OnReaction(reaction, owner, unitReactions);
if (reaction.Sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(owner), reaction.Sound.GetSound(), owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(owner), sound, owner.Transform.Coordinates);
} }
} }
} }

View File

@@ -80,7 +80,7 @@ namespace Content.Server.Chemistry.ReactionEffects
/// <summary> /// <summary>
/// Sound that will get played when this reaction effect occurs. /// Sound that will get played when this reaction effect occurs.
/// </summary> /// </summary>
[DataField("sound")] private SoundSpecifier _sound = default!; [DataField("sound", required: true)] private SoundSpecifier _sound = default!;
protected AreaReactionEffect() protected AreaReactionEffect()
{ {
@@ -136,10 +136,7 @@ namespace Content.Server.Chemistry.ReactionEffects
areaEffectComponent.TryAddSolution(solution); areaEffectComponent.TryAddSolution(solution);
areaEffectComponent.Start(amount, _duration, _spreadDelay, _removeDelay); areaEffectComponent.Start(amount, _duration, _spreadDelay, _removeDelay);
if (_sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(solutionEntity), _sound.GetSound(), solutionEntity, AudioHelpers.WithVariation(0.125f));
{
SoundSystem.Play(Filter.Pvs(solutionEntity), sound, solutionEntity, AudioHelpers.WithVariation(0.125f));
}
} }
protected abstract SolutionAreaEffectComponent? GetAreaEffectComponent(IEntity entity); protected abstract SolutionAreaEffectComponent? GetAreaEffectComponent(IEntity entity);

View File

@@ -14,12 +14,11 @@ namespace Content.Server.Construction.Completions
[DataDefinition] [DataDefinition]
public class PlaySound : IGraphAction public class PlaySound : IGraphAction
{ {
[DataField("sound")] public SoundSpecifier Sound { get; private set; } = default!; [DataField("sound", required: true)] public SoundSpecifier Sound { get; private set; } = default!;
public async Task PerformAction(IEntity entity, IEntity? user) public async Task PerformAction(IEntity entity, IEntity? user)
{ {
if(Sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(entity), Sound.GetSound(), entity, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(entity), sound, entity, AudioHelpers.WithVariation(0.125f));
} }
} }
} }

View File

@@ -30,7 +30,7 @@ namespace Content.Server.Crayon
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
//TODO: useSound //TODO: useSound
[DataField("useSound")] [DataField("useSound", required: true)]
private SoundSpecifier _useSound = default!; private SoundSpecifier _useSound = default!;
[ViewVariables] [ViewVariables]
@@ -139,10 +139,7 @@ namespace Content.Server.Crayon
appearance.SetData(CrayonVisuals.Rotation, eventArgs.User.Transform.LocalRotation); appearance.SetData(CrayonVisuals.Rotation, eventArgs.User.Transform.LocalRotation);
} }
if (_useSound.TryGetSound(out var useSound)) SoundSystem.Play(Filter.Pvs(Owner), _useSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
{
SoundSystem.Play(Filter.Pvs(Owner), useSound, Owner, AudioHelpers.WithVariation(0.125f));
}
// Decrease "Ammo" // Decrease "Ammo"
Charges--; Charges--;

View File

@@ -231,13 +231,11 @@ namespace Content.Server.Cuffs.Components
if (isOwner) if (isOwner)
{ {
if (cuff.StartBreakoutSound.TryGetSound(out var startBreakoutSound)) SoundSystem.Play(Filter.Pvs(Owner), cuff.StartBreakoutSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), startBreakoutSound, Owner);
} }
else else
{ {
if (cuff.StartUncuffSound.TryGetSound(out var startUncuffSound)) SoundSystem.Play(Filter.Pvs(Owner), cuff.StartUncuffSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), startUncuffSound, Owner);
} }
var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime; var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime;
@@ -258,8 +256,7 @@ namespace Content.Server.Cuffs.Components
if (result != DoAfterStatus.Cancelled) if (result != DoAfterStatus.Cancelled)
{ {
if (cuff.EndUncuffSound.TryGetSound(out var endUncuffSound)) SoundSystem.Play(Filter.Pvs(Owner), cuff.EndUncuffSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), endUncuffSound, Owner);
Container.ForceRemove(cuffsToRemove); Container.ForceRemove(cuffsToRemove);
cuffsToRemove.Transform.AttachToGridOrMap(); cuffsToRemove.Transform.AttachToGridOrMap();
@@ -289,7 +286,7 @@ namespace Content.Server.Cuffs.Components
if (!isOwner) if (!isOwner)
{ {
user.PopupMessage(Owner, Loc.GetString("cuffable-component-remove-cuffs-by-other-success-message",("otherName", user))); user.PopupMessage(Owner, Loc.GetString("cuffable-component-remove-cuffs-by-other-success-message", ("otherName", user)));
} }
} }
else else
@@ -305,7 +302,7 @@ namespace Content.Server.Cuffs.Components
} }
else else
{ {
user.PopupMessage(Loc.GetString("cuffable-component-remove-cuffs-partial-success-message",("cuffedHandCount", CuffedHandCount))); user.PopupMessage(Loc.GetString("cuffable-component-remove-cuffs-partial-success-message", ("cuffedHandCount", CuffedHandCount)));
} }
} }
} }

View File

@@ -184,8 +184,7 @@ namespace Content.Server.Cuffs.Components
eventArgs.User.PopupMessage(Loc.GetString("handcuff-component-start-cuffing-target-message",("targetName", eventArgs.Target))); eventArgs.User.PopupMessage(Loc.GetString("handcuff-component-start-cuffing-target-message",("targetName", eventArgs.Target)));
eventArgs.User.PopupMessage(eventArgs.Target, Loc.GetString("handcuff-component-start-cuffing-by-other-message",("otherName", eventArgs.User))); eventArgs.User.PopupMessage(eventArgs.Target, Loc.GetString("handcuff-component-start-cuffing-by-other-message",("otherName", eventArgs.User)));
if (StartCuffSound.TryGetSound(out var startCuffSound)) SoundSystem.Play(Filter.Pvs(Owner), StartCuffSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), startCuffSound, Owner);
TryUpdateCuff(eventArgs.User, eventArgs.Target, cuffed); TryUpdateCuff(eventArgs.User, eventArgs.Target, cuffed);
return true; return true;
@@ -222,8 +221,7 @@ namespace Content.Server.Cuffs.Components
{ {
if (cuffs.TryAddNewCuffs(user, Owner)) if (cuffs.TryAddNewCuffs(user, Owner))
{ {
if (EndCuffSound.TryGetSound(out var endCuffSound)) SoundSystem.Play(Filter.Pvs(Owner), EndCuffSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), endCuffSound, Owner);
user.PopupMessage(Loc.GetString("handcuff-component-cuff-other-success-message",("otherName", target))); user.PopupMessage(Loc.GetString("handcuff-component-cuff-other-success-message",("otherName", target)));
target.PopupMessage(Loc.GetString("handcuff-component-cuff-by-other-success-message", ("otherName", user))); target.PopupMessage(Loc.GetString("handcuff-component-cuff-by-other-success-message", ("otherName", user)));

View File

@@ -22,7 +22,7 @@ namespace Content.Server.Damage.Components
public int BaseDamage { get; set; } = 5; public int BaseDamage { get; set; } = 5;
[DataField("factor")] [DataField("factor")]
public float Factor { get; set; } = 1f; public float Factor { get; set; } = 1f;
[DataField("soundHit")] [DataField("soundHit", required: true)]
public SoundSpecifier SoundHit { get; set; } = default!; public SoundSpecifier SoundHit { get; set; } = default!;
[DataField("stunChance")] [DataField("stunChance")]
public float StunChance { get; set; } = 0.25f; public float StunChance { get; set; } = 0.25f;

View File

@@ -34,8 +34,7 @@ namespace Content.Server.Damage
if (speed < component.MinimumSpeed) return; if (speed < component.MinimumSpeed) return;
if (component.SoundHit.TryGetSound(out var soundHit)) SoundSystem.Play(Filter.Pvs(otherBody), component.SoundHit.GetSound(), otherBody, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
SoundSystem.Play(Filter.Pvs(otherBody), soundHit, otherBody, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
if ((_gameTiming.CurTime - component.LastHit).TotalSeconds < component.DamageCooldown) if ((_gameTiming.CurTime - component.LastHit).TotalSeconds < component.DamageCooldown)
return; return;

View File

@@ -15,15 +15,12 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
/// <summary> /// <summary>
/// Sound played upon destruction. /// Sound played upon destruction.
/// </summary> /// </summary>
[DataField("sound")] public SoundSpecifier Sound { get; set; } = default!; [DataField("sound", required: true)] public SoundSpecifier Sound { get; set; } = default!;
public void Execute(IEntity owner, DestructibleSystem system) public void Execute(IEntity owner, DestructibleSystem system)
{
if (Sound.TryGetSound(out var sound))
{ {
var pos = owner.Transform.Coordinates; var pos = owner.Transform.Coordinates;
SoundSystem.Play(Filter.Pvs(pos), sound, pos, AudioHelpers.WithVariation(0.125f)); SoundSystem.Play(Filter.Pvs(pos), Sound.GetSound(), pos, AudioHelpers.WithVariation(0.125f));
}
} }
} }
} }

View File

@@ -64,8 +64,7 @@ namespace Content.Server.Dice
public void PlayDiceEffect() public void PlayDiceEffect()
{ {
if(_sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _sound.GetSound(), Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default);
} }
void IActivate.Activate(ActivateEventArgs eventArgs) void IActivate.Activate(ActivateEventArgs eventArgs)

View File

@@ -435,8 +435,7 @@ namespace Content.Server.Disposal.Mailing
break; break;
case UiButton.Power: case UiButton.Power:
TogglePower(); TogglePower();
if(_receivedMessageSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _receivedMessageSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default.WithVolume(-2f));
break; break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();

View File

@@ -127,7 +127,7 @@ namespace Content.Server.Disposal.Tube.Components
/// <returns>Returns a <see cref="DisposalRouterUserInterfaceState"/></returns> /// <returns>Returns a <see cref="DisposalRouterUserInterfaceState"/></returns>
private DisposalRouterUserInterfaceState GetUserInterfaceState() private DisposalRouterUserInterfaceState GetUserInterfaceState()
{ {
if(_tags.Count <= 0) if (_tags.Count <= 0)
{ {
return new DisposalRouterUserInterfaceState(""); return new DisposalRouterUserInterfaceState("");
} }
@@ -153,8 +153,7 @@ namespace Content.Server.Disposal.Tube.Components
private void ClickSound() private void ClickSound()
{ {
if(_clickSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default.WithVolume(-2f));
} }
/// <summary> /// <summary>

View File

@@ -119,8 +119,7 @@ namespace Content.Server.Disposal.Tube.Components
private void ClickSound() private void ClickSound()
{ {
if(_clickSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default.WithVolume(-2f));
} }
/// <summary> /// <summary>

View File

@@ -266,8 +266,7 @@ namespace Content.Server.Disposal.Tube.Components
} }
_lastClang = _gameTiming.CurTime; _lastClang = _gameTiming.CurTime;
if(_clangSound.TryGetSound(out var clangSound)) SoundSystem.Play(Filter.Pvs(Owner), _clangSound.GetSound(), Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), clangSound, Owner.Transform.Coordinates);
break; break;
} }
} }

View File

@@ -373,8 +373,7 @@ namespace Content.Server.Disposal.Unit.Components
break; break;
case UiButton.Power: case UiButton.Power:
TogglePower(); TogglePower();
if(_clickSound.TryGetSound(out var clickSound)) SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), clickSound, Owner, AudioParams.Default.WithVolume(-2f));
break; break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();

View File

@@ -359,7 +359,7 @@ namespace Content.Server.Doors.Components
public void WiresUpdate(WiresUpdateEventArgs args) public void WiresUpdate(WiresUpdateEventArgs args)
{ {
if(_doorComponent == null) if (_doorComponent == null)
{ {
return; return;
} }
@@ -463,13 +463,11 @@ namespace Content.Server.Doors.Components
if (newBolts) if (newBolts)
{ {
if (_setBoltsDownSound.TryGetSound(out var boltsDownSound)) SoundSystem.Play(Filter.Broadcast(), _setBoltsDownSound.GetSound(), Owner);
SoundSystem.Play(Filter.Broadcast(), boltsDownSound, Owner);
} }
else else
{ {
if (_setBoltsUpSound.TryGetSound(out var boltsUpSound)) SoundSystem.Play(Filter.Broadcast(), _setBoltsUpSound.GetSound(), Owner);
SoundSystem.Play(Filter.Broadcast(), boltsUpSound, Owner);
} }
} }
} }

View File

@@ -222,10 +222,9 @@ namespace Content.Server.Doors.Components
{ {
Open(); Open();
if (user.TryGetComponent(out HandsComponent? hands) && hands.Count == 0 if (user.TryGetComponent(out HandsComponent? hands) && hands.Count == 0)
&& _tryOpenDoorSound.TryGetSound(out var tryOpenDoorSound))
{ {
SoundSystem.Play(Filter.Pvs(Owner), tryOpenDoorSound, Owner, AudioParams.Default.WithVolume(-2)); SoundSystem.Play(Filter.Pvs(Owner), _tryOpenDoorSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2));
} }
} }
else else

View File

@@ -14,7 +14,7 @@ namespace Content.Server.Explosion.Components
public override string Name => "SoundOnTrigger"; public override string Name => "SoundOnTrigger";
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("sound")] [DataField("sound", required: true)]
public SoundSpecifier? Sound { get; set; } = null; public SoundSpecifier? Sound { get; set; } = null;
} }
} }

View File

@@ -314,8 +314,7 @@ namespace Content.Server.Explosion
var boundingBox = new Box2(epicenterMapPos - new Vector2(maxRange, maxRange), var boundingBox = new Box2(epicenterMapPos - new Vector2(maxRange, maxRange),
epicenterMapPos + new Vector2(maxRange, maxRange)); epicenterMapPos + new Vector2(maxRange, maxRange));
if(_explosionSound.TryGetSound(out var explosionSound)) SoundSystem.Play(Filter.Broadcast(), _explosionSound.GetSound(), epicenter);
SoundSystem.Play(Filter.Broadcast(), explosionSound, epicenter);
DamageEntitiesInRange(epicenter, boundingBox, devastationRange, heavyImpactRange, maxRange, mapId); DamageEntitiesInRange(epicenter, boundingBox, devastationRange, heavyImpactRange, maxRange, mapId);
var mapGridsNear = mapManager.FindGridsIntersecting(mapId, boundingBox); var mapGridsNear = mapManager.FindGridsIntersecting(mapId, boundingBox);

View File

@@ -43,8 +43,7 @@ namespace Content.Server.Extinguisher
var drained = targetSolution.Drain(trans); var drained = targetSolution.Drain(trans);
container.TryAddSolution(drained); container.TryAddSolution(drained);
if(_refillSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _refillSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner);
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("fire-extinguisher-component-after-interact-refilled-message",("owner", Owner))); eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("fire-extinguisher-component-after-interact-refilled-message",("owner", Owner)));
} }

View File

@@ -42,9 +42,9 @@ namespace Content.Server.Flash.Components
flashable.Flash(duration); flashable.Flash(duration);
} }
if (sound != null && sound.TryGetSound(out var soundName)) if (sound != null)
{ {
SoundSystem.Play(Filter.Pvs(source), soundName, source.Transform.Coordinates); SoundSystem.Play(Filter.Pvs(source), sound.GetSound(), source.Transform.Coordinates);
} }
} }
} }

View File

@@ -92,8 +92,7 @@ namespace Content.Server.Flash
}); });
} }
if(comp.Sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(comp.Owner), comp.Sound.GetSound(), comp.Owner.Transform.Coordinates, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(comp.Owner), sound, comp.Owner.Transform.Coordinates, AudioParams.Default);
return true; return true;
} }

View File

@@ -114,10 +114,7 @@ namespace Content.Server.Fluids.Components
return false; return false;
} }
if (_sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _sound.GetSound(), Owner);
{
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner);
}
return true; return true;
} }

View File

@@ -163,10 +163,7 @@ namespace Content.Server.Fluids.Components
contents.SplitSolution(transferAmount); contents.SplitSolution(transferAmount);
} }
if (_pickupSound.TryGetSound(out var pickupSound)) SoundSystem.Play(Filter.Pvs(Owner), _pickupSound.GetSound(), Owner);
{
SoundSystem.Play(Filter.Pvs(Owner), pickupSound, Owner);
}
return true; return true;
} }

View File

@@ -190,8 +190,7 @@ namespace Content.Server.Fluids.Components
return true; return true;
} }
if(_spillSound.TryGetSound(out var spillSound)) SoundSystem.Play(Filter.Pvs(Owner), _spillSound.GetSound(), Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), spillSound, Owner.Transform.Coordinates);
return true; return true;
} }

View File

@@ -76,7 +76,7 @@ namespace Content.Server.Fluids.Components
set => _sprayVelocity = value; set => _sprayVelocity = value;
} }
[DataField("spraySound")] [DataField("spraySound", required: true)]
public SoundSpecifier SpraySound { get; } = default!; public SoundSpecifier SpraySound { get; } = default!;
public ReagentUnit CurrentVolume => Owner.GetComponentOrNull<SolutionContainerComponent>()?.CurrentVolume ?? ReagentUnit.Zero; public ReagentUnit CurrentVolume => Owner.GetComponentOrNull<SolutionContainerComponent>()?.CurrentVolume ?? ReagentUnit.Zero;
@@ -173,11 +173,7 @@ namespace Content.Server.Fluids.Components
} }
} }
//Play sound SoundSystem.Play(Filter.Pvs(Owner), SpraySound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
if (SpraySound.TryGetSound(out var spraySound))
{
SoundSystem.Play(Filter.Pvs(Owner), spraySound, Owner, AudioHelpers.WithVariation(0.125f));
}
_lastUseTime = curTime; _lastUseTime = curTime;
_cooldownEnd = _lastUseTime + TimeSpan.FromSeconds(_cooldownTime); _cooldownEnd = _lastUseTime + TimeSpan.FromSeconds(_cooldownTime);

View File

@@ -52,10 +52,9 @@ namespace Content.Server.GameTicking.Rules
_chatManager.DispatchServerAnnouncement(Loc.GetString("rule-suspicion-added-announcement")); _chatManager.DispatchServerAnnouncement(Loc.GetString("rule-suspicion-added-announcement"));
var filter = Filter.Empty() var filter = Filter.Empty()
.AddWhere(session => ((IPlayerSession)session).ContentData()?.Mind?.HasRole<SuspicionTraitorRole>() ?? false); .AddWhere(session => ((IPlayerSession) session).ContentData()?.Mind?.HasRole<SuspicionTraitorRole>() ?? false);
if(_addedSound.TryGetSound(out var addedSound)) SoundSystem.Play(filter, _addedSound.GetSound(), AudioParams.Default);
SoundSystem.Play(filter, addedSound, AudioParams.Default);
EntitySystem.Get<SuspicionEndTimerSystem>().EndTime = _endTime; EntitySystem.Get<SuspicionEndTimerSystem>().EndTime = _endTime;
EntitySystem.Get<DoorSystem>().AccessType = DoorSystem.AccessTypes.AllowAllNoExternal; EntitySystem.Get<DoorSystem>().AccessType = DoorSystem.AccessTypes.AllowAllNoExternal;
@@ -160,7 +159,7 @@ namespace Content.Server.GameTicking.Rules
var gameTicker = EntitySystem.Get<GameTicker>(); var gameTicker = EntitySystem.Get<GameTicker>();
gameTicker.EndRound(text); gameTicker.EndRound(text);
_chatManager.DispatchServerAnnouncement(Loc.GetString("rule-restarting-in-seconds",("seconds", (int) RoundEndDelay.TotalSeconds))); _chatManager.DispatchServerAnnouncement(Loc.GetString("rule-restarting-in-seconds", ("seconds", (int) RoundEndDelay.TotalSeconds)));
_checkTimerCancel.Cancel(); _checkTimerCancel.Cancel();
Timer.Spawn(RoundEndDelay, () => gameTicker.RestartRound()); Timer.Spawn(RoundEndDelay, () => gameTicker.RestartRound());

View File

@@ -24,8 +24,7 @@ namespace Content.Server.GameTicking.Rules
var filter = Filter.Empty() var filter = Filter.Empty()
.AddWhere(session => ((IPlayerSession)session).ContentData()?.Mind?.HasRole<TraitorRole>() ?? false); .AddWhere(session => ((IPlayerSession)session).ContentData()?.Mind?.HasRole<TraitorRole>() ?? false);
if(_addedSound.TryGetSound(out var addedSound)) SoundSystem.Play(filter, _addedSound.GetSound(), AudioParams.Default);
SoundSystem.Play(filter, addedSound, AudioParams.Default);
} }
} }
} }

View File

@@ -144,8 +144,7 @@ namespace Content.Server.Gravity.EntitySystems
|| player.AttachedEntity.Transform.GridID != gridId) || player.AttachedEntity.Transform.GridID != gridId)
continue; continue;
if(comp.GravityShakeSound.TryGetSound(out var gravityShakeSound)) SoundSystem.Play(Filter.Pvs(player.AttachedEntity), comp.GravityShakeSound.GetSound(), player.AttachedEntity);
SoundSystem.Play(Filter.Pvs(player.AttachedEntity), gravityShakeSound, player.AttachedEntity);
} }
} }

View File

@@ -143,8 +143,7 @@ namespace Content.Server.Hands.Components
if (source != null) if (source != null)
{ {
if(_disarmedSound.TryGetSound(out var disarmedSound)) SoundSystem.Play(Filter.Pvs(source), _disarmedSound.GetSound(), source, AudioHelpers.WithVariation(0.025f));
SoundSystem.Play(Filter.Pvs(source), disarmedSound, source, AudioHelpers.WithVariation(0.025f));
if (target != null) if (target != null)
{ {

View File

@@ -160,8 +160,7 @@ namespace Content.Server.Kitchen.Components
// TODO: Need to be able to leave them on the spike to do DoT, see ss13. // TODO: Need to be able to leave them on the spike to do DoT, see ss13.
victim.Delete(); victim.Delete();
if (SpikeSound.TryGetSound(out var spikeSound)) SoundSystem.Play(Filter.Pvs(Owner), SpikeSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), spikeSound, Owner);
} }
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat) SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)

View File

@@ -107,10 +107,10 @@ namespace Content.Server.Kitchen.Components
switch (message.Message) switch (message.Message)
{ {
case MicrowaveStartCookMessage msg : case MicrowaveStartCookMessage msg:
Wzhzhzh(); Wzhzhzh();
break; break;
case MicrowaveEjectMessage msg : case MicrowaveEjectMessage msg:
if (_hasContents) if (_hasContents)
{ {
VaporizeReagents(); VaporizeReagents();
@@ -271,7 +271,7 @@ namespace Content.Server.Kitchen.Components
} }
Owner.PopupMessage(eventArgs.User, Loc.GetString("microwave-component-interact-using-transfer-success", Owner.PopupMessage(eventArgs.User, Loc.GetString("microwave-component-interact-using-transfer-success",
("amount",removedSolution.TotalVolume))); ("amount", removedSolution.TotalVolume)));
return true; return true;
} }
@@ -300,14 +300,14 @@ namespace Content.Server.Kitchen.Components
_busy = true; _busy = true;
// Convert storage into Dictionary of ingredients // Convert storage into Dictionary of ingredients
var solidsDict = new Dictionary<string, int>(); var solidsDict = new Dictionary<string, int>();
foreach(var item in _storage.ContainedEntities) foreach (var item in _storage.ContainedEntities)
{ {
if (item.Prototype == null) if (item.Prototype == null)
{ {
continue; continue;
} }
if(solidsDict.ContainsKey(item.Prototype.ID)) if (solidsDict.ContainsKey(item.Prototype.ID))
{ {
solidsDict[item.Prototype.ID]++; solidsDict[item.Prototype.ID]++;
} }
@@ -318,9 +318,9 @@ namespace Content.Server.Kitchen.Components
} }
var failState = MicrowaveSuccessState.RecipeFail; var failState = MicrowaveSuccessState.RecipeFail;
foreach(var id in solidsDict.Keys) foreach (var id in solidsDict.Keys)
{ {
if(_recipeManager.SolidAppears(id)) if (_recipeManager.SolidAppears(id))
{ {
continue; continue;
} }
@@ -337,16 +337,15 @@ namespace Content.Server.Kitchen.Components
} }
SetAppearance(MicrowaveVisualState.Cooking); SetAppearance(MicrowaveVisualState.Cooking);
if(_startCookingSound.TryGetSound(out var startCookingSound)) SoundSystem.Play(Filter.Pvs(Owner), _startCookingSound.GetSound(), Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), startCookingSound, Owner, AudioParams.Default); Owner.SpawnTimer((int) (_currentCookTimerTime * _cookTimeMultiplier), (Action) (() =>
Owner.SpawnTimer((int)(_currentCookTimerTime * _cookTimeMultiplier), (Action)(() =>
{ {
if (_lostPower) if (_lostPower)
{ {
return; return;
} }
if(failState == MicrowaveSuccessState.UnwantedForeignObject) if (failState == MicrowaveSuccessState.UnwantedForeignObject)
{ {
VaporizeReagents(); VaporizeReagents();
EjectSolids(); EjectSolids();
@@ -366,8 +365,7 @@ namespace Content.Server.Kitchen.Components
} }
} }
if(_cookingCompleteSound.TryGetSound(out var cookingCompleteSound)) SoundSystem.Play(Filter.Pvs(Owner), _cookingCompleteSound.GetSound(), Owner, AudioParams.Default.WithVolume(-1f));
SoundSystem.Play(Filter.Pvs(Owner), cookingCompleteSound, Owner, AudioParams.Default.WithVolume(-1f));
SetAppearance(MicrowaveVisualState.Idle); SetAppearance(MicrowaveVisualState.Idle);
_busy = false; _busy = false;
@@ -396,7 +394,7 @@ namespace Content.Server.Kitchen.Components
private void VaporizeSolids() private void VaporizeSolids()
{ {
for(var i = _storage.ContainedEntities.Count-1; i>=0; i--) for (var i = _storage.ContainedEntities.Count - 1; i >= 0; i--)
{ {
var item = _storage.ContainedEntities.ElementAt(i); var item = _storage.ContainedEntities.ElementAt(i);
_storage.Remove(item); _storage.Remove(item);
@@ -407,7 +405,7 @@ namespace Content.Server.Kitchen.Components
private void EjectSolids() private void EjectSolids()
{ {
for(var i = _storage.ContainedEntities.Count-1; i>=0; i--) for (var i = _storage.ContainedEntities.Count - 1; i >= 0; i--)
{ {
_storage.Remove(_storage.ContainedEntities.ElementAt(i)); _storage.Remove(_storage.ContainedEntities.ElementAt(i));
} }
@@ -429,7 +427,7 @@ namespace Content.Server.Kitchen.Components
return; return;
} }
foreach(var recipeReagent in recipe.IngredientsReagents) foreach (var recipeReagent in recipe.IngredientsReagents)
{ {
solution?.TryRemoveReagent(recipeReagent.Key, ReagentUnit.New(recipeReagent.Value)); solution?.TryRemoveReagent(recipeReagent.Key, ReagentUnit.New(recipeReagent.Value));
} }
@@ -457,7 +455,7 @@ namespace Content.Server.Kitchen.Components
} }
private MicrowaveSuccessState CanSatisfyRecipe(FoodRecipePrototype recipe, Dictionary<string,int> solids) private MicrowaveSuccessState CanSatisfyRecipe(FoodRecipePrototype recipe, Dictionary<string, int> solids)
{ {
if (_currentCookTimerTime != (uint) recipe.CookTime) if (_currentCookTimerTime != (uint) recipe.CookTime)
{ {
@@ -500,8 +498,7 @@ namespace Content.Server.Kitchen.Components
private void ClickSound() private void ClickSound()
{ {
if(_clickSound.TryGetSound(out var clickSound)) SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), clickSound, Owner,AudioParams.Default.WithVolume(-2f));
} }
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat) SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)
@@ -537,7 +534,7 @@ namespace Content.Server.Kitchen.Components
var othersMessage = headCount > 1 var othersMessage = headCount > 1
? Loc.GetString("microwave-component-suicide-multi-head-others-message", ("victim", victim)) ? Loc.GetString("microwave-component-suicide-multi-head-others-message", ("victim", victim))
: Loc.GetString("microwave-component-suicide-others-message",("victim", victim)); : Loc.GetString("microwave-component-suicide-others-message", ("victim", victim));
victim.PopupMessageOtherClients(othersMessage); victim.PopupMessageOtherClients(othersMessage);

View File

@@ -39,8 +39,8 @@ namespace Content.Server.Kitchen.Components
//YAML serialization vars //YAML serialization vars
[ViewVariables(VVAccess.ReadWrite)] [DataField("chamberCapacity")] public int StorageCap = 16; [ViewVariables(VVAccess.ReadWrite)] [DataField("chamberCapacity")] public int StorageCap = 16;
[ViewVariables(VVAccess.ReadWrite)] [DataField("workTime")] public int WorkTime = 3500; //3.5 seconds, completely arbitrary for now. [ViewVariables(VVAccess.ReadWrite)] [DataField("workTime")] public int WorkTime = 3500; //3.5 seconds, completely arbitrary for now.
[DataField("clickSound")] private SoundSpecifier _clickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg"); [DataField("clickSound")] public SoundSpecifier ClickSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
[DataField("grindSound")] private SoundSpecifier _grindSound = new SoundPathSpecifier("/Audio/Machines/blender.ogg"); [DataField("grindSound")] public SoundSpecifier GrindSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/blender.ogg");
[DataField("juiceSound")] private SoundSpecifier _juiceSound = new SoundPathSpecifier("/Audio/Machines/juicer.ogg"); [DataField("juiceSound")] public SoundSpecifier JuiceSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/juicer.ogg");
} }
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Content.Server.Chemistry.Components; using Content.Server.Chemistry.Components;
@@ -270,7 +270,7 @@ namespace Content.Server.Kitchen.EntitySystems
switch (program) switch (program)
{ {
case SharedReagentGrinderComponent.GrinderProgram.Grind: case SharedReagentGrinderComponent.GrinderProgram.Grind:
SoundSystem.Play(Filter.Pvs(component.Owner), "/Audio/Machines/blender.ogg", component.Owner, AudioParams.Default); SoundSystem.Play(Filter.Pvs(component.Owner), component.GrindSound.GetSound(), component.Owner, AudioParams.Default);
//Get each item inside the chamber and get the reagents it contains. Transfer those reagents to the beaker, given we have one in. //Get each item inside the chamber and get the reagents it contains. Transfer those reagents to the beaker, given we have one in.
component.Owner.SpawnTimer(component.WorkTime, (Action) (() => component.Owner.SpawnTimer(component.WorkTime, (Action) (() =>
{ {
@@ -291,7 +291,7 @@ namespace Content.Server.Kitchen.EntitySystems
break; break;
case SharedReagentGrinderComponent.GrinderProgram.Juice: case SharedReagentGrinderComponent.GrinderProgram.Juice:
SoundSystem.Play(Filter.Pvs(component.Owner), "/Audio/Machines/juicer.ogg", component.Owner, AudioParams.Default); SoundSystem.Play(Filter.Pvs(component.Owner), component.JuiceSound.GetSound(), component.Owner, AudioParams.Default);
component.Owner.SpawnTimer(component.WorkTime, (Action) (() => component.Owner.SpawnTimer(component.WorkTime, (Action) (() =>
{ {
foreach (var item in component.Chamber.ContainedEntities.ToList()) foreach (var item in component.Chamber.ContainedEntities.ToList())
@@ -311,7 +311,7 @@ namespace Content.Server.Kitchen.EntitySystems
private void ClickSound(ReagentGrinderComponent component) private void ClickSound(ReagentGrinderComponent component)
{ {
SoundSystem.Play(Filter.Pvs(component.Owner), "/Audio/Machines/machine_switch.ogg", component.Owner, AudioParams.Default.WithVolume(-2f)); SoundSystem.Play(Filter.Pvs(component.Owner), component.ClickSound.GetSound(), component.Owner, AudioParams.Default.WithVolume(-2f));
} }
} }
} }

View File

@@ -100,10 +100,7 @@ namespace Content.Server.Light.Components
switch (CurrentState) switch (CurrentState)
{ {
case ExpendableLightState.Lit: case ExpendableLightState.Lit:
if (LitSound.TryGetSound(out var litSound)) SoundSystem.Play(Filter.Pvs(Owner), LitSound.GetSound(), Owner);
{
SoundSystem.Play(Filter.Pvs(Owner), litSound, Owner);
}
if (IconStateLit != string.Empty) if (IconStateLit != string.Empty)
{ {
@@ -119,11 +116,7 @@ namespace Content.Server.Light.Components
default: default:
case ExpendableLightState.Dead: case ExpendableLightState.Dead:
SoundSystem.Play(Filter.Pvs(Owner), DieSound.GetSound(), Owner);
if (DieSound.TryGetSound(out var dieSound))
{
SoundSystem.Play(Filter.Pvs(Owner), dieSound, Owner);
}
sprite.LayerSetState(0, IconStateSpent); sprite.LayerSetState(0, IconStateSpent);
sprite.LayerSetShader(0, "shaded"); sprite.LayerSetShader(0, "shaded");

View File

@@ -120,9 +120,9 @@ namespace Content.Server.Light.Components
UpdateLightAction(); UpdateLightAction();
Owner.EntityManager.EventBus.QueueEvent(EventSource.Local, new DeactivateHandheldLightMessage(this)); Owner.EntityManager.EventBus.QueueEvent(EventSource.Local, new DeactivateHandheldLightMessage(this));
if (makeNoise && TurnOffSound.TryGetSound(out var turnOffSound)) if (makeNoise)
{ {
SoundSystem.Play(Filter.Pvs(Owner), turnOffSound, Owner); SoundSystem.Play(Filter.Pvs(Owner), TurnOffSound.GetSound(), Owner);
} }
return true; return true;
@@ -137,8 +137,7 @@ namespace Content.Server.Light.Components
if (Cell == null) if (Cell == null)
{ {
if (TurnOnFailSound.TryGetSound(out var turnOnFailSound)) SoundSystem.Play(Filter.Pvs(Owner), TurnOnFailSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), turnOnFailSound, Owner);
Owner.PopupMessage(user, Loc.GetString("handheld-light-component-cell-missing-message")); Owner.PopupMessage(user, Loc.GetString("handheld-light-component-cell-missing-message"));
UpdateLightAction(); UpdateLightAction();
return false; return false;
@@ -149,8 +148,7 @@ namespace Content.Server.Light.Components
// Simple enough. // Simple enough.
if (Wattage > Cell.CurrentCharge) if (Wattage > Cell.CurrentCharge)
{ {
if (TurnOnFailSound.TryGetSound(out var turnOnFailSound)) SoundSystem.Play(Filter.Pvs(Owner), TurnOnFailSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), turnOnFailSound, Owner);
Owner.PopupMessage(user, Loc.GetString("handheld-light-component-cell-dead-message")); Owner.PopupMessage(user, Loc.GetString("handheld-light-component-cell-dead-message"));
UpdateLightAction(); UpdateLightAction();
return false; return false;
@@ -161,8 +159,7 @@ namespace Content.Server.Light.Components
SetState(true); SetState(true);
Owner.EntityManager.EventBus.QueueEvent(EventSource.Local, new ActivateHandheldLightMessage(this)); Owner.EntityManager.EventBus.QueueEvent(EventSource.Local, new ActivateHandheldLightMessage(this));
if (TurnOnSound.TryGetSound(out var turnOnSound)) SoundSystem.Play(Filter.Pvs(Owner), TurnOnSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), turnOnSound, Owner);
return true; return true;
} }

View File

@@ -47,7 +47,8 @@ namespace Content.Server.Light.Components
[DataField("color")] [DataField("color")]
private Color _color = Color.White; private Color _color = Color.White;
[ViewVariables(VVAccess.ReadWrite)] public Color Color [ViewVariables(VVAccess.ReadWrite)]
public Color Color
{ {
get { return _color; } get { return _color; }
set set
@@ -78,7 +79,8 @@ namespace Content.Server.Light.Components
/// The current state of the light bulb. Invokes the OnLightBulbStateChange event when set. /// The current state of the light bulb. Invokes the OnLightBulbStateChange event when set.
/// It also updates the bulb's sprite accordingly. /// It also updates the bulb's sprite accordingly.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)] public LightBulbState State [ViewVariables(VVAccess.ReadWrite)]
public LightBulbState State
{ {
get { return _state; } get { return _state; }
set set
@@ -132,8 +134,7 @@ namespace Content.Server.Light.Components
public void PlayBreakSound() public void PlayBreakSound()
{ {
if(_breakSound.TryGetSound(out var breakSound)) SoundSystem.Play(Filter.Pvs(Owner), _breakSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), breakSound, Owner);
} }
} }
} }

View File

@@ -24,13 +24,14 @@ namespace Content.Server.Light.Components
/// <summary> /// <summary>
/// How long will matchstick last in seconds. /// How long will matchstick last in seconds.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadOnly)] [DataField("duration")] [ViewVariables(VVAccess.ReadOnly)]
[DataField("duration")]
private int _duration = 10; private int _duration = 10;
/// <summary> /// <summary>
/// Sound played when you ignite the matchstick. /// Sound played when you ignite the matchstick.
/// </summary> /// </summary>
[DataField("igniteSound")] private SoundSpecifier _igniteSound = default!; [DataField("igniteSound", required: true)] private SoundSpecifier _igniteSound = default!;
/// <summary> /// <summary>
/// Point light component. Gives matches a glow in dark effect. /// Point light component. Gives matches a glow in dark effect.
@@ -69,11 +70,9 @@ namespace Content.Server.Light.Components
public void Ignite(IEntity user) public void Ignite(IEntity user)
{ {
// Play Sound // Play Sound
if (_igniteSound.TryGetSound(out var igniteSound)) SoundSystem.Play(
{ Filter.Pvs(Owner), _igniteSound.GetSound(), Owner,
SoundSystem.Play(Filter.Pvs(Owner), igniteSound, Owner,
AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f)); AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
}
// Change state // Change state
CurrentState = SharedBurningStates.Lit; CurrentState = SharedBurningStates.Lit;

View File

@@ -58,7 +58,8 @@ namespace Content.Server.Light.Components
[DataField("hasLampOnSpawn")] [DataField("hasLampOnSpawn")]
private bool _hasLampOnSpawn = true; private bool _hasLampOnSpawn = true;
[ViewVariables] [DataField("on")] [ViewVariables]
[DataField("on")]
private bool _on = true; private bool _on = true;
[ViewVariables] [ViewVariables]
@@ -67,7 +68,8 @@ namespace Content.Server.Light.Components
[ViewVariables] [ViewVariables]
private bool _isBlinking; private bool _isBlinking;
[ViewVariables] [DataField("ignoreGhostsBoo")] [ViewVariables]
[DataField("ignoreGhostsBoo")]
private bool _ignoreGhostsBoo; private bool _ignoreGhostsBoo;
[DataField("bulb")] private LightBulbType _bulbType = LightBulbType.Tube; [DataField("bulb")] private LightBulbType _bulbType = LightBulbType.Tube;
@@ -102,9 +104,9 @@ namespace Content.Server.Light.Components
Eject(); Eject();
return false; return false;
} }
if(eventArgs.User.TryGetComponent(out HeatResistanceComponent? heatResistanceComponent)) if (eventArgs.User.TryGetComponent(out HeatResistanceComponent? heatResistanceComponent))
{ {
if(CanBurn(heatResistanceComponent.GetHeatResistance())) if (CanBurn(heatResistanceComponent.GetHeatResistance()))
{ {
Burn(); Burn();
return true; return true;
@@ -125,8 +127,7 @@ namespace Content.Server.Light.Components
{ {
Owner.PopupMessage(eventArgs.User, Loc.GetString("powered-light-component-burn-hand")); Owner.PopupMessage(eventArgs.User, Loc.GetString("powered-light-component-burn-hand"));
damageableComponent.ChangeDamage(DamageType.Heat, 20, false, Owner); damageableComponent.ChangeDamage(DamageType.Heat, 20, false, Owner);
if(_burnHandSound.TryGetSound(out var burnHandSound)) SoundSystem.Play(Filter.Pvs(Owner), _burnHandSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), burnHandSound, Owner);
} }
void Eject() void Eject()
@@ -228,8 +229,7 @@ namespace Content.Server.Light.Components
if (time > _lastThunk + _thunkDelay) if (time > _lastThunk + _thunkDelay)
{ {
_lastThunk = time; _lastThunk = time;
if(_turnOnSound.TryGetSound(out var turnOnSound)) SoundSystem.Play(Filter.Pvs(Owner), _turnOnSound.GetSound(), Owner, AudioParams.Default.WithVolume(-10f));
SoundSystem.Play(Filter.Pvs(Owner), turnOnSound, Owner, AudioParams.Default.WithVolume(-10f));
} }
} }
else else
@@ -338,7 +338,8 @@ namespace Content.Server.Light.Components
_lastGhostBlink = time; _lastGhostBlink = time;
ToggleBlinkingLight(true); ToggleBlinkingLight(true);
Owner.SpawnTimer(ghostBlinkingTime, () => { Owner.SpawnTimer(ghostBlinkingTime, () =>
{
ToggleBlinkingLight(false); ToggleBlinkingLight(false);
}); });

View File

@@ -20,8 +20,8 @@ namespace Content.Server.Storage.Components
public override string Name => "Lock"; public override string Name => "Lock";
[ViewVariables(VVAccess.ReadWrite)] [DataField("locked")] public bool Locked { get; set; } = true; [ViewVariables(VVAccess.ReadWrite)] [DataField("locked")] public bool Locked { get; set; } = true;
[ViewVariables(VVAccess.ReadWrite)] [DataField("unlockingSound")] public SoundSpecifier? UnlockSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg"); [ViewVariables(VVAccess.ReadWrite)] [DataField("unlockingSound")] public SoundSpecifier UnlockSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg");
[ViewVariables(VVAccess.ReadWrite)] [DataField("lockingSound")] public SoundSpecifier? LockSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg"); [ViewVariables(VVAccess.ReadWrite)] [DataField("lockingSound")] public SoundSpecifier LockSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg");
[Verb] [Verb]
private sealed class ToggleLockVerb : Verb<LockComponent> private sealed class ToggleLockVerb : Verb<LockComponent>

View File

@@ -42,10 +42,7 @@ namespace Content.Server.Mining.Components
if (!item.TryGetComponent(out PickaxeComponent? pickaxeComponent)) if (!item.TryGetComponent(out PickaxeComponent? pickaxeComponent))
return true; return true;
if (pickaxeComponent.MiningSound.TryGetSound(out var miningSound)) SoundSystem.Play(Filter.Pvs(Owner), pickaxeComponent.MiningSound.GetSound(), Owner, AudioParams.Default);
{
SoundSystem.Play(Filter.Pvs(Owner), miningSound, Owner, AudioParams.Default);
}
return true; return true;
} }
} }

View File

@@ -120,8 +120,7 @@ namespace Content.Server.Morgue.Components
TryOpenStorage(Owner); TryOpenStorage(Owner);
if (_cremateFinishSound.TryGetSound(out var cremateFinishSound)) SoundSystem.Play(Filter.Pvs(Owner), _cremateFinishSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), cremateFinishSound, Owner);
}, _cremateCancelToken.Token); }, _cremateCancelToken.Token);
} }

View File

@@ -146,10 +146,9 @@ namespace Content.Server.Morgue.Components
{ {
CheckContents(); CheckContents();
if (DoSoulBeep && Appearance != null && Appearance.TryGetData(MorgueVisuals.HasSoul, out bool hasSoul) && hasSoul && if (DoSoulBeep && Appearance != null && Appearance.TryGetData(MorgueVisuals.HasSoul, out bool hasSoul) && hasSoul)
_occupantHasSoulAlarmSound.TryGetSound(out var occupantHasSoulAlarmSound))
{ {
SoundSystem.Play(Filter.Pvs(Owner), occupantHasSoulAlarmSound, Owner); SoundSystem.Play(Filter.Pvs(Owner), _occupantHasSoulAlarmSound.GetSound(), Owner);
} }
} }

View File

@@ -15,13 +15,12 @@ namespace Content.Server.Movement.Components
/// <inheritdoc /> /// <inheritdoc />
public override string Name => "FootstepModifier"; public override string Name => "FootstepModifier";
[DataField("footstepSoundCollection")] [DataField("footstepSoundCollection", required: true)]
public SoundSpecifier _soundCollection = default!; public SoundSpecifier SoundCollection = default!;
public void PlayFootstep() public void PlayFootstep()
{ {
if (_soundCollection.TryGetSound(out var footstepSound)) SoundSystem.Play(Filter.Pvs(Owner), SoundCollection.GetSound(), Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), footstepSound, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2f));
} }
} }
} }

View File

@@ -25,8 +25,7 @@ namespace Content.Server.Nutrition.Components
public void PlaySound() public void PlaySound()
{ {
if(_sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _sound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioHelpers.WithVariation(0.125f));
} }
void IThrowCollide.DoHit(ThrowCollideEventArgs eventArgs) void IThrowCollide.DoHit(ThrowCollideEventArgs eventArgs)

View File

@@ -127,8 +127,7 @@ namespace Content.Server.Nutrition.Components
if (!Opened) if (!Opened)
{ {
//Do the opening stuff like playing the sounds. //Do the opening stuff like playing the sounds.
if(_openSounds.TryGetSound(out var openSound)) SoundSystem.Play(Filter.Pvs(args.User), _openSounds.GetSound(), args.User, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(args.User), openSound, args.User, AudioParams.Default);
Opened = true; Opened = true;
return false; return false;
@@ -137,7 +136,7 @@ namespace Content.Server.Nutrition.Components
if (!Owner.TryGetComponent(out ISolutionInteractionsComponent? contents) || if (!Owner.TryGetComponent(out ISolutionInteractionsComponent? contents) ||
contents.DrainAvailable <= 0) contents.DrainAvailable <= 0)
{ {
args.User.PopupMessage(Loc.GetString("drink-component-on-use-is-empty",("owner", Owner))); args.User.PopupMessage(Loc.GetString("drink-component-on-use-is-empty", ("owner", Owner)));
return true; return true;
} }
@@ -163,14 +162,14 @@ namespace Content.Server.Nutrition.Components
} }
var color = Empty ? "gray" : "yellow"; var color = Empty ? "gray" : "yellow";
var openedText = Loc.GetString(Empty ? "drink-component-on-examine-is-empty" : "drink-component-on-examine-is-opened"); var openedText = Loc.GetString(Empty ? "drink-component-on-examine-is-empty" : "drink-component-on-examine-is-opened");
message.AddMarkup(Loc.GetString("drink-component-on-examine-details-text",("colorName", color),("text", openedText))); message.AddMarkup(Loc.GetString("drink-component-on-examine-details-text", ("colorName", color), ("text", openedText)));
} }
private bool TryUseDrink(IEntity user, IEntity target, bool forced = false) private bool TryUseDrink(IEntity user, IEntity target, bool forced = false)
{ {
if (!Opened) if (!Opened)
{ {
target.PopupMessage(Loc.GetString("drink-component-try-use-drink-not-open",("owner", Owner))); target.PopupMessage(Loc.GetString("drink-component-try-use-drink-not-open", ("owner", Owner)));
return false; return false;
} }
@@ -180,7 +179,7 @@ namespace Content.Server.Nutrition.Components
{ {
if (!forced) if (!forced)
{ {
target.PopupMessage(Loc.GetString("drink-component-try-use-drink-is-empty", ("entity",Owner))); target.PopupMessage(Loc.GetString("drink-component-try-use-drink-is-empty", ("entity", Owner)));
} }
return false; return false;
@@ -189,7 +188,7 @@ namespace Content.Server.Nutrition.Components
if (!target.TryGetComponent(out SharedBodyComponent? body) || if (!target.TryGetComponent(out SharedBodyComponent? body) ||
!body.TryGetMechanismBehaviors<StomachBehavior>(out var stomachs)) !body.TryGetMechanismBehaviors<StomachBehavior>(out var stomachs))
{ {
target.PopupMessage(Loc.GetString("drink-component-try-use-drink-cannot-drink",("owner", Owner))); target.PopupMessage(Loc.GetString("drink-component-try-use-drink-cannot-drink", ("owner", Owner)));
return false; return false;
} }
@@ -207,7 +206,7 @@ namespace Content.Server.Nutrition.Components
// All stomach are full or can't handle whatever solution we have. // All stomach are full or can't handle whatever solution we have.
if (firstStomach == null) if (firstStomach == null)
{ {
target.PopupMessage(Loc.GetString("drink-component-try-use-drink-had-enough",("owner", Owner))); target.PopupMessage(Loc.GetString("drink-component-try-use-drink-had-enough", ("owner", Owner)));
if (!interactions.CanRefill) if (!interactions.CanRefill)
{ {
@@ -219,10 +218,7 @@ namespace Content.Server.Nutrition.Components
return false; return false;
} }
if (_useSound.TryGetSound(out var useSound)) SoundSystem.Play(Filter.Pvs(target), _useSound.GetSound(), target, AudioParams.Default.WithVolume(-2f));
{
SoundSystem.Play(Filter.Pvs(target), useSound, target, AudioParams.Default.WithVolume(-2f));
}
target.PopupMessage(Loc.GetString("drink-component-try-use-drink-success-slurp")); target.PopupMessage(Loc.GetString("drink-component-try-use-drink-success-slurp"));
UpdateAppearance(); UpdateAppearance();
@@ -253,8 +249,7 @@ namespace Content.Server.Nutrition.Components
var solution = interactions.Drain(interactions.DrainAvailable); var solution = interactions.Drain(interactions.DrainAvailable);
solution.SpillAt(Owner, "PuddleSmear"); solution.SpillAt(Owner, "PuddleSmear");
if(_burstSound.TryGetSound(out var burstSound)) SoundSystem.Play(Filter.Pvs(Owner), _burstSound.GetSound(), Owner, AudioParams.Default.WithVolume(-4));
SoundSystem.Play(Filter.Pvs(Owner), burstSound, Owner, AudioParams.Default.WithVolume(-4));
} }
} }
} }

View File

@@ -50,7 +50,7 @@ namespace Content.Server.Nutrition.Components
return solution.CurrentVolume == 0 return solution.CurrentVolume == 0
? 0 ? 0
: Math.Max(1, (int)Math.Ceiling((solution.CurrentVolume / TransferAmount).Float())); : Math.Max(1, (int) Math.Ceiling((solution.CurrentVolume / TransferAmount).Float()));
} }
} }
@@ -110,7 +110,7 @@ namespace Content.Server.Nutrition.Components
} }
var utensils = utensilUsed != null var utensils = utensilUsed != null
? new List<UtensilComponent> {utensilUsed} ? new List<UtensilComponent> { utensilUsed }
: null; : null;
if (_utensilsNeeded != UtensilType.None) if (_utensilsNeeded != UtensilType.None)
@@ -160,10 +160,7 @@ namespace Content.Server.Nutrition.Components
firstStomach.TryTransferSolution(split); firstStomach.TryTransferSolution(split);
if (UseSound.TryGetSound(out var useSound)) SoundSystem.Play(Filter.Pvs(trueTarget), UseSound.GetSound(), trueTarget, AudioParams.Default.WithVolume(-1f));
{
SoundSystem.Play(Filter.Pvs(trueTarget), useSound, trueTarget, AudioParams.Default.WithVolume(-1f));
}
trueTarget.PopupMessage(user, Loc.GetString("food-nom")); trueTarget.PopupMessage(user, Loc.GetString("food-nom"));

View File

@@ -24,13 +24,16 @@ namespace Content.Server.Nutrition.Components
int IInteractUsing.Priority => 1; // take priority over eating with utensils int IInteractUsing.Priority => 1; // take priority over eating with utensils
[DataField("slice")] [ViewVariables(VVAccess.ReadWrite)] [DataField("slice")]
[ViewVariables(VVAccess.ReadWrite)]
private string _slice = string.Empty; private string _slice = string.Empty;
[DataField("sound")] [ViewVariables(VVAccess.ReadWrite)] [DataField("sound")]
[ViewVariables(VVAccess.ReadWrite)]
private SoundSpecifier _sound = new SoundPathSpecifier("/Audio/Items/Culinary/chop.ogg"); private SoundSpecifier _sound = new SoundPathSpecifier("/Audio/Items/Culinary/chop.ogg");
[DataField("count")] [ViewVariables(VVAccess.ReadWrite)] [DataField("count")]
[ViewVariables(VVAccess.ReadWrite)]
private ushort _totalCount = 5; private ushort _totalCount = 5;
[ViewVariables(VVAccess.ReadWrite)] public ushort Count; [ViewVariables(VVAccess.ReadWrite)] public ushort Count;
@@ -67,8 +70,7 @@ namespace Content.Server.Nutrition.Components
} }
} }
if(_sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _sound.GetSound(), Owner.Transform.Coordinates,
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner.Transform.Coordinates,
AudioParams.Default.WithVolume(-2)); AudioParams.Default.WithVolume(-2));
Count--; Count--;

View File

@@ -71,9 +71,9 @@ namespace Content.Server.Nutrition.Components
internal void TryBreak(IEntity user) internal void TryBreak(IEntity user)
{ {
if (_breakSound.TryGetSound(out var breakSound) && IoCManager.Resolve<IRobustRandom>().Prob(_breakChance)) if (IoCManager.Resolve<IRobustRandom>().Prob(_breakChance))
{ {
SoundSystem.Play(Filter.Pvs(user), breakSound, user, AudioParams.Default.WithVolume(-2f)); SoundSystem.Play(Filter.Pvs(user), _breakSound.GetSound(), user, AudioParams.Default.WithVolume(-2f));
Owner.Delete(); Owner.Delete();
} }
} }

View File

@@ -305,8 +305,7 @@ namespace Content.Server.PDA
{ {
_idSlot.Insert(card.Owner); _idSlot.Insert(card.Owner);
ContainedID = card; ContainedID = card;
if(_insertIdSound.TryGetSound(out var insertIdSound)) SoundSystem.Play(Filter.Pvs(Owner), _insertIdSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), insertIdSound, Owner);
} }
/// <summary> /// <summary>
@@ -335,8 +334,7 @@ namespace Content.Server.PDA
_lightOn = !_lightOn; _lightOn = !_lightOn;
light.Enabled = _lightOn; light.Enabled = _lightOn;
if(_toggleFlashlightSound.TryGetSound(out var toggleFlashlightSound)) SoundSystem.Play(Filter.Pvs(Owner), _toggleFlashlightSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), toggleFlashlightSound, Owner);
UpdatePDAUserInterface(); UpdatePDAUserInterface();
} }
@@ -355,8 +353,7 @@ namespace Content.Server.PDA
hands.PutInHandOrDrop(cardItemComponent); hands.PutInHandOrDrop(cardItemComponent);
ContainedID = null; ContainedID = null;
if(_ejectIdSound.TryGetSound(out var ejectIdSound)) SoundSystem.Play(Filter.Pvs(Owner), _ejectIdSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), ejectIdSound, Owner);
UpdatePDAUserInterface(); UpdatePDAUserInterface();
} }

View File

@@ -214,10 +214,9 @@ namespace Content.Server.Physics.Controllers
string? soundToPlay = null; string? soundToPlay = null;
foreach (var maybeFootstep in grid.GetAnchoredEntities(tile.GridIndices)) foreach (var maybeFootstep in grid.GetAnchoredEntities(tile.GridIndices))
{ {
if (EntityManager.ComponentManager.TryGetComponent(maybeFootstep, out FootstepModifierComponent? footstep) && if (EntityManager.ComponentManager.TryGetComponent(maybeFootstep, out FootstepModifierComponent? footstep))
footstep._soundCollection.TryGetSound(out var footstepSound))
{ {
soundToPlay = footstepSound; soundToPlay = footstep.SoundCollection.GetSound();
break; break;
} }
} }
@@ -226,12 +225,9 @@ namespace Content.Server.Physics.Controllers
{ {
// Walking on a tile. // Walking on a tile.
var def = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId]; var def = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId];
if (def.FootstepSounds.TryGetSound(out var footstepSound)) soundToPlay = def.FootstepSounds.GetSound();
{
soundToPlay = footstepSound;
return; return;
} }
}
if (string.IsNullOrWhiteSpace(soundToPlay)) if (string.IsNullOrWhiteSpace(soundToPlay))
{ {

View File

@@ -49,8 +49,7 @@ namespace Content.Server.Plants.Components
private void Rustle() private void Rustle()
{ {
if(_rustleSound.TryGetSound(out var rustleSound)) SoundSystem.Play(Filter.Pvs(Owner), _rustleSound.GetSound(), Owner, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(Owner), rustleSound, Owner, AudioHelpers.WithVariation(0.25f));
} }
} }
} }

View File

@@ -123,8 +123,7 @@ namespace Content.Server.Pointing.Components
} }
Owner.SpawnExplosion(0, 2, 1, 1); Owner.SpawnExplosion(0, 2, 1, 1);
if(_explosionSound.TryGetSound(out var explosionSound)) SoundSystem.Play(Filter.Pvs(Owner), _explosionSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), explosionSound, Owner);
Owner.Delete(); Owner.Delete();
} }

View File

@@ -85,7 +85,7 @@ namespace Content.Server.Power.Components
if (serverMsg.Message is ApcToggleMainBreakerMessage) if (serverMsg.Message is ApcToggleMainBreakerMessage)
{ {
var user = serverMsg.Session.AttachedEntity; var user = serverMsg.Session.AttachedEntity;
if(user == null) return; if (user == null) return;
if (_accessReader == null || _accessReader.IsAllowed(user)) if (_accessReader == null || _accessReader.IsAllowed(user))
{ {
@@ -93,8 +93,7 @@ namespace Content.Server.Power.Components
Owner.GetComponent<PowerNetworkBatteryComponent>().CanDischarge = MainBreakerEnabled; Owner.GetComponent<PowerNetworkBatteryComponent>().CanDischarge = MainBreakerEnabled;
_uiDirty = true; _uiDirty = true;
if(_onReceiveMessageSound.TryGetSound(out var onReceiveMessageSound)) SoundSystem.Play(Filter.Pvs(Owner), _onReceiveMessageSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), onReceiveMessageSound, Owner, AudioParams.Default.WithVolume(-2f));
} }
else else
{ {

View File

@@ -144,9 +144,9 @@ namespace Content.Server.PowerCell.Components
cell.Owner.Transform.Coordinates = Owner.Transform.Coordinates; cell.Owner.Transform.Coordinates = Owner.Transform.Coordinates;
} }
if (playSound && CellRemoveSound.TryGetSound(out var cellRemoveSound)) if (playSound)
{ {
SoundSystem.Play(Filter.Pvs(Owner), cellRemoveSound, Owner, AudioHelpers.WithVariation(0.125f)); SoundSystem.Play(Filter.Pvs(Owner), CellRemoveSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
} }
Owner.EntityManager.EventBus.RaiseLocalEvent(Owner.Uid, new PowerCellChangedEvent(true), false); Owner.EntityManager.EventBus.RaiseLocalEvent(Owner.Uid, new PowerCellChangedEvent(true), false);
@@ -167,9 +167,9 @@ namespace Content.Server.PowerCell.Components
if (cellComponent.CellSize != SlotSize) return false; if (cellComponent.CellSize != SlotSize) return false;
if (!_cellContainer.Insert(cell)) return false; if (!_cellContainer.Insert(cell)) return false;
//Dirty(); //Dirty();
if (playSound && CellInsertSound.TryGetSound(out var cellInsertSound)) if (playSound)
{ {
SoundSystem.Play(Filter.Pvs(Owner), cellInsertSound, Owner, AudioHelpers.WithVariation(0.125f)); SoundSystem.Play(Filter.Pvs(Owner), CellInsertSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
} }
Owner.EntityManager.EventBus.RaiseLocalEvent(Owner.Uid, new PowerCellChangedEvent(false), false); Owner.EntityManager.EventBus.RaiseLocalEvent(Owner.Uid, new PowerCellChangedEvent(false), false);

View File

@@ -86,8 +86,7 @@ namespace Content.Server.Projectiles.Components
// TODO: No wall component so ? // TODO: No wall component so ?
var offset = angle.ToVec().Normalized / 2; var offset = angle.ToVec().Normalized / 2;
var coordinates = user.Transform.Coordinates.Offset(offset); var coordinates = user.Transform.Coordinates.Offset(offset);
if(_soundHitWall.TryGetSound(out var soundHitWall)) SoundSystem.Play(Filter.Pvs(coordinates), _soundHitWall.GetSound(), coordinates);
SoundSystem.Play(Filter.Pvs(coordinates), soundHitWall, coordinates);
} }
Owner.SpawnTimer((int) _deathTime.TotalMilliseconds, () => Owner.SpawnTimer((int) _deathTime.TotalMilliseconds, () =>

View File

@@ -26,8 +26,8 @@ namespace Content.Server.Projectiles.Components
public bool DeleteOnCollide { get; } = true; public bool DeleteOnCollide { get; } = true;
// Get that juicy FPS hit sound // Get that juicy FPS hit sound
[DataField("soundHit")] public SoundSpecifier SoundHit = default!; [DataField("soundHit", required: true)] public SoundSpecifier SoundHit = default!;
[DataField("soundHitSpecies")] public SoundSpecifier SoundHitSpecies = default!; [DataField("soundHitSpecies", required: true)] public SoundSpecifier SoundHitSpecies = default!;
public bool DamagedEntity; public bool DamagedEntity;

View File

@@ -32,14 +32,13 @@ namespace Content.Server.Projectiles
var coordinates = args.OtherFixture.Body.Owner.Transform.Coordinates; var coordinates = args.OtherFixture.Body.Owner.Transform.Coordinates;
var playerFilter = Filter.Pvs(coordinates); var playerFilter = Filter.Pvs(coordinates);
if (!otherEntity.Deleted && if (!otherEntity.Deleted && otherEntity.HasComponent<SharedBodyComponent>())
otherEntity.HasComponent<SharedBodyComponent>() && component.SoundHitSpecies.TryGetSound(out var soundHitSpecies))
{ {
SoundSystem.Play(playerFilter, soundHitSpecies, coordinates); SoundSystem.Play(playerFilter, component.SoundHitSpecies.GetSound(), coordinates);
} }
else if (component.SoundHit.TryGetSound(out var soundHit)) else
{ {
SoundSystem.Play(playerFilter, soundHit, coordinates); SoundSystem.Play(playerFilter, component.SoundHit.GetSound(), coordinates);
} }
if (!otherEntity.Deleted && otherEntity.TryGetComponent(out IDamageableComponent? damage)) if (!otherEntity.Deleted && otherEntity.TryGetComponent(out IDamageableComponent? damage))

View File

@@ -77,8 +77,7 @@ namespace Content.Server.RCD.Components
public void SwapMode(UseEntityEventArgs eventArgs) public void SwapMode(UseEntityEventArgs eventArgs)
{ {
if(_swapModeSound.TryGetSound(out var swapModeSound)) SoundSystem.Play(Filter.Pvs(Owner), _swapModeSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), swapModeSound, Owner);
var mode = (int) _mode; //Firstly, cast our RCDmode mode to an int (enums are backed by ints anyway by default) var mode = (int) _mode; //Firstly, cast our RCDmode mode to an int (enums are backed by ints anyway by default)
mode = (++mode) % _modes.Length; //Then, do a rollover on the value so it doesnt hit an invalid state mode = (++mode) % _modes.Length; //Then, do a rollover on the value so it doesnt hit an invalid state
_mode = (RcdMode) mode; //Finally, cast the newly acquired int mode to an RCDmode so we can use it. _mode = (RcdMode) mode; //Finally, cast the newly acquired int mode to an RCDmode so we can use it.
@@ -163,8 +162,7 @@ namespace Content.Server.RCD.Components
return true; //I don't know why this would happen, but sure I guess. Get out of here invalid state! return true; //I don't know why this would happen, but sure I guess. Get out of here invalid state!
} }
if(_successSound.TryGetSound(out var successSound)) SoundSystem.Play(Filter.Pvs(Owner), _successSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), successSound, Owner);
_ammo--; _ammo--;
return true; return true;
} }

View File

@@ -93,8 +93,7 @@ namespace Content.Server.Radiation
_endTime = currentTime + TimeSpan.FromSeconds(_duration); _endTime = currentTime + TimeSpan.FromSeconds(_duration);
} }
if(Sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), Sound.GetSound(), Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner.Transform.Coordinates);
Dirty(); Dirty();
} }
@@ -109,7 +108,7 @@ namespace Content.Server.Radiation
if (!Decay || Owner.Deleted) if (!Decay || Owner.Deleted)
return; return;
if(_duration <= 0f) if (_duration <= 0f)
Owner.QueueDelete(); Owner.QueueDelete();
_duration -= frameTime; _duration -= frameTime;

View File

@@ -125,8 +125,7 @@ namespace Content.Server.Research.Components
private void PlayKeyboardSound() private void PlayKeyboardSound()
{ {
if (_soundCollectionName.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _soundCollectionName.GetSound(), Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default);
} }
} }
} }

View File

@@ -89,9 +89,8 @@ namespace Content.Server.Singularity.Components
audioParams.Loop = true; audioParams.Loop = true;
audioParams.MaxDistance = 20f; audioParams.MaxDistance = 20f;
audioParams.Volume = 5; audioParams.Volume = 5;
if(_singularityFormingSound.TryGetSound(out var singuloFormingSound)) SoundSystem.Play(Filter.Pvs(Owner), _singularityFormingSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), singuloFormingSound, Owner); Timer.Spawn(5200, () => _playingSound = SoundSystem.Play(Filter.Pvs(Owner), _singularitySound.GetSound(), Owner, audioParams));
Timer.Spawn(5200,() => _playingSound = SoundSystem.Play(Filter.Pvs(Owner), _singularitySound.GetSound(), Owner, audioParams));
_singularitySystem.ChangeSingularityLevel(this, 1); _singularitySystem.ChangeSingularityLevel(this, 1);
} }
@@ -104,8 +103,7 @@ namespace Content.Server.Singularity.Components
protected override void OnRemove() protected override void OnRemove()
{ {
_playingSound?.Stop(); _playingSound?.Stop();
if(_singularityCollapsingSound.TryGetSound(out var singuloCollapseSound)) SoundSystem.Play(Filter.Pvs(Owner), _singularityCollapsingSound.GetSound(), Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), singuloCollapseSound, Owner.Transform.Coordinates);
base.OnRemove(); base.OnRemove();
} }
} }

View File

@@ -9,10 +9,7 @@ namespace Content.Server.Slippery
{ {
protected override void PlaySound(SlipperyComponent component) protected override void PlaySound(SlipperyComponent component)
{ {
if (component.SlipSound.TryGetSound(out var slipSound)) SoundSystem.Play(Filter.Pvs(component.Owner), component.SlipSound.GetSound(), component.Owner, AudioHelpers.WithVariation(0.2f));
{
SoundSystem.Play(Filter.Pvs(component.Owner), slipSound, component.Owner, AudioHelpers.WithVariation(0.2f));
}
} }
} }
} }

View File

@@ -12,7 +12,7 @@ namespace Content.Server.Sound.Components
public abstract class BaseEmitSoundComponent : Component public abstract class BaseEmitSoundComponent : Component
{ {
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("sound")] [DataField("sound", required: true)]
public SoundSpecifier Sound { get; set; } = default!; public SoundSpecifier Sound { get; set; } = default!;
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]

View File

@@ -7,7 +7,6 @@ using Content.Shared.Throwing;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Player; using Robust.Shared.Player;
namespace Content.Server.Sound namespace Content.Server.Sound
@@ -50,14 +49,7 @@ namespace Content.Server.Sound
private static void TryEmitSound(BaseEmitSoundComponent component) private static void TryEmitSound(BaseEmitSoundComponent component)
{ {
if (component.Sound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(component.Owner), component.Sound.GetSound(), component.Owner, AudioHelpers.WithVariation(component.PitchVariation).WithVolume(-2f));
{
SoundSystem.Play(Filter.Pvs(component.Owner), sound, component.Owner, AudioHelpers.WithVariation(component.PitchVariation).WithVolume(-2f));
}
else
{
Logger.Warning($"{nameof(component)} Uid:{component.Owner.Uid} has no {nameof(component.Sound)} to play.");
}
} }
} }
} }

View File

@@ -42,7 +42,7 @@ namespace Content.Server.Storage.Components
var locker = lockerEnt.GetComponent<EntityStorageComponent>(); var locker = lockerEnt.GetComponent<EntityStorageComponent>();
if(locker.Open) if (locker.Open)
locker.TryCloseStorage(Owner); locker.TryCloseStorage(Owner);
foreach (var entity in Contents.ContainedEntities.ToArray()) foreach (var entity in Contents.ContainedEntities.ToArray())
@@ -51,10 +51,8 @@ namespace Content.Server.Storage.Components
locker.Insert(entity); locker.Insert(entity);
} }
if(_cursedSound.TryGetSound(out var cursedSound)) SoundSystem.Play(Filter.Pvs(Owner), _cursedSound.GetSound(), Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), cursedSound, Owner, AudioHelpers.WithVariation(0.125f)); SoundSystem.Play(Filter.Pvs(lockerEnt), _cursedLockerSound.GetSound(), lockerEnt, AudioHelpers.WithVariation(0.125f));
if(_cursedLockerSound.TryGetSound(out var cursedLockerSound))
SoundSystem.Play(Filter.Pvs(lockerEnt), cursedLockerSound, lockerEnt, AudioHelpers.WithVariation(0.125f));
} }
} }
} }

View File

@@ -226,8 +226,7 @@ namespace Content.Server.Storage.Components
} }
ModifyComponents(); ModifyComponents();
if(_closeSound.TryGetSound(out var closeSound)) SoundSystem.Play(Filter.Pvs(Owner), _closeSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), closeSound, Owner);
_lastInternalOpenAttempt = default; _lastInternalOpenAttempt = default;
} }
@@ -236,8 +235,7 @@ namespace Content.Server.Storage.Components
Open = true; Open = true;
EmptyContents(); EmptyContents();
ModifyComponents(); ModifyComponents();
if(_openSound.TryGetSound(out var openSound)) SoundSystem.Play(Filter.Pvs(Owner), _openSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), openSound, Owner);
} }
private void UpdateAppearance() private void UpdateAppearance()

View File

@@ -1,18 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Content.Server.DoAfter; using Content.Server.DoAfter;
using Content.Server.Hands.Components; using Content.Server.Hands.Components;
using Content.Server.Items; using Content.Server.Items;
using Content.Server.Placeable; using Content.Server.Placeable;
using Content.Shared.Acts; using Content.Shared.Acts;
using Content.Shared.Audio;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Interaction.Helpers; using Content.Shared.Interaction.Helpers;
using Content.Shared.Item; using Content.Shared.Item;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers; using Content.Shared.Notification.Managers;
using Content.Shared.Sound; using Content.Shared.Sound;
using Content.Shared.Storage; using Content.Shared.Storage;
@@ -31,6 +24,11 @@ using Robust.Shared.Player;
using Robust.Shared.Players; using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Content.Server.Storage.Components namespace Content.Server.Storage.Components
{ {
@@ -66,7 +64,7 @@ namespace Content.Server.Storage.Components
public readonly HashSet<IPlayerSession> SubscribedSessions = new(); public readonly HashSet<IPlayerSession> SubscribedSessions = new();
[DataField("storageSoundCollection")] [DataField("storageSoundCollection")]
public SoundSpecifier StorageSoundCollection { get; set; } = default!; public SoundSpecifier StorageSoundCollection { get; set; } = new SoundCollectionSpecifier("storageRustle");
[ViewVariables] [ViewVariables]
public override IReadOnlyList<IEntity>? StoredEntities => _storage?.ContainedEntities; public override IReadOnlyList<IEntity>? StoredEntities => _storage?.ContainedEntities;
@@ -511,7 +509,7 @@ namespace Content.Server.Storage.Components
// Pick up all entities in a radius around the clicked location. // Pick up all entities in a radius around the clicked location.
// The last half of the if is because carpets exist and this is terrible // The last half of the if is because carpets exist and this is terrible
if(_areaInsert && (eventArgs.Target == null || !eventArgs.Target.HasComponent<SharedItemComponent>())) if (_areaInsert && (eventArgs.Target == null || !eventArgs.Target.HasComponent<SharedItemComponent>()))
{ {
var validStorables = new List<IEntity>(); var validStorables = new List<IEntity>();
foreach (var entity in IoCManager.Resolve<IEntityLookup>().GetEntitiesInRange(eventArgs.ClickLocation, 1)) foreach (var entity in IoCManager.Resolve<IEntityLookup>().GetEntitiesInRange(eventArgs.ClickLocation, 1))
@@ -556,7 +554,7 @@ namespace Content.Server.Storage.Components
} }
// If we picked up atleast one thing, play a sound and do a cool animation! // If we picked up atleast one thing, play a sound and do a cool animation!
if (successfullyInserted.Count>0) if (successfullyInserted.Count > 0)
{ {
PlaySoundCollection(); PlaySoundCollection();
SendNetworkMessage( SendNetworkMessage(
@@ -569,7 +567,7 @@ namespace Content.Server.Storage.Components
return true; return true;
} }
// Pick up the clicked entity // Pick up the clicked entity
else if(_quickInsert) else if (_quickInsert)
{ {
if (eventArgs.Target == null if (eventArgs.Target == null
|| !eventArgs.Target.Transform.IsMapTransform || !eventArgs.Target.Transform.IsMapTransform
@@ -577,7 +575,7 @@ namespace Content.Server.Storage.Components
|| !eventArgs.Target.HasComponent<SharedItemComponent>()) || !eventArgs.Target.HasComponent<SharedItemComponent>())
return false; return false;
var position = eventArgs.Target.Transform.Coordinates; var position = eventArgs.Target.Transform.Coordinates;
if(PlayerInsertEntityInWorld(eventArgs.User, eventArgs.Target)) if (PlayerInsertEntityInWorld(eventArgs.User, eventArgs.Target))
{ {
SendNetworkMessage(new AnimateInsertingEntitiesMessage( SendNetworkMessage(new AnimateInsertingEntitiesMessage(
new List<EntityUid>() { eventArgs.Target.Uid }, new List<EntityUid>() { eventArgs.Target.Uid },
@@ -631,9 +629,7 @@ namespace Content.Server.Storage.Components
private void PlaySoundCollection() private void PlaySoundCollection()
{ {
// TODO this doesn't compile or work SoundSystem.Play(Filter.Pvs(Owner), StorageSoundCollection.GetSound(), Owner, AudioParams.Default);
if(StorageSoundCollection?.TryGetSound(out var sound))
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioParams.Default);
} }
} }
} }

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using Content.Shared.Sound; using Content.Shared.Sound;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
@@ -23,7 +23,7 @@ namespace Content.Server.Storage.Components
/// <summary> /// <summary>
/// A sound to play when the items are spawned. For example, gift boxes being unwrapped. /// A sound to play when the items are spawned. For example, gift boxes being unwrapped.
/// </summary> /// </summary>
[DataField("sound")] [DataField("sound", required: true)]
public SoundSpecifier? Sound = null; public SoundSpecifier? Sound = null;
/// <summary> /// <summary>

View File

@@ -29,7 +29,7 @@ namespace Content.Server.Stunnable.Components
protected override void OnKnockdownEnd() protected override void OnKnockdownEnd()
{ {
if(Owner.TryGetComponent(out IMobStateComponent? mobState) && !mobState.IsIncapacitated()) if (Owner.TryGetComponent(out IMobStateComponent? mobState) && !mobState.IsIncapacitated())
EntitySystem.Get<StandingStateSystem>().Stand(Owner); EntitySystem.Get<StandingStateSystem>().Stand(Owner);
} }
@@ -57,8 +57,7 @@ namespace Content.Server.Stunnable.Components
protected override void OnInteractHand() protected override void OnInteractHand()
{ {
if(_stunAttemptSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _stunAttemptSound.GetSound(), Owner, AudioHelpers.WithVariation(0.05f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioHelpers.WithVariation(0.05f));
} }
bool IDisarmedAct.Disarmed(DisarmedActEventArgs eventArgs) bool IDisarmedAct.Disarmed(DisarmedActEventArgs eventArgs)
@@ -73,12 +72,11 @@ namespace Content.Server.Stunnable.Components
if (source != null) if (source != null)
{ {
if (_stunAttemptSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(source), _stunAttemptSound.GetSound(), source, AudioHelpers.WithVariation(0.025f));
SoundSystem.Play(Filter.Pvs(source), sound, source, AudioHelpers.WithVariation(0.025f));
if (target != null) if (target != null)
{ {
source.PopupMessageOtherClients(Loc.GetString("stunnable-component-disarm-success-others", ("source", source.Name),("target", target.Name))); source.PopupMessageOtherClients(Loc.GetString("stunnable-component-disarm-success-others", ("source", source.Name), ("target", target.Name)));
source.PopupMessageCursor(Loc.GetString("stunnable-component-disarm-success",("target", target.Name))); source.PopupMessageCursor(Loc.GetString("stunnable-component-disarm-success", ("target", target.Name)));
} }
} }

View File

@@ -119,18 +119,17 @@ namespace Content.Server.Stunnable
{ {
if (!entity.TryGetComponent(out StunnableComponent? stunnable) || !comp.Activated) return; if (!entity.TryGetComponent(out StunnableComponent? stunnable) || !comp.Activated) return;
if(comp.StunSound.TryGetSound(out var stunSound)) SoundSystem.Play(Filter.Pvs(comp.Owner), comp.StunSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(comp.Owner), stunSound, comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f)); if (!stunnable.SlowedDown)
if(!stunnable.SlowedDown)
{ {
if(_robustRandom.Prob(comp.ParalyzeChanceNoSlowdown)) if (_robustRandom.Prob(comp.ParalyzeChanceNoSlowdown))
stunnable.Paralyze(comp.ParalyzeTime); stunnable.Paralyze(comp.ParalyzeTime);
else else
stunnable.Slowdown(comp.SlowdownTime); stunnable.Slowdown(comp.SlowdownTime);
} }
else else
{ {
if(_robustRandom.Prob(comp.ParalyzeChanceWithSlowdown)) if (_robustRandom.Prob(comp.ParalyzeChanceWithSlowdown))
stunnable.Paralyze(comp.ParalyzeTime); stunnable.Paralyze(comp.ParalyzeTime);
else else
stunnable.Slowdown(comp.SlowdownTime); stunnable.Slowdown(comp.SlowdownTime);
@@ -140,8 +139,7 @@ namespace Content.Server.Stunnable
if (!comp.Owner.TryGetComponent<PowerCellSlotComponent>(out var slot) || slot.Cell == null || !(slot.Cell.CurrentCharge < comp.EnergyPerUse)) if (!comp.Owner.TryGetComponent<PowerCellSlotComponent>(out var slot) || slot.Cell == null || !(slot.Cell.CurrentCharge < comp.EnergyPerUse))
return; return;
if(comp.SparksSound.TryGetSound(out var sparksSound)) SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(comp.Owner), sparksSound, comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
TurnOff(comp); TurnOff(comp);
} }
@@ -155,8 +153,7 @@ namespace Content.Server.Stunnable
if (!comp.Owner.TryGetComponent<SpriteComponent>(out var sprite) || if (!comp.Owner.TryGetComponent<SpriteComponent>(out var sprite) ||
!comp.Owner.TryGetComponent<ItemComponent>(out var item)) return; !comp.Owner.TryGetComponent<ItemComponent>(out var item)) return;
if(comp.SparksSound.TryGetSound(out var sparksSound)) SoundSystem.Play(Filter.Pvs(comp.Owner), comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(comp.Owner), sparksSound, comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
item.EquippedPrefix = "off"; item.EquippedPrefix = "off";
// TODO stunbaton visualizer // TODO stunbaton visualizer
sprite.LayerSetState(0, "stunbaton_off"); sprite.LayerSetState(0, "stunbaton_off");
@@ -180,22 +177,19 @@ namespace Content.Server.Stunnable
if (slot.Cell == null) if (slot.Cell == null)
{ {
if(comp.TurnOnFailSound.TryGetSound(out var turnOnFailSound)) SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, turnOnFailSound, comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
user.PopupMessage(Loc.GetString("comp-stunbaton-activated-missing-cell")); user.PopupMessage(Loc.GetString("comp-stunbaton-activated-missing-cell"));
return; return;
} }
if (slot.Cell != null && slot.Cell.CurrentCharge < comp.EnergyPerUse) if (slot.Cell != null && slot.Cell.CurrentCharge < comp.EnergyPerUse)
{ {
if(comp.TurnOnFailSound.TryGetSound(out var turnOnFailSound)) SoundSystem.Play(playerFilter, comp.TurnOnFailSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, turnOnFailSound, comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
user.PopupMessage(Loc.GetString("comp-stunbaton-activated-dead-cell")); user.PopupMessage(Loc.GetString("comp-stunbaton-activated-dead-cell"));
return; return;
} }
if(comp.SparksSound.TryGetSound(out var sparksSound)) SoundSystem.Play(playerFilter, comp.SparksSound.GetSound(), comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, sparksSound, comp.Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
item.EquippedPrefix = "on"; item.EquippedPrefix = "on";
sprite.LayerSetState(0, "stunbaton_on"); sprite.LayerSetState(0, "stunbaton_on");

View File

@@ -23,7 +23,7 @@ namespace Content.Server.Tiles
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
public override string Name => "FloorTile"; public override string Name => "FloorTile";
[DataField("outputs", customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))] [DataField("outputs", customTypeSerializer: typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
private List<string>? _outputTiles; private List<string>? _outputTiles;
[DataField("placeTileSound")] SoundSpecifier _placeTileSound = new SoundPathSpecifier("/Audio/Items/genhit.ogg"); [DataField("placeTileSound")] SoundSpecifier _placeTileSound = new SoundPathSpecifier("/Audio/Items/genhit.ogg");
@@ -50,8 +50,7 @@ namespace Content.Server.Tiles
private void PlaceAt(IMapGrid mapGrid, EntityCoordinates location, ushort tileId, float offset = 0) private void PlaceAt(IMapGrid mapGrid, EntityCoordinates location, ushort tileId, float offset = 0)
{ {
mapGrid.SetTile(location.Offset(new Vector2(offset, offset)), new Tile(tileId)); mapGrid.SetTile(location.Offset(new Vector2(offset, offset)), new Tile(tileId));
if(_placeTileSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(location), _placeTileSound.GetSound(), location, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(location), sound, location, AudioHelpers.WithVariation(0.125f));
} }
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)

View File

@@ -130,8 +130,7 @@ namespace Content.Server.Toilet
public void ToggleToiletSeat() public void ToggleToiletSeat()
{ {
IsSeatUp = !IsSeatUp; IsSeatUp = !IsSeatUp;
if(_toggleSound.TryGetSound(out var sound)) SoundSystem.Play(Filter.Pvs(Owner), _toggleSound.GetSound(), Owner, AudioHelpers.WithVariation(0.05f));
SoundSystem.Play(Filter.Pvs(Owner), sound, Owner, AudioHelpers.WithVariation(0.05f));
UpdateSprite(); UpdateSprite();
} }

View File

@@ -33,10 +33,10 @@ namespace Content.Server.Tools.Components
[DataField("sprite")] [DataField("sprite")]
public string Sprite { get; } = string.Empty; public string Sprite { get; } = string.Empty;
[DataField("useSound")] [DataField("useSound", required: true)]
public SoundSpecifier Sound { get; } = default!; public SoundSpecifier Sound { get; } = default!;
[DataField("changeSound")] [DataField("changeSound", required: true)]
public SoundSpecifier ChangeSound { get; } = default!; public SoundSpecifier ChangeSound { get; } = default!;
} }
@@ -60,8 +60,7 @@ namespace Content.Server.Tools.Components
_currentTool = (_currentTool + 1) % _tools.Count; _currentTool = (_currentTool + 1) % _tools.Count;
SetTool(); SetTool();
var current = _tools[_currentTool]; var current = _tools[_currentTool];
if(current.ChangeSound.TryGetSound(out var changeSound)) SoundSystem.Play(Filter.Pvs(Owner), current.ChangeSound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), changeSound, Owner);
} }
private void SetTool() private void SetTool()

View File

@@ -44,7 +44,7 @@ namespace Content.Server.Tools.Components
[DataField("speed")] [DataField("speed")]
public float SpeedModifier { get; set; } = 1; public float SpeedModifier { get; set; } = 1;
[DataField("useSound")] [DataField("useSound", required: true)]
public SoundSpecifier UseSound { get; set; } = default!; public SoundSpecifier UseSound { get; set; } = default!;
public void AddQuality(ToolQuality quality) public void AddQuality(ToolQuality quality)
@@ -96,8 +96,7 @@ namespace Content.Server.Tools.Components
public void PlayUseSound(float volume = -5f) public void PlayUseSound(float volume = -5f)
{ {
if(UseSound.TryGetSound(out var useSound)) SoundSystem.Play(Filter.Pvs(Owner), UseSound.GetSound(), Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
SoundSystem.Play(Filter.Pvs(Owner), useSound, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
} }
} }
} }

View File

@@ -60,7 +60,7 @@ namespace Content.Server.Tools.Components
private SolutionContainerComponent? _solutionComponent; private SolutionContainerComponent? _solutionComponent;
private PointLightComponent? _pointLightComponent; private PointLightComponent? _pointLightComponent;
[DataField("weldSounds")] [DataField("weldSounds", required: true)]
private SoundSpecifier WeldSounds { get; set; } = default!; private SoundSpecifier WeldSounds { get; set; } = default!;
[DataField("welderOffSounds")] [DataField("welderOffSounds")]
@@ -171,9 +171,9 @@ namespace Content.Server.Tools.Components
var succeeded = _solutionComponent.TryRemoveReagent("WeldingFuel", ReagentUnit.New(value)); var succeeded = _solutionComponent.TryRemoveReagent("WeldingFuel", ReagentUnit.New(value));
if (succeeded && !silent && WeldSounds.TryGetSound(out var weldSounds)) if (succeeded && !silent)
{ {
PlaySound(weldSounds); PlaySound(WeldSounds);
} }
return succeeded; return succeeded;
} }
@@ -204,8 +204,7 @@ namespace Content.Server.Tools.Components
if (_pointLightComponent != null) _pointLightComponent.Enabled = false; if (_pointLightComponent != null) _pointLightComponent.Enabled = false;
if(WelderOffSounds.TryGetSound(out var welderOffSOunds)) PlaySound(WelderOffSounds, -5);
PlaySound(welderOffSOunds, -5);
_welderSystem.Unsubscribe(this); _welderSystem.Unsubscribe(this);
return true; return true;
} }
@@ -222,8 +221,7 @@ namespace Content.Server.Tools.Components
if (_pointLightComponent != null) _pointLightComponent.Enabled = true; if (_pointLightComponent != null) _pointLightComponent.Enabled = true;
if (WelderOnSounds.TryGetSound(out var welderOnSOunds)) PlaySound(WelderOnSounds, -5);
PlaySound(welderOnSOunds, -5);
_welderSystem.Subscribe(this); _welderSystem.Subscribe(this);
EntitySystem.Get<AtmosphereSystem>().HotspotExpose(Owner.Transform.Coordinates, 700, 50, true); EntitySystem.Get<AtmosphereSystem>().HotspotExpose(Owner.Transform.Coordinates, 700, 50, true);
@@ -283,8 +281,7 @@ namespace Content.Server.Tools.Components
if (TryWeld(5, victim, silent: true)) if (TryWeld(5, victim, silent: true))
{ {
if(WeldSounds.TryGetSound(out var weldSound)) PlaySound(WeldSounds);
PlaySound(weldSound);
othersMessage = othersMessage =
Loc.GetString("welder-component-suicide-lit-others-message", Loc.GetString("welder-component-suicide-lit-others-message",
@@ -337,8 +334,7 @@ namespace Content.Server.Tools.Components
{ {
var drained = targetSolution.Drain(trans); var drained = targetSolution.Drain(trans);
_solutionComponent.TryAddSolution(drained); _solutionComponent.TryAddSolution(drained);
if(WelderRefill.TryGetSound(out var welderRefillSound)) SoundSystem.Play(Filter.Pvs(Owner), WelderRefill.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(Owner), welderRefillSound, Owner);
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("welder-component-after-interact-refueled-message")); eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("welder-component-after-interact-refueled-message"));
} }
} }
@@ -346,9 +342,9 @@ namespace Content.Server.Tools.Components
return true; return true;
} }
private void PlaySound(string soundName, float volume = -5f) private void PlaySound(SoundSpecifier sound, float volume = -5f)
{ {
SoundSystem.Play(Filter.Pvs(Owner), soundName, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume)); SoundSystem.Play(Filter.Pvs(Owner), sound.GetSound(), Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
} }
} }
} }

View File

@@ -202,8 +202,7 @@ namespace Content.Server.VendingMachines
Owner.EntityManager.SpawnEntity(id, Owner.Transform.Coordinates); Owner.EntityManager.SpawnEntity(id, Owner.Transform.Coordinates);
}); });
if(_soundVend.TryGetSound(out var soundVend)) SoundSystem.Play(Filter.Pvs(Owner), _soundVend.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), soundVend, Owner, AudioParams.Default.WithVolume(-2f));
} }
private void TryEject(string id, IEntity? sender) private void TryEject(string id, IEntity? sender)
@@ -222,8 +221,7 @@ namespace Content.Server.VendingMachines
private void Deny() private void Deny()
{ {
if(_soundDeny.TryGetSound(out var soundDeny)) SoundSystem.Play(Filter.Pvs(Owner), _soundDeny.GetSound(), Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), soundDeny, Owner, AudioParams.Default.WithVolume(-2f));
// Play the Deny animation // Play the Deny animation
TrySetVisualState(VendingMachineVisualState.Deny); TrySetVisualState(VendingMachineVisualState.Deny);

Some files were not shown because too many files have changed in this diff Show More