cleanup and changed empowered action cost
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user