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,28 +1,20 @@
using Content.Server.Body.Systems;
using System.Numerics;
using Content.Server.Chat.Systems;
using Content.Server.GameTicking;
using Content.Server.NPC;
using Content.Server.NPC.Systems;
using Content.Server.Popups;
using Content.Server.Station.Systems;
using Content.Shared.Actions;
using Content.Shared.Chemistry.Components;
using Content.Shared.Damage;
using Content.Shared.DoAfter;
using Content.Shared.Dragon;
using Content.Shared.Examine;
using Content.Shared.Humanoid;
using Content.Shared.Maps;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Movement.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Content.Shared.Sprite;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Random;
using System.Numerics;
using Content.Shared.Sprite;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager;
namespace Content.Server.Dragon;
@@ -56,6 +48,7 @@ public sealed partial class DragonSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<DragonComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<DragonComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<DragonComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<DragonComponent, DragonSpawnRiftActionEvent>(OnDragonRift);
SubscribeLocalEvent<DragonComponent, RefreshMovementSpeedModifiersEvent>(OnDragonMove);
@@ -302,10 +295,12 @@ public sealed partial class DragonSystem : EntitySystem
private void OnStartup(EntityUid uid, DragonComponent component, ComponentStartup args)
{
if (component.SpawnRiftAction != null)
_actionsSystem.AddAction(uid, component.SpawnRiftAction, null);
Roar(component);
}
private void OnMapInit(EntityUid uid, DragonComponent component, MapInitEvent args)
{
_actionsSystem.AddAction(uid, ref component.SpawnRiftActionEntity, component.SpawnRiftAction);
}
}