boilerfix
This commit is contained in:
@@ -342,7 +342,7 @@ namespace Content.Client.Actions
|
||||
var (uid, comp) = ent;
|
||||
if (comp.Event is not {} ev)
|
||||
{
|
||||
DebugTools.Assert(HasComp<WorldTargetActionComponent>(ent), $"Action {ToPrettyString(ent)} requires WorldTargetActionComponent for entity-world targeting");
|
||||
DebugTools.Assert(HasComp<WorldTargetActionComponent>(ent), $"Action {ToPrettyString(ent)} requir45es WorldTargetActionComponent for entity-world targeting");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<CP14MagicEffectComponent> 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<CP14MagicEffectToggledComponent>(action);
|
||||
|
||||
var endEv = new CP14EndCastMagicEffectEvent(performer);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user