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

@@ -4,6 +4,7 @@ using Content.Server.Ghost.Roles.Events;
using Content.Server.Popups;
using Content.Shared.ActionBlocker;
using Content.Shared.Actions;
using Content.Shared.Bible;
using Content.Shared.Damage;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
@@ -179,8 +180,9 @@ namespace Content.Server.Bible
if (component.AlreadySummoned)
return;
args.Actions.Add(component.SummonAction);
args.AddAction(ref component.SummonActionEntity, component.SummonAction);
}
private void OnSummon(EntityUid uid, SummonableComponent component, SummonActionEvent args)
{
AttemptSummon(component, args.Performer, Transform(args.Performer));
@@ -238,12 +240,7 @@ namespace Content.Server.Bible
Transform(familiar).AttachParent(component.Owner);
}
component.AlreadySummoned = true;
_actionsSystem.RemoveAction(user, component.SummonAction);
_actionsSystem.RemoveAction(user, component.SummonActionEntity);
}
}
public sealed partial class SummonActionEvent : InstantActionEvent
{
}
}