Moved the exploding sword forge object from the code only hardcoded stuff to the resource based stuff
This commit is contained in:
42
forge/abilities/ForgeEffectApplicationBehavior.cs
Normal file
42
forge/abilities/ForgeEffectApplicationBehavior.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
using Gamesmiths.Forge.Abilities;
|
||||||
|
using Gamesmiths.Forge.Core;
|
||||||
|
using Gamesmiths.Forge.Effects;
|
||||||
|
using Gamesmiths.Forge.Godot.Resources;
|
||||||
|
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
||||||
|
using Godot;
|
||||||
|
|
||||||
|
namespace Movementtests.forge.abilities;
|
||||||
|
|
||||||
|
|
||||||
|
public class EffectApplicationBehavior(EffectData effectData) : IAbilityBehavior
|
||||||
|
{
|
||||||
|
private ActiveEffectHandle? _effectHandle;
|
||||||
|
public void OnStarted(AbilityBehaviorContext context)
|
||||||
|
{
|
||||||
|
GD.Print("This is applying the periodic effect to the flying weapon");
|
||||||
|
_effectHandle = context.Owner.EffectsManager.ApplyEffect(new Effect(effectData, new EffectOwnership(context.Owner, context.Owner)));
|
||||||
|
context.AbilityHandle.CommitAbility();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnEnded(AbilityBehaviorContext context)
|
||||||
|
{
|
||||||
|
GD.Print("This is removing the periodic effect from the flying weapon");
|
||||||
|
if (_effectHandle is not null)
|
||||||
|
context.Owner.EffectsManager.RemoveEffect(_effectHandle);
|
||||||
|
context.InstanceHandle.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Tool]
|
||||||
|
[GlobalClass]
|
||||||
|
public partial class ForgeEffectApplicationBehavior : ForgeAbilityBehavior
|
||||||
|
{
|
||||||
|
[Export] public ForgeEffectData? EffectData { get; set; }
|
||||||
|
|
||||||
|
public override IAbilityBehavior GetBehavior()
|
||||||
|
{
|
||||||
|
if (EffectData == null)
|
||||||
|
throw new System.ArgumentException("EffectData is null");
|
||||||
|
return new EffectApplicationBehavior(EffectData.GetEffectData());
|
||||||
|
}
|
||||||
|
}
|
||||||
1
forge/abilities/ForgeEffectApplicationBehavior.cs.uid
Normal file
1
forge/abilities/ForgeEffectApplicationBehavior.cs.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cl5hudinl1rex
|
||||||
59
forge/abilities/ForgeExplodingSwordBehavior.cs
Normal file
59
forge/abilities/ForgeExplodingSwordBehavior.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using Gamesmiths.Forge.Abilities;
|
||||||
|
using Gamesmiths.Forge.Core;
|
||||||
|
using Gamesmiths.Forge.Godot.Nodes;
|
||||||
|
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
||||||
|
using Godot;
|
||||||
|
|
||||||
|
namespace Movementtests.forge.abilities;
|
||||||
|
|
||||||
|
public class ExplodingSwordBehavior(PackedScene explosion) : IAbilityBehavior
|
||||||
|
{
|
||||||
|
public void OnStarted(AbilityBehaviorContext context)
|
||||||
|
{
|
||||||
|
if (context.Owner is not Node3D owner)
|
||||||
|
{
|
||||||
|
context.InstanceHandle.End();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (explosion.Instantiate() is not Explosion explosion1)
|
||||||
|
{
|
||||||
|
GD.Print("Cannot instantiate");
|
||||||
|
context.InstanceHandle.End();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!owner.IsInsideTree())
|
||||||
|
{
|
||||||
|
GD.Print("Not inside tree");
|
||||||
|
context.InstanceHandle.End();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GD.Print("EXPLOSION");
|
||||||
|
|
||||||
|
explosion1.Radius = 6f;
|
||||||
|
|
||||||
|
owner.GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, explosion1);
|
||||||
|
explosion1.CallDeferred(Node3D.MethodName.SetGlobalPosition, owner.GlobalPosition);
|
||||||
|
|
||||||
|
context.AbilityHandle.CommitAbility();
|
||||||
|
context.InstanceHandle.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnEnded(AbilityBehaviorContext context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Tool]
|
||||||
|
[GlobalClass]
|
||||||
|
public partial class ForgeExplodingSwordBehavior : ForgeAbilityBehavior
|
||||||
|
{
|
||||||
|
[Export] public PackedScene? Explosion { get; set; }
|
||||||
|
public override IAbilityBehavior GetBehavior()
|
||||||
|
{
|
||||||
|
if (Explosion == null)
|
||||||
|
throw new System.ArgumentException("Explosion is null");
|
||||||
|
return new ExplodingSwordBehavior(Explosion);
|
||||||
|
}
|
||||||
|
}
|
||||||
1
forge/abilities/ForgeExplodingSwordBehavior.cs.uid
Normal file
1
forge/abilities/ForgeExplodingSwordBehavior.cs.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bnee6amtc2bhj
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Gamesmiths.Forge.Abilities;
|
|
||||||
using Gamesmiths.Forge.Core;
|
|
||||||
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;
|
|
||||||
using Movementtests.systems;
|
|
||||||
|
|
||||||
namespace Movementtests.forge.abilities;
|
|
||||||
|
|
||||||
public record struct ExplodingSwordCreation(Node3D Owner);
|
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_projectile.png")]
|
|
||||||
public partial class RExplodingSword(PackedScene? explosion) : Resource, IAbilityBase<ExplodingSwordCreation, WeaponEventPayload>
|
|
||||||
{
|
|
||||||
[Export] public PackedScene? Explosion { get; set; } = explosion;
|
|
||||||
|
|
||||||
public RExplodingSword() : this(null) {}
|
|
||||||
|
|
||||||
public AbilityData Ability(ExplodingSwordCreation creationData, TagContainer? tags)
|
|
||||||
{
|
|
||||||
return new AbilityData(
|
|
||||||
name: "Exploding Sword Throw",
|
|
||||||
abilityTags: tags,
|
|
||||||
instancingPolicy: AbilityInstancingPolicy.PerEntity,
|
|
||||||
behaviorFactory: () => new ExplodingSwordThrowBehavior<WeaponEventPayload>(creationData.Owner, Explosion));
|
|
||||||
}
|
|
||||||
|
|
||||||
public IAbilityBehavior<WeaponEventPayload> Behavior(ExplodingSwordCreation creationData)
|
|
||||||
{
|
|
||||||
return new ExplodingSwordThrowBehavior<WeaponEventPayload>(creationData.Owner, Explosion);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ExplodingSwordThrowBehavior<TPayload>(Node3D owner, PackedScene? explosion) : IAbilityBehavior<TPayload>
|
|
||||||
{
|
|
||||||
private Node3D _owner = owner;
|
|
||||||
private PackedScene? _explosion = explosion;
|
|
||||||
public void OnStarted(AbilityBehaviorContext context, TPayload payload)
|
|
||||||
{
|
|
||||||
if (_explosion?.Instantiate() is not Explosion explosion)
|
|
||||||
{
|
|
||||||
GD.Print("Cannot instantiate");
|
|
||||||
context.InstanceHandle.End();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!_owner.IsInsideTree())
|
|
||||||
{
|
|
||||||
GD.Print("Not inside tree");
|
|
||||||
context.InstanceHandle.End();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GD.Print("EXPLOSION");
|
|
||||||
|
|
||||||
explosion.Radius = 6f;
|
|
||||||
|
|
||||||
_owner.GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, explosion);
|
|
||||||
explosion.CallDeferred(Node3D.MethodName.SetGlobalPosition, _owner.GlobalPosition);
|
|
||||||
|
|
||||||
context.AbilityHandle.CommitAbility();
|
|
||||||
context.InstanceHandle.End();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnEnded(AbilityBehaviorContext context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class FlyingSwordBehavior(IForgeEntity owner, EffectData effectData) : IAbilityBehavior
|
|
||||||
{
|
|
||||||
private ActiveEffectHandle? _effectHandle;
|
|
||||||
public void OnStarted(AbilityBehaviorContext context)
|
|
||||||
{
|
|
||||||
GD.Print("This is applying the periodic effect to the flying weapon");
|
|
||||||
_effectHandle = owner.EffectsManager.ApplyEffect(new Effect(effectData, new EffectOwnership(owner, owner)));
|
|
||||||
context.AbilityHandle.CommitAbility();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnEnded(AbilityBehaviorContext context)
|
|
||||||
{
|
|
||||||
GD.Print("This is removing the periodic effect from the flying weapon");
|
|
||||||
if (_effectHandle is not null)
|
|
||||||
owner.EffectsManager.RemoveEffect(_effectHandle);
|
|
||||||
context.InstanceHandle.End();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://rux15j7q78e8
|
|
||||||
@@ -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 [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
48
forge/calculators/ForgeRaiseEventTagExecution.cs
Normal file
48
forge/calculators/ForgeRaiseEventTagExecution.cs
Normal 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());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
[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="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="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"]
|
||||||
@@ -151,7 +150,6 @@ collision_mask = 272
|
|||||||
script = ExtResource("1_poq2x")
|
script = ExtResource("1_poq2x")
|
||||||
EmpoweredActionUsed = SubResource("Resource_5gbhg")
|
EmpoweredActionUsed = SubResource("Resource_5gbhg")
|
||||||
EmpoweredActionAbility = ExtResource("10_2rkt1")
|
EmpoweredActionAbility = ExtResource("10_2rkt1")
|
||||||
AbilityLoadout = [ExtResource("4_11013")]
|
|
||||||
DefaultPermanentEffects = [ExtResource("5_2rkt1")]
|
DefaultPermanentEffects = [ExtResource("5_2rkt1")]
|
||||||
EmpoweredActionEffects = [ExtResource("6_u8yay")]
|
EmpoweredActionEffects = [ExtResource("6_u8yay")]
|
||||||
AimAssistStrength = 0.3
|
AimAssistStrength = 0.3
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Gamesmiths.Forge.Events;
|
|||||||
using Gamesmiths.Forge.Godot.Core;
|
using Gamesmiths.Forge.Godot.Core;
|
||||||
using Gamesmiths.Forge.Godot.Nodes;
|
using Gamesmiths.Forge.Godot.Nodes;
|
||||||
using Gamesmiths.Forge.Godot.Resources;
|
using Gamesmiths.Forge.Godot.Resources;
|
||||||
|
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
||||||
using Gamesmiths.Forge.Tags;
|
using Gamesmiths.Forge.Tags;
|
||||||
using Godot;
|
using Godot;
|
||||||
using GodotStateCharts;
|
using GodotStateCharts;
|
||||||
@@ -26,20 +27,6 @@ using Movementtests.tools.calculators;
|
|||||||
|
|
||||||
namespace Movementtests.systems;
|
namespace Movementtests.systems;
|
||||||
|
|
||||||
public record struct WeaponEventPayload(String Message);
|
|
||||||
|
|
||||||
|
|
||||||
public class ClosureBehavior<TPayload>(
|
|
||||||
Action<AbilityBehaviorContext, TPayload> callback) : IAbilityBehavior<TPayload>
|
|
||||||
{
|
|
||||||
public void OnStarted(AbilityBehaviorContext context, TPayload data)
|
|
||||||
{
|
|
||||||
callback(context, data);
|
|
||||||
context.InstanceHandle.End();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnEnded(AbilityBehaviorContext context){}
|
|
||||||
}
|
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_sword.png")]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_sword.png")]
|
||||||
public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||||
@@ -50,9 +37,10 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
[Signal]
|
[Signal]
|
||||||
public delegate void WeaponRetrievedEventHandler();
|
public delegate void WeaponRetrievedEventHandler();
|
||||||
|
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public ForgeTagContainer BaseTags { get; set; } = new();
|
public ForgeTagContainer BaseTags { get; set; } = new();
|
||||||
|
[Export] public ForgeAbilityData[] WeaponAbilities { get; set; } = Array.Empty<ForgeAbilityData>();
|
||||||
|
[Export] public ForgeAbilityData FlyingTickAbility { get; set; } = new();
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public RDamage RDamage { get; set; }
|
public RDamage RDamage { get; set; }
|
||||||
@@ -107,6 +95,8 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
|
|
||||||
public Tag WeaponFlyingAbilityTag;
|
public Tag WeaponFlyingAbilityTag;
|
||||||
|
|
||||||
|
private AbilityHandle? _weaponFlyingAbility;
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
_weaponState = StateChart.Of(GetNode("StateChart"));
|
_weaponState = StateChart.Of(GetNode("StateChart"));
|
||||||
@@ -171,7 +161,27 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
Abilities = new(this);
|
Abilities = new(this);
|
||||||
Events = new();
|
Events = new();
|
||||||
|
|
||||||
CreateFlyingAbility();
|
// TODO: Waiting on bug resolve
|
||||||
|
// _weaponFlyingAbility = Abilities.GrantAbilityPermanently(FlyingTickAbility.GetAbilityData(), 1, LevelComparison.None, this);
|
||||||
|
|
||||||
|
foreach (var ability in WeaponAbilities)
|
||||||
|
{
|
||||||
|
var leftGrantAbilityConfig = new GrantAbilityConfig(
|
||||||
|
ability.GetAbilityData(),
|
||||||
|
ScalableLevel: new ScalableInt(1),
|
||||||
|
RemovalPolicy: AbilityDeactivationPolicy.CancelImmediately,
|
||||||
|
InhibitionPolicy: AbilityDeactivationPolicy.CancelImmediately,
|
||||||
|
TryActivateOnGrant: false,
|
||||||
|
TryActivateOnEnable: false,
|
||||||
|
LevelOverridePolicy: LevelComparison.Higher);
|
||||||
|
|
||||||
|
var leftGrantComponent = new GrantAbilityEffectComponent([leftGrantAbilityConfig]);
|
||||||
|
var leftGrantEffect = new EffectData(
|
||||||
|
"Grant Weapon Ability",
|
||||||
|
new DurationData(DurationType.Infinite),
|
||||||
|
effectComponents: [leftGrantComponent]);
|
||||||
|
EffectsManager.ApplyEffect(new Effect(leftGrantEffect, new EffectOwnership(this, this)));
|
||||||
|
}
|
||||||
|
|
||||||
BodyEntered += OnThrownWeaponReachesGround;
|
BodyEntered += OnThrownWeaponReachesGround;
|
||||||
|
|
||||||
@@ -180,136 +190,76 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
|
|
||||||
_handToFlying.Taken += () =>
|
_handToFlying.Taken += () =>
|
||||||
{
|
{
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponHandToFlyingEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponHandToFlyingEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this
|
||||||
Payload = new WeaponEventPayload(Message: "handToFlying")
|
|
||||||
});
|
});
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponStartedFlyingEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponStartedFlyingEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this
|
||||||
Payload = new WeaponEventPayload(Message: "startedFlying")
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_flyingToHand.Taken += () =>
|
_flyingToHand.Taken += () =>
|
||||||
{
|
{
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponFlyingToHandEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponFlyingToHandEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this
|
||||||
Payload = new WeaponEventPayload(Message: "flyingToHand")
|
|
||||||
});
|
});
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponStoppedFlyingEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponStoppedFlyingEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this
|
||||||
Payload = new WeaponEventPayload(Message: "stoppedFlying")
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_plantedToHand.Taken += () =>
|
_plantedToHand.Taken += () =>
|
||||||
{
|
{
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponPlantedToHandEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponPlantedToHandEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this
|
||||||
Payload = new WeaponEventPayload(Message: "plantedToHand")
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_plantedToFlying.Taken += () =>
|
_plantedToFlying.Taken += () =>
|
||||||
{
|
{
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponPlantedToFlyingEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponPlantedToFlyingEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this
|
||||||
Payload = new WeaponEventPayload(Message: "plantedToFlying")
|
|
||||||
});
|
});
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponStartedFlyingEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponStartedFlyingEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this
|
||||||
Payload = new WeaponEventPayload(Message: "startedFlying")
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_toPlanted.Taken += () =>
|
_toPlanted.Taken += () =>
|
||||||
{
|
{
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponPlantedEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponPlantedEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this,
|
||||||
Target = _plantedEntity,
|
Target = _plantedEntity
|
||||||
Payload = new WeaponEventPayload(Message: "planted")
|
|
||||||
});
|
});
|
||||||
Events.Raise(new EventData<WeaponEventPayload>
|
Events.Raise(new EventData
|
||||||
{
|
{
|
||||||
EventTags = WeaponStoppedFlyingEventTag.GetSingleTagContainer()!,
|
EventTags = WeaponStoppedFlyingEventTag.GetSingleTagContainer()!,
|
||||||
Source = this,
|
Source = this
|
||||||
Payload = new WeaponEventPayload(Message: "stoppedFlying")
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Events.Subscribe<WeaponEventPayload>(WeaponStoppedFlyingEventTag, data =>
|
Events.Subscribe(WeaponStoppedFlyingEventTag, data =>
|
||||||
{
|
{
|
||||||
_weaponFlyingAbility.Cancel();
|
// TODO: Waiting on bug resolve
|
||||||
|
// _weaponFlyingAbility.Cancel();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
private ActiveEffectHandle? _flyingWeaponEffectHandle;
|
|
||||||
|
|
||||||
public void CreateFlyingAbility()
|
|
||||||
{
|
|
||||||
var flyingWeaponEffectData = new EffectData(
|
|
||||||
"Flying Weapon Effect Data",
|
|
||||||
new DurationData(DurationType.Infinite),
|
|
||||||
customExecutions:
|
|
||||||
[
|
|
||||||
new FlyingWeaponExecution(this)
|
|
||||||
],
|
|
||||||
periodicData: new PeriodicData(new ScalableFloat(0.2f), false, PeriodInhibitionRemovedPolicy.ResetPeriod)
|
|
||||||
);
|
|
||||||
|
|
||||||
var weaponHandToFlyingAbilityData = new AbilityData(
|
|
||||||
name: "WeaponHandToFlyingSword",
|
|
||||||
abilityTags: WeaponFlyingAbilityTag.GetSingleTagContainer(),
|
|
||||||
instancingPolicy: AbilityInstancingPolicy.PerEntity,
|
|
||||||
abilityTriggerData: AbilityTriggerData.ForEvent<WeaponEventPayload>(WeaponStartedFlyingEventTag),
|
|
||||||
behaviorFactory: () => new FlyingSwordBehavior(this, flyingWeaponEffectData));
|
|
||||||
_weaponFlyingAbility = Abilities.GrantAbilityPermanently(weaponHandToFlyingAbilityData, 1, LevelComparison.None, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private AbilityHandle _weaponFlyingAbility;
|
|
||||||
|
|
||||||
public void GrantNewAbilityForWeaponFly(RExplodingSword ability)
|
|
||||||
{
|
|
||||||
var weaponFlyingAbilityData = new AbilityData(
|
|
||||||
name: "WeaponFlyingSwordAbility",
|
|
||||||
abilityTags: WeaponFlyingAbilityTag.GetSingleTagContainer(),
|
|
||||||
instancingPolicy: AbilityInstancingPolicy.PerEntity,
|
|
||||||
abilityTriggerData: AbilityTriggerData.ForEvent<WeaponEventPayload>(WeaponFlyingTickEventTag),
|
|
||||||
behaviorFactory: () => ability.Behavior(new ExplodingSwordCreation(this)));
|
|
||||||
|
|
||||||
var weaponFlyGrantAbilityConfig = new GrantAbilityConfig(
|
|
||||||
weaponFlyingAbilityData,
|
|
||||||
ScalableLevel: new ScalableInt(1),
|
|
||||||
RemovalPolicy: AbilityDeactivationPolicy.CancelImmediately,
|
|
||||||
InhibitionPolicy: AbilityDeactivationPolicy.CancelImmediately,
|
|
||||||
TryActivateOnGrant: false,
|
|
||||||
TryActivateOnEnable: false,
|
|
||||||
LevelOverridePolicy: LevelComparison.Higher);
|
|
||||||
|
|
||||||
var weaponFlyGrantComponent = new GrantAbilityEffectComponent([weaponFlyGrantAbilityConfig]);
|
|
||||||
var weaponFlyGrantEffect = new EffectData(
|
|
||||||
"Grant Weapon Fly Ability",
|
|
||||||
new DurationData(DurationType.Infinite),
|
|
||||||
effectComponents: [weaponFlyGrantComponent]);
|
|
||||||
EffectsManager.ApplyEffect(new Effect(weaponFlyGrantEffect, new EffectOwnership(this, this)));
|
|
||||||
|
|
||||||
GD.Print("New weapon flight ability granted");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void WeaponLeft()
|
public void WeaponLeft()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
[ext_resource type="Script" uid="uid://iii3wfto4t5b" path="res://scenes/player_controller/components/weapon/WeaponSystem.cs" id="1_csqwk"]
|
[ext_resource type="Script" uid="uid://iii3wfto4t5b" path="res://scenes/player_controller/components/weapon/WeaponSystem.cs" id="1_csqwk"]
|
||||||
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_m0v1h"]
|
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_m0v1h"]
|
||||||
|
[ext_resource type="Resource" uid="uid://cu0685gspk2fk" path="res://scenes/player_controller/resources/forge/exploding_sword_weapon_land.tres" id="2_pgbtr"]
|
||||||
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="3_3xjpi"]
|
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="3_3xjpi"]
|
||||||
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_5owyf"]
|
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_5owyf"]
|
||||||
|
[ext_resource type="Resource" uid="uid://busdbvfi3jiic" path="res://scenes/player_controller/resources/forge/exploding_sword_weapon_left.tres" id="3_7bruw"]
|
||||||
[ext_resource type="ArrayMesh" uid="uid://cho5fixitrbds" path="res://assets/meshes/swords/resources/sword23.tres" id="3_svc06"]
|
[ext_resource type="ArrayMesh" uid="uid://cho5fixitrbds" path="res://assets/meshes/swords/resources/sword23.tres" id="3_svc06"]
|
||||||
|
[ext_resource type="Resource" uid="uid://btnnpqann3ktp" path="res://scenes/player_controller/resources/forge/weapon_flying_tick_ability.tres" id="4_7bruw"]
|
||||||
[ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="4_q6xv7"]
|
[ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="4_q6xv7"]
|
||||||
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_svc06"]
|
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_svc06"]
|
||||||
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_m0v1h"]
|
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_m0v1h"]
|
||||||
@@ -56,6 +59,8 @@ continuous_cd = true
|
|||||||
contact_monitor = true
|
contact_monitor = true
|
||||||
max_contacts_reported = 1
|
max_contacts_reported = 1
|
||||||
script = ExtResource("1_csqwk")
|
script = ExtResource("1_csqwk")
|
||||||
|
WeaponAbilities = [ExtResource("2_pgbtr"), ExtResource("3_7bruw")]
|
||||||
|
FlyingTickAbility = ExtResource("4_7bruw")
|
||||||
RDamage = SubResource("Resource_jpdh0")
|
RDamage = SubResource("Resource_jpdh0")
|
||||||
|
|
||||||
[node name="WeaponAttributeSet" type="Node" parent="." unique_id=14845649]
|
[node name="WeaponAttributeSet" type="Node" parent="." unique_id=14845649]
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeExplodingSwordBehavior" format=3 uid="uid://ifeavnlps7hy"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://duju3atqgltkg" path="res://scenes/explosion/explosion.tscn" id="1_mnals"]
|
||||||
|
[ext_resource type="Script" uid="uid://bnee6amtc2bhj" path="res://forge/abilities/ForgeExplodingSwordBehavior.cs" id="1_ot53g"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_ot53g")
|
||||||
|
Explosion = ExtResource("1_mnals")
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
[gd_resource type="Resource" script_class="RExplodingSword" format=3 uid="uid://cdxbwirfiaipi"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://duju3atqgltkg" path="res://scenes/explosion/explosion.tscn" id="1_aru71"]
|
|
||||||
[ext_resource type="Script" path="res://forge/abilities/RExplodingSword.cs" id="2_syk3q"]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
script = ExtResource("2_syk3q")
|
|
||||||
Explosion = ExtResource("1_aru71")
|
|
||||||
Cost = 10.0
|
|
||||||
metadata/_custom_type_script = "uid://rux15j7q78e8"
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://bl0mng4kl1xy8"]
|
||||||
|
|
||||||
|
[ext_resource type="Resource" uid="uid://ifeavnlps7hy" path="res://scenes/player_controller/resources/forge/exploding_sword.tres" id="1_postf"]
|
||||||
|
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_km5rh"]
|
||||||
|
[ext_resource type="Script" uid="uid://dpakv7agvir6y" path="res://addons/forge/resources/ForgeTag.cs" id="3_spdwn"]
|
||||||
|
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="4_cm86c"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_ixeut"]
|
||||||
|
script = ExtResource("2_km5rh")
|
||||||
|
ContainerTags = Array[String](["abilities.weapon.land"])
|
||||||
|
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_6c3kr"]
|
||||||
|
script = ExtResource("3_spdwn")
|
||||||
|
Tag = "events.weapon.flyingtick"
|
||||||
|
metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("4_cm86c")
|
||||||
|
Name = "Exploding Sword on Weapon Flight"
|
||||||
|
CooldownEffects = []
|
||||||
|
AbilityBehavior = ExtResource("1_postf")
|
||||||
|
TriggerSource = 1
|
||||||
|
TriggerTag = SubResource("Resource_6c3kr")
|
||||||
|
AbilityTags = SubResource("Resource_ixeut")
|
||||||
|
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://cu0685gspk2fk"]
|
||||||
|
|
||||||
|
[ext_resource type="Resource" uid="uid://ifeavnlps7hy" path="res://scenes/player_controller/resources/forge/exploding_sword.tres" id="1_l4v7e"]
|
||||||
|
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_6c3kr"]
|
||||||
|
[ext_resource type="Script" uid="uid://dpakv7agvir6y" path="res://addons/forge/resources/ForgeTag.cs" id="2_l4v7e"]
|
||||||
|
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="3_ixeut"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_ixeut"]
|
||||||
|
script = ExtResource("2_6c3kr")
|
||||||
|
ContainerTags = Array[String](["abilities.weapon.land"])
|
||||||
|
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_6c3kr"]
|
||||||
|
script = ExtResource("2_l4v7e")
|
||||||
|
Tag = "events.weapon.stoppedflying"
|
||||||
|
metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("3_ixeut")
|
||||||
|
Name = "Exploding Sword on Weapon Land"
|
||||||
|
CooldownEffects = []
|
||||||
|
AbilityBehavior = ExtResource("1_l4v7e")
|
||||||
|
TriggerSource = 1
|
||||||
|
TriggerTag = SubResource("Resource_6c3kr")
|
||||||
|
AbilityTags = SubResource("Resource_ixeut")
|
||||||
|
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://busdbvfi3jiic"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="1_85dnt"]
|
||||||
|
[ext_resource type="Resource" uid="uid://ifeavnlps7hy" path="res://scenes/player_controller/resources/forge/exploding_sword.tres" id="1_m0rkb"]
|
||||||
|
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_u5iw7"]
|
||||||
|
[ext_resource type="Script" uid="uid://dpakv7agvir6y" path="res://addons/forge/resources/ForgeTag.cs" id="3_u5iw7"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_cjh4j"]
|
||||||
|
script = ExtResource("2_u5iw7")
|
||||||
|
ContainerTags = Array[String](["abilities.weapon.left"])
|
||||||
|
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_mtsda"]
|
||||||
|
script = ExtResource("3_u5iw7")
|
||||||
|
Tag = "events.weapon.startedflying"
|
||||||
|
metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_85dnt")
|
||||||
|
Name = "Exploding Sword on Weapon Left"
|
||||||
|
CooldownEffects = []
|
||||||
|
AbilityBehavior = ExtResource("1_m0rkb")
|
||||||
|
TriggerSource = 1
|
||||||
|
TriggerTag = SubResource("Resource_mtsda")
|
||||||
|
AbilityTags = SubResource("Resource_cjh4j")
|
||||||
|
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"
|
||||||
@@ -66,10 +66,10 @@ script = ExtResource("2_scapu")
|
|||||||
Name = "Inhibit Player Mana Regen Temp"
|
Name = "Inhibit Player Mana Regen Temp"
|
||||||
Modifiers = []
|
Modifiers = []
|
||||||
Components = Array[Object]([SubResource("Resource_bi1d8")])
|
Components = Array[Object]([SubResource("Resource_bi1d8")])
|
||||||
Executions = null
|
Executions = []
|
||||||
DurationType = 2
|
DurationType = 2
|
||||||
Duration = SubResource("Resource_exi3e")
|
Duration = SubResource("Resource_exi3e")
|
||||||
StackLimit = SubResource("Resource_ijayu")
|
StackLimit = SubResource("Resource_ijayu")
|
||||||
InitialStack = SubResource("Resource_1go02")
|
InitialStack = SubResource("Resource_1go02")
|
||||||
Cues = null
|
Cues = []
|
||||||
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeRaiseEventTagExecution" format=3 uid="uid://oe2suroa1klj"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="1_iqjlm"]
|
||||||
|
[ext_resource type="Script" path="res://forge/calculators/ForgeRaiseEventTagExecution.cs" id="2_am2ak"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_sxbq4"]
|
||||||
|
script = ExtResource("1_iqjlm")
|
||||||
|
ContainerTags = Array[String](["events.weapon.flyingtick"])
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("2_am2ak")
|
||||||
|
metadata/_custom_type_script = "uid://br7ut4lbau66w"
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://btnnpqann3ktp"]
|
||||||
|
|
||||||
|
[ext_resource type="Resource" uid="uid://oe2suroa1klj" path="res://scenes/player_controller/resources/forge/raise_flying_tick_event.tres" id="1_pdt6v"]
|
||||||
|
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="1_vh0wp"]
|
||||||
|
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="2_xkoyb"]
|
||||||
|
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="3_j2gem"]
|
||||||
|
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="4_e2sm2"]
|
||||||
|
[ext_resource type="Script" uid="uid://cl5hudinl1rex" path="res://forge/abilities/ForgeEffectApplicationBehavior.cs" id="5_trglf"]
|
||||||
|
[ext_resource type="Script" uid="uid://dpakv7agvir6y" path="res://addons/forge/resources/ForgeTag.cs" id="6_napws"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_dgkld"]
|
||||||
|
script = ExtResource("2_xkoyb")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_1ften"]
|
||||||
|
script = ExtResource("3_j2gem")
|
||||||
|
BaseValue = 0.2
|
||||||
|
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_l278c"]
|
||||||
|
script = ExtResource("2_xkoyb")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_esyoj"]
|
||||||
|
script = ExtResource("4_e2sm2")
|
||||||
|
Modifiers = null
|
||||||
|
Components = null
|
||||||
|
Executions = Array[Object]([ExtResource("1_pdt6v")])
|
||||||
|
DurationType = 1
|
||||||
|
HasPeriodicApplication = true
|
||||||
|
Period = SubResource("Resource_1ften")
|
||||||
|
ExecuteOnApplication = true
|
||||||
|
StackLimit = SubResource("Resource_l278c")
|
||||||
|
InitialStack = SubResource("Resource_dgkld")
|
||||||
|
Cues = null
|
||||||
|
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_0xegy"]
|
||||||
|
script = ExtResource("5_trglf")
|
||||||
|
EffectData = SubResource("Resource_esyoj")
|
||||||
|
metadata/_custom_type_script = "uid://cl5hudinl1rex"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_4aw8y"]
|
||||||
|
script = ExtResource("6_napws")
|
||||||
|
Tag = "events.weapon.startedflying"
|
||||||
|
metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_vh0wp")
|
||||||
|
Name = "Weapon Flying Tick"
|
||||||
|
CooldownEffects = null
|
||||||
|
AbilityBehavior = SubResource("Resource_0xegy")
|
||||||
|
TriggerSource = 1
|
||||||
|
TriggerTag = SubResource("Resource_4aw8y")
|
||||||
|
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
[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.05
|
|
||||||
metadata/_custom_type_script = "uid://di04jvuqp0h7m"
|
|
||||||
@@ -122,7 +122,7 @@ public partial class PlayerController : CharacterBody3D,
|
|||||||
[Export] public ForgeAbilityData EmpoweredActionAbility = null!;
|
[Export] public ForgeAbilityData EmpoweredActionAbility = null!;
|
||||||
[Export] public ForgeAbilityData[] DefaultPermanentAbilities = [];
|
[Export] public ForgeAbilityData[] DefaultPermanentAbilities = [];
|
||||||
[ExportSubgroup("WeaponThrow")]
|
[ExportSubgroup("WeaponThrow")]
|
||||||
[Export] public RExplodingSword[] AbilityLoadout = [];
|
[Export] public ForgeAbilityData[] AbilityLoadout = [];
|
||||||
|
|
||||||
[ExportGroup("Effects")]
|
[ExportGroup("Effects")]
|
||||||
[ExportSubgroup("Common and defaults")]
|
[ExportSubgroup("Common and defaults")]
|
||||||
@@ -747,9 +747,8 @@ public partial class PlayerController : CharacterBody3D,
|
|||||||
|
|
||||||
foreach (var weaponLandAbility in AbilityLoadout)
|
foreach (var weaponLandAbility in AbilityLoadout)
|
||||||
{
|
{
|
||||||
var weaponLeftTag = Tag.RequestTag(tagsManager,"abilities.weapon.left").GetSingleTagContainer();
|
|
||||||
var leftGrantAbilityConfig = new GrantAbilityConfig(
|
var leftGrantAbilityConfig = new GrantAbilityConfig(
|
||||||
weaponLandAbility.Ability(new ExplodingSwordCreation(WeaponSystem), weaponLeftTag),
|
weaponLandAbility.GetAbilityData(),
|
||||||
ScalableLevel: new ScalableInt(1),
|
ScalableLevel: new ScalableInt(1),
|
||||||
RemovalPolicy: AbilityDeactivationPolicy.CancelImmediately,
|
RemovalPolicy: AbilityDeactivationPolicy.CancelImmediately,
|
||||||
InhibitionPolicy: AbilityDeactivationPolicy.CancelImmediately,
|
InhibitionPolicy: AbilityDeactivationPolicy.CancelImmediately,
|
||||||
@@ -763,32 +762,14 @@ public partial class PlayerController : CharacterBody3D,
|
|||||||
new DurationData(DurationType.Infinite),
|
new DurationData(DurationType.Infinite),
|
||||||
effectComponents: [leftGrantComponent]);
|
effectComponents: [leftGrantComponent]);
|
||||||
EffectsManager.ApplyEffect(new Effect(leftGrantEffect, new EffectOwnership(this, this)));
|
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
|
// Forge events
|
||||||
var weaponLeftToken = WeaponSystem.Events.Subscribe<WeaponEventPayload>(WeaponSystem.WeaponStartedFlyingEventTag, OnWeaponLeft);
|
var weaponLeftToken = WeaponSystem.Events.Subscribe(WeaponSystem.WeaponStartedFlyingEventTag, OnWeaponLeft);
|
||||||
var weaponLandedToken = WeaponSystem.Events.Subscribe<WeaponEventPayload>(WeaponSystem.WeaponStoppedFlyingEventTag, OnWeaponLanded);
|
var weaponLandedToken = WeaponSystem.Events.Subscribe(WeaponSystem.WeaponStoppedFlyingEventTag, OnWeaponLanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnWeaponLeft(EventData<WeaponEventPayload> data)
|
public void OnWeaponLeft(EventData data)
|
||||||
{
|
{
|
||||||
var target = data.Target;
|
var target = data.Target;
|
||||||
|
|
||||||
@@ -798,7 +779,7 @@ public partial class PlayerController : CharacterBody3D,
|
|||||||
Abilities.TryActivateAbilitiesByTag(weaponLeftTag, target, out var landedFailures);
|
Abilities.TryActivateAbilitiesByTag(weaponLeftTag, target, out var landedFailures);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnWeaponLanded(EventData<WeaponEventPayload> data)
|
public void OnWeaponLanded(EventData data)
|
||||||
{
|
{
|
||||||
var source = data.Source;
|
var source = data.Source;
|
||||||
var target = data.Target;
|
var target = data.Target;
|
||||||
|
|||||||
Reference in New Issue
Block a user