Remove speech & popups from actions (#15747)

This commit is contained in:
Leon Friedrich
2023-04-26 16:04:44 +12:00
committed by GitHub
parent beacaed0bb
commit 4e7cea96de
22 changed files with 89 additions and 126 deletions

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Magic.Events;
/// <summary>
/// Spell that uses the magic of ECS to add & remove components. Components are first removed, then added.
/// </summary>
public sealed class ChangeComponentsSpellEvent : EntityTargetActionEvent
public sealed class ChangeComponentsSpellEvent : EntityTargetActionEvent, ISpeakSpell
{
// TODO allow it to set component data-fields?
// for now a Hackish way to do that is to remove & add, but that doesn't allow you to selectively set specific data fields.
@@ -18,4 +18,7 @@ public sealed class ChangeComponentsSpellEvent : EntityTargetActionEvent
[DataField("toRemove")]
[AlwaysPushInheritance]
public HashSet<string> ToRemove = new();
[DataField("speech")]
public string? Speech { get; }
}

View File

@@ -0,0 +1,10 @@
namespace Content.Server.Magic.Events;
public interface ISpeakSpell // The speak n spell interface
{
/// <summary>
/// Localized string spoken by the caster when casting this spell.
/// </summary>
public string? Speech { get; }
}

View File

@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Magic.Events;
public sealed class InstantSpawnSpellEvent : InstantActionEvent
public sealed class InstantSpawnSpellEvent : InstantActionEvent, ISpeakSpell
{
/// <summary>
/// What entity should be spawned.
@@ -15,6 +15,9 @@ public sealed class InstantSpawnSpellEvent : InstantActionEvent
[DataField("preventCollide")]
public bool PreventCollideWithCaster = true;
[DataField("speech")]
public string? Speech { get; }
/// <summary>
/// Gets the targeted spawn positons; may lead to multiple entities being spawned.
/// </summary>

View File

@@ -3,7 +3,7 @@ using Robust.Shared.Audio;
namespace Content.Server.Magic.Events;
public sealed class KnockSpellEvent : InstantActionEvent
public sealed class KnockSpellEvent : InstantActionEvent, ISpeakSpell
{
/// <summary>
/// The range this spell opens doors in
@@ -20,4 +20,7 @@ public sealed class KnockSpellEvent : InstantActionEvent
/// </summary>
[DataField("knockVolume")]
public float KnockVolume = 5f;
[DataField("speech")]
public string? Speech { get; }
}

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Server.Magic.Events;
public sealed class ProjectileSpellEvent : WorldTargetActionEvent
public sealed class ProjectileSpellEvent : WorldTargetActionEvent, ISpeakSpell
{
/// <summary>
/// What entity should be spawned.
@@ -17,4 +17,7 @@ public sealed class ProjectileSpellEvent : WorldTargetActionEvent
/// Gets the targeted spawn positions; may lead to multiple entities being spawned.
/// </summary>
[DataField("posData")] public MagicSpawnData Pos = new TargetCasterPos();
[DataField("speech")]
public string? Speech { get; }
}

View File

@@ -2,11 +2,14 @@
namespace Content.Server.Magic.Events;
public sealed class SmiteSpellEvent : EntityTargetActionEvent
public sealed class SmiteSpellEvent : EntityTargetActionEvent, ISpeakSpell
{
/// <summary>
/// Should this smite delete all parts/mechanisms gibbed except for the brain?
/// </summary>
[DataField("deleteNonBrainParts")]
public bool DeleteNonBrainParts = true;
[DataField("speech")]
public string? Speech { get; }
}

View File

@@ -3,11 +3,13 @@ using Robust.Shared.Audio;
namespace Content.Server.Magic.Events;
public sealed class TeleportSpellEvent : WorldTargetActionEvent
public sealed class TeleportSpellEvent : WorldTargetActionEvent, ISpeakSpell
{
[DataField("blinkSound")]
public SoundSpecifier BlinkSound = new SoundPathSpecifier("/Audio/Magic/blink.ogg");
[DataField("speech")]
public string? Speech { get; }
/// <summary>
/// Volume control for the spell.

View File

@@ -3,7 +3,7 @@ using Content.Shared.Storage;
namespace Content.Server.Magic.Events;
public sealed class WorldSpawnSpellEvent : WorldTargetActionEvent
public sealed class WorldSpawnSpellEvent : WorldTargetActionEvent, ISpeakSpell
{
// TODO:This class needs combining with InstantSpawnSpellEvent
@@ -25,5 +25,8 @@ public sealed class WorldSpawnSpellEvent : WorldTargetActionEvent
/// Lifetime to set for the entities to self delete
/// </summary>
[DataField("lifetime")] public float? Lifetime;
[DataField("speech")]
public string? Speech { get; }
}