cleanup and changed empowered action cost

This commit is contained in:
2026-04-18 09:28:21 +02:00
parent 585c2302d6
commit bb2b2ace06
7 changed files with 10 additions and 52 deletions

View File

@@ -13,8 +13,7 @@ public class EffectApplicationBehavior(EffectData effectData) : IAbilityBehavior
private Effect? _effect;
private ActiveEffectHandle? _effectHandle;
public void OnStarted(AbilityBehaviorContext context)
{
GD.Print("This is applying the periodic effect to the flying weapon");
{
_effect = new Effect(effectData, new EffectOwnership(context.Owner, context.Owner));
_effectHandle = context.Owner.EffectsManager.ApplyEffect(_effect);
context.AbilityHandle.CommitAbility();
@@ -22,7 +21,6 @@ public class EffectApplicationBehavior(EffectData effectData) : IAbilityBehavior
public void OnEnded(AbilityBehaviorContext context)
{
GD.Print("This is removing the periodic effect from the flying weapon");
if (_effectHandle is not null)
context.Owner.EffectsManager.RemoveEffect(_effectHandle);
context.InstanceHandle.End();

View File

@@ -6,7 +6,7 @@ using Godot;
namespace Movementtests.forge.abilities;
public class ExplodingSwordBehavior(PackedScene explosion) : IAbilityBehavior
public class ExplodingSwordBehavior(PackedScene explosion, float radius) : IAbilityBehavior
{
public void OnStarted(AbilityBehaviorContext context)
{
@@ -28,10 +28,7 @@ public class ExplodingSwordBehavior(PackedScene explosion) : IAbilityBehavior
context.InstanceHandle.End();
return;
}
GD.Print("EXPLOSION");
explo.Radius = 6f;
explo.Radius = radius;
owner.GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, explo);
explo.CallDeferred(Node3D.MethodName.SetGlobalPosition, owner.GlobalPosition);
@@ -50,8 +47,9 @@ public class ExplodingSwordBehavior(PackedScene explosion) : IAbilityBehavior
public partial class ForgeExplodingSwordBehavior : ForgeAbilityBehavior
{
[Export] public PackedScene Explosion { get; set; }
[Export] public float Radius { get; set; } = 5f;
public override IAbilityBehavior GetBehavior()
{
return new ExplodingSwordBehavior(Explosion);
return new ExplodingSwordBehavior(Explosion, Radius);
}
}

View File

@@ -22,10 +22,6 @@ public class RaiseEventTagExecution(TagContainer eventTags) : CustomExecution
{
var owner = effect.Ownership.Owner;
if (owner == null) return [];
foreach (var tag in eventTags.Tags)
{
GD.Print(tag);
}
owner.Events.Raise(new EventData
{