* add: Temporamancy tree with new shadow swap spell * feat: Increased tempo loadout to 2 * feat: Remove most popups from swap spell * fix: Swap with no mob entities * feat: Add CanCast to spell effect * fix: Handeling cancaled event & swap state * feat: Add UseCustomCastConditions * feat: Add swap to magic shadow staff * feat: Add tempo essence & magic type * feat: Add Tempo type to all dimension spells * fix: Magic shadow staff tempo manacost modify * fix: Spell type local * feat: Add touhou lore * fix: Review * feat: Add target dead block component * feat: Remove checking access * feat: Add RequireCanInteract * feat: Remove essence * fix: Review * fuck * fuck part 2 * Update Content.Shared/_CP14/MagicSpell/CP14SharedMagicSystem.DelayedActions.cs * Update dimension.png * minor nitpick * fix --------- Co-authored-by: Tornado Tech <54727692+Tornado-Technology@users.noreply.github.com> Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com> Co-authored-by: Ed <edwardxperia2000@gmail.com>
67 lines
2.3 KiB
C#
67 lines
2.3 KiB
C#
using Content.Shared._CP14.MagicSpell.Components;
|
|
using Content.Shared._CP14.MagicSpell.Events;
|
|
using Content.Shared._CP14.MagicSpell.Spells;
|
|
|
|
namespace Content.Shared._CP14.MagicSpell;
|
|
|
|
public abstract partial class CP14SharedMagicSystem
|
|
{
|
|
private void InitializeInstantActions()
|
|
{
|
|
SubscribeLocalEvent<CP14InstantActionEvent>(OnMagicInstantAction);
|
|
SubscribeLocalEvent<CP14EntityWorldTargetActionEvent>(OnMagicEntityWorldTargetAction);
|
|
SubscribeLocalEvent<CP14EntityTargetActionEvent>(OnMagicEntityTargetAction);
|
|
}
|
|
|
|
private void OnMagicInstantAction(CP14InstantActionEvent args)
|
|
{
|
|
if (args.Handled)
|
|
return;
|
|
|
|
if (!TryComp<CP14MagicEffectComponent>(args.Action, out var magicEffect))
|
|
return;
|
|
|
|
var spellArgs = new CP14SpellEffectBaseArgs(args.Performer, magicEffect.SpellStorage, args.Performer, Transform(args.Performer).Coordinates);
|
|
|
|
if (!CanCastSpell((args.Action, magicEffect), spellArgs))
|
|
return;
|
|
|
|
CastSpell((args.Action, magicEffect), spellArgs);
|
|
_action.CP14StartCustomDelay(args.Action, args.Cooldown);
|
|
}
|
|
|
|
private void OnMagicEntityWorldTargetAction(CP14EntityWorldTargetActionEvent args)
|
|
{
|
|
if (args.Handled)
|
|
return;
|
|
|
|
if (!TryComp<CP14MagicEffectComponent>(args.Action, out var magicEffect))
|
|
return;
|
|
|
|
var spellArgs = new CP14SpellEffectBaseArgs(args.Performer, magicEffect.SpellStorage, args.Entity, args.Coords);
|
|
|
|
if (!CanCastSpell((args.Action, magicEffect), spellArgs))
|
|
return;
|
|
|
|
CastSpell((args.Action, magicEffect), spellArgs);
|
|
_action.CP14StartCustomDelay(args.Action, args.Cooldown);
|
|
}
|
|
|
|
private void OnMagicEntityTargetAction(CP14EntityTargetActionEvent args)
|
|
{
|
|
if (args.Handled)
|
|
return;
|
|
|
|
if (!TryComp<CP14MagicEffectComponent>(args.Action, out var magicEffect))
|
|
return;
|
|
|
|
var spellArgs = new CP14SpellEffectBaseArgs(args.Performer, magicEffect.SpellStorage, args.Target, Transform(args.Target).Coordinates);
|
|
|
|
if (!CanCastSpell((args.Action, magicEffect), spellArgs))
|
|
return;
|
|
|
|
CastSpell((args.Action, magicEffect), spellArgs);
|
|
_action.CP14StartCustomDelay(args.Action, args.Cooldown);
|
|
}
|
|
}
|