Refactor actions to be entities with components (#19900)

This commit is contained in:
DrSmugleaf
2023-09-08 18:16:05 -07:00
committed by GitHub
parent e18f731b91
commit c71f97e3a2
210 changed files with 10693 additions and 11714 deletions

View File

@@ -1,7 +1,6 @@
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using Robust.Shared.Containers;
using Robust.Shared.Utility;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Guardian
{
@@ -24,17 +23,9 @@ namespace Content.Server.Guardian
/// </summary>
[ViewVariables] public ContainerSlot GuardianContainer = default!;
[DataField("action")]
public InstantAction Action = new()
{
DisplayName = "action-name-guardian",
Description = "action-description-guardian",
Icon = new SpriteSpecifier.Texture(new ("Interface/Actions/manifest.png")),
UseDelay = TimeSpan.FromSeconds(2),
CheckCanInteract = false, // allow use while stunned, etc. Gets removed on death anyways.
Event = new GuardianToggleActionEvent(),
};
}
[DataField("action", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Action = "ActionToggleGuardian";
public sealed partial class GuardianToggleActionEvent : InstantActionEvent { };
[DataField("actionEntity")] public EntityUid? ActionEntity;
}
}