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

@@ -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);
}
}