Setup empowered action as a Forge ability
This commit is contained in:
22
forge/ForgeManager.cs
Normal file
22
forge/ForgeManager.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Gamesmiths.Forge.Cues;
|
||||
using Gamesmiths.Forge.Tags;
|
||||
using Godot;
|
||||
|
||||
namespace Movementtests.tools;
|
||||
|
||||
public partial class ForgeManager : Node
|
||||
{
|
||||
public CuesManager CuesManager { get; private set; } = new CuesManager();
|
||||
public TagsManager TagsManager { get; private set; } = new TagsManager(
|
||||
[
|
||||
"character.player",
|
||||
"class.warrior",
|
||||
"status.stunned",
|
||||
"status.burning",
|
||||
"status.immune.fire",
|
||||
"cues.damage.fire",
|
||||
"events.combat.damage",
|
||||
"events.combat.hit",
|
||||
"cooldown.empoweredAction",
|
||||
]);
|
||||
}
|
||||
1
forge/ForgeManager.cs.uid
Normal file
1
forge/ForgeManager.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c75tpswl62eew
|
||||
56
forge/abilities/EmpoweredActionBehavior.cs
Normal file
56
forge/abilities/EmpoweredActionBehavior.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Gamesmiths.Forge.Abilities;
|
||||
using Gamesmiths.Forge.Effects;
|
||||
using Gamesmiths.Forge.Effects.Components;
|
||||
using Gamesmiths.Forge.Effects.Duration;
|
||||
using Gamesmiths.Forge.Effects.Magnitudes;
|
||||
using Gamesmiths.Forge.Effects.Modifiers;
|
||||
using Gamesmiths.Forge.Tags;
|
||||
|
||||
namespace Movementtests.forge.abilities;
|
||||
|
||||
public class EmpoweredAction(TagsManager tagsManager)
|
||||
{
|
||||
public EffectData EmpoweredActionCostEffect = new(
|
||||
"Empowered Action Mana Cost",
|
||||
new DurationData(DurationType.Instant),
|
||||
new[] {
|
||||
new Modifier(
|
||||
"PlayerAttributeSet.Mana",
|
||||
ModifierOperation.FlatBonus,
|
||||
new ModifierMagnitude(
|
||||
MagnitudeCalculationType.ScalableFloat,
|
||||
new ScalableFloat(-20)
|
||||
)
|
||||
)
|
||||
});
|
||||
|
||||
public EffectData EmpoweredActionCooldown = new(
|
||||
"Empowered Action Cooldown",
|
||||
new DurationData(
|
||||
DurationType.HasDuration,
|
||||
new ModifierMagnitude(
|
||||
MagnitudeCalculationType.ScalableFloat,
|
||||
new ScalableFloat(1.0f))),
|
||||
effectComponents: new[] {
|
||||
new ModifierTagsEffectComponent(
|
||||
tagsManager.RequestTagContainer(new[] { "cooldown.empoweredAction" })
|
||||
)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class EmpoweredActionBehavior : IAbilityBehavior
|
||||
{
|
||||
public void OnStarted(AbilityBehaviorContext context)
|
||||
{
|
||||
// Apply costs and cooldowns
|
||||
context.AbilityHandle.CommitAbility();
|
||||
context.InstanceHandle.End();
|
||||
}
|
||||
|
||||
public void OnEnded(AbilityBehaviorContext context)
|
||||
{
|
||||
// Do any necessary cleanups
|
||||
}
|
||||
}
|
||||
1
forge/abilities/EmpoweredActionBehavior.cs.uid
Normal file
1
forge/abilities/EmpoweredActionBehavior.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d0l07gcx1ef18
|
||||
Reference in New Issue
Block a user