removed TryGetSound + made some SoundSpecifier datafields required
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,11 @@ namespace Content.Client.PDA
|
|||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|
||||||
|
|||||||
@@ -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),
|
||||||
@@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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",
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
@@ -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());
|
||||||
@@ -300,8 +308,7 @@ 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;
|
||||||
@@ -312,8 +319,7 @@ 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;
|
||||||
@@ -322,8 +328,7 @@ namespace Content.Server.Arcade.Components
|
|||||||
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;
|
||||||
@@ -357,8 +362,7 @@ namespace Content.Server.Arcade.Components
|
|||||||
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;
|
||||||
}
|
}
|
||||||
@@ -371,8 +375,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-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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -241,10 +241,7 @@ 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))
|
||||||
{
|
{
|
||||||
@@ -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));
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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]
|
||||||
|
|||||||
@@ -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>();
|
||||||
|
|
||||||
|
|||||||
@@ -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"));
|
||||||
|
|
||||||
|
|||||||
@@ -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]
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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--;
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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)));
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -54,8 +54,7 @@ namespace Content.Server.GameTicking.Rules
|
|||||||
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;
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -337,8 +337,7 @@ 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)
|
||||||
@@ -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;
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"));
|
||||||
|
|
||||||
|
|||||||
@@ -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--;
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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, () =>
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,8 +89,7 @@ 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)]
|
||||||
|
|||||||
@@ -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.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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,8 +72,7 @@ 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)));
|
||||||
|
|||||||
@@ -119,8 +119,7 @@ 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))
|
||||||
@@ -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");
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
Reference in New Issue
Block a user