2023-01-02 13:01:40 +13:00
|
|
|
using Content.Shared.Actions;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Magic.Events;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Spell that uses the magic of ECS to add & remove components. Components are first removed, then added.
|
|
|
|
|
/// </summary>
|
2023-04-26 16:04:44 +12:00
|
|
|
public sealed class ChangeComponentsSpellEvent : EntityTargetActionEvent, ISpeakSpell
|
2023-01-02 13:01:40 +13:00
|
|
|
{
|
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
|
|
[DataField("toAdd")]
|
|
|
|
|
[AlwaysPushInheritance]
|
2023-05-19 15:45:09 -05:00
|
|
|
public ComponentRegistry ToAdd = new();
|
2023-01-02 13:01:40 +13:00
|
|
|
|
|
|
|
|
[DataField("toRemove")]
|
|
|
|
|
[AlwaysPushInheritance]
|
|
|
|
|
public HashSet<string> ToRemove = new();
|
2023-04-26 16:04:44 +12:00
|
|
|
|
|
|
|
|
[DataField("speech")]
|
|
|
|
|
public string? Speech { get; }
|
2023-01-02 13:01:40 +13:00
|
|
|
}
|