Replaced the entire mana usage and inhibition with the provided forge resources

This commit is contained in:
2026-04-03 16:35:15 +02:00
parent 673368a200
commit bfa1f251dd
17 changed files with 356 additions and 389 deletions

View File

@@ -4,4 +4,4 @@
[resource] [resource]
script = ExtResource("1_x0pne") script = ExtResource("1_x0pne")
RegisteredTags = Array[String](["character.player", "character.enemy", "weapon", "status.stunned", "status.burning", "status.frozen", "abilities.weapon.land", "abilities.weapon.flying", "abilities.weapon.left", "events.combat.damage", "events.combat.hit", "events.weapon.flyingTick", "events.weapon.startedFlying", "events.weapon.stoppedFlying", "events.weapon.handToFlying", "events.weapon.flyingToHand", "events.weapon.plantedToHand", "events.weapon.plantedToFlying", "events.weapon.planted", "cooldown.empoweredAction", "cooldown.empoweredSwordThrow", "cues.resources.mana"]) RegisteredTags = Array[String](["character.player", "character.enemy", "weapon", "status.stunned", "status.burning", "status.frozen", "abilities.weapon.land", "abilities.weapon.flying", "abilities.weapon.left", "events.combat.damage", "events.combat.hit", "events.weapon.flyingTick", "events.weapon.startedFlying", "events.weapon.stoppedFlying", "events.weapon.handToFlying", "events.weapon.flyingToHand", "events.weapon.plantedToHand", "events.weapon.plantedToFlying", "events.weapon.planted", "cooldown.empoweredAction", "cooldown.empoweredSwordThrow", "cues.resources.mana", "events.player.empowered_action_used", "character.player.mana", "character.player.mana.regen", "character.player.mana.regen.inhibited"])

View File

@@ -1,26 +0,0 @@
using System;
using Gamesmiths.Forge.Abilities;
using Gamesmiths.Forge.Cues;
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;
using Movementtests.interfaces;
namespace Movementtests.forge.abilities;
[GlobalClass]
public partial class RAbilityBase : Resource
{
public RAbilityBase()
{
}
public virtual AbilityData Ability(TagContainer? tags, Node3D owner)
{
throw new NotImplementedException();
}
}

View File

@@ -1 +0,0 @@
uid://4eosgwb3h528

View File

@@ -1,99 +0,0 @@
using Gamesmiths.Forge.Abilities;
using Gamesmiths.Forge.Cues;
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 AbilityData Ability(TagsManager tagsManager)
{
return new AbilityData(
name: "Empowered Action",
costEffect: CostEffect(tagsManager),
cooldownEffects: [CooldownEffect(tagsManager)],
instancingPolicy: AbilityInstancingPolicy.PerEntity,
behaviorFactory: () => new EmpoweredActionBehavior());
}
public EffectData CostEffect(TagsManager tagsManager)
{
return new(
"Empowered Action Mana Cost",
new DurationData(DurationType.Instant),
new[]
{
new Modifier(
"PlayerAttributeSet.Mana",
ModifierOperation.FlatBonus,
new ModifierMagnitude(
MagnitudeCalculationType.ScalableFloat,
new ScalableFloat(-Cost)
)
)
},
cues: new []
{
new CueData(
CueTags: Tag.RequestTag(tagsManager, "cues.resources.mana").GetSingleTagContainer(),
MinValue: 0,
MaxValue: 100,
MagnitudeType: CueMagnitudeType.AttributeValueChange,
MagnitudeAttribute: "PlayerAttributeSet.Mana"
)
});
}
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

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

View File

@@ -1,58 +0,0 @@
using Gamesmiths.Forge.Cues;
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 Gamesmiths.Forge.Tags;
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.01,or_greater")]
public float Frequency { get; set; } = frequency;
public RManaRegen() : this(1.0f, 0.1f)
{
}
public EffectData ManaRegen(TagsManager tagsManager)
{
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))
)
],
cues: new []
{
new CueData(
CueTags: Tag.RequestTag(tagsManager, "cues.resources.mana").GetSingleTagContainer(),
MinValue: 0,
MaxValue: 100,
MagnitudeType: CueMagnitudeType.AttributeValueChange,
MagnitudeAttribute: "PlayerAttributeSet.Mana"
)
},
periodicData: new PeriodicData(
Period: new ScalableFloat(Frequency),
ExecuteOnApplication: true,
PeriodInhibitionRemovedPolicy: PeriodInhibitionRemovedPolicy.ResetPeriod
)
);
}
}

View File

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

View File

@@ -4,4 +4,4 @@
[resource] [resource]
script = ExtResource("1_l686n") script = ExtResource("1_l686n")
RegisteredTags = Array[String](["effect.fire", "effect.wet", "cue.floating.text", "cue.vfx.fire", "cue.vfx.wet", "cue.vfx.regen", "cooldown.enemy.attack", "set_by_caller.damage", "event.damage", "cooldown", "cooldown.skill.projectile", "cooldown.skill.shield", "cooldown.skill.dash", "movement.block", "immunity.damage", "effect.mana_shield", "cue.vfx.shield", "event.damage.taken", "event.damage.dealt", "event", "set_by_caller", "trait.flammable", "trait.healable", "trait.damageable", "trait.wettable", "cue.vfx.reflect", "cue.vfx", "cooldown.skill", "cooldown.skill.reflect"]) RegisteredTags = Array[String](["effect.fire", "effect.wet", "cue.floating.text", "cue.vfx.fire", "cue.vfx.wet", "cue.vfx.regen", "cooldown.enemy.attack", "set_by_caller.damage", "event.damage", "cooldown", "cooldown.skill.projectile", "cooldown.skill.shield", "cooldown.skill.dash", "movement.block", "immunity.damage", "effect.mana_shield", "cue.vfx.shield", "event", "event.player.empowered_action_used", "event.damage.taken", "event.damage.dealt", "set_by_caller", "trait.flammable", "trait.healable", "trait.damageable", "trait.wettable", "cue.vfx.reflect", "cue.vfx", "cooldown.skill", "cooldown.skill.reflect"])

View File

@@ -5,18 +5,19 @@
[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="Resource" uid="uid://cdxbwirfiaipi" path="res://scenes/player_controller/resources/forge/exploding_sword_throw.tres" id="4_11013"] [ext_resource type="Resource" uid="uid://cdxbwirfiaipi" path="res://scenes/player_controller/resources/forge/exploding_sword_throw.tres" id="4_11013"]
[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"]
[ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://inputs/base_mode/rotate_y.tres" id="4_rxwoh"] [ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://inputs/base_mode/rotate_y.tres" id="4_rxwoh"]
[ext_resource type="Resource" uid="uid://dh437cuxgjv6b" path="res://scenes/player_controller/resources/forge/mana_regeneration.tres" id="5_2rkt1"]
[ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"] [ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"]
[ext_resource type="PackedScene" uid="uid://hpsg4fqwrx1u" path="res://scenes/components/damage/CDamageable.tscn" id="5_jb43f"] [ext_resource type="PackedScene" uid="uid://hpsg4fqwrx1u" path="res://scenes/components/damage/CDamageable.tscn" id="5_jb43f"]
[ext_resource type="Resource" uid="uid://f3vs6l4m623s" path="res://inputs/base_mode/move_left.tres" id="5_q14ux"] [ext_resource type="Resource" uid="uid://f3vs6l4m623s" path="res://inputs/base_mode/move_left.tres" id="5_q14ux"]
[ext_resource type="PackedScene" uid="uid://duju3atqgltkg" path="res://scenes/explosion/explosion.tscn" id="5_ue7xq"] [ext_resource type="PackedScene" uid="uid://duju3atqgltkg" path="res://scenes/explosion/explosion.tscn" id="5_ue7xq"]
[ext_resource type="Resource" uid="uid://dyru7mxo121w6" path="res://scenes/player_controller/resources/player_normal_damage_mod.tres" id="6_cmijs"] [ext_resource type="Resource" uid="uid://dyru7mxo121w6" path="res://scenes/player_controller/resources/player_normal_damage_mod.tres" id="6_cmijs"]
[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="Resource" uid="uid://cffil4tic3ysg" path="res://scenes/player_controller/resources/forge/inhibit_mana_regen_temporarily.tres" id="6_u8yay"]
[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="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"]
@@ -27,12 +28,13 @@
[ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://scenes/player_controller/components/mantle/mantle_system.tscn" id="8_qu4wy"] [ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://scenes/player_controller/components/mantle/mantle_system.tscn" id="8_qu4wy"]
[ext_resource type="AudioStream" uid="uid://clfggn87oeg1s" path="res://scenes/player_controller/audio/InteractiveSFX.tres" id="9_jb43f"] [ext_resource type="AudioStream" uid="uid://clfggn87oeg1s" path="res://scenes/player_controller/audio/InteractiveSFX.tres" id="9_jb43f"]
[ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://inputs/base_mode/aim_pressed.tres" id="9_nob5r"] [ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://inputs/base_mode/aim_pressed.tres" id="9_nob5r"]
[ext_resource type="Resource" uid="uid://dccuj66egxfwh" path="res://scenes/player_controller/resources/empowered_action.tres" id="10_2rkt1"] [ext_resource type="Resource" uid="uid://dccuj66egxfwh" path="res://scenes/player_controller/resources/forge/empowered_action.tres" id="10_2rkt1"]
[ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://inputs/base_mode/jump.tres" id="10_4u7i3"] [ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://inputs/base_mode/jump.tres" id="10_4u7i3"]
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="10_pw5r7"] [ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="10_pw5r7"]
[ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="11_2rkt1"] [ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="11_2rkt1"]
[ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://inputs/base_mode/hit.tres" id="11_cresl"] [ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://inputs/base_mode/hit.tres" id="11_cresl"]
[ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://scenes/player_controller/components/head/head_system.tscn" id="11_rxwoh"] [ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://scenes/player_controller/components/head/head_system.tscn" id="11_rxwoh"]
[ext_resource type="Script" uid="uid://dpakv7agvir6y" path="res://addons/forge/resources/ForgeTag.cs" id="11_u8yay"]
[ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://inputs/base_mode/dash.tres" id="12_34snm"] [ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://inputs/base_mode/dash.tres" id="12_34snm"]
[ext_resource type="Resource" uid="uid://55b0dsvioj08" path="res://inputs/base_mode/jump_pressed.tres" id="13_nob5r"] [ext_resource type="Resource" uid="uid://55b0dsvioj08" path="res://inputs/base_mode/jump_pressed.tres" id="13_nob5r"]
[ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://scenes/player_controller/resources/PlayerShape.tres" id="13_r7i3q"] [ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://scenes/player_controller/resources/PlayerShape.tres" id="13_r7i3q"]
@@ -58,6 +60,11 @@
[ext_resource type="Texture2D" uid="uid://c40orhfdgsim" path="res://assets/ui/IconGodotNode/white/icon_circle.png" id="45_u8rdp"] [ext_resource type="Texture2D" uid="uid://c40orhfdgsim" path="res://assets/ui/IconGodotNode/white/icon_circle.png" id="45_u8rdp"]
[ext_resource type="PackedScene" uid="uid://cyw8p0p6a78tl" path="res://scenes/ui/healthbar/healthbar.tscn" id="47_76kmc"] [ext_resource type="PackedScene" uid="uid://cyw8p0p6a78tl" path="res://scenes/ui/healthbar/healthbar.tscn" id="47_76kmc"]
[sub_resource type="Resource" id="Resource_5gbhg"]
script = ExtResource("11_u8yay")
Tag = "events.player.empowered_action_used"
metadata/_custom_type_script = "uid://dpakv7agvir6y"
[sub_resource type="Resource" id="Resource_cb2lu"] [sub_resource type="Resource" id="Resource_cb2lu"]
script = ExtResource("2_x835q") script = ExtResource("2_x835q")
DamageDealt = 10.0 DamageDealt = 10.0
@@ -142,9 +149,11 @@ bg_color = Color(0.15869555, 0.64034444, 0.906125, 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")
ManaRegen = ExtResource("3_n24vh") EmpoweredActionUsed = SubResource("Resource_5gbhg")
EmpoweredActionAbility = ExtResource("10_2rkt1") EmpoweredActionAbility = ExtResource("10_2rkt1")
AbilityLoadout = [ExtResource("4_11013")] AbilityLoadout = [ExtResource("4_11013")]
DefaultPermanentEffects = [ExtResource("5_2rkt1")]
EmpoweredActionEffects = [ExtResource("6_u8yay")]
AimAssistStrength = 0.3 AimAssistStrength = 0.3
AimAssistReductionWhenCloseToTarget = 0.1 AimAssistReductionWhenCloseToTarget = 0.1
AimAssistReductionStartDistance = 8.0 AimAssistReductionStartDistance = 8.0

View File

@@ -107,9 +107,6 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
public Tag WeaponFlyingAbilityTag; public Tag WeaponFlyingAbilityTag;
private RAbilityBase? _flyingAbility;
public List<RAbilityBase> AbilityLoadout { get; } = [];
public void Init() public void Init()
{ {
_weaponState = StateChart.Of(GetNode("StateChart")); _weaponState = StateChart.Of(GetNode("StateChart"));

View File

@@ -1,156 +0,0 @@
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://dccuj66egxfwh"]
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="1_7rg1m"]
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="1_16foq"]
[ext_resource type="Resource" uid="uid://crgwob8t8yysq" path="res://scenes/player_controller/resources/forge/instant_end_behavior.tres" id="1_odwcb"]
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="1_qpqxp"]
[ext_resource type="Script" uid="uid://2gm1hdhi8u08" path="res://addons/forge/resources/magnitudes/ForgeModifierMagnitude.cs" id="2_3t6pm"]
[ext_resource type="Script" uid="uid://dngf30hxy5go4" path="res://addons/forge/resources/components/ModifierTags.cs" id="2_g4w5p"]
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="3_16foq"]
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="4_g4w5p"]
[ext_resource type="Script" uid="uid://cmrsxccn0ei4j" path="res://addons/forge/resources/ForgeCue.cs" id="7_ekcln"]
[ext_resource type="Script" uid="uid://bdfcavbjyhxxa" path="res://addons/forge/resources/ForgeModifier.cs" id="8_odwcb"]
[sub_resource type="Resource" id="Resource_h116a"]
script = ExtResource("1_16foq")
ContainerTags = Array[String](["cooldown.empoweredaction"])
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
[sub_resource type="Resource" id="Resource_mgrka"]
script = ExtResource("2_g4w5p")
TagsToAdd = SubResource("Resource_h116a")
metadata/_custom_type_script = "uid://dngf30hxy5go4"
[sub_resource type="Resource" id="Resource_ekcln"]
script = ExtResource("1_qpqxp")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_odwcb"]
script = ExtResource("1_qpqxp")
[sub_resource type="Resource" id="Resource_psy6a"]
script = ExtResource("1_qpqxp")
[sub_resource type="Resource" id="Resource_j4bwy"]
script = ExtResource("1_qpqxp")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_s60jg"]
script = ExtResource("1_qpqxp")
[sub_resource type="Resource" id="Resource_wdif6"]
script = ExtResource("1_qpqxp")
[sub_resource type="Resource" id="Resource_inx6r"]
script = ExtResource("1_qpqxp")
BaseValue = 0.5
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
[sub_resource type="Resource" id="Resource_4jm88"]
script = ExtResource("2_3t6pm")
ScalableFloat = SubResource("Resource_inx6r")
Coefficient = SubResource("Resource_j4bwy")
PreMultiplyAdditiveValue = SubResource("Resource_wdif6")
PostMultiplyAdditiveValue = SubResource("Resource_s60jg")
CalculatorCoefficient = SubResource("Resource_ekcln")
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_psy6a")
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_odwcb")
metadata/_custom_type_script = "uid://2gm1hdhi8u08"
[sub_resource type="Resource" id="Resource_lmnuh"]
script = ExtResource("3_16foq")
BaseValue = 1
[sub_resource type="Resource" id="Resource_xp6fe"]
script = ExtResource("3_16foq")
BaseValue = 1
[sub_resource type="Resource" id="Resource_egh2b"]
script = ExtResource("4_g4w5p")
Name = "Empowered Action Cooldown"
Modifiers = []
Components = Array[Object]([SubResource("Resource_mgrka")])
Executions = []
DurationType = 2
Duration = SubResource("Resource_4jm88")
StackLimit = SubResource("Resource_xp6fe")
InitialStack = SubResource("Resource_lmnuh")
Cues = []
metadata/_custom_type_script = "uid://b83hf13nj37k3"
[sub_resource type="Resource" id="Resource_4mhqs"]
script = ExtResource("1_16foq")
ContainerTags = Array[String](["cues.resources.mana"])
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
[sub_resource type="Resource" id="Resource_itmis"]
script = ExtResource("7_ekcln")
CueKeys = SubResource("Resource_4mhqs")
MaxValue = 100
MagnitudeType = 2
MagnitudeAttribute = "PlayerAttributeSet.Mana"
metadata/_custom_type_script = "uid://cmrsxccn0ei4j"
[sub_resource type="Resource" id="Resource_8dsdw"]
script = ExtResource("3_16foq")
BaseValue = 1
[sub_resource type="Resource" id="Resource_clulf"]
script = ExtResource("1_qpqxp")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_4kkx2"]
script = ExtResource("1_qpqxp")
[sub_resource type="Resource" id="Resource_5vdhj"]
script = ExtResource("1_qpqxp")
[sub_resource type="Resource" id="Resource_nx5he"]
script = ExtResource("1_qpqxp")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_st5kh"]
script = ExtResource("1_qpqxp")
[sub_resource type="Resource" id="Resource_wl5ql"]
script = ExtResource("1_qpqxp")
[sub_resource type="Resource" id="Resource_uv4a1"]
script = ExtResource("1_qpqxp")
BaseValue = -30.0
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
[sub_resource type="Resource" id="Resource_dhni4"]
script = ExtResource("8_odwcb")
Attribute = "PlayerAttributeSet.Mana"
ScalableFloat = SubResource("Resource_uv4a1")
Coefficient = SubResource("Resource_nx5he")
PreMultiplyAdditiveValue = SubResource("Resource_wl5ql")
PostMultiplyAdditiveValue = SubResource("Resource_st5kh")
CalculatorCoefficient = SubResource("Resource_clulf")
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_5vdhj")
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_4kkx2")
metadata/_custom_type_script = "uid://bdfcavbjyhxxa"
[sub_resource type="Resource" id="Resource_w5rmc"]
script = ExtResource("3_16foq")
BaseValue = 1
[sub_resource type="Resource" id="Resource_mtef8"]
script = ExtResource("4_g4w5p")
Name = "Empowered Action Cost"
Modifiers = Array[Object]([SubResource("Resource_dhni4")])
Components = []
Executions = []
StackLimit = SubResource("Resource_w5rmc")
InitialStack = SubResource("Resource_8dsdw")
Cues = Array[Object]([SubResource("Resource_itmis")])
metadata/_custom_type_script = "uid://b83hf13nj37k3"
[resource]
script = ExtResource("1_7rg1m")
Name = "Empowered Action"
CooldownEffects = [SubResource("Resource_egh2b")]
CostEffect = SubResource("Resource_mtef8")
AbilityBehavior = ExtResource("1_odwcb")
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"

View File

@@ -1,10 +1,143 @@
[gd_resource type="Resource" script_class="REmpoweredAction" format=3 uid="uid://7dpkk5rk3di5"] [gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://dccuj66egxfwh"]
[ext_resource type="Script" uid="uid://d0l07gcx1ef18" path="res://forge/abilities/REmpoweredAction.cs" id="1_1rxoq"] [ext_resource type="Resource" uid="uid://crgwob8t8yysq" path="res://scenes/player_controller/resources/forge/instant_end_behavior.tres" id="1_x7d0c"]
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_prg0a"]
[ext_resource type="Script" uid="uid://dngf30hxy5go4" path="res://addons/forge/resources/components/ModifierTags.cs" id="3_k72m0"]
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="4_5fdax"]
[ext_resource type="Script" uid="uid://2gm1hdhi8u08" path="res://addons/forge/resources/magnitudes/ForgeModifierMagnitude.cs" id="5_5qmmj"]
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="6_yi0bg"]
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="7_0rp6y"]
[ext_resource type="Resource" uid="uid://dn7b8frkoxpxr" path="res://scenes/player_controller/resources/forge/player_mana_changed_cue.tres" id="8_0olwd"]
[ext_resource type="Script" uid="uid://bdfcavbjyhxxa" path="res://addons/forge/resources/ForgeModifier.cs" id="9_wluo0"]
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="10_2sq4o"]
[sub_resource type="Resource" id="Resource_h116a"]
script = ExtResource("2_prg0a")
ContainerTags = Array[String](["cooldown.empoweredaction"])
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
[sub_resource type="Resource" id="Resource_mgrka"]
script = ExtResource("3_k72m0")
TagsToAdd = SubResource("Resource_h116a")
metadata/_custom_type_script = "uid://dngf30hxy5go4"
[sub_resource type="Resource" id="Resource_ekcln"]
script = ExtResource("4_5fdax")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_odwcb"]
script = ExtResource("4_5fdax")
[sub_resource type="Resource" id="Resource_psy6a"]
script = ExtResource("4_5fdax")
[sub_resource type="Resource" id="Resource_j4bwy"]
script = ExtResource("4_5fdax")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_s60jg"]
script = ExtResource("4_5fdax")
[sub_resource type="Resource" id="Resource_wdif6"]
script = ExtResource("4_5fdax")
[sub_resource type="Resource" id="Resource_inx6r"]
script = ExtResource("4_5fdax")
BaseValue = 0.5
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
[sub_resource type="Resource" id="Resource_4jm88"]
script = ExtResource("5_5qmmj")
ScalableFloat = SubResource("Resource_inx6r")
Coefficient = SubResource("Resource_j4bwy")
PreMultiplyAdditiveValue = SubResource("Resource_wdif6")
PostMultiplyAdditiveValue = SubResource("Resource_s60jg")
CalculatorCoefficient = SubResource("Resource_ekcln")
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_psy6a")
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_odwcb")
metadata/_custom_type_script = "uid://2gm1hdhi8u08"
[sub_resource type="Resource" id="Resource_lmnuh"]
script = ExtResource("6_yi0bg")
BaseValue = 1
[sub_resource type="Resource" id="Resource_xp6fe"]
script = ExtResource("6_yi0bg")
BaseValue = 1
[sub_resource type="Resource" id="Resource_egh2b"]
script = ExtResource("7_0rp6y")
Name = "Empowered Action Cooldown"
Modifiers = []
Components = Array[Object]([SubResource("Resource_mgrka")])
Executions = []
DurationType = 2
Duration = SubResource("Resource_4jm88")
StackLimit = SubResource("Resource_xp6fe")
InitialStack = SubResource("Resource_lmnuh")
Cues = []
metadata/_custom_type_script = "uid://b83hf13nj37k3"
[sub_resource type="Resource" id="Resource_8dsdw"]
script = ExtResource("6_yi0bg")
BaseValue = 1
[sub_resource type="Resource" id="Resource_clulf"]
script = ExtResource("4_5fdax")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_4kkx2"]
script = ExtResource("4_5fdax")
[sub_resource type="Resource" id="Resource_5vdhj"]
script = ExtResource("4_5fdax")
[sub_resource type="Resource" id="Resource_nx5he"]
script = ExtResource("4_5fdax")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_st5kh"]
script = ExtResource("4_5fdax")
[sub_resource type="Resource" id="Resource_wl5ql"]
script = ExtResource("4_5fdax")
[sub_resource type="Resource" id="Resource_uv4a1"]
script = ExtResource("4_5fdax")
BaseValue = -30.0
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
[sub_resource type="Resource" id="Resource_dhni4"]
script = ExtResource("9_wluo0")
Attribute = "PlayerAttributeSet.Mana"
ScalableFloat = SubResource("Resource_uv4a1")
Coefficient = SubResource("Resource_nx5he")
PreMultiplyAdditiveValue = SubResource("Resource_wl5ql")
PostMultiplyAdditiveValue = SubResource("Resource_st5kh")
CalculatorCoefficient = SubResource("Resource_clulf")
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_5vdhj")
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_4kkx2")
metadata/_custom_type_script = "uid://bdfcavbjyhxxa"
[sub_resource type="Resource" id="Resource_w5rmc"]
script = ExtResource("6_yi0bg")
BaseValue = 1
[sub_resource type="Resource" id="Resource_mtef8"]
script = ExtResource("7_0rp6y")
Name = "Empowered Action Cost"
Modifiers = Array[Object]([SubResource("Resource_dhni4")])
Components = []
Executions = []
StackLimit = SubResource("Resource_w5rmc")
InitialStack = SubResource("Resource_8dsdw")
Cues = Array[Object]([ExtResource("8_0olwd")])
metadata/_custom_type_script = "uid://b83hf13nj37k3"
[resource] [resource]
script = ExtResource("1_1rxoq") script = ExtResource("10_2sq4o")
Cost = 30.0 Name = "Empowered Action"
Cooldown = 0.5 CooldownEffects = [SubResource("Resource_egh2b")]
ManaRegenPause = 2.0 CostEffect = SubResource("Resource_mtef8")
metadata/_custom_type_script = "uid://d0l07gcx1ef18" AbilityBehavior = ExtResource("1_x7d0c")
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"

View File

@@ -1,24 +0,0 @@
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://ifeavnlps7hy"]
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="1_l3coe"]
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="1_ot53g"]
[ext_resource type="Script" uid="uid://dpakv7agvir6y" path="res://addons/forge/resources/ForgeTag.cs" id="2_un8hi"]
[sub_resource type="Resource" id="Resource_l76xb"]
script = ExtResource("1_l3coe")
ContainerTags = Array[String](["abilities.weapon"])
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
[sub_resource type="Resource" id="Resource_g5tg7"]
script = ExtResource("2_un8hi")
Tag = "events.weapon.startedflying"
metadata/_custom_type_script = "uid://dpakv7agvir6y"
[resource]
script = ExtResource("1_ot53g")
Name = "Exploding Sword"
CooldownEffects = null
TriggerSource = 1
TriggerTag = SubResource("Resource_g5tg7")
AbilityTags = SubResource("Resource_l76xb")
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"

View File

@@ -0,0 +1,75 @@
[gd_resource type="Resource" script_class="ForgeEffectData" format=3 uid="uid://cffil4tic3ysg"]
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="1_bi1d8"]
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="1_qae83"]
[ext_resource type="Script" uid="uid://dngf30hxy5go4" path="res://addons/forge/resources/components/ModifierTags.cs" id="1_scapu"]
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="2_scapu"]
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="3_fp8ou"]
[ext_resource type="Script" uid="uid://2gm1hdhi8u08" path="res://addons/forge/resources/magnitudes/ForgeModifierMagnitude.cs" id="4_xxxse"]
[sub_resource type="Resource" id="Resource_gi65x"]
script = ExtResource("1_bi1d8")
ContainerTags = Array[String](["character.player.mana.regen.inhibited"])
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
[sub_resource type="Resource" id="Resource_bi1d8"]
script = ExtResource("1_scapu")
TagsToAdd = SubResource("Resource_gi65x")
metadata/_custom_type_script = "uid://dngf30hxy5go4"
[sub_resource type="Resource" id="Resource_pqllu"]
script = ExtResource("3_fp8ou")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_1inmd"]
script = ExtResource("3_fp8ou")
[sub_resource type="Resource" id="Resource_cv55m"]
script = ExtResource("3_fp8ou")
[sub_resource type="Resource" id="Resource_68n87"]
script = ExtResource("3_fp8ou")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_og1rv"]
script = ExtResource("3_fp8ou")
[sub_resource type="Resource" id="Resource_cqegr"]
script = ExtResource("3_fp8ou")
[sub_resource type="Resource" id="Resource_mbpss"]
script = ExtResource("3_fp8ou")
BaseValue = 1.0
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
[sub_resource type="Resource" id="Resource_exi3e"]
script = ExtResource("4_xxxse")
ScalableFloat = SubResource("Resource_mbpss")
Coefficient = SubResource("Resource_68n87")
PreMultiplyAdditiveValue = SubResource("Resource_cqegr")
PostMultiplyAdditiveValue = SubResource("Resource_og1rv")
CalculatorCoefficient = SubResource("Resource_pqllu")
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_cv55m")
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_1inmd")
metadata/_custom_type_script = "uid://2gm1hdhi8u08"
[sub_resource type="Resource" id="Resource_1go02"]
script = ExtResource("1_qae83")
BaseValue = 1
[sub_resource type="Resource" id="Resource_ijayu"]
script = ExtResource("1_qae83")
BaseValue = 1
[resource]
script = ExtResource("2_scapu")
Name = "Inhibit Player Mana Regen Temp"
Modifiers = []
Components = Array[Object]([SubResource("Resource_bi1d8")])
Executions = null
DurationType = 2
Duration = SubResource("Resource_exi3e")
StackLimit = SubResource("Resource_ijayu")
InitialStack = SubResource("Resource_1go02")
Cues = null
metadata/_custom_type_script = "uid://b83hf13nj37k3"

View File

@@ -0,0 +1,83 @@
[gd_resource type="Resource" script_class="ForgeEffectData" format=3 uid="uid://dh437cuxgjv6b"]
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="1_mlifq"]
[ext_resource type="Resource" uid="uid://dn7b8frkoxpxr" path="res://scenes/player_controller/resources/forge/player_mana_changed_cue.tres" id="1_nsr3v"]
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="1_q8tml"]
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="2_5tp50"]
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="2_pm3n3"]
[ext_resource type="Script" uid="uid://b0eq12mjqfage" path="res://addons/forge/resources/components/TargetTagRequirements.cs" id="2_xbgy2"]
[ext_resource type="Script" uid="uid://bdfcavbjyhxxa" path="res://addons/forge/resources/ForgeModifier.cs" id="3_nsr3v"]
[sub_resource type="Resource" id="Resource_5yygy"]
script = ExtResource("1_q8tml")
ContainerTags = Array[String](["character.player.mana.regen.inhibited"])
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
[sub_resource type="Resource" id="Resource_ncjx6"]
script = ExtResource("2_xbgy2")
OngoingIgnoredTags = SubResource("Resource_5yygy")
metadata/_custom_type_script = "uid://b0eq12mjqfage"
[sub_resource type="Resource" id="Resource_pm3n3"]
script = ExtResource("1_mlifq")
BaseValue = 1
[sub_resource type="Resource" id="Resource_q8tml"]
script = ExtResource("2_pm3n3")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_xbgy2"]
script = ExtResource("2_pm3n3")
[sub_resource type="Resource" id="Resource_rhldn"]
script = ExtResource("2_pm3n3")
[sub_resource type="Resource" id="Resource_p6h8c"]
script = ExtResource("2_pm3n3")
BaseValue = 1.0
[sub_resource type="Resource" id="Resource_yqxv4"]
script = ExtResource("2_pm3n3")
[sub_resource type="Resource" id="Resource_b6opn"]
script = ExtResource("2_pm3n3")
[sub_resource type="Resource" id="Resource_5frso"]
script = ExtResource("2_pm3n3")
BaseValue = 2.0
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
[sub_resource type="Resource" id="Resource_okenf"]
script = ExtResource("3_nsr3v")
Attribute = "PlayerAttributeSet.Mana"
ScalableFloat = SubResource("Resource_5frso")
Coefficient = SubResource("Resource_p6h8c")
PreMultiplyAdditiveValue = SubResource("Resource_b6opn")
PostMultiplyAdditiveValue = SubResource("Resource_yqxv4")
CalculatorCoefficient = SubResource("Resource_q8tml")
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_rhldn")
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_xbgy2")
metadata/_custom_type_script = "uid://bdfcavbjyhxxa"
[sub_resource type="Resource" id="Resource_w35mq"]
script = ExtResource("2_pm3n3")
BaseValue = 0.1
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
[sub_resource type="Resource" id="Resource_nsr3v"]
script = ExtResource("1_mlifq")
BaseValue = 1
[resource]
script = ExtResource("2_5tp50")
Name = "Mana Regeneration"
Modifiers = Array[Object]([SubResource("Resource_okenf")])
Components = [SubResource("Resource_ncjx6")]
Executions = []
DurationType = 1
HasPeriodicApplication = true
Period = SubResource("Resource_w35mq")
StackLimit = SubResource("Resource_nsr3v")
InitialStack = SubResource("Resource_pm3n3")
Cues = Array[Object]([ExtResource("1_nsr3v")])
metadata/_custom_type_script = "uid://b83hf13nj37k3"

View File

@@ -0,0 +1,17 @@
[gd_resource type="Resource" script_class="ForgeCue" format=3 uid="uid://dn7b8frkoxpxr"]
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="1_lbula"]
[ext_resource type="Script" uid="uid://cmrsxccn0ei4j" path="res://addons/forge/resources/ForgeCue.cs" id="2_jijlk"]
[sub_resource type="Resource" id="Resource_4mhqs"]
script = ExtResource("1_lbula")
ContainerTags = Array[String](["cues.resources.mana"])
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
[resource]
script = ExtResource("2_jijlk")
CueKeys = SubResource("Resource_4mhqs")
MaxValue = 100
MagnitudeType = 2
MagnitudeAttribute = "PlayerAttributeSet.Mana"
metadata/_custom_type_script = "uid://cmrsxccn0ei4j"

View File

@@ -28,9 +28,10 @@ using Movementtests.scenes.player_controller.scripts;
using Movementtests.tools; using Movementtests.tools;
using Movementtests.forge.abilities; using Movementtests.forge.abilities;
using Movementtests.tools.calculators; using Movementtests.tools.calculators;
using Movementtests.tools.effects;
using RustyOptions; using RustyOptions;
public record struct EmpoweredActionPayload;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_character.png")] [GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_character.png")]
public partial class PlayerController : CharacterBody3D, public partial class PlayerController : CharacterBody3D,
IDamageable, IDamageable,
@@ -114,7 +115,7 @@ public partial class PlayerController : CharacterBody3D,
[ExportGroup("General")] [ExportGroup("General")]
[Export] [Export]
public ForgeTagContainer BaseTags { get; set; } = new(); public ForgeTagContainer BaseTags { get; set; } = new();
[Export] public RManaRegen ManaRegen = null!; [Export] public ForgeTag EmpoweredActionUsed;
[ExportGroup("Abilities")] [ExportGroup("Abilities")]
[ExportSubgroup("Common and defaults")] [ExportSubgroup("Common and defaults")]
@@ -126,6 +127,8 @@ public partial class PlayerController : CharacterBody3D,
[ExportGroup("Effects")] [ExportGroup("Effects")]
[ExportSubgroup("Common and defaults")] [ExportSubgroup("Common and defaults")]
[Export] public ForgeEffectData[] DefaultPermanentEffects = []; [Export] public ForgeEffectData[] DefaultPermanentEffects = [];
[ExportSubgroup("Applied on Empowered Action used")]
[Export] public ForgeEffectData[] EmpoweredActionEffects = [];
// Combat stuff // Combat stuff
[ExportCategory("Combat")] [ExportCategory("Combat")]
@@ -435,7 +438,6 @@ public partial class PlayerController : CharacterBody3D,
private Camera3D _camera = null!; private Camera3D _camera = null!;
private AbilityHandle? _empoweredActionHandle; private AbilityHandle? _empoweredActionHandle;
private ActiveEffectHandle? _manaRegenEffectHandle;
public override void _Ready() public override void _Ready()
{ {
@@ -488,11 +490,21 @@ public partial class PlayerController : CharacterBody3D,
levelOverridePolicy: LevelComparison.None, levelOverridePolicy: LevelComparison.None,
sourceEntity: this); sourceEntity: this);
} }
// var empoweredActionData = EmpoweredAction.Ability(tagsManager);
// // Grant permanently // Apply all default effects
foreach (var effect in DefaultPermanentEffects)
var manaRegenEffect = new Effect(ManaRegen.ManaRegen(tagsManager), new EffectOwnership(this, this)); {
_manaRegenEffectHandle = EffectsManager.ApplyEffect(manaRegenEffect); EffectsManager.ApplyEffect(new Effect(effect.GetEffectData(), new EffectOwnership(this, this)));
}
// Subscribe default empowered actions effects to the Empowered Action Used event
foreach (var effect in EmpoweredActionEffects)
{
Events.Subscribe<EmpoweredActionPayload>(EmpoweredActionUsed.GetTag(), data =>
{
EffectsManager.ApplyEffect(new Effect(effect.GetEffectData(), new EffectOwnership(this, this)));
});
}
// DashIndicator = GetNode<TextureRect>("%DashIndicator"); // DashIndicator = GetNode<TextureRect>("%DashIndicator");
PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator"); PowerCooldownIndicator = GetNode<ColorRect>("%DashCooldownIndicator");
@@ -2089,6 +2101,13 @@ public partial class PlayerController : CharacterBody3D,
_canDashAirborne = true; _canDashAirborne = true;
EmpoweredActionsLeft--; EmpoweredActionsLeft--;
_playerState.SendEvent(EmpoweredActionsLeft <= 0 ? "expired" : "power_used"); _playerState.SendEvent(EmpoweredActionsLeft <= 0 ? "expired" : "power_used");
Events.Raise(new EventData<EmpoweredActionPayload>
{
EventTags = EmpoweredActionUsed.GetTag().GetSingleTagContainer()!,
Source = this,
Payload = new EmpoweredActionPayload()
});
} }
/////////////////////////// ///////////////////////////