Moved the exploding sword forge object from the code only hardcoded stuff to the resource based stuff
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 24s
Create tag and build when new code gets to main / Export (push) Failing after 3m55s

This commit is contained in:
2026-04-04 12:06:48 +02:00
parent bfa1f251dd
commit 7a787a36d6
22 changed files with 365 additions and 272 deletions

View File

@@ -1,30 +0,0 @@
using System.Collections.Generic;
using Gamesmiths.Forge.Attributes;
using Gamesmiths.Forge.Core;
using Gamesmiths.Forge.Effects;
using Gamesmiths.Forge.Effects.Calculator;
using Gamesmiths.Forge.Effects.Magnitudes;
using Gamesmiths.Forge.Effects.Modifiers;
using Gamesmiths.Forge.Events;
using Godot;
using Movementtests.systems;
namespace Movementtests.tools.calculators;
public class FlyingWeaponExecution(WeaponSystem weaponSystem) : CustomExecution
{
public override ModifierEvaluatedData[] EvaluateExecution(Effect effect, IForgeEntity target, EffectEvaluatedData? effectEvaluatedData)
{
GD.Print("Custom execution executed");
weaponSystem.Events.Raise(new EventData<WeaponEventPayload>
{
EventTags = weaponSystem.WeaponFlyingTickEventTag.GetSingleTagContainer()!,
Source = weaponSystem,
EventMagnitude = 12f,
Payload = new WeaponEventPayload(Message: "flying")
});
return [];
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using Gamesmiths.Forge.Attributes;
using Gamesmiths.Forge.Core;
using Gamesmiths.Forge.Effects;
using Gamesmiths.Forge.Effects.Calculator;
using Gamesmiths.Forge.Effects.Magnitudes;
using Gamesmiths.Forge.Effects.Modifiers;
using Gamesmiths.Forge.Events;
using Gamesmiths.Forge.Godot.Resources;
using Gamesmiths.Forge.Godot.Resources.Calculators;
using Gamesmiths.Forge.Tags;
using Godot;
using Movementtests.systems;
namespace Movementtests.tools.calculators;
public class FlyingWeaponExecution(TagContainer eventTags) : CustomExecution
{
public override ModifierEvaluatedData[] EvaluateExecution(Effect effect, IForgeEntity target, EffectEvaluatedData? effectEvaluatedData)
{
GD.Print("Custom execution executed");
var owner = effect.Ownership.Owner;
if (owner == null) return [];
owner.Events.Raise(new EventData
{
EventTags = eventTags,
Source = owner,
EventMagnitude = 12f
});
return [];
}
}
[GlobalClass]
public partial class ForgeRaiseEventTagExecution : ForgeCustomExecution
{
[Export] ForgeTagContainer EventTags { get; set; } = new();
public override CustomExecution GetExecutionClass()
{
return new FlyingWeaponExecution(EventTags.GetTagContainer());
}
}