fixed inventory + using Sync bindings
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 57s
Create tag and build when new code gets to main / Export (push) Successful in 5m13s

This commit is contained in:
2026-05-04 10:19:00 +02:00
parent 99f383be00
commit bed1384dc7
13 changed files with 258 additions and 124 deletions

View File

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

View File

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