Compare commits

...

13 Commits

Author SHA1 Message Date
95616f61fc Implemented mana regeneration
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 40s
Create tag and build when new code gets to main / Export (push) Successful in 5m18s
2026-03-11 16:29:09 +01:00
b15a4fef95 empowered action as a forge ability 2026-03-11 15:56:17 +01:00
14d29d68bb Setup empowered action as a Forge ability 2026-03-10 09:22:39 +01:00
9d612682ec created a normal process function
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 41s
Create tag and build when new code gets to main / Export (push) Successful in 4m39s
2026-03-08 18:12:57 +01:00
9bfe37af62 trying cache
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 30s
Create tag and build when new code gets to main / Export (push) Successful in 4m56s
2026-03-08 10:08:06 +01:00
55eba7fcc8 trying to remove xunit
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 27s
Create tag and build when new code gets to main / Export (push) Failing after 3m37s
2026-03-08 09:49:18 +01:00
7a3e61b86f added lights in dark tutorial area 2026-03-08 09:46:33 +01:00
8153ec07e7 Revert "removing tests because they might break the solution"
This reverts commit 3a21f00528.
2026-03-08 09:44:02 +01:00
ddc85655be Revert "removed internal"
This reverts commit 5408f455af.
2026-03-08 09:43:38 +01:00
c92eb19a1c Revert "removed null!"
This reverts commit 290f79afd4.
2026-03-08 09:43:12 +01:00
290f79afd4 removed null!
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Export (push) Successful in 4m52s
2026-02-26 19:18:27 +01:00
5408f455af removed internal
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Export (push) Successful in 5m2s
2026-02-26 18:56:50 +01:00
3a21f00528 removing tests because they might break the solution
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 21s
Create tag and build when new code gets to main / Export (push) Successful in 4m50s
2026-02-26 18:42:46 +01:00
20 changed files with 294 additions and 56 deletions

View File

@@ -83,6 +83,8 @@ jobs:
Export: Export:
runs-on: godot runs-on: godot
env:
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
needs: needs:
- BumpTag - BumpTag

View File

@@ -126,25 +126,13 @@
<ItemGroup> <ItemGroup>
<Folder Include="addons\" /> <Folder Include="addons\" />
<Folder Include="tests\" /> <Folder Include="tests\" />
<Folder Include="tools\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="RustyOptions" Version="0.10.1" /> <PackageReference Include="RustyOptions" Version="0.10.1" />
</ItemGroup> </ItemGroup>
<Import Project="addons/forge/Forge.props" /> <Import Project="addons/forge/Forge.props" />
<!-- XUnit -->
<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
</ItemGroup>
<!-- gdUnit4 package dependencies --> <!-- gdUnit4 package dependencies -->
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
@@ -155,5 +143,4 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -13,15 +13,10 @@ public partial class ForgeManager : Node
"class.warrior", "class.warrior",
"status.stunned", "status.stunned",
"status.burning", "status.burning",
"status.enraged",
"status.immune.fire", "status.immune.fire",
"cues.damage.fire", "cues.damage.fire",
"events.combat.damage", "events.combat.damage",
"events.combat.hit", "events.combat.hit",
"cooldown.fireball" "cooldown.empoweredAction",
]); ]);
public ForgeManager()
{
}
} }

View File

@@ -0,0 +1,78 @@
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;
using Godot;
namespace Movementtests.forge.abilities;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_animation.png")]
public partial class REmpoweredAction(float cost, float cooldown, float manaRegenPause) : Resource
{
[Export(PropertyHint.Range, "0,100,1,or_greater")]
public float Cost { get; set; } = cost;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float Cooldown { get; set; } = cooldown;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float ManaRegenPause { get; set; } = manaRegenPause;
public REmpoweredAction() : this(20.0f, 1.0f, 3.0f)
{
}
public EffectData CostEffect()
{
return new(
"Empowered Action Mana Cost",
new DurationData(DurationType.Instant),
new[]
{
new Modifier(
"PlayerAttributeSet.Mana",
ModifierOperation.FlatBonus,
new ModifierMagnitude(
MagnitudeCalculationType.ScalableFloat,
new ScalableFloat(-Cost)
)
)
});
}
public EffectData CooldownEffect(TagsManager tagsManager)
{
return new(
"Empowered Action Cooldown",
new DurationData(
DurationType.HasDuration,
new ModifierMagnitude(
MagnitudeCalculationType.ScalableFloat,
new ScalableFloat(Cooldown))),
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
}
}

View File

@@ -0,0 +1 @@
uid://d0l07gcx1ef18

View File

@@ -0,0 +1,46 @@
using Gamesmiths.Forge.Effects;
using Gamesmiths.Forge.Effects.Duration;
using Gamesmiths.Forge.Effects.Magnitudes;
using Gamesmiths.Forge.Effects.Modifiers;
using Gamesmiths.Forge.Effects.Periodic;
using Godot;
namespace Movementtests.tools.effects;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_liquid.png")]
public partial class RManaRegen(float manaRegenRate, float frequency) : Resource
{
[Export(PropertyHint.Range, "0,100,0.1,or_greater")]
public float ManaRegenRate { get; set; } = manaRegenRate;
[Export(PropertyHint.Range, "0.01,1,0.1,or_greater")]
public float Frequency { get; set; } = frequency;
public RManaRegen() : this(1.0f, 0.1f)
{
}
public EffectData ManaRegen()
{
return new EffectData(
"Mana Regen",
durationData: new DurationData(
DurationType.Infinite
),
modifiers: [
new Modifier(
"PlayerAttributeSet.Mana",
ModifierOperation.FlatBonus,
new ModifierMagnitude(
MagnitudeCalculationType.ScalableFloat,
new ScalableFloat(ManaRegenRate * Frequency))
)
],
periodicData: new PeriodicData(
Period: new ScalableFloat(Frequency),
ExecuteOnApplication: true,
PeriodInhibitionRemovedPolicy: PeriodInhibitionRemovedPolicy.ResetPeriod
)
);
}
}

View File

@@ -0,0 +1 @@
uid://di04jvuqp0h7m

View File

@@ -1,5 +0,0 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}

View File

@@ -770,3 +770,10 @@ transform = Transform3D(0.99999994, 0, 0, 0, 1, 0, 0, 0, 0.99999994, -0.5, 0, 0)
[node name="PlayerFellRespawn" parent="." index="10" unique_id=479136076] [node name="PlayerFellRespawn" parent="." index="10" unique_id=479136076]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 1.5, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 1.5, 0)
[node name="OmniLight3D" type="OmniLight3D" parent="." index="13" unique_id=702421172]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 25, 4)
[node name="OmniLight3D2" type="OmniLight3D" parent="." index="14" unique_id=2016820716]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5, 25, -9.5)
omni_range = 12.0

View File

@@ -3,14 +3,10 @@ using System;
using Movementtests.interfaces; using Movementtests.interfaces;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_heart.png")] [GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_heart.png")]
public partial class RHealth : Resource public partial class RHealth(float startingHealth) : Resource
{ {
[Export] [Export]
public float StartingHealth { get; set;} public float StartingHealth { get; set;} = startingHealth;
public RHealth() : this(100.0f) {} public RHealth() : this(100.0f) {}
public RHealth(float startingHealth)
{
StartingHealth = startingHealth;
}
} }

View File

@@ -1,7 +1,14 @@
using System; using System;
using Gamesmiths.Forge.Core;
using Gamesmiths.Forge.Effects;
using Gamesmiths.Forge.Events;
using Gamesmiths.Forge.Tags;
using Godot; using Godot;
using Movementtests.interfaces; using Movementtests.interfaces;
using Movementtests.scenes.enemies;
using Movementtests.scenes.player_controller.scripts;
using Movementtests.systems; using Movementtests.systems;
using Movementtests.tools;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_beetle.png")] [GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_beetle.png")]
public partial class Enemy : CharacterBody3D, public partial class Enemy : CharacterBody3D,
@@ -13,7 +20,8 @@ public partial class Enemy : CharacterBody3D,
ISpawnable, ISpawnable,
IKnockbackable, IKnockbackable,
ITargetable, ITargetable,
IStunnable IStunnable,
IForgeEntity
{ {
// Signals and events // Signals and events
public event Action<IDamageable, DamageRecord> DamageTaken = null!; public event Action<IDamageable, DamageRecord> DamageTaken = null!;
@@ -55,6 +63,12 @@ public partial class Enemy : CharacterBody3D,
set => CHealth.CurrentHealth = value; set => CHealth.CurrentHealth = value;
} }
public EntityAttributes Attributes { get; set; } = null!;
public EntityTags Tags { get; set; } = null!;
public EffectsManager EffectsManager { get; set; } = null!;
public EntityAbilities Abilities { get; set; } = null!;
public EventManager Events { get; set; } = null!;
// Private stuff // Private stuff
private Area3D _damageBox = null!; private Area3D _damageBox = null!;
internal Node3D _target = null!; internal Node3D _target = null!;
@@ -71,6 +85,21 @@ public partial class Enemy : CharacterBody3D,
_damageBox = GetNode<Area3D>("DamageBox"); _damageBox = GetNode<Area3D>("DamageBox");
_target = GetNode<Node3D>("CTarget"); _target = GetNode<Node3D>("CTarget");
// Forge stuff
var forgeManager = GetTree().Root.GetNode<ForgeManager>("ForgeManager")!;
var baseTags = new TagContainer(
forgeManager.TagsManager,
[
Tag.RequestTag(forgeManager.TagsManager, "character.player"),
Tag.RequestTag(forgeManager.TagsManager, "class.warrior")
]);
Attributes = new EntityAttributes(new EnemyAttributeSet());
Tags = new EntityTags(baseTags);
EffectsManager = new EffectsManager(this, forgeManager.CuesManager);
Abilities = new(this);
Events = new();
CDamageable = (GetNode<Node>("CDamageable") as IDamageable)!; CDamageable = (GetNode<Node>("CDamageable") as IDamageable)!;
CMovement = (GetNode<Node>("CMovement") as IMoveable)!; CMovement = (GetNode<Node>("CMovement") as IMoveable)!;
CHealth = (GetNode<Node>("CHealth") as IHealthable)!; CHealth = (GetNode<Node>("CHealth") as IHealthable)!;

View File

@@ -0,0 +1,16 @@
using Gamesmiths.Forge.Attributes;
namespace Movementtests.scenes.enemies;
public class EnemyAttributeSet : AttributeSet
{
public EntityAttribute Health { get; }
public EntityAttribute Strength { get; }
public EntityAttribute Speed { get; }
public EnemyAttributeSet()
{
Health = InitializeAttribute(nameof(Health), 100, 0, 150);
Strength = InitializeAttribute(nameof(Strength), 10, 0, 99);
Speed = InitializeAttribute(nameof(Speed), 5, 0, 10);
}
}

View File

@@ -0,0 +1 @@
uid://nqxdkkg3l7go

View File

@@ -5,6 +5,7 @@
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_x835q"] [ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_x835q"]
[ext_resource type="Script" uid="uid://b44cse62qru7j" path="res://scenes/components/knockback/RKnockback.cs" id="3_cb2lu"] [ext_resource type="Script" uid="uid://b44cse62qru7j" path="res://scenes/components/knockback/RKnockback.cs" id="3_cb2lu"]
[ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://inputs/base_mode/base_mode.tres" id="3_cresl"] [ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://inputs/base_mode/base_mode.tres" id="3_cresl"]
[ext_resource type="Resource" uid="uid://dtmhtlix2amme" path="res://scenes/player_controller/resources/player_mana_regen.tres" id="3_n24vh"]
[ext_resource type="PackedScene" uid="uid://c4ikbhojckpnc" path="res://scenes/components/health/CHealth.tscn" id="3_q7bng"] [ext_resource type="PackedScene" uid="uid://c4ikbhojckpnc" path="res://scenes/components/health/CHealth.tscn" id="3_q7bng"]
[ext_resource type="Script" uid="uid://baiapod3csndf" path="res://scenes/components/health/RHealth.cs" id="4_abfq8"] [ext_resource type="Script" uid="uid://baiapod3csndf" path="res://scenes/components/health/RHealth.cs" id="4_abfq8"]
[ext_resource type="Resource" uid="uid://bjyd801wvverk" path="res://scenes/player_controller/resources/player_health.tres" id="4_m8gvy"] [ext_resource type="Resource" uid="uid://bjyd801wvverk" path="res://scenes/player_controller/resources/player_health.tres" id="4_m8gvy"]
@@ -17,6 +18,7 @@
[ext_resource type="Resource" uid="uid://t612lts1wi1s" path="res://inputs/base_mode/move_right.tres" id="6_q7bng"] [ext_resource type="Resource" uid="uid://t612lts1wi1s" path="res://inputs/base_mode/move_right.tres" id="6_q7bng"]
[ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://scenes/player_controller/scripts/StairsSystem.cs" id="7_bmt5a"] [ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://scenes/player_controller/scripts/StairsSystem.cs" id="7_bmt5a"]
[ext_resource type="Resource" uid="uid://brswsknpgwal2" path="res://inputs/base_mode/move_front.tres" id="7_m8gvy"] [ext_resource type="Resource" uid="uid://brswsknpgwal2" path="res://inputs/base_mode/move_front.tres" id="7_m8gvy"]
[ext_resource type="Resource" uid="uid://7dpkk5rk3di5" path="res://scenes/player_controller/resources/forge_empowered_action.tres" id="7_qheee"]
[ext_resource type="PackedScene" uid="uid://bctpe34ddamg5" path="res://scenes/components/knockback/CKnockback.tscn" id="7_x835q"] [ext_resource type="PackedScene" uid="uid://bctpe34ddamg5" path="res://scenes/components/knockback/CKnockback.tscn" id="7_x835q"]
[ext_resource type="Resource" uid="uid://s1l0n1iitc6m" path="res://inputs/base_mode/move_back.tres" id="8_jb43f"] [ext_resource type="Resource" uid="uid://s1l0n1iitc6m" path="res://inputs/base_mode/move_back.tres" id="8_jb43f"]
[ext_resource type="Resource" uid="uid://j1o5ud0plk4" path="res://inputs/base_mode/aim_release.tres" id="8_lhb11"] [ext_resource type="Resource" uid="uid://j1o5ud0plk4" path="res://inputs/base_mode/aim_release.tres" id="8_lhb11"]
@@ -112,6 +114,8 @@ blend_mode = 1
[node name="Player" type="CharacterBody3D" unique_id=709076448] [node name="Player" type="CharacterBody3D" unique_id=709076448]
collision_mask = 272 collision_mask = 272
script = ExtResource("1_poq2x") script = ExtResource("1_poq2x")
EmpoweredAction = ExtResource("7_qheee")
ManaRegen = ExtResource("3_n24vh")
AimAssistStrength = 0.3 AimAssistStrength = 0.3
AimAssistReductionWhenCloseToTarget = 0.1 AimAssistReductionWhenCloseToTarget = 0.1
AimAssistReductionStartDistance = 8.0 AimAssistReductionStartDistance = 8.0

View File

@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="REmpoweredAction" format=3 uid="uid://7dpkk5rk3di5"]
[ext_resource type="Script" uid="uid://d0l07gcx1ef18" path="res://forge/abilities/REmpoweredAction.cs" id="1_1rxoq"]
[resource]
script = ExtResource("1_1rxoq")
Cost = 50.0
Cooldown = 1.0
ManaRegenPause = 3.0
metadata/_custom_type_script = "uid://d0l07gcx1ef18"

View File

@@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="RManaRegen" format=3 uid="uid://dtmhtlix2amme"]
[ext_resource type="Script" uid="uid://di04jvuqp0h7m" path="res://forge/effects/RManaRegen.cs" id="1_ecb1p"]
[resource]
script = ExtResource("1_ecb1p")
ManaRegenRate = 20.0
Frequency = 0.1
metadata/_custom_type_script = "uid://di04jvuqp0h7m"

View File

@@ -11,7 +11,6 @@ public class PlayerAttributeSet : AttributeSet
public PlayerAttributeSet() public PlayerAttributeSet()
{ {
// Initialize the attributes with the current, min and max values.
Health = InitializeAttribute(nameof(Health), 100, 0, 150); Health = InitializeAttribute(nameof(Health), 100, 0, 150);
Mana = InitializeAttribute(nameof(Mana), 100, 0, 100); Mana = InitializeAttribute(nameof(Mana), 100, 0, 100);
Strength = InitializeAttribute(nameof(Strength), 10, 0, 99); Strength = InitializeAttribute(nameof(Strength), 10, 0, 99);

View File

@@ -1,17 +1,22 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Gamesmiths.Forge.Abilities;
using Gamesmiths.Forge.Core; using Gamesmiths.Forge.Core;
using Gamesmiths.Forge.Effects; using Gamesmiths.Forge.Effects;
using Gamesmiths.Forge.Events; using Gamesmiths.Forge.Events;
using Gamesmiths.Forge.Tags; using Gamesmiths.Forge.Tags;
using Godot; using Godot;
using GodotStateCharts; using GodotStateCharts;
using Movementtests.addons.godot_state_charts.csharp; using Movementtests.addons.godot_state_charts.csharp;
using Movementtests.interfaces; using Movementtests.interfaces;
using Movementtests.systems; using Movementtests.systems;
using Movementtests.player_controller.Scripts; using Movementtests.player_controller.Scripts;
using Movementtests.scenes.player_controller.scripts; using Movementtests.scenes.player_controller.scripts;
using Movementtests.tools; using Movementtests.tools;
using Movementtests.forge.abilities;
using Movementtests.tools.effects;
using RustyOptions; using RustyOptions;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_character.png")] [GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_character.png")]
@@ -92,6 +97,12 @@ public partial class PlayerController : CharacterBody3D,
[Export] public bool HasSword { get; set; } = true; [Export] public bool HasSword { get; set; } = true;
[Export] public bool HasParry { get; set; } = true; [Export] public bool HasParry { get; set; } = true;
// Forge stuff
[ExportCategory("Forge")]
[ExportGroup("General")]
[Export] public REmpoweredAction EmpoweredAction = null!;
[Export] public RManaRegen ManaRegen = null!;
// Combat stuff // Combat stuff
[ExportCategory("Combat")] [ExportCategory("Combat")]
[ExportGroup("General")] [ExportGroup("General")]
@@ -399,6 +410,9 @@ public partial class PlayerController : CharacterBody3D,
private RayCast3D _aimAssisRayCast = null!; private RayCast3D _aimAssisRayCast = null!;
private Camera3D _camera = null!; private Camera3D _camera = null!;
private AbilityHandle? _empoweredActionHandle;
private ActiveEffectHandle? _manaRegenEffectHandle;
public override void _Ready() public override void _Ready()
{ {
LoadSettings(); LoadSettings();
@@ -429,11 +443,27 @@ public partial class PlayerController : CharacterBody3D,
Abilities = new(this); Abilities = new(this);
Events = new(); Events = new();
var empoweredActionData = new AbilityData(
name: "Empowered Action",
costEffect: EmpoweredAction.CostEffect(),
cooldownEffects: [EmpoweredAction.CooldownEffect(forgeManager.TagsManager)],
instancingPolicy: AbilityInstancingPolicy.PerEntity,
behaviorFactory: () => new EmpoweredActionBehavior());
// Grant permanently
_empoweredActionHandle = Abilities.GrantAbilityPermanently(
empoweredActionData,
abilityLevel: 1,
levelOverridePolicy: LevelComparison.None,
sourceEntity: this);
var manaRegenEffect = new Effect(ManaRegen.ManaRegen(), new EffectOwnership(this, this));
_manaRegenEffectHandle = EffectsManager.ApplyEffect(manaRegenEffect);
var health = Attributes["PlayerAttributeSet.Health"].CurrentValue; // 100 var health = Attributes["PlayerAttributeSet.Health"].CurrentValue; // 100
var mana = Attributes["PlayerAttributeSet.Mana"].CurrentValue; // 100 var mana = Attributes["PlayerAttributeSet.Mana"].CurrentValue; // 100
var strength = Attributes["PlayerAttributeSet.Strength"].CurrentValue; // 10 var strength = Attributes["PlayerAttributeSet.Strength"].CurrentValue; // 10
var speed = Attributes["PlayerAttributeSet.Speed"].CurrentValue; // 5 var speed = Attributes["PlayerAttributeSet.Speed"].CurrentValue; // 5
GD.Print(health, mana, strength, speed);
// DashIndicator = GetNode<TextureRect>("%DashIndicator"); // DashIndicator = GetNode<TextureRect>("%DashIndicator");
PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator"); PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator");
@@ -1913,10 +1943,53 @@ public partial class PlayerController : CharacterBody3D,
public bool CanPerformEmpoweredAction() public bool CanPerformEmpoweredAction()
{ {
if(_empoweredActionHandle == null) return false;
var cooldowns = _empoweredActionHandle.GetCooldownData();
foreach (var cd in cooldowns)
{
//GD.Print($"Cooldown remaining: {cd.RemainingTime}");
}
var costs = _empoweredActionHandle.GetCostData();
foreach (var cost in costs)
{
// Assuming you want to check Mana costs
if (cost.Attribute == "PlayerAttributeSet.Mana")
{
//GD.Print($"Mana Cost: {cost.Cost}");
}
}
var canActivate = _empoweredActionHandle.CanActivate(out var failures);
if (!canActivate)
{
GD.PrintErr($"Cannot activate empowered action: {failures}");
if (failures.HasFlag(AbilityActivationFailures.Cooldown)) GD.PrintErr("In Cooldown");
if (failures.HasFlag(AbilityActivationFailures.InsufficientResources)) GD.PrintErr("Not Enough Mana");
}
return canActivate;
return EmpoweredActionsLeft > 0 && TutorialDone; return EmpoweredActionsLeft > 0 && TutorialDone;
} }
public void PerformEmpoweredAction() public void PerformEmpoweredAction()
{ {
if(_empoweredActionHandle == null) return;
var canActivate = _empoweredActionHandle.Activate(out var failures);
if (!canActivate)
{
GD.PrintErr($"Cannot activate empowered action: {failures}");
if (failures.HasFlag(AbilityActivationFailures.Cooldown)) GD.PrintErr("In Cooldown");
if (failures.HasFlag(AbilityActivationFailures.InsufficientResources)) GD.PrintErr("Not Enough Mana");
}
else
{
GD.Print($"Remaining mana: {Attributes["PlayerAttributeSet.Mana"].CurrentValue}");
}
// Inhibit Mana Regeneration for a while after using an empowered action
// TODO: Use Forge events instead of relying on direct referencing
_manaRegenEffectHandle!.SetInhibit(true);
GetTree().CreateTimer(EmpoweredAction.ManaRegenPause).Timeout += () => {_manaRegenEffectHandle!.SetInhibit(false);};
_isWallJumpAvailable = true; _isWallJumpAvailable = true;
_canDashAirborne = true; _canDashAirborne = true;
EmpoweredActionsLeft--; EmpoweredActionsLeft--;
@@ -2223,14 +2296,10 @@ public partial class PlayerController : CharacterBody3D,
_spaceState = GetWorld3D().DirectSpaceState; _spaceState = GetWorld3D().DirectSpaceState;
if (_currentInputBufferFrames > 0) _currentInputBufferFrames -= 1; if (_currentInputBufferFrames > 0) _currentInputBufferFrames -= 1;
// Limit maximum speed // Limit maximum speed
if (Velocity.Length() > AbsoluteMaxSpeed) if (Velocity.Length() > AbsoluteMaxSpeed)
Velocity = Velocity.Normalized() * AbsoluteMaxSpeed; Velocity = Velocity.Normalized() * AbsoluteMaxSpeed;
// Manage head and camera movement
LookAround(delta);
// Manage general movement // Manage general movement
Velocity += ComputeKnockback(); Velocity += ComputeKnockback();
MoveSlideAndHandleStairs((float) delta); MoveSlideAndHandleStairs((float) delta);
@@ -2238,19 +2307,15 @@ public partial class PlayerController : CharacterBody3D,
// Manage gameplay systems // Manage gameplay systems
MantleSystem.ProcessMantle(_grounded.Active); MantleSystem.ProcessMantle(_grounded.Active);
HandleEnemyTargeting(); HandleEnemyTargeting();
}
// Manage dash target and tutorial specific stuff public override void _Process(double delta)
// if (WeaponSystem.InHandState.Active && !_aiming.Active && TutorialDone) {
// { // Manage head and camera movement
// DashIndicatorMesh.Visible = false; LookAround(delta);
// }
// if (!WeaponSystem.InHandState.Active && TutorialDone) EffectsManager.UpdateEffects(delta);
// { GD.Print(Attributes["PlayerAttributeSet.Mana"].CurrentValue);
// DashIndicatorMesh.Visible = true;
//
// DashIndicatorMeshCylinder.Height = WeaponSystem.GlobalPosition.DistanceTo(GlobalPosition) * 2;
// DashIndicatorNode.LookAt(WeaponSystem.GlobalPosition);
// }
} }
/////////////////////////// ///////////////////////////

View File

@@ -1,3 +0,0 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
}