some few fixes that don't fix anything
This commit is contained in:
@@ -16,7 +16,7 @@ public class ExplodingSwordBehavior(PackedScene explosion) : IAbilityBehavior
|
||||
return;
|
||||
}
|
||||
|
||||
if (explosion.Instantiate() is not Explosion explosion1)
|
||||
if (explosion.Instantiate() is not Explosion explo)
|
||||
{
|
||||
GD.Print("Cannot instantiate");
|
||||
context.InstanceHandle.End();
|
||||
@@ -31,10 +31,10 @@ public class ExplodingSwordBehavior(PackedScene explosion) : IAbilityBehavior
|
||||
|
||||
GD.Print("EXPLOSION");
|
||||
|
||||
explosion1.Radius = 6f;
|
||||
explo.Radius = 6f;
|
||||
|
||||
owner.GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, explosion1);
|
||||
explosion1.CallDeferred(Node3D.MethodName.SetGlobalPosition, owner.GlobalPosition);
|
||||
owner.GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, explo);
|
||||
explo.CallDeferred(Node3D.MethodName.SetGlobalPosition, owner.GlobalPosition);
|
||||
|
||||
context.AbilityHandle.CommitAbility();
|
||||
context.InstanceHandle.End();
|
||||
@@ -45,15 +45,12 @@ public class ExplodingSwordBehavior(PackedScene explosion) : IAbilityBehavior
|
||||
}
|
||||
}
|
||||
|
||||
[Tool]
|
||||
[GlobalClass]
|
||||
public partial class ForgeExplodingSwordBehavior : ForgeAbilityBehavior
|
||||
{
|
||||
[Export] public PackedScene? Explosion { get; set; }
|
||||
[Export] public PackedScene Explosion { get; set; }
|
||||
public override IAbilityBehavior GetBehavior()
|
||||
{
|
||||
if (Explosion == null)
|
||||
throw new System.ArgumentException("Explosion is null");
|
||||
return new ExplodingSwordBehavior(Explosion);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user