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

@@ -3,11 +3,9 @@ using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.ActionBlocker;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using Content.Shared.Destructible;
using Content.Shared.DoAfter;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events;
@@ -176,14 +174,12 @@ public abstract class SharedMechSystem : EntitySystem
_mover.SetRelay(pilot, mech);
_interaction.SetRelay(pilot, mech, irelay);
rider.Mech = mech;
Dirty(rider);
Dirty(pilot, rider);
_actions.AddAction(pilot,
new InstantAction(_prototype.Index<InstantActionPrototype>(component.MechCycleAction)), mech);
_actions.AddAction(pilot, new InstantAction(_prototype.Index<InstantActionPrototype>(component.MechUiAction)),
_actions.AddAction(pilot, Spawn(component.MechCycleAction), mech);
_actions.AddAction(pilot, Spawn(component.MechUiAction),
mech);
_actions.AddAction(pilot,
new InstantAction(_prototype.Index<InstantActionPrototype>(component.MechEjectAction)), mech);
_actions.AddAction(pilot, Spawn(component.MechEjectAction), mech);
}
private void RemoveUser(EntityUid mech, EntityUid pilot)