Spells stuff (#153)

* -add: Create and remove blood spells using verbs.

* - add: Blood spells now have charges and disappear.

* - add: Localize spells.

* - add: New blood spells.
This commit is contained in:
Aviu00
2024-03-01 17:44:27 +09:00
committed by GitHub
parent 9b5dd4481d
commit 71ca698a7c
20 changed files with 498 additions and 43 deletions

View File

@@ -15,6 +15,7 @@ using Robust.Shared.Map;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Shared.Rejuvenate;
using Robust.Shared.Network;
namespace Content.Shared.Actions;
@@ -29,6 +30,7 @@ public abstract class SharedActionsSystem : EntitySystem
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly INetManager _net = default!; // WD
public override void Initialize()
{
@@ -537,6 +539,13 @@ public abstract class SharedActionsSystem : EntitySystem
action.Charges--;
if (action is { Charges: 0, RenewCharges: false })
action.Enabled = false;
// WD START
if (action is {Charges: 0, RemoveOnNoCharges: true})
{
RaiseLocalEvent(performer, new ActionGettingRemovedEvent {Action = actionId});
RemoveAction(performer, actionId, component, action);
}
// WD END
}
action.Cooldown = null;
@@ -816,7 +825,7 @@ public abstract class SharedActionsSystem : EntitySystem
Dirty(actionId.Value, action);
Dirty(performer, comp);
ActionRemoved(performer, actionId.Value, comp, action);
if (action.Temporary)
if (action.Temporary && (!_net.IsClient || action.ClientExclusive)) // WD EDIT
QueueDel(actionId.Value);
}