2023-09-08 18:16:05 -07:00
|
|
|
|
using Content.Shared.Actions;
|
2023-01-02 13:01:40 +13:00
|
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
|
2023-09-08 18:16:05 -07:00
|
|
|
|
namespace Content.Shared.Magic.Events;
|
2023-01-02 13:01:40 +13:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Spell that uses the magic of ECS to add & remove components. Components are first removed, then added.
|
|
|
|
|
|
/// </summary>
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial 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")]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public string? Speech { get; private set; }
|
2023-01-02 13:01:40 +13:00
|
|
|
|
}
|