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

@@ -122,7 +122,7 @@ public partial class PlayerController : CharacterBody3D,
[Export] public ForgeAbilityData EmpoweredActionAbility = null!;
[Export] public ForgeAbilityData[] DefaultPermanentAbilities = [];
[ExportSubgroup("WeaponThrow")]
[Export] public RExplodingSword[] AbilityLoadout = [];
[Export] public ForgeAbilityData[] AbilityLoadout = [];
[ExportGroup("Effects")]
[ExportSubgroup("Common and defaults")]
@@ -747,9 +747,8 @@ public partial class PlayerController : CharacterBody3D,
foreach (var weaponLandAbility in AbilityLoadout)
{
var weaponLeftTag = Tag.RequestTag(tagsManager,"abilities.weapon.left").GetSingleTagContainer();
var leftGrantAbilityConfig = new GrantAbilityConfig(
weaponLandAbility.Ability(new ExplodingSwordCreation(WeaponSystem), weaponLeftTag),
weaponLandAbility.GetAbilityData(),
ScalableLevel: new ScalableInt(1),
RemovalPolicy: AbilityDeactivationPolicy.CancelImmediately,
InhibitionPolicy: AbilityDeactivationPolicy.CancelImmediately,
@@ -763,32 +762,14 @@ public partial class PlayerController : CharacterBody3D,
new DurationData(DurationType.Infinite),
effectComponents: [leftGrantComponent]);
EffectsManager.ApplyEffect(new Effect(leftGrantEffect, new EffectOwnership(this, this)));
var weaponLandedTag = Tag.RequestTag(tagsManager, "abilities.weapon.land").GetSingleTagContainer();
var landGrantAbilityConfig = new GrantAbilityConfig(
weaponLandAbility.Ability(new ExplodingSwordCreation(WeaponSystem), weaponLandedTag),
ScalableLevel: new ScalableInt(1),
RemovalPolicy: AbilityDeactivationPolicy.CancelImmediately,
InhibitionPolicy: AbilityDeactivationPolicy.CancelImmediately,
TryActivateOnGrant: false,
TryActivateOnEnable: false,
LevelOverridePolicy: LevelComparison.Higher);
var landGrantComponent = new GrantAbilityEffectComponent([landGrantAbilityConfig]);
var landGrantEffect = new EffectData(
"Grant Weapon Land Ability",
new DurationData(DurationType.Infinite),
effectComponents: [landGrantComponent]);
EffectsManager.ApplyEffect(new Effect(landGrantEffect, new EffectOwnership(this, this)));
GetTree().CreateTimer(5).Timeout += () => WeaponSystem.GrantNewAbilityForWeaponFly(weaponLandAbility);
}
// GetTree().CreateTimer(5).Timeout += () => WeaponSystem.GrantNewAbilityForWeaponFly(weaponLandAbility);
// Forge events
var weaponLeftToken = WeaponSystem.Events.Subscribe<WeaponEventPayload>(WeaponSystem.WeaponStartedFlyingEventTag, OnWeaponLeft);
var weaponLandedToken = WeaponSystem.Events.Subscribe<WeaponEventPayload>(WeaponSystem.WeaponStoppedFlyingEventTag, OnWeaponLanded);
var weaponLeftToken = WeaponSystem.Events.Subscribe(WeaponSystem.WeaponStartedFlyingEventTag, OnWeaponLeft);
var weaponLandedToken = WeaponSystem.Events.Subscribe(WeaponSystem.WeaponStoppedFlyingEventTag, OnWeaponLanded);
}
public void OnWeaponLeft(EventData<WeaponEventPayload> data)
public void OnWeaponLeft(EventData data)
{
var target = data.Target;
@@ -798,7 +779,7 @@ public partial class PlayerController : CharacterBody3D,
Abilities.TryActivateAbilitiesByTag(weaponLeftTag, target, out var landedFailures);
}
public void OnWeaponLanded(EventData<WeaponEventPayload> data)
public void OnWeaponLanded(EventData data)
{
var source = data.Source;
var target = data.Target;