Spell sounds are no longer global, also tweaked volumes (#8961)

This commit is contained in:
Jessica M
2022-06-19 14:07:00 -07:00
committed by GitHub
parent ee9ba8d569
commit 1baee5f306
3 changed files with 10 additions and 4 deletions

View File

@@ -17,8 +17,7 @@ public sealed class KnockSpellEvent : InstantActionEvent
/// <summary> /// <summary>
/// Volume control for the spell. /// Volume control for the spell.
/// -6f is default because the base soundfile is really loud
/// </summary> /// </summary>
[DataField("knockVolume")] [DataField("knockVolume")]
public float KnockVolume = -6f; public float KnockVolume = 5f;
} }

View File

@@ -7,4 +7,11 @@ public sealed class TeleportSpellEvent : WorldTargetActionEvent
{ {
[DataField("blinkSound")] [DataField("blinkSound")]
public SoundSpecifier BlinkSound = new SoundPathSpecifier("/Audio/Magic/blink.ogg"); public SoundSpecifier BlinkSound = new SoundPathSpecifier("/Audio/Magic/blink.ogg");
/// <summary>
/// Volume control for the spell.
/// </summary>
[DataField("blinkVolume")]
public float BlinkVolume = 5f;
} }

View File

@@ -215,7 +215,7 @@ public sealed class MagicSystem : EntitySystem
transform.WorldPosition = args.Target.Position; transform.WorldPosition = args.Target.Position;
transform.AttachToGridOrMap(); transform.AttachToGridOrMap();
SoundSystem.Play(args.BlinkSound.GetSound(), Filter.Pvs(args.Target)); SoundSystem.Play(args.BlinkSound.GetSound(), Filter.Pvs(args.Target), args.Performer, AudioParams.Default.WithVolume(args.BlinkVolume));
args.Handled = true; args.Handled = true;
} }
@@ -232,7 +232,7 @@ public sealed class MagicSystem : EntitySystem
var transform = Transform(args.Performer); var transform = Transform(args.Performer);
var coords = transform.Coordinates; var coords = transform.Coordinates;
SoundSystem.Play(args.KnockSound.GetSound(), Filter.Pvs(coords), AudioParams.Default.WithVolume(args.KnockVolume)); SoundSystem.Play(args.KnockSound.GetSound(), Filter.Pvs(coords), args.Performer, AudioParams.Default.WithVolume(args.KnockVolume));
//Look for doors and don't open them if they're already open. //Look for doors and don't open them if they're already open.
foreach (var entity in _lookup.GetEntitiesInRange(coords, args.Range)) foreach (var entity in _lookup.GetEntitiesInRange(coords, args.Range))