fixed inventory + using Sync bindings
This commit is contained in:
@@ -12,6 +12,7 @@ public class ExplodingSwordBehavior(PackedScene explosion, float radius) : IAbil
|
||||
{
|
||||
if (context.Owner is not Node3D owner)
|
||||
{
|
||||
GD.Print("Owner isn't a Node3D");
|
||||
context.InstanceHandle.End();
|
||||
return;
|
||||
}
|
||||
@@ -30,7 +31,6 @@ public class ExplodingSwordBehavior(PackedScene explosion, float radius) : IAbil
|
||||
}
|
||||
explo.Radius = radius;
|
||||
|
||||
GD.Print("explosion");
|
||||
owner.GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, explo);
|
||||
explo.CallDeferred(Node3D.MethodName.SetGlobalPosition, owner.GlobalPosition);
|
||||
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
using Gamesmiths.Forge.Abilities;
|
||||
using Gamesmiths.Forge.Effects;
|
||||
using Gamesmiths.Forge.Godot.Resources;
|
||||
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
||||
using Godot;
|
||||
|
||||
namespace Movementtests.forge.abilities;
|
||||
|
||||
public class InstantEndBehavior : IAbilityBehavior
|
||||
public class InstantEndBehavior(ForgeEffectData? effectData) : IAbilityBehavior
|
||||
{
|
||||
public void OnStarted(AbilityBehaviorContext context)
|
||||
{
|
||||
if (effectData != null)
|
||||
{
|
||||
var effect = new Effect(effectData.GetEffectData(), new EffectOwnership(context.Owner, context.Owner));
|
||||
context.Owner.EffectsManager.ApplyEffect(effect);
|
||||
}
|
||||
context.AbilityHandle.CommitAbility();
|
||||
context.InstanceHandle.End();
|
||||
}
|
||||
@@ -19,5 +26,6 @@ public class InstantEndBehavior : IAbilityBehavior
|
||||
[GlobalClass]
|
||||
public partial class ForgeInstantEndBehavior : ForgeAbilityBehavior
|
||||
{
|
||||
public override IAbilityBehavior GetBehavior() => new InstantEndBehavior();
|
||||
[Export] public ForgeEffectData? OptionalEffectData { get; set; }
|
||||
public override IAbilityBehavior GetBehavior() => new InstantEndBehavior(OptionalEffectData);
|
||||
}
|
||||
Reference in New Issue
Block a user