Spells content (#897)

* modifiers

* counter spell, and 2 new spell scrolls

* Update magical_acceleration.yml

* Update T0_counter_spell.yml
This commit is contained in:
Ed
2025-02-14 11:50:57 +03:00
committed by GitHub
parent 04aa7504fb
commit 909dc36158
17 changed files with 331 additions and 4 deletions

View File

@@ -52,9 +52,27 @@ public abstract partial class CP14SharedMagicSystem : EntitySystem
SubscribeLocalEvent<CP14MagicEffectComponent, MapInitEvent>(OnMagicEffectInit);
SubscribeLocalEvent<CP14MagicEffectComponent, ComponentShutdown>(OnMagicEffectShutdown);
SubscribeLocalEvent<CP14MagicEffectComponent, CP14StartCastMagicEffectEvent>(OnStartCast);
SubscribeLocalEvent<CP14MagicEffectComponent, CP14EndCastMagicEffectEvent>(OnEndCast);
SubscribeLocalEvent<CP14MagicEffectStaminaCostComponent, CP14MagicEffectConsumeResourceEvent>(OnStaminaConsume);
}
private void OnStartCast(Entity<CP14MagicEffectComponent> ent, ref CP14StartCastMagicEffectEvent args)
{
var caster = EnsureComp<CP14MagicCasterComponent>(args.Performer);
caster.CastedSpells.Add(ent);
}
private void OnEndCast(Entity<CP14MagicEffectComponent> ent, ref CP14EndCastMagicEffectEvent args)
{
if (TryComp<CP14MagicCasterComponent>(args.Performer, out var caster))
{
caster.CastedSpells.Remove(ent);
}
}
public override void Update(float frameTime)
{
base.Update(frameTime);