Nerf ringers (#6558)
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
using Content.Shared.PDA;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.PDA.Ringer
|
||||
{
|
||||
[RegisterComponent, ComponentProtoName("Ringer")]
|
||||
[RegisterComponent]
|
||||
public sealed class RingerComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
@@ -23,5 +20,16 @@ namespace Content.Server.PDA.Ringer
|
||||
|
||||
[DataField("isPlaying")]
|
||||
public bool IsPlaying = false;
|
||||
|
||||
/// <summary>
|
||||
/// How far the sound projects in metres.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("range")]
|
||||
public float Range = 3f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("volume")]
|
||||
public float Volume = -4f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,14 @@ namespace Content.Server.PDA.Ringer
|
||||
if (ringer.TimeElapsed < NoteDelay) continue;
|
||||
|
||||
ringer.TimeElapsed -= NoteDelay;
|
||||
SoundSystem.Play(Filter.Pvs(ringer.Owner, entityManager: EntityManager), GetSound(ringer.Ringtone[ringer.NoteCount]));
|
||||
var ringerXform = Transform(ringer.Owner);
|
||||
|
||||
SoundSystem.Play(
|
||||
Filter.Empty().AddInRange(ringerXform.MapPosition, ringer.Range),
|
||||
GetSound(ringer.Ringtone[ringer.NoteCount]),
|
||||
ringer.Owner,
|
||||
AudioParams.Default.WithMaxDistance(ringer.Range).WithVolume(ringer.Volume));
|
||||
|
||||
ringer.NoteCount++;
|
||||
|
||||
if (ringer.NoteCount > 3)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -103,6 +103,7 @@
|
||||
- savemap
|
||||
- tpgrid
|
||||
- gridtc
|
||||
- togglespritenetsync
|
||||
|
||||
- Flags: ADMIN
|
||||
Commands:
|
||||
|
||||
Reference in New Issue
Block a user