From f0e0339c681e984a98177f0c6d891687dfa670f3 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 16 Jun 2025 22:59:56 +0300 Subject: [PATCH] boilerfix --- Content.Client/Actions/ActionsSystem.cs | 2 +- .../CP14SharedMagicSystem.ToggleableActions.cs | 15 +++++++++++++-- .../Actions/Spells/Demigods/Lumera/touch.yml | 7 +++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Content.Client/Actions/ActionsSystem.cs b/Content.Client/Actions/ActionsSystem.cs index 91baa3b1a9..3903cf9f3f 100644 --- a/Content.Client/Actions/ActionsSystem.cs +++ b/Content.Client/Actions/ActionsSystem.cs @@ -342,7 +342,7 @@ namespace Content.Client.Actions var (uid, comp) = ent; if (comp.Event is not {} ev) { - DebugTools.Assert(HasComp(ent), $"Action {ToPrettyString(ent)} requires WorldTargetActionComponent for entity-world targeting"); + DebugTools.Assert(HasComp(ent), $"Action {ToPrettyString(ent)} requir45es WorldTargetActionComponent for entity-world targeting"); return; } diff --git a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.ToggleableActions.cs b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.ToggleableActions.cs index 53e10ab119..66eaad0f51 100644 --- a/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.ToggleableActions.cs +++ b/Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.ToggleableActions.cs @@ -3,6 +3,7 @@ using Content.Shared._CP14.MagicSpell.Events; using Content.Shared._CP14.MagicSpell.Spells; using Content.Shared.DoAfter; using Robust.Shared.Map; +using Robust.Shared.Timing; namespace Content.Shared._CP14.MagicSpell; @@ -106,8 +107,18 @@ public abstract partial class CP14SharedMagicSystem private void EndToggleableAction(Entity action, EntityUid performer, float? cooldown = null) { - if (cooldown is not null) - _action.SetCooldown(action.Owner, TimeSpan.FromSeconds(cooldown.Value)); + //This is an extremely dirty hack. I added it only because I know that in the coming weeks we will be rewriting this entire system. + // But until then, the game just needs to work as intended. The refactoring of actions hit us all hard... + //The main problem is that my stupid spell system has its own separate cooldown, which works independently of the official system (to support doAfters). + //And at this point in the code, the cooldown was first set by my system, and then reset to 0 by the official system. + //Previously, I edited the official system a little so that it would not reset the cooldowns, but I don't want to repeat this after refactoring the actions. + //So I just delay installing the cooldown from my fucked-up system for a split second. This is evil! And we will destroy this evil! + Timer.Spawn(50, + () => + { + if (cooldown is not null) + _action.SetCooldown(action.Owner, TimeSpan.FromSeconds(cooldown.Value)); + }); RemCompDeferred(action); var endEv = new CP14EndCastMagicEffectEvent(performer); diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Demigods/Lumera/touch.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Demigods/Lumera/touch.yml index 157d9109c3..056653381a 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Demigods/Lumera/touch.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Demigods/Lumera/touch.yml @@ -22,12 +22,15 @@ state: touch - type: TargetAction repeat: true - checkCanAccess: false + interactOnMiss: false + #checkCanAccess: false range: 100 - type: EntityTargetAction event: !type:CP14EntityTargetActionEvent cooldown: 0.5 - #- type: WorldTargetAction + - type: WorldTargetAction + event: !type:CP14WorldTargetActionEvent + cooldown: 0.5 - type: entity id: CP14LumeraTouchImpact