Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 68e36742af | |||
| 33f55d04f3 | |||
| a139990390 | |||
| b2b7baffe8 | |||
| bed1384dc7 |
@@ -130,6 +130,7 @@
|
|||||||
<Folder Include="tests\" />
|
<Folder Include="tests\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Chickensoft.Sync" Version="2.3.0" />
|
||||||
<PackageReference Include="RustyOptions" Version="0.10.1" />
|
<PackageReference Include="RustyOptions" Version="0.10.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -32,12 +32,21 @@ func _exit_tree() -> void:
|
|||||||
|
|
||||||
func close() -> void:
|
func close() -> void:
|
||||||
menu_closing.emit()
|
menu_closing.emit()
|
||||||
|
hide()
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
func hide_menu() -> void:
|
||||||
_scene_tree.paused = _initial_pause_state
|
_scene_tree.paused = _initial_pause_state
|
||||||
Input.set_mouse_mode(_initial_mouse_mode)
|
Input.set_mouse_mode(_initial_mouse_mode)
|
||||||
if is_instance_valid(_initial_focus_control) and _initial_focus_control.is_inside_tree():
|
if is_instance_valid(_initial_focus_control) and _initial_focus_control.is_inside_tree():
|
||||||
_initial_focus_control.focus_mode = _initial_focus_mode
|
_initial_focus_control.focus_mode = _initial_focus_mode
|
||||||
_initial_focus_control.grab_focus()
|
_initial_focus_control.grab_focus()
|
||||||
queue_free()
|
|
||||||
|
GUIDE.disable_mapping_context(menu_context)
|
||||||
|
for previous_context in previous_mapping_contexts:
|
||||||
|
GUIDE.enable_mapping_context(previous_context)
|
||||||
|
|
||||||
|
visible = false
|
||||||
|
|
||||||
func _handle_cancel_input() -> void:
|
func _handle_cancel_input() -> void:
|
||||||
close()
|
close()
|
||||||
@@ -45,7 +54,7 @@ func _handle_cancel_input() -> void:
|
|||||||
func _on_close_button_pressed() -> void:
|
func _on_close_button_pressed() -> void:
|
||||||
close()
|
close()
|
||||||
|
|
||||||
func _enter_tree() -> void:
|
func show_menu() -> void:
|
||||||
_scene_tree = get_tree()
|
_scene_tree = get_tree()
|
||||||
_initial_pause_state = _scene_tree.paused
|
_initial_pause_state = _scene_tree.paused
|
||||||
_initial_mouse_mode = Input.get_mouse_mode()
|
_initial_mouse_mode = Input.get_mouse_mode()
|
||||||
@@ -61,5 +70,11 @@ func _enter_tree() -> void:
|
|||||||
for previous_context in previous_mapping_contexts:
|
for previous_context in previous_mapping_contexts:
|
||||||
GUIDE.disable_mapping_context(previous_context)
|
GUIDE.disable_mapping_context(previous_context)
|
||||||
GUIDE.enable_mapping_context(menu_context)
|
GUIDE.enable_mapping_context(menu_context)
|
||||||
|
|
||||||
|
visible = true
|
||||||
|
|
||||||
|
func _enter_tree() -> void:
|
||||||
|
print("enter_tree")
|
||||||
|
show_menu()
|
||||||
back_action.triggered.connect(_handle_cancel_input)
|
back_action.triggered.connect(_handle_cancel_input)
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ public partial class ForgeEntityNode : Node3D, IForgeEntity
|
|||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
[Dependency]
|
[Dependency]
|
||||||
public TagsManager TagsManager => this.DependOn<TagsManager>();
|
public TagsManager TagsManager => this.DependOn(() => ForgeManagers.Instance.TagsManager);
|
||||||
[Dependency]
|
[Dependency]
|
||||||
public CuesManager CuesManager => this.DependOn<CuesManager>();
|
public CuesManager CuesManager => this.DependOn(() => ForgeManagers.Instance.CuesManager);
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public ForgeTagContainer? BaseTags { get; set; }
|
public ForgeTagContainer? BaseTags { get; set; }
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public class ExplodingSwordBehavior(PackedScene explosion, float radius) : IAbil
|
|||||||
{
|
{
|
||||||
if (context.Owner is not Node3D owner)
|
if (context.Owner is not Node3D owner)
|
||||||
{
|
{
|
||||||
|
GD.Print("Owner isn't a Node3D");
|
||||||
context.InstanceHandle.End();
|
context.InstanceHandle.End();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -30,8 +31,7 @@ public class ExplodingSwordBehavior(PackedScene explosion, float radius) : IAbil
|
|||||||
}
|
}
|
||||||
explo.Radius = radius;
|
explo.Radius = radius;
|
||||||
|
|
||||||
GD.Print("explosion");
|
owner.GetTree().GetCurrentScene().CallDeferred(Node.MethodName.AddChild, explo);
|
||||||
owner.GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, explo);
|
|
||||||
explo.CallDeferred(Node3D.MethodName.SetGlobalPosition, owner.GlobalPosition);
|
explo.CallDeferred(Node3D.MethodName.SetGlobalPosition, owner.GlobalPosition);
|
||||||
|
|
||||||
context.AbilityHandle.CommitAbility();
|
context.AbilityHandle.CommitAbility();
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
using Gamesmiths.Forge.Abilities;
|
using Gamesmiths.Forge.Abilities;
|
||||||
|
using Gamesmiths.Forge.Effects;
|
||||||
|
using Gamesmiths.Forge.Godot.Resources;
|
||||||
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace Movementtests.forge.abilities;
|
namespace Movementtests.forge.abilities;
|
||||||
|
|
||||||
public class InstantEndBehavior : IAbilityBehavior
|
public class InstantEndBehavior(ForgeEffectData? effectData) : IAbilityBehavior
|
||||||
{
|
{
|
||||||
public void OnStarted(AbilityBehaviorContext context)
|
public void OnStarted(AbilityBehaviorContext context)
|
||||||
{
|
{
|
||||||
|
if (effectData != null)
|
||||||
|
{
|
||||||
|
var effect = new Effect(effectData.GetEffectData(), new EffectOwnership(context.Owner, context.Owner));
|
||||||
|
context.Owner.EffectsManager.ApplyEffect(effect);
|
||||||
|
}
|
||||||
context.AbilityHandle.CommitAbility();
|
context.AbilityHandle.CommitAbility();
|
||||||
context.InstanceHandle.End();
|
context.InstanceHandle.End();
|
||||||
}
|
}
|
||||||
@@ -19,5 +26,6 @@ public class InstantEndBehavior : IAbilityBehavior
|
|||||||
[GlobalClass]
|
[GlobalClass]
|
||||||
public partial class ForgeInstantEndBehavior : ForgeAbilityBehavior
|
public partial class ForgeInstantEndBehavior : ForgeAbilityBehavior
|
||||||
{
|
{
|
||||||
public override IAbilityBehavior GetBehavior() => new InstantEndBehavior();
|
[Export] public ForgeEffectData? OptionalEffectData { get; set; }
|
||||||
|
public override IAbilityBehavior GetBehavior() => new InstantEndBehavior(OptionalEffectData);
|
||||||
}
|
}
|
||||||
@@ -6,20 +6,28 @@ using Godot;
|
|||||||
|
|
||||||
namespace Movementtests.forge.abilities;
|
namespace Movementtests.forge.abilities;
|
||||||
|
|
||||||
|
public record SimpleHitEffectData(Vector3 SourceLocation, Vector3 TargetLocation, float Magnitude = 1);
|
||||||
|
|
||||||
public class SimpleHitBehavior(ForgeEffectData? damage) : IAbilityBehavior
|
public class SimpleHitBehavior(ForgeEffectData? damage) : IAbilityBehavior
|
||||||
{
|
{
|
||||||
public void OnStarted(AbilityBehaviorContext context)
|
public void OnStarted(AbilityBehaviorContext context)
|
||||||
{
|
{
|
||||||
if (context.Target == null || damage == null) return;
|
if (context.Target == null || damage == null) return;
|
||||||
|
|
||||||
var effect = new Effect(damage.GetEffectData(), new EffectOwnership(context.Owner, context.Owner));
|
var sourceLocation = (context.Source as Node3D)?.GlobalPosition ?? Vector3.Zero;
|
||||||
context.Target.EffectsManager.ApplyEffect(effect);
|
var targetLocation = (context.Target as Node3D)?.GlobalPosition ?? Vector3.Zero;
|
||||||
|
|
||||||
context.AbilityHandle.CommitAbility();
|
var magnitude = context.Magnitude == 0 ? 1 : context.Magnitude;
|
||||||
context.InstanceHandle.End();
|
var effect = new Effect(damage.GetEffectData(), new EffectOwnership(context.Owner, context.Owner));
|
||||||
|
context.Target.EffectsManager.ApplyEffect(effect, new SimpleHitEffectData(sourceLocation, targetLocation, magnitude));
|
||||||
|
|
||||||
|
// context.InstanceHandle.End();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnEnded(AbilityBehaviorContext context) {}
|
public void OnEnded(AbilityBehaviorContext context)
|
||||||
|
{
|
||||||
|
context.AbilityHandle.CommitAbility();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Tool]
|
[Tool]
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ namespace Movementtests.scenes.enemies;
|
|||||||
public class MetaAttributeSet : AttributeSet
|
public class MetaAttributeSet : AttributeSet
|
||||||
{
|
{
|
||||||
public EntityAttribute IncomingDamage { get; private set; }
|
public EntityAttribute IncomingDamage { get; private set; }
|
||||||
|
public EntityAttribute Level { get; private set; }
|
||||||
|
|
||||||
public MetaAttributeSet()
|
public MetaAttributeSet()
|
||||||
{
|
{
|
||||||
IncomingDamage = InitializeAttribute(nameof(IncomingDamage), 0, 0, 1000, channels: 4);
|
IncomingDamage = InitializeAttribute(nameof(IncomingDamage), 0, 0, 1000, channels: 4);
|
||||||
|
Level = InitializeAttribute(nameof(Level), 1, 1, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,18 +2,8 @@ namespace Movementtests.tools.calculators;
|
|||||||
|
|
||||||
public enum DamageType
|
public enum DamageType
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Physical damage.
|
|
||||||
/// </summary>
|
|
||||||
Physical = 0,
|
Physical = 0,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Magical damage.
|
|
||||||
/// </summary>
|
|
||||||
Magical = 1,
|
Magical = 1,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Elemental damage.
|
|
||||||
/// </summary>
|
|
||||||
Elemental = 2,
|
Elemental = 2,
|
||||||
|
Explosive = 3,
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ using Gamesmiths.Forge.Godot.Resources;
|
|||||||
using Gamesmiths.Forge.Godot.Resources.Calculators;
|
using Gamesmiths.Forge.Godot.Resources.Calculators;
|
||||||
using Gamesmiths.Forge.Tags;
|
using Gamesmiths.Forge.Tags;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using Movementtests.forge.abilities;
|
||||||
|
|
||||||
namespace Movementtests.tools.calculators;
|
namespace Movementtests.tools.calculators;
|
||||||
|
|
||||||
@@ -64,9 +65,9 @@ public class DamageExecution : CustomExecution
|
|||||||
return [.. results];
|
return [.. results];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effectEvaluatedData?.TryGetContextData(out float multiplier) == true)
|
if (effectEvaluatedData?.TryGetContextData(out SimpleHitEffectData? hitEffectData) == true)
|
||||||
{
|
{
|
||||||
targetIncomingDamage *= multiplier;
|
targetIncomingDamage *= hitEffectData.Magnitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply health reduction to target if attribute exists
|
// Apply health reduction to target if attribute exists
|
||||||
|
|||||||
102
forge/calculators/ForgeKnockbackExecution.cs
Normal file
102
forge/calculators/ForgeKnockbackExecution.cs
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Gamesmiths.Forge.Core;
|
||||||
|
using Gamesmiths.Forge.Effects;
|
||||||
|
using Gamesmiths.Forge.Effects.Calculator;
|
||||||
|
using Gamesmiths.Forge.Effects.Magnitudes;
|
||||||
|
using Gamesmiths.Forge.Events;
|
||||||
|
using Gamesmiths.Forge.Godot.Resources;
|
||||||
|
using Gamesmiths.Forge.Godot.Resources.Calculators;
|
||||||
|
using Godot;
|
||||||
|
using Movementtests.forge.abilities;
|
||||||
|
using Movementtests.scenes.components.knockback;
|
||||||
|
|
||||||
|
namespace Movementtests.tools.calculators;
|
||||||
|
|
||||||
|
|
||||||
|
public record KnockbackDone(float KnockbackValue, Vector3 knockbackDirection);
|
||||||
|
|
||||||
|
public class KnockbackExecution : CustomExecution
|
||||||
|
{
|
||||||
|
private readonly RKnockback _knockback;
|
||||||
|
private readonly ForgeTag _knockbackTag;
|
||||||
|
private readonly ForgeTagContainer? _knockbackReceiverEventTags;
|
||||||
|
private readonly ForgeTagContainer? _knockbackDealerEventTags;
|
||||||
|
|
||||||
|
public AttributeCaptureDefinition TargetIncomingDamage { get; }
|
||||||
|
|
||||||
|
public KnockbackExecution(ForgeTag knockbackTag, RKnockback knockback, ForgeTagContainer? knockbackDealerEventTags, ForgeTagContainer? knockbackReceiverEventTags)
|
||||||
|
{
|
||||||
|
_knockback = knockback;
|
||||||
|
_knockbackTag = knockbackTag;
|
||||||
|
_knockbackDealerEventTags = knockbackDealerEventTags;
|
||||||
|
_knockbackReceiverEventTags = knockbackReceiverEventTags;
|
||||||
|
|
||||||
|
TargetIncomingDamage = new AttributeCaptureDefinition(
|
||||||
|
"MetaAttributeSet.IncomingDamage",
|
||||||
|
AttributeCaptureSource.Target);
|
||||||
|
AttributesToCapture.Add(TargetIncomingDamage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override ModifierEvaluatedData[] EvaluateExecution(Effect effect, IForgeEntity target, EffectEvaluatedData? effectEvaluatedData)
|
||||||
|
{
|
||||||
|
var results = new List<ModifierEvaluatedData>();
|
||||||
|
if (!target.Tags.CombinedTags.HasTag(_knockbackTag.GetTag()))
|
||||||
|
return [.. results];
|
||||||
|
|
||||||
|
float targetIncomingDamage = CaptureAttributeMagnitude(
|
||||||
|
TargetIncomingDamage,
|
||||||
|
effect,
|
||||||
|
target,
|
||||||
|
effectEvaluatedData);
|
||||||
|
|
||||||
|
if (targetIncomingDamage <= 0)
|
||||||
|
return [.. results];
|
||||||
|
|
||||||
|
var knockbackValue = _knockback.Modifier * targetIncomingDamage / 100.0f;
|
||||||
|
|
||||||
|
if (_knockbackReceiverEventTags is null)
|
||||||
|
return [.. results];
|
||||||
|
|
||||||
|
var knockbackDirection = Vector3.Zero;
|
||||||
|
if (effectEvaluatedData?.TryGetContextData(out SimpleHitEffectData? hitEffectData) == true)
|
||||||
|
{
|
||||||
|
knockbackDirection = hitEffectData.SourceLocation.DirectionTo(hitEffectData.TargetLocation);
|
||||||
|
}
|
||||||
|
target.Events.Raise(new EventData<KnockbackDone>
|
||||||
|
{
|
||||||
|
EventTags = _knockbackReceiverEventTags.GetTagContainer(),
|
||||||
|
Source = effect.Ownership.Owner,
|
||||||
|
Target = target,
|
||||||
|
EventMagnitude = knockbackValue,
|
||||||
|
Payload = new KnockbackDone(knockbackValue, knockbackDirection)
|
||||||
|
});
|
||||||
|
|
||||||
|
if (effect.Ownership.Source is null || _knockbackDealerEventTags is null)
|
||||||
|
return [.. results];
|
||||||
|
|
||||||
|
effect.Ownership.Source.Events.Raise(new EventData<KnockbackDone>
|
||||||
|
{
|
||||||
|
EventTags = _knockbackDealerEventTags.GetTagContainer(),
|
||||||
|
Source = effect.Ownership.Owner,
|
||||||
|
Target = target,
|
||||||
|
EventMagnitude = knockbackValue,
|
||||||
|
Payload = new KnockbackDone(knockbackValue, knockbackDirection)
|
||||||
|
});
|
||||||
|
|
||||||
|
return [.. results];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[GlobalClass]
|
||||||
|
public partial class ForgeKnockbackExecution : ForgeCustomExecution
|
||||||
|
{
|
||||||
|
[Export] public ForgeTag? KnockbackableTag { get; set; }
|
||||||
|
[Export] public RKnockback? Knockback { get; set; }
|
||||||
|
[Export] public ForgeTagContainer? KnockbackDealerEventTags { get; set; }
|
||||||
|
[Export] public ForgeTagContainer? KnockbackReceiverEventTags { get; set; }
|
||||||
|
public override CustomExecution GetExecutionClass()
|
||||||
|
{
|
||||||
|
if (Knockback == null || KnockbackableTag == null) throw new System.ArgumentException("Knockback or KnockbackableTag is null");
|
||||||
|
return new KnockbackExecution(KnockbackableTag, Knockback, KnockbackDealerEventTags, KnockbackReceiverEventTags);
|
||||||
|
}
|
||||||
|
}
|
||||||
1
forge/calculators/ForgeKnockbackExecution.cs.uid
Normal file
1
forge/calculators/ForgeKnockbackExecution.cs.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://diondfg5xp78h
|
||||||
@@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_l686n")
|
script = ExtResource("1_l686n")
|
||||||
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", "cues.resources.mana.inhibited", "cues.resources.health", "cooldown.enemy.hit", "events.combat.death", "cooldown.hit", "events.player.hit", "cues.enemy.health", "immunity.damage", "status", "traits.damageable"])
|
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", "cues.resources.mana.inhibited", "cues.resources.health", "cooldown.enemy.hit", "events.combat.death", "cooldown.hit", "events.player.hit", "cues.enemy.health", "immunity.damage", "status", "traits.damageable", "traits.knockbackable", "events.combat.knockback_dealt", "events.combat.knockback_received"])
|
||||||
|
|||||||
@@ -1,84 +1,21 @@
|
|||||||
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://dccuj66egxfwh"]
|
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://dccuj66egxfwh"]
|
||||||
|
|
||||||
|
[ext_resource type="Resource" uid="uid://c4ea6ktafqe0r" path="res://forge/resources/effect_datas/temp_invincibility.tres" id="1_ent4t"]
|
||||||
|
[ext_resource type="Script" uid="uid://c7s5v7ii4nujg" path="res://forge/abilities/ForgeInstantEndBehavior.cs" id="2_ent4t"]
|
||||||
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_prg0a"]
|
[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://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://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://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://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="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="7_0rp6y"]
|
||||||
[ext_resource type="Script" uid="uid://cl5hudinl1rex" path="res://forge/abilities/ForgeEffectApplicationBehavior.cs" id="7_ent4t"]
|
|
||||||
[ext_resource type="Resource" uid="uid://dn7b8frkoxpxr" path="res://forge/resources/cues/player_mana_changed_cue.tres" id="8_0olwd"]
|
[ext_resource type="Resource" uid="uid://dn7b8frkoxpxr" path="res://forge/resources/cues/player_mana_changed_cue.tres" id="8_0olwd"]
|
||||||
[ext_resource type="Resource" uid="uid://cw2ytd34jsxj" path="res://forge/resources/tag_containers/immune_damage.tres" id="8_ent4t"]
|
|
||||||
[ext_resource type="Script" uid="uid://bdfcavbjyhxxa" path="res://addons/forge/resources/ForgeModifier.cs" id="9_wluo0"]
|
[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"]
|
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="10_2sq4o"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_xltxv"]
|
[sub_resource type="Resource" id="Resource_xltxv"]
|
||||||
script = ExtResource("3_k72m0")
|
script = ExtResource("2_ent4t")
|
||||||
TagsToAdd = ExtResource("8_ent4t")
|
OptionalEffectData = ExtResource("1_ent4t")
|
||||||
metadata/_custom_type_script = "uid://dngf30hxy5go4"
|
metadata/_custom_type_script = "uid://c7s5v7ii4nujg"
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_60xl1"]
|
|
||||||
script = ExtResource("4_5fdax")
|
|
||||||
BaseValue = 1.0
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_2rev5"]
|
|
||||||
script = ExtResource("4_5fdax")
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_kxytj"]
|
|
||||||
script = ExtResource("4_5fdax")
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_e5nje"]
|
|
||||||
script = ExtResource("4_5fdax")
|
|
||||||
BaseValue = 1.0
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_xc8ja"]
|
|
||||||
script = ExtResource("4_5fdax")
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_tan32"]
|
|
||||||
script = ExtResource("4_5fdax")
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_l52b0"]
|
|
||||||
script = ExtResource("4_5fdax")
|
|
||||||
BaseValue = 0.3
|
|
||||||
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_6jn6y"]
|
|
||||||
script = ExtResource("5_5qmmj")
|
|
||||||
ScalableFloat = SubResource("Resource_l52b0")
|
|
||||||
Coefficient = SubResource("Resource_e5nje")
|
|
||||||
PreMultiplyAdditiveValue = SubResource("Resource_tan32")
|
|
||||||
PostMultiplyAdditiveValue = SubResource("Resource_xc8ja")
|
|
||||||
CalculatorCoefficient = SubResource("Resource_60xl1")
|
|
||||||
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_kxytj")
|
|
||||||
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_2rev5")
|
|
||||||
metadata/_custom_type_script = "uid://2gm1hdhi8u08"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_ev6w4"]
|
|
||||||
script = ExtResource("6_yi0bg")
|
|
||||||
BaseValue = 1
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_u8xa8"]
|
|
||||||
script = ExtResource("6_yi0bg")
|
|
||||||
BaseValue = 1
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_xsfte"]
|
|
||||||
script = ExtResource("7_0rp6y")
|
|
||||||
Name = "ApplyInvincibility"
|
|
||||||
Modifiers = []
|
|
||||||
Components = Array[Object]([SubResource("Resource_xltxv")])
|
|
||||||
Executions = null
|
|
||||||
DurationType = 2
|
|
||||||
Duration = SubResource("Resource_6jn6y")
|
|
||||||
StackLimit = SubResource("Resource_u8xa8")
|
|
||||||
InitialStack = SubResource("Resource_ev6w4")
|
|
||||||
Cues = null
|
|
||||||
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_xh53a"]
|
|
||||||
script = ExtResource("7_ent4t")
|
|
||||||
EffectData = SubResource("Resource_xsfte")
|
|
||||||
Name = "Apply invincibility"
|
|
||||||
metadata/_custom_type_script = "uid://cl5hudinl1rex"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_h116a"]
|
[sub_resource type="Resource" id="Resource_h116a"]
|
||||||
script = ExtResource("2_prg0a")
|
script = ExtResource("2_prg0a")
|
||||||
@@ -245,5 +182,5 @@ script = ExtResource("10_2sq4o")
|
|||||||
Name = "Empowered Action"
|
Name = "Empowered Action"
|
||||||
CooldownEffects = [SubResource("Resource_egh2b")]
|
CooldownEffects = [SubResource("Resource_egh2b")]
|
||||||
CostEffect = SubResource("Resource_mtef8")
|
CostEffect = SubResource("Resource_mtef8")
|
||||||
AbilityBehavior = SubResource("Resource_xh53a")
|
AbilityBehavior = SubResource("Resource_xltxv")
|
||||||
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"
|
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"
|
||||||
|
|||||||
113
forge/resources/ability_datas/explosion_hit.tres
Normal file
113
forge/resources/ability_datas/explosion_hit.tres
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeAbilityData" format=3 uid="uid://nns16d5uhtl8"]
|
||||||
|
|
||||||
|
[ext_resource type="Resource" uid="uid://bpovqvlqv5bs5" path="res://forge/resources/effect_components/damageable.tres" id="1_w36j6"]
|
||||||
|
[ext_resource type="Resource" uid="uid://sn6kndc6ukic" path="res://forge/resources/tag_containers/on_damage_dealt.tres" id="2_3ma4g"]
|
||||||
|
[ext_resource type="Resource" uid="uid://5tr54q0rdpho" path="res://forge/resources/tag_containers/on_damage_taken.tres" id="3_kyfqu"]
|
||||||
|
[ext_resource type="Script" uid="uid://cfx62w40nd84v" path="res://forge/calculators/ForgeDamageExecution.cs" id="4_xfamx"]
|
||||||
|
[ext_resource type="Script" uid="uid://b44cse62qru7j" path="res://scenes/components/knockback/RKnockback.cs" id="5_tw4gc"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bhn27s8ne0uyg" path="res://forge/resources/tag_containers/on_knockback_dealt.tres" id="6_nq3a0"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bkr6uu57wm3o3" path="res://forge/resources/tag_containers/on_knockback_received.tres" id="7_3utx7"]
|
||||||
|
[ext_resource type="Resource" uid="uid://45l7vnfs72b" path="res://forge/resources/tag_containers/knockbackable_tag.tres" id="8_7hfxb"]
|
||||||
|
[ext_resource type="Script" uid="uid://diondfg5xp78h" path="res://forge/calculators/ForgeKnockbackExecution.cs" id="9_lysxe"]
|
||||||
|
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="10_sd7ih"]
|
||||||
|
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="11_bs6rs"]
|
||||||
|
[ext_resource type="Script" uid="uid://bdfcavbjyhxxa" path="res://addons/forge/resources/ForgeModifier.cs" id="12_a6jts"]
|
||||||
|
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="13_c85am"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c2akxlg7tdb67" path="res://assets/ui/IconGodotNode/node/icon_projectile.png" id="14_ow2i8"]
|
||||||
|
[ext_resource type="Script" uid="uid://n6efm5o4uxvr" path="res://forge/abilities/ForgeSimpleHitBehavior.cs" id="15_ki7ct"]
|
||||||
|
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="16_hhyju"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_vy8wr"]
|
||||||
|
script = ExtResource("4_xfamx")
|
||||||
|
DamageType = 3
|
||||||
|
DamageDealerEventTags = ExtResource("2_3ma4g")
|
||||||
|
DamageReceiverEventTags = ExtResource("3_kyfqu")
|
||||||
|
metadata/_custom_type_script = "uid://cfx62w40nd84v"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_ndb8p"]
|
||||||
|
script = ExtResource("5_tw4gc")
|
||||||
|
Modifier = 100.0
|
||||||
|
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_dy671"]
|
||||||
|
script = ExtResource("9_lysxe")
|
||||||
|
KnockbackableTag = ExtResource("8_7hfxb")
|
||||||
|
Knockback = SubResource("Resource_ndb8p")
|
||||||
|
KnockbackDealerEventTags = ExtResource("6_nq3a0")
|
||||||
|
KnockbackReceiverEventTags = ExtResource("7_3utx7")
|
||||||
|
metadata/_custom_type_script = "uid://diondfg5xp78h"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_i0sj3"]
|
||||||
|
script = ExtResource("10_sd7ih")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_1mvp7"]
|
||||||
|
script = ExtResource("11_bs6rs")
|
||||||
|
BaseValue = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_jxdlf"]
|
||||||
|
script = ExtResource("11_bs6rs")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_rslib"]
|
||||||
|
script = ExtResource("11_bs6rs")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_3l3du"]
|
||||||
|
script = ExtResource("11_bs6rs")
|
||||||
|
BaseValue = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_qqpg8"]
|
||||||
|
script = ExtResource("11_bs6rs")
|
||||||
|
BaseValue = 10.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_igmn0"]
|
||||||
|
script = ExtResource("11_bs6rs")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_acqnn"]
|
||||||
|
script = ExtResource("11_bs6rs")
|
||||||
|
BaseValue = 50.0
|
||||||
|
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_xwtie"]
|
||||||
|
script = ExtResource("12_a6jts")
|
||||||
|
Attribute = "MetaAttributeSet.IncomingDamage"
|
||||||
|
CalculationType = 1
|
||||||
|
ScalableFloat = SubResource("Resource_acqnn")
|
||||||
|
CapturedAttribute = "MetaAttributeSet.Level"
|
||||||
|
Coefficient = SubResource("Resource_3l3du")
|
||||||
|
PreMultiplyAdditiveValue = SubResource("Resource_igmn0")
|
||||||
|
PostMultiplyAdditiveValue = SubResource("Resource_qqpg8")
|
||||||
|
CalculatorCoefficient = SubResource("Resource_1mvp7")
|
||||||
|
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_rslib")
|
||||||
|
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_jxdlf")
|
||||||
|
metadata/_custom_type_script = "uid://bdfcavbjyhxxa"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_ikb7l"]
|
||||||
|
script = ExtResource("10_sd7ih")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_jdvg8"]
|
||||||
|
script = ExtResource("13_c85am")
|
||||||
|
Name = "Explosion hit"
|
||||||
|
Modifiers = Array[Object]([SubResource("Resource_xwtie")])
|
||||||
|
Components = Array[Object]([ExtResource("1_w36j6")])
|
||||||
|
Executions = Array[Object]([SubResource("Resource_vy8wr"), SubResource("Resource_dy671")])
|
||||||
|
StackLimit = SubResource("Resource_ikb7l")
|
||||||
|
InitialStack = SubResource("Resource_i0sj3")
|
||||||
|
Cues = []
|
||||||
|
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_ba5lh"]
|
||||||
|
script = ExtResource("15_ki7ct")
|
||||||
|
DamageEffect = SubResource("Resource_jdvg8")
|
||||||
|
Name = "Explostion hit"
|
||||||
|
Description = "Called by explosion scene"
|
||||||
|
Icon = ExtResource("14_ow2i8")
|
||||||
|
metadata/_custom_type_script = "uid://n6efm5o4uxvr"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("16_hhyju")
|
||||||
|
Name = "Explosion "
|
||||||
|
InstancingPolicy = 1
|
||||||
|
CooldownEffects = []
|
||||||
|
AbilityBehavior = SubResource("Resource_ba5lh")
|
||||||
|
metadata/_custom_type_script = "uid://dhxfbxh54pyxp"
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
[ext_resource type="Script" uid="uid://dngf30hxy5go4" path="res://addons/forge/resources/components/ModifierTags.cs" id="2_jwyed"]
|
[ext_resource type="Script" uid="uid://dngf30hxy5go4" path="res://addons/forge/resources/components/ModifierTags.cs" id="2_jwyed"]
|
||||||
[ext_resource type="Resource" uid="uid://4rkwr10pc6tp" path="res://forge/resources/custom_executions/physical_damage_calculator.tres" id="2_l5emy"]
|
[ext_resource type="Resource" uid="uid://4rkwr10pc6tp" path="res://forge/resources/custom_executions/physical_damage_calculator.tres" id="2_l5emy"]
|
||||||
[ext_resource type="Script" uid="uid://bdfcavbjyhxxa" path="res://addons/forge/resources/ForgeModifier.cs" id="3_c4wry"]
|
[ext_resource type="Script" uid="uid://bdfcavbjyhxxa" path="res://addons/forge/resources/ForgeModifier.cs" id="3_c4wry"]
|
||||||
|
[ext_resource type="Resource" uid="uid://cc1qrmbp12fk8" path="res://forge/resources/custom_executions/player_hit_knoback_calculation.tres" id="3_l5emy"]
|
||||||
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="3_w1wo0"]
|
[ext_resource type="Script" uid="uid://dhxfbxh54pyxp" path="res://addons/forge/resources/abilities/ForgeAbilityData.cs" id="3_w1wo0"]
|
||||||
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="4_c4wry"]
|
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="4_c4wry"]
|
||||||
[ext_resource type="Script" uid="uid://2gm1hdhi8u08" path="res://addons/forge/resources/magnitudes/ForgeModifierMagnitude.cs" id="5_0cyim"]
|
[ext_resource type="Script" uid="uid://2gm1hdhi8u08" path="res://addons/forge/resources/magnitudes/ForgeModifierMagnitude.cs" id="5_0cyim"]
|
||||||
@@ -63,7 +64,7 @@ script = ExtResource("2_5vjbv")
|
|||||||
Name = "Player Hit Effect"
|
Name = "Player Hit Effect"
|
||||||
Modifiers = Array[Object]([SubResource("Resource_04hqa")])
|
Modifiers = Array[Object]([SubResource("Resource_04hqa")])
|
||||||
Components = Array[Object]([ExtResource("1_r7waw")])
|
Components = Array[Object]([ExtResource("1_r7waw")])
|
||||||
Executions = Array[Object]([ExtResource("2_l5emy")])
|
Executions = Array[Object]([ExtResource("2_l5emy"), ExtResource("3_l5emy")])
|
||||||
StackLimit = SubResource("Resource_8fbeq")
|
StackLimit = SubResource("Resource_8fbeq")
|
||||||
InitialStack = SubResource("Resource_0cyim")
|
InitialStack = SubResource("Resource_0cyim")
|
||||||
Cues = []
|
Cues = []
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeKnockbackExecution" format=3 uid="uid://cc1qrmbp12fk8"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://b44cse62qru7j" path="res://scenes/components/knockback/RKnockback.cs" id="1_kcl5u"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bhn27s8ne0uyg" path="res://forge/resources/tag_containers/on_knockback_dealt.tres" id="2_oqtq1"]
|
||||||
|
[ext_resource type="Resource" uid="uid://bkr6uu57wm3o3" path="res://forge/resources/tag_containers/on_knockback_received.tres" id="3_1va1b"]
|
||||||
|
[ext_resource type="Resource" uid="uid://45l7vnfs72b" path="res://forge/resources/tag_containers/knockbackable_tag.tres" id="4_0i0oh"]
|
||||||
|
[ext_resource type="Script" uid="uid://diondfg5xp78h" path="res://forge/calculators/ForgeKnockbackExecution.cs" id="5_babc1"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_6x2ov"]
|
||||||
|
script = ExtResource("1_kcl5u")
|
||||||
|
Modifier = 50.0
|
||||||
|
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("5_babc1")
|
||||||
|
KnockbackableTag = ExtResource("4_0i0oh")
|
||||||
|
Knockback = SubResource("Resource_6x2ov")
|
||||||
|
KnockbackDealerEventTags = ExtResource("2_oqtq1")
|
||||||
|
KnockbackReceiverEventTags = ExtResource("3_1va1b")
|
||||||
|
metadata/_custom_type_script = "uid://diondfg5xp78h"
|
||||||
70
forge/resources/effect_datas/temp_invincibility.tres
Normal file
70
forge/resources/effect_datas/temp_invincibility.tres
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeEffectData" format=3 uid="uid://c4ea6ktafqe0r"]
|
||||||
|
|
||||||
|
[ext_resource type="Resource" uid="uid://cw2ytd34jsxj" path="res://forge/resources/tag_containers/immune_damage.tres" id="1_suvh6"]
|
||||||
|
[ext_resource type="Script" uid="uid://dngf30hxy5go4" path="res://addons/forge/resources/components/ModifierTags.cs" id="2_7y7k0"]
|
||||||
|
[ext_resource type="Script" uid="uid://cn3b4ya15fg7e" path="res://addons/forge/resources/magnitudes/ForgeScalableFloat.cs" id="3_wdmyo"]
|
||||||
|
[ext_resource type="Script" uid="uid://2gm1hdhi8u08" path="res://addons/forge/resources/magnitudes/ForgeModifierMagnitude.cs" id="4_m2dme"]
|
||||||
|
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="5_uck3v"]
|
||||||
|
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="6_gt48y"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_xltxv"]
|
||||||
|
script = ExtResource("2_7y7k0")
|
||||||
|
TagsToAdd = ExtResource("1_suvh6")
|
||||||
|
metadata/_custom_type_script = "uid://dngf30hxy5go4"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_60xl1"]
|
||||||
|
script = ExtResource("3_wdmyo")
|
||||||
|
BaseValue = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_2rev5"]
|
||||||
|
script = ExtResource("3_wdmyo")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_kxytj"]
|
||||||
|
script = ExtResource("3_wdmyo")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_e5nje"]
|
||||||
|
script = ExtResource("3_wdmyo")
|
||||||
|
BaseValue = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_xc8ja"]
|
||||||
|
script = ExtResource("3_wdmyo")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_tan32"]
|
||||||
|
script = ExtResource("3_wdmyo")
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_l52b0"]
|
||||||
|
script = ExtResource("3_wdmyo")
|
||||||
|
BaseValue = 0.3
|
||||||
|
metadata/_custom_type_script = "uid://cn3b4ya15fg7e"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_6jn6y"]
|
||||||
|
script = ExtResource("4_m2dme")
|
||||||
|
ScalableFloat = SubResource("Resource_l52b0")
|
||||||
|
Coefficient = SubResource("Resource_e5nje")
|
||||||
|
PreMultiplyAdditiveValue = SubResource("Resource_tan32")
|
||||||
|
PostMultiplyAdditiveValue = SubResource("Resource_xc8ja")
|
||||||
|
CalculatorCoefficient = SubResource("Resource_60xl1")
|
||||||
|
CalculatorPreMultiplyAdditiveValue = SubResource("Resource_kxytj")
|
||||||
|
CalculatorPostMultiplyAdditiveValue = SubResource("Resource_2rev5")
|
||||||
|
metadata/_custom_type_script = "uid://2gm1hdhi8u08"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_ev6w4"]
|
||||||
|
script = ExtResource("5_uck3v")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_u8xa8"]
|
||||||
|
script = ExtResource("5_uck3v")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("6_gt48y")
|
||||||
|
Name = "ApplyInvincibility"
|
||||||
|
Modifiers = []
|
||||||
|
Components = Array[Object]([SubResource("Resource_xltxv")])
|
||||||
|
Executions = []
|
||||||
|
DurationType = 2
|
||||||
|
Duration = SubResource("Resource_6jn6y")
|
||||||
|
StackLimit = SubResource("Resource_u8xa8")
|
||||||
|
InitialStack = SubResource("Resource_ev6w4")
|
||||||
|
Cues = []
|
||||||
|
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
||||||
@@ -4,5 +4,5 @@
|
|||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_kdy2b")
|
script = ExtResource("1_kdy2b")
|
||||||
ContainerTags = Array[String](["character.enemy", "traits.damageable"])
|
ContainerTags = Array[String](["character.enemy", "traits.damageable", "traits.knockbackable"])
|
||||||
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
||||||
|
|||||||
8
forge/resources/tag_containers/knockbackable_tag.tres
Normal file
8
forge/resources/tag_containers/knockbackable_tag.tres
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeTag" format=3 uid="uid://45l7vnfs72b"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dpakv7agvir6y" path="res://addons/forge/resources/ForgeTag.cs" id="1_1cy5u"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_1cy5u")
|
||||||
|
Tag = "traits.knockbackable"
|
||||||
|
metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
||||||
8
forge/resources/tag_containers/on_knockback_dealt.tres
Normal file
8
forge/resources/tag_containers/on_knockback_dealt.tres
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeTagContainer" format=3 uid="uid://bhn27s8ne0uyg"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="1_kgxiq"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_kgxiq")
|
||||||
|
ContainerTags = Array[String](["events.combat.knockback_dealt"])
|
||||||
|
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[gd_resource type="Resource" script_class="ForgeTagContainer" format=3 uid="uid://bkr6uu57wm3o3"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="1_ro1gp"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_ro1gp")
|
||||||
|
ContainerTags = Array[String](["events.combat.knockback_received"])
|
||||||
|
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using Gamesmiths.Forge.Abilities;
|
|
||||||
using Gamesmiths.Forge.Effects;
|
|
||||||
using Gamesmiths.Forge.Tags;
|
|
||||||
using Godot;
|
|
||||||
|
|
||||||
namespace Movementtests.interfaces;
|
|
||||||
|
|
||||||
public interface IAbilityBase<TCreation, TPayload>
|
|
||||||
{
|
|
||||||
AbilityData Ability(TCreation creationData, TagContainer? tags);
|
|
||||||
IAbilityBehavior<TPayload> Behavior(TCreation creationData);
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://de881c2xsbutk
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
|
|
||||||
namespace Movementtests.interfaces;
|
|
||||||
|
|
||||||
public interface IDamageDealer
|
|
||||||
{
|
|
||||||
[Export]
|
|
||||||
RDamage RDamage { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://wdqo51131g5
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Godot;
|
|
||||||
|
|
||||||
namespace Movementtests.interfaces;
|
|
||||||
|
|
||||||
public record DamageRecord(Vector3 SourceLocation, RDamage Damage);
|
|
||||||
|
|
||||||
public interface IDamageable
|
|
||||||
{
|
|
||||||
event Action<IDamageable, DamageRecord> DamageTaken;
|
|
||||||
|
|
||||||
DamageRecord TakeDamage(DamageRecord damageRecord);
|
|
||||||
DamageRecord ComputeDamage(DamageRecord damageRecord);
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://cf56b2ep3bu3j
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Godot;
|
|
||||||
|
|
||||||
namespace Movementtests.interfaces;
|
|
||||||
|
|
||||||
public record HealthChangedRecord(float CurrentHealth, float PreviousHealth, float MaxHealth);
|
|
||||||
|
|
||||||
public interface IHealthable
|
|
||||||
{
|
|
||||||
event Action<IHealthable, HealthChangedRecord> HealthChanged;
|
|
||||||
event Action<IHealthable> HealthDepleted;
|
|
||||||
|
|
||||||
[Export] RHealth? RHealth { get; set; }
|
|
||||||
|
|
||||||
float CurrentHealth { get; set; }
|
|
||||||
|
|
||||||
HealthChangedRecord ReduceHealth(IDamageable source, DamageRecord damageRecord);
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://bea2kvnu3kuhu
|
|
||||||
@@ -2,5 +2,5 @@ namespace Movementtests.interfaces;
|
|||||||
|
|
||||||
public interface IKillable
|
public interface IKillable
|
||||||
{
|
{
|
||||||
void Kill(IHealthable source);
|
void Kill();
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
|
using Movementtests.scenes.components.knockback;
|
||||||
|
|
||||||
namespace Movementtests.interfaces;
|
namespace Movementtests.interfaces;
|
||||||
|
|
||||||
public record KnockbackRecord(DamageRecord DamageRecord, float ForceMultiplier = 1.0f);
|
public record KnockbackRecord(Vector3 Direction, float ForceMultiplier = 1.0f);
|
||||||
|
|
||||||
public interface IKnockbackable
|
public interface IKnockbackable
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,10 +5,6 @@ namespace Movementtests.interfaces;
|
|||||||
|
|
||||||
public static class NodeExtensions
|
public static class NodeExtensions
|
||||||
{
|
{
|
||||||
public static IDamageable[] ToIDamageables(this GodotObject[] nodes)
|
|
||||||
{
|
|
||||||
return nodes == null ? System.Array.Empty<IDamageable>() : nodes.OfType<IDamageable>().ToArray();
|
|
||||||
}
|
|
||||||
public static IKillable[] ToIKillables(this GodotObject[] nodes)
|
public static IKillable[] ToIKillables(this GodotObject[] nodes)
|
||||||
{
|
{
|
||||||
return nodes == null ? System.Array.Empty<IKillable>() : nodes.OfType<IKillable>().ToArray();
|
return nodes == null ? System.Array.Empty<IKillable>() : nodes.OfType<IKillable>().ToArray();
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
|
using Chickensoft.Sync.Primitives;
|
||||||
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
||||||
using Godot;
|
using Godot;
|
||||||
using Movementtests.systems;
|
using Movementtests.systems;
|
||||||
@@ -14,9 +16,11 @@ public partial class WeaponEventAbilityData(WeaponSystem.WeaponEvent forEvent, F
|
|||||||
public ForgeAbilityBehavior Ability { get; private set; } = ability;
|
public ForgeAbilityBehavior Ability { get; private set; } = ability;
|
||||||
}
|
}
|
||||||
|
|
||||||
[GlobalClass]
|
[GlobalClass, Meta(typeof(IAutoNode))]
|
||||||
public partial class InventoryManager : Node
|
public partial class InventoryManager : Node, IDisposable
|
||||||
{
|
{
|
||||||
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
#region Signals
|
#region Signals
|
||||||
|
|
||||||
[Signal]
|
[Signal]
|
||||||
@@ -26,35 +30,52 @@ public partial class InventoryManager : Node
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public Dictionary<WeaponSystem.WeaponEvent, HashSet<ForgeAbilityBehavior>> WeaponEventsInventory { get; private set; }
|
private AutoSet<ForgeAbilityBehavior> _startedFlyingAbilities = new();
|
||||||
= new() {
|
private AutoSet<ForgeAbilityBehavior> _flyingTickAbilities = new();
|
||||||
{ WeaponSystem.WeaponEvent.FlyingTick, [] },
|
private AutoSet<ForgeAbilityBehavior> _stoppedFlyingAbilities = new();
|
||||||
{ WeaponSystem.WeaponEvent.StartedFlying, [] },
|
|
||||||
{ WeaponSystem.WeaponEvent.StoppedFlying, [] }
|
public IAutoSet<ForgeAbilityBehavior> StartedFlyingAbilities => _startedFlyingAbilities;
|
||||||
};
|
public IAutoSet<ForgeAbilityBehavior> FlyingTickAbilities => _flyingTickAbilities;
|
||||||
|
public IAutoSet<ForgeAbilityBehavior> StoppedFlyingAbilities => _stoppedFlyingAbilities;
|
||||||
|
|
||||||
|
private readonly AutoMap<WeaponSystem.WeaponEvent, AutoSet<ForgeAbilityBehavior>> _weaponEventsInventory = new();
|
||||||
|
public IAutoMap<WeaponSystem.WeaponEvent, AutoSet<ForgeAbilityBehavior>> WeaponEventsInventory => _weaponEventsInventory;
|
||||||
|
|
||||||
|
public void OnReady()
|
||||||
|
{
|
||||||
|
_weaponEventsInventory[WeaponSystem.WeaponEvent.StartedFlying] = _startedFlyingAbilities;
|
||||||
|
_weaponEventsInventory[WeaponSystem.WeaponEvent.FlyingTick] = _flyingTickAbilities;
|
||||||
|
_weaponEventsInventory[WeaponSystem.WeaponEvent.StoppedFlying] = _stoppedFlyingAbilities;
|
||||||
|
}
|
||||||
|
|
||||||
public void InitializeFromResource(WeaponInventory inventory)
|
public void InitializeFromResource(WeaponInventory inventory)
|
||||||
{
|
{
|
||||||
WeaponEventsInventory[WeaponSystem.WeaponEvent.FlyingTick] = new HashSet<ForgeAbilityBehavior>(inventory.OnWeaponFlyingTickAbilities);
|
_startedFlyingAbilities = new AutoSet<ForgeAbilityBehavior>(inventory.OnWeaponStartedFlyingAbilities);
|
||||||
WeaponEventsInventory[WeaponSystem.WeaponEvent.StartedFlying] = new HashSet<ForgeAbilityBehavior>(inventory.OnWeaponStartedFlyingAbilities);
|
_flyingTickAbilities = new AutoSet<ForgeAbilityBehavior>(inventory.OnWeaponFlyingTickAbilities);
|
||||||
WeaponEventsInventory[WeaponSystem.WeaponEvent.StoppedFlying] = new HashSet<ForgeAbilityBehavior>(inventory.OnWeaponStoppedFlyingAbilities);
|
_stoppedFlyingAbilities = new AutoSet<ForgeAbilityBehavior>(inventory.OnWeaponStoppedFlyingAbilities);
|
||||||
|
}
|
||||||
|
|
||||||
|
public new void Dispose()
|
||||||
|
{
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
|
||||||
|
_startedFlyingAbilities.Dispose();
|
||||||
|
_flyingTickAbilities.Dispose();
|
||||||
|
_stoppedFlyingAbilities.Dispose();
|
||||||
|
_weaponEventsInventory.Dispose();
|
||||||
|
|
||||||
|
base.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddAbilityForWeaponEvent(WeaponSystem.WeaponEvent forEvent, ForgeAbilityBehavior abilityBehavior)
|
public void AddAbilityForWeaponEvent(WeaponSystem.WeaponEvent forEvent, ForgeAbilityBehavior abilityBehavior)
|
||||||
{
|
{
|
||||||
var inventoryForEvent = WeaponEventsInventory[forEvent];
|
var inventoryForEvent = _weaponEventsInventory[forEvent];
|
||||||
var addedAbilityToInventory = inventoryForEvent.Add(abilityBehavior);
|
inventoryForEvent.Add(abilityBehavior);
|
||||||
if (!addedAbilityToInventory) return;
|
|
||||||
|
|
||||||
EmitSignalWeaponEventAbilityAdded(new WeaponEventAbilityData(forEvent, abilityBehavior));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveAbilityForWeaponEvent(WeaponSystem.WeaponEvent forEvent, ForgeAbilityBehavior abilityBehavior)
|
public void RemoveAbilityForWeaponEvent(WeaponSystem.WeaponEvent forEvent, ForgeAbilityBehavior abilityBehavior)
|
||||||
{
|
{
|
||||||
var inventoryForEvent = WeaponEventsInventory[forEvent];
|
var inventoryForEvent = _weaponEventsInventory[forEvent];
|
||||||
var removedFromInventory = inventoryForEvent.Remove(abilityBehavior);
|
inventoryForEvent.Remove(abilityBehavior);
|
||||||
if (!removedFromInventory) return;
|
|
||||||
|
|
||||||
EmitSignalWeaponEventAbilityRemoved(new WeaponEventAbilityData(forEvent, abilityBehavior));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,12 +82,11 @@ public partial class MainSceneTemplate : Node3D, IProvide<InventoryManager>, IPr
|
|||||||
|
|
||||||
public void KillEnemy(Node3D body)
|
public void KillEnemy(Node3D body)
|
||||||
{
|
{
|
||||||
if (body is not (IKillable killable and IHealthable healthable))
|
if (body is not IKillable killable)
|
||||||
{
|
{
|
||||||
body.QueueFree();
|
// body.QueueFree();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
killable.Kill();
|
||||||
killable.Kill(healthable);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://cmlud1hwkd6sv" path="res://scenes/enemies/flying_enemy/flying_enemy.tscn" id="5_dl1un"]
|
[ext_resource type="PackedScene" uid="uid://cmlud1hwkd6sv" path="res://scenes/enemies/flying_enemy/flying_enemy.tscn" id="5_dl1un"]
|
||||||
[ext_resource type="Script" uid="uid://dtpxijlnb2c5" path="res://scenes/components/movement/RMovement.cs" id="6_465vr"]
|
[ext_resource type="Script" uid="uid://dtpxijlnb2c5" path="res://scenes/components/movement/RMovement.cs" id="6_465vr"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dxt0e2ugmttqq" path="res://scenes/enemies/grounded_enemy/grounded_enemy.tscn" id="7_egib5"]
|
[ext_resource type="PackedScene" uid="uid://dxt0e2ugmttqq" path="res://scenes/enemies/grounded_enemy/grounded_enemy.tscn" id="7_egib5"]
|
||||||
[ext_resource type="Script" uid="uid://baiapod3csndf" path="res://scenes/components/health/RHealth.cs" id="8_a01g8"]
|
|
||||||
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="9_doqxp"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b8aet6m4m2i83" path="res://scenes/tuto_trigger/TutoTrigger.tscn" id="10_vqwwk"]
|
[ext_resource type="PackedScene" uid="uid://b8aet6m4m2i83" path="res://scenes/tuto_trigger/TutoTrigger.tscn" id="10_vqwwk"]
|
||||||
[ext_resource type="Texture2D" uid="uid://nrhxjdpuje3f" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_lt_outline.svg" id="11_bdsxx"]
|
[ext_resource type="Texture2D" uid="uid://nrhxjdpuje3f" path="res://assets/ui/input-prompts/Xbox Series/Vector/xbox_lt_outline.svg" id="11_bdsxx"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dx2mk8qd6g8uh" path="res://assets/ui/input-prompts/Keyboard & Mouse/Vector/mouse_right_outline.svg" id="12_2usyc"]
|
[ext_resource type="Texture2D" uid="uid://dx2mk8qd6g8uh" path="res://assets/ui/input-prompts/Keyboard & Mouse/Vector/mouse_right_outline.svg" id="12_2usyc"]
|
||||||
@@ -26,31 +24,6 @@ script = ExtResource("6_465vr")
|
|||||||
GravityModifier = 5.0
|
GravityModifier = 5.0
|
||||||
metadata/_custom_type_script = "uid://dtpxijlnb2c5"
|
metadata/_custom_type_script = "uid://dtpxijlnb2c5"
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_xy0m1"]
|
|
||||||
script = ExtResource("8_a01g8")
|
|
||||||
StartingHealth = 100.0
|
|
||||||
metadata/_custom_type_script = "uid://baiapod3csndf"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_invhv"]
|
|
||||||
script = ExtResource("8_a01g8")
|
|
||||||
StartingHealth = 1.0
|
|
||||||
metadata/_custom_type_script = "uid://baiapod3csndf"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_cgfmf"]
|
|
||||||
script = ExtResource("9_doqxp")
|
|
||||||
DamageType = 2
|
|
||||||
metadata/_custom_type_script = "uid://jitubgv6judn"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_05lnh"]
|
|
||||||
script = ExtResource("8_a01g8")
|
|
||||||
StartingHealth = 100.0
|
|
||||||
metadata/_custom_type_script = "uid://baiapod3csndf"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_t5o40"]
|
|
||||||
script = ExtResource("8_a01g8")
|
|
||||||
StartingHealth = 100.0
|
|
||||||
metadata/_custom_type_script = "uid://baiapod3csndf"
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xy0m1"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_xy0m1"]
|
||||||
size = Vector3(3, 3.75, 3)
|
size = Vector3(3, 3.75, 3)
|
||||||
|
|
||||||
@@ -184,151 +157,126 @@ RMovement = SubResource("Resource_nwk5u")
|
|||||||
[node name="Enemy3" parent="Playground/GroundedEnemies" index="0" unique_id=1159989424 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy3" parent="Playground/GroundedEnemies" index="0" unique_id=1159989424 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 25, 0, -8.336809)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 25, 0, -8.336809)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy11" parent="Playground/GroundedEnemies" index="1" unique_id=1747444936 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy11" parent="Playground/GroundedEnemies" index="1" unique_id=1747444936 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 17, 8, 3.6631908)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 17, 8, 3.6631908)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy12" parent="Playground/GroundedEnemies" index="2" unique_id=283117081 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy12" parent="Playground/GroundedEnemies" index="2" unique_id=283117081 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 36.5, 11, -4.836809)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 36.5, 11, -4.836809)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy13" parent="Playground/GroundedEnemies" index="3" unique_id=970022638 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy13" parent="Playground/GroundedEnemies" index="3" unique_id=970022638 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 36.5, 12, -19.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 36.5, 12, -19.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy18" parent="Playground/GroundedEnemies" index="4" unique_id=2077088475 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy18" parent="Playground/GroundedEnemies" index="4" unique_id=2077088475 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 30.5, 12, -19.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 30.5, 12, -19.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy19" parent="Playground/GroundedEnemies" index="5" unique_id=2023773341 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy19" parent="Playground/GroundedEnemies" index="5" unique_id=2023773341 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 36.5, 7.5, -19.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 36.5, 7.5, -19.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy25" parent="Playground/GroundedEnemies" index="6" unique_id=1101329723 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy25" parent="Playground/GroundedEnemies" index="6" unique_id=1101329723 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 46, 7.5, -19.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 46, 7.5, -19.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy26" parent="Playground/GroundedEnemies" index="7" unique_id=855220553 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy26" parent="Playground/GroundedEnemies" index="7" unique_id=855220553 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 46, 12, -35.336807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 46, 12, -35.336807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy20" parent="Playground/GroundedEnemies" index="8" unique_id=1255215986 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy20" parent="Playground/GroundedEnemies" index="8" unique_id=1255215986 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 30.5, 7.5, -19.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 30.5, 7.5, -19.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy21" parent="Playground/GroundedEnemies" index="9" unique_id=2098915426 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy21" parent="Playground/GroundedEnemies" index="9" unique_id=2098915426 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 36.5, 0.5, -19.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 36.5, 0.5, -19.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy22" parent="Playground/GroundedEnemies" index="10" unique_id=246912749 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy22" parent="Playground/GroundedEnemies" index="10" unique_id=246912749 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 30.5, 0.5, -19.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 30.5, 0.5, -19.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy14" parent="Playground/GroundedEnemies" index="11" unique_id=211015190 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy14" parent="Playground/GroundedEnemies" index="11" unique_id=211015190 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 41, 17.5, -33.336807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 41, 17.5, -33.336807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy15" parent="Playground/GroundedEnemies" index="12" unique_id=1164179421 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy15" parent="Playground/GroundedEnemies" index="12" unique_id=1164179421 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 31, 17.5, -33.336807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 31, 17.5, -33.336807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy16" parent="Playground/GroundedEnemies" index="13" unique_id=1169725422 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy16" parent="Playground/GroundedEnemies" index="13" unique_id=1169725422 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 24.5, 17.5, -33.336807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 24.5, 17.5, -33.336807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy17" parent="Playground/GroundedEnemies" index="14" unique_id=1951666189 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy17" parent="Playground/GroundedEnemies" index="14" unique_id=1951666189 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 17.5, 17.5, -22.836807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 17.5, 17.5, -22.836807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy23" parent="Playground/GroundedEnemies" index="15" unique_id=1348057502 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy23" parent="Playground/GroundedEnemies" index="15" unique_id=1348057502 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 17.5, 24.5, -43.336807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 17.5, 24.5, -43.336807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy24" parent="Playground/GroundedEnemies" index="16" unique_id=2068813971 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy24" parent="Playground/GroundedEnemies" index="16" unique_id=2068813971 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 45, 24.5, -43.336807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 45, 24.5, -43.336807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy4" parent="Playground/GroundedEnemies" index="17" unique_id=366059658 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy4" parent="Playground/GroundedEnemies" index="17" unique_id=366059658 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 10.5, 0, -18.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 10.5, 0, -18.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy7" parent="Playground/GroundedEnemies" index="18" unique_id=1389063523 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy7" parent="Playground/GroundedEnemies" index="18" unique_id=1389063523 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 25.5, 4, -27.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 25.5, 4, -27.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy27" parent="Playground/GroundedEnemies" index="19" unique_id=854456486 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy27" parent="Playground/GroundedEnemies" index="19" unique_id=854456486 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 20, 0, -44.836807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 20, 0, -44.836807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy10" parent="Playground/GroundedEnemies" index="20" unique_id=836898496 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy10" parent="Playground/GroundedEnemies" index="20" unique_id=836898496 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 30.5, 11, -33.336807)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 30.5, 11, -33.336807)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy8" parent="Playground/GroundedEnemies" index="21" unique_id=1015624071 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy8" parent="Playground/GroundedEnemies" index="21" unique_id=1015624071 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 34.5, 1.5, -27.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 34.5, 1.5, -27.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy9" parent="Playground/GroundedEnemies" index="22" unique_id=827865590 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy9" parent="Playground/GroundedEnemies" index="22" unique_id=827865590 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 46.5, 0, -27.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 46.5, 0, -27.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy5" parent="Playground/GroundedEnemies" index="23" unique_id=1267116862 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy5" parent="Playground/GroundedEnemies" index="23" unique_id=1267116862 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4, 0, -18.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 4, 0, -18.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy6" parent="Playground/GroundedEnemies" index="24" unique_id=1147823180 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy6" parent="Playground/GroundedEnemies" index="24" unique_id=1147823180 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 16.5, 7, -17.33681)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 16.5, 7, -17.33681)
|
||||||
Target = NodePath("../../../Player")
|
Target = NodePath("../../../Player")
|
||||||
RHealth = SubResource("Resource_xy0m1")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Tutorial" type="CSGCombiner3D" parent="." index="8" unique_id=1168290062]
|
[node name="Tutorial" type="CSGCombiner3D" parent="." index="8" unique_id=1168290062]
|
||||||
@@ -345,22 +293,16 @@ transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1.3647223, 23.75, -13.7
|
|||||||
[node name="Enemy28" parent="Tutorial" index="2" unique_id=1765389924 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy28" parent="Tutorial" index="2" unique_id=1765389924 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -5, 22, 15.5)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -5, 22, 15.5)
|
||||||
Target = NodePath("../../Player")
|
Target = NodePath("../../Player")
|
||||||
RHealth = SubResource("Resource_invhv")
|
|
||||||
RDamage = SubResource("Resource_cgfmf")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy29" parent="Tutorial" index="3" unique_id=1071267369 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy29" parent="Tutorial" index="3" unique_id=1071267369 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -10, 22, 28.75)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -10, 22, 28.75)
|
||||||
Target = NodePath("../../Player")
|
Target = NodePath("../../Player")
|
||||||
RHealth = SubResource("Resource_05lnh")
|
|
||||||
RDamage = SubResource("Resource_cgfmf")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Enemy30" parent="Tutorial" index="4" unique_id=1982933011 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
[node name="Enemy30" parent="Tutorial" index="4" unique_id=1982933011 node_paths=PackedStringArray("Target") instance=ExtResource("7_egib5")]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0.25, 22, 28.75)
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0.25, 22, 28.75)
|
||||||
Target = NodePath("../../Player")
|
Target = NodePath("../../Player")
|
||||||
RHealth = SubResource("Resource_t5o40")
|
|
||||||
RDamage = SubResource("Resource_cgfmf")
|
|
||||||
RMovement = SubResource("Resource_nwk5u")
|
RMovement = SubResource("Resource_nwk5u")
|
||||||
|
|
||||||
[node name="Triggers" type="Node3D" parent="Tutorial" index="5" unique_id=1531131828]
|
[node name="Triggers" type="Node3D" parent="Tutorial" index="5" unique_id=1531131828]
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ HealthInputs = ExtResource("11_5jlg7")
|
|||||||
DamageInputs = ExtResource("12_pjgox")
|
DamageInputs = ExtResource("12_pjgox")
|
||||||
Target = NodePath("../Player")
|
Target = NodePath("../Player")
|
||||||
SpawnInterval = 5.0
|
SpawnInterval = 5.0
|
||||||
IsActiveOnStart = false
|
|
||||||
|
|
||||||
[node name="FlyingSpawner2" parent="." index="12" unique_id=365997644 node_paths=PackedStringArray("Target") instance=ExtResource("4_jaqjx")]
|
[node name="FlyingSpawner2" parent="." index="12" unique_id=365997644 node_paths=PackedStringArray("Target") instance=ExtResource("4_jaqjx")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 45.5, 25.5, -42.5)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 45.5, 25.5, -42.5)
|
||||||
@@ -84,7 +83,6 @@ HealthInputs = ExtResource("11_5jlg7")
|
|||||||
DamageInputs = ExtResource("12_pjgox")
|
DamageInputs = ExtResource("12_pjgox")
|
||||||
Target = NodePath("../Player")
|
Target = NodePath("../Player")
|
||||||
SpawnInterval = 5.0
|
SpawnInterval = 5.0
|
||||||
IsActiveOnStart = false
|
|
||||||
|
|
||||||
[node name="Targets" type="Node3D" parent="." index="13" unique_id=1620747784]
|
[node name="Targets" type="Node3D" parent="." index="13" unique_id=1620747784]
|
||||||
|
|
||||||
|
|||||||
@@ -90,4 +90,12 @@ public partial class AbilitySelection : Control
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearAbilities()
|
||||||
|
{
|
||||||
|
foreach (var child in SelectedAbilities.GetChildren())
|
||||||
|
{
|
||||||
|
SelectedAbilities.RemoveChild(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
|
using Chickensoft.Sync.Primitives;
|
||||||
using Gamesmiths.Forge.Effects;
|
using Gamesmiths.Forge.Effects;
|
||||||
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
using Gamesmiths.Forge.Godot.Resources.Abilities;
|
||||||
using Godot;
|
using Godot;
|
||||||
@@ -9,7 +11,7 @@ using Movementtests.systems;
|
|||||||
|
|
||||||
|
|
||||||
[Tool, GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_crate.png"), Meta(typeof(IAutoNode))]
|
[Tool, GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_crate.png"), Meta(typeof(IAutoNode))]
|
||||||
public partial class InventoryUi : Control
|
public partial class InventoryUi : Control, IDisposable
|
||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
@@ -27,6 +29,10 @@ public partial class InventoryUi : Control
|
|||||||
public required AbilitySelection StoppedFlying { get; set; }
|
public required AbilitySelection StoppedFlying { get; set; }
|
||||||
#endregion Nodes
|
#endregion Nodes
|
||||||
|
|
||||||
|
public AutoSet<ForgeAbilityBehavior>.Binding StartedFlyingBinding { get; set; }
|
||||||
|
public AutoSet<ForgeAbilityBehavior>.Binding FlyingTickBinding { get; set; }
|
||||||
|
public AutoSet<ForgeAbilityBehavior>.Binding StoppedFlyingBinding { get; set; }
|
||||||
|
|
||||||
public void OnReady()
|
public void OnReady()
|
||||||
{
|
{
|
||||||
StartedFlying.AbilityAdded += AddAbilityForEvent;
|
StartedFlying.AbilityAdded += AddAbilityForEvent;
|
||||||
@@ -44,14 +50,32 @@ public partial class InventoryUi : Control
|
|||||||
WhileFlying.Initialize(InventoryManager.WeaponEventsInventory[WeaponSystem.WeaponEvent.FlyingTick]);
|
WhileFlying.Initialize(InventoryManager.WeaponEventsInventory[WeaponSystem.WeaponEvent.FlyingTick]);
|
||||||
StoppedFlying.Initialize(InventoryManager.WeaponEventsInventory[WeaponSystem.WeaponEvent.StoppedFlying]);
|
StoppedFlying.Initialize(InventoryManager.WeaponEventsInventory[WeaponSystem.WeaponEvent.StoppedFlying]);
|
||||||
|
|
||||||
InventoryManager.WeaponEventAbilityAdded += OnWeaponEventInventoryAdded;
|
StartedFlyingBinding = InventoryManager.StartedFlyingAbilities.Bind();
|
||||||
InventoryManager.WeaponEventAbilityRemoved += OnWeaponEventInventoryRemoved;
|
StartedFlyingBinding
|
||||||
|
.OnAdd(behavior => OnWeaponEventInventoryAdded(WeaponSystem.WeaponEvent.StartedFlying, behavior))
|
||||||
|
.OnRemove(behavior => OnWeaponEventInventoryRemoved(WeaponSystem.WeaponEvent.StartedFlying, behavior))
|
||||||
|
.OnClear(() => OnWeaponEventInventoryCleared(WeaponSystem.WeaponEvent.StartedFlying));
|
||||||
|
FlyingTickBinding = InventoryManager.FlyingTickAbilities.Bind();
|
||||||
|
FlyingTickBinding
|
||||||
|
.OnAdd(behavior => OnWeaponEventInventoryAdded(WeaponSystem.WeaponEvent.FlyingTick, behavior))
|
||||||
|
.OnRemove(behavior => OnWeaponEventInventoryRemoved(WeaponSystem.WeaponEvent.FlyingTick, behavior))
|
||||||
|
.OnClear(() => OnWeaponEventInventoryCleared(WeaponSystem.WeaponEvent.FlyingTick));
|
||||||
|
StoppedFlyingBinding = InventoryManager.StoppedFlyingAbilities.Bind();
|
||||||
|
StoppedFlyingBinding
|
||||||
|
.OnAdd(behavior => OnWeaponEventInventoryAdded(WeaponSystem.WeaponEvent.StoppedFlying, behavior))
|
||||||
|
.OnRemove(behavior => OnWeaponEventInventoryRemoved(WeaponSystem.WeaponEvent.StoppedFlying, behavior))
|
||||||
|
.OnClear(() => OnWeaponEventInventoryCleared(WeaponSystem.WeaponEvent.StoppedFlying));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnExitTree()
|
public new void Dispose()
|
||||||
{
|
{
|
||||||
InventoryManager.WeaponEventAbilityAdded -= OnWeaponEventInventoryAdded;
|
GC.SuppressFinalize(this);
|
||||||
InventoryManager.WeaponEventAbilityRemoved -= OnWeaponEventInventoryRemoved;
|
|
||||||
|
StartedFlying.Dispose();
|
||||||
|
WhileFlying.Dispose();
|
||||||
|
StoppedFlying.Dispose();
|
||||||
|
|
||||||
|
base.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddAbilityForEvent(WeaponSystem.WeaponEvent forEvent, ForgeAbilityBehavior abilityBehavior)
|
public void AddAbilityForEvent(WeaponSystem.WeaponEvent forEvent, ForgeAbilityBehavior abilityBehavior)
|
||||||
@@ -64,16 +88,22 @@ public partial class InventoryUi : Control
|
|||||||
InventoryManager.RemoveAbilityForWeaponEvent(forEvent, abilityBehavior);
|
InventoryManager.RemoveAbilityForWeaponEvent(forEvent, abilityBehavior);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnWeaponEventInventoryAdded(WeaponEventAbilityData data)
|
public void OnWeaponEventInventoryAdded(WeaponSystem.WeaponEvent forEvent, ForgeAbilityBehavior abilityBehavior)
|
||||||
{
|
{
|
||||||
var selection = GetAbilitySelection(data.ForEvent);
|
var selection = GetAbilitySelection(forEvent);
|
||||||
selection.AddSelectedAbility(data.Ability);
|
selection.AddSelectedAbility(abilityBehavior);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnWeaponEventInventoryRemoved(WeaponEventAbilityData data)
|
public void OnWeaponEventInventoryRemoved(WeaponSystem.WeaponEvent forEvent, ForgeAbilityBehavior abilityBehavior)
|
||||||
{
|
{
|
||||||
var selection = GetAbilitySelection(data.ForEvent);
|
var selection = GetAbilitySelection(forEvent);
|
||||||
selection.RemoveSelectedAbility(data.Ability);
|
selection.RemoveSelectedAbility(abilityBehavior);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnWeaponEventInventoryCleared(WeaponSystem.WeaponEvent forEvent)
|
||||||
|
{
|
||||||
|
var selection = GetAbilitySelection(forEvent);
|
||||||
|
selection.ClearAbilities();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbilitySelection GetAbilitySelection(WeaponSystem.WeaponEvent forEvent)
|
public AbilitySelection GetAbilitySelection(WeaponSystem.WeaponEvent forEvent)
|
||||||
|
|||||||
@@ -8,5 +8,8 @@ extends OverlaidMenu
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
if Engine.is_editor_hint(): return
|
if Engine.is_editor_hint(): return
|
||||||
|
|
||||||
|
func _handle_cancel_input() -> void:
|
||||||
|
hide_menu()
|
||||||
|
|
||||||
func _on_close_button_pressed() -> void:
|
func _on_close_button_pressed() -> void:
|
||||||
close()
|
hide_menu()
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using System;
|
|
||||||
using Movementtests.interfaces;
|
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_skull.png")]
|
|
||||||
public partial class CDamageable : Node, IDamageable
|
|
||||||
{
|
|
||||||
public event Action<IDamageable, DamageRecord> DamageTaken;
|
|
||||||
|
|
||||||
[Export]
|
|
||||||
public RDamageModifier[] DamageModifiers { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
var finalDamage = 0f;
|
|
||||||
foreach (var damageable in DamageModifiers.ToIDamageables())
|
|
||||||
finalDamage += damageable.TakeDamage(damageRecord).Damage.DamageDealt;
|
|
||||||
var finalDamageRecord = damageRecord with { Damage = new RDamage(finalDamage, damageRecord.Damage.DamageType) };
|
|
||||||
DamageTaken?.Invoke(this, finalDamageRecord);
|
|
||||||
return finalDamageRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DamageRecord ComputeDamage(DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
var finalDamage = 0f;
|
|
||||||
foreach (var damageable in DamageModifiers.ToIDamageables())
|
|
||||||
finalDamage += damageable.ComputeDamage(damageRecord).Damage.DamageDealt;
|
|
||||||
return damageRecord with { Damage = new RDamage(finalDamage, damageRecord.Damage.DamageType) };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://b0u23nkpaimyc
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://hpsg4fqwrx1u"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://b0u23nkpaimyc" path="res://scenes/components/damage/CDamageable.cs" id="1_qp8bd"]
|
|
||||||
|
|
||||||
[node name="CDamageable" type="Node" unique_id=482221079]
|
|
||||||
script = ExtResource("1_qp8bd")
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace Movementtests.systems.damage;
|
|
||||||
|
|
||||||
public enum EDamageTypes
|
|
||||||
{
|
|
||||||
Normal,
|
|
||||||
Fire,
|
|
||||||
Ice,
|
|
||||||
Explosion,
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://dubmiwfuunxmu
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using System;
|
|
||||||
using Movementtests.systems.damage;
|
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_skull.png")]
|
|
||||||
public partial class RDamage : Resource
|
|
||||||
{
|
|
||||||
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
|
|
||||||
public float DamageDealt { get; set;}
|
|
||||||
|
|
||||||
[Export]
|
|
||||||
public EDamageTypes DamageType { get; set;}
|
|
||||||
|
|
||||||
public RDamage() : this(1.0f, EDamageTypes.Normal) {}
|
|
||||||
public RDamage(float damageDealt, EDamageTypes damageType)
|
|
||||||
{
|
|
||||||
DamageDealt = damageDealt;
|
|
||||||
DamageType = damageType;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://jitubgv6judn
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using System;
|
|
||||||
using Movementtests.interfaces;
|
|
||||||
using Movementtests.systems.damage;
|
|
||||||
|
|
||||||
[Icon("res://assets/ui/IconGodotNode/white/icon_freeze.png")]
|
|
||||||
[GlobalClass]
|
|
||||||
public partial class RDamageModifier : Resource, IDamageable
|
|
||||||
{
|
|
||||||
public event Action<IDamageable, DamageRecord> DamageTaken = null!;
|
|
||||||
|
|
||||||
[Export]
|
|
||||||
public EDamageTypes DamageType { get; set;}
|
|
||||||
[Export]
|
|
||||||
public float Modifier { get; set;}
|
|
||||||
|
|
||||||
public RDamageModifier() : this(EDamageTypes.Normal, 1.0f) {}
|
|
||||||
public RDamageModifier(EDamageTypes damageType, float modifier)
|
|
||||||
{
|
|
||||||
Modifier = modifier;
|
|
||||||
DamageType = damageType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
if (damageRecord.Damage.DamageType != DamageType)
|
|
||||||
return damageRecord with { Damage = new RDamage(0, damageRecord.Damage.DamageType) };
|
|
||||||
|
|
||||||
var finalDamage = damageRecord.Damage.DamageDealt * Modifier;
|
|
||||||
var finalDamageRecord = damageRecord with { Damage = new RDamage(finalDamage, damageRecord.Damage.DamageType) };
|
|
||||||
DamageTaken?.Invoke(this, finalDamageRecord);
|
|
||||||
return finalDamageRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DamageRecord ComputeDamage(DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
if (damageRecord.Damage.DamageType != DamageType)
|
|
||||||
return damageRecord with { Damage = new RDamage(0, damageRecord.Damage.DamageType) };
|
|
||||||
|
|
||||||
var finalDamage = damageRecord.Damage.DamageDealt * Modifier;
|
|
||||||
return damageRecord with { Damage = new RDamage(finalDamage, damageRecord.Damage.DamageType) };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://b6y3ugfydvch0
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using System;
|
|
||||||
using Movementtests.interfaces;
|
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_heart.png")]
|
|
||||||
public partial class CHealth : Node, IHealthable
|
|
||||||
{
|
|
||||||
public event Action<IHealthable, HealthChangedRecord> HealthChanged = null!;
|
|
||||||
public event Action<IHealthable> HealthDepleted = null!;
|
|
||||||
|
|
||||||
[Export]
|
|
||||||
public RHealth RHealth { get; set; } = null!;
|
|
||||||
|
|
||||||
public float CurrentHealth { get; set; }
|
|
||||||
|
|
||||||
public override void _Ready()
|
|
||||||
{
|
|
||||||
CurrentHealth = RHealth.StartingHealth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HealthChangedRecord ReduceHealth(IDamageable source, DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
var previousHealth = CurrentHealth;
|
|
||||||
CurrentHealth -= damageRecord.Damage.DamageDealt;
|
|
||||||
var record = new HealthChangedRecord(CurrentHealth, previousHealth, RHealth.StartingHealth);
|
|
||||||
HealthChanged?.Invoke(this, record);
|
|
||||||
|
|
||||||
if (CurrentHealth <= 0)
|
|
||||||
{
|
|
||||||
CurrentHealth = 0;
|
|
||||||
HealthDepleted?.Invoke(this);
|
|
||||||
}
|
|
||||||
return record;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://bjwrpv3jpsc1e
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://c4ikbhojckpnc"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bjwrpv3jpsc1e" path="res://scenes/components/health/CHealth.cs" id="1_75uyt"]
|
|
||||||
|
|
||||||
[node name="CHealth" type="Node" unique_id=1940090217]
|
|
||||||
script = ExtResource("1_75uyt")
|
|
||||||
@@ -5,8 +5,8 @@ using Movementtests.interfaces;
|
|||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_thunder.png")]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_thunder.png")]
|
||||||
public partial class RDeathEffect : Resource, IKillable
|
public partial class RDeathEffect : Resource, IKillable
|
||||||
{
|
{
|
||||||
public void Kill(IHealthable source)
|
public void Kill()
|
||||||
{
|
{
|
||||||
GD.Print($"Death Effect triggered on {source}");
|
GD.Print($"Death Effect triggered");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using System;
|
|
||||||
using Movementtests.interfaces;
|
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_heart.png")]
|
|
||||||
public partial class RHealth(float startingHealth) : Resource
|
|
||||||
{
|
|
||||||
[Export]
|
|
||||||
public float StartingHealth { get; set;} = startingHealth;
|
|
||||||
|
|
||||||
public RHealth() : this(100.0f) {}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://baiapod3csndf
|
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
using Movementtests.interfaces;
|
using Movementtests.interfaces;
|
||||||
|
|
||||||
|
namespace Movementtests.scenes.components.knockback;
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_wind.png")]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_wind.png")]
|
||||||
public partial class CKnockback : Node3D, IKnockbackable
|
public partial class CKnockback : Node3D, IKnockbackable
|
||||||
{
|
{
|
||||||
[Export] public RKnockback RKnockback { get; set;} = null!;
|
[Export] public RKnockback RKnockback { get; set;} = null!;
|
||||||
|
|
||||||
private KnockbackRecord _knockbackRecord = null!;
|
private KnockbackRecord? _knockbackRecord;
|
||||||
|
|
||||||
public void RegisterKnockback(KnockbackRecord knockbackRecord)
|
public void RegisterKnockback(KnockbackRecord knockbackRecord)
|
||||||
{
|
{
|
||||||
@@ -18,9 +19,8 @@ public partial class CKnockback : Node3D, IKnockbackable
|
|||||||
{
|
{
|
||||||
if (_knockbackRecord == null) return Vector3.Zero;
|
if (_knockbackRecord == null) return Vector3.Zero;
|
||||||
|
|
||||||
var knockbackDirection = GlobalPosition - _knockbackRecord.DamageRecord.SourceLocation;
|
var finalKnockback = _knockbackRecord.Direction.Normalized() * RKnockback.Modifier * _knockbackRecord.ForceMultiplier;
|
||||||
var finalKnockback = knockbackDirection.Normalized() * RKnockback.Modifier * _knockbackRecord.ForceMultiplier;
|
_knockbackRecord = null;
|
||||||
_knockbackRecord = null!;
|
|
||||||
return finalKnockback;
|
return finalKnockback;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,12 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
|
||||||
using Movementtests.interfaces;
|
namespace Movementtests.scenes.components.knockback;
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_wind.png")]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_wind.png")]
|
||||||
public partial class RKnockback : Resource
|
public partial class RKnockback(float modifier) : Resource
|
||||||
{
|
{
|
||||||
[Export]
|
[Export]
|
||||||
public float Modifier { get; set;}
|
public float Modifier { get; set;} = modifier;
|
||||||
|
|
||||||
public RKnockback() : this(1.0f) {}
|
public RKnockback() : this(1.0f) {}
|
||||||
public RKnockback(float modifier)
|
|
||||||
{
|
|
||||||
Modifier = modifier;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ using Gamesmiths.Forge.Statescript;
|
|||||||
using Gamesmiths.Forge.Tags;
|
using Gamesmiths.Forge.Tags;
|
||||||
using Godot;
|
using Godot;
|
||||||
using Movementtests.interfaces;
|
using Movementtests.interfaces;
|
||||||
|
using Movementtests.scenes.components.knockback;
|
||||||
using Movementtests.systems;
|
using Movementtests.systems;
|
||||||
using Movementtests.tools;
|
using Movementtests.tools;
|
||||||
using Movementtests.tools.calculators;
|
using Movementtests.tools.calculators;
|
||||||
@@ -20,8 +21,6 @@ using Node = Godot.Node;
|
|||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_beetle.png"), Meta(typeof(IAutoNode))]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_beetle.png"), Meta(typeof(IAutoNode))]
|
||||||
public partial class Enemy : CharacterBody3D,
|
public partial class Enemy : CharacterBody3D,
|
||||||
IDamageable,
|
|
||||||
IHealthable,
|
|
||||||
IKillable,
|
IKillable,
|
||||||
IMoveable,
|
IMoveable,
|
||||||
ISpawnable,
|
ISpawnable,
|
||||||
@@ -39,15 +38,6 @@ public partial class Enemy : CharacterBody3D,
|
|||||||
[Dependency]
|
[Dependency]
|
||||||
public CuesManager CuesManager => this.DependOn<CuesManager>();
|
public CuesManager CuesManager => this.DependOn<CuesManager>();
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Signals
|
|
||||||
|
|
||||||
// Signals and events
|
|
||||||
public event Action<IDamageable, DamageRecord> DamageTaken = null!;
|
|
||||||
public event Action<IHealthable, HealthChangedRecord> HealthChanged = null!;
|
|
||||||
public event Action<IHealthable> HealthDepleted = null!;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Inspector
|
#region Inspector
|
||||||
@@ -56,25 +46,14 @@ public partial class Enemy : CharacterBody3D,
|
|||||||
[Export]
|
[Export]
|
||||||
public Node3D? Target { get; set; }
|
public Node3D? Target { get; set; }
|
||||||
[Export] public required ForgeAbilityData HitAbility { get; set; }
|
[Export] public required ForgeAbilityData HitAbility { get; set; }
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public float EnemyHeight { get; set; } = 1f;
|
public float EnemyHeight { get; set; } = 1f;
|
||||||
|
|
||||||
[ExportGroup("Health")]
|
|
||||||
[Export]
|
[Export]
|
||||||
public RHealth RHealth { get; set; } = null!;
|
public RDeathEffect[] DeathEffects { get; set; } = [];
|
||||||
[Export]
|
|
||||||
public RDeathEffect[] DeathEffects { get; set; } = null!;
|
|
||||||
public IHealthable CHealth { get; set; } = null!;
|
|
||||||
|
|
||||||
[ExportGroup("Damage")]
|
|
||||||
[Export]
|
|
||||||
public RDamage? RDamage { get; set; }
|
|
||||||
public IDamageable CDamageable { get; set; } = null!;
|
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public RKnockback? RKnockback { get; set; }
|
public RKnockback? RKnockback { get; set; }
|
||||||
public IKnockbackable CKnockback { get; set; } = null!;
|
public IKnockbackable? CKnockback { get; set; }
|
||||||
|
|
||||||
[ExportGroup("Movement")]
|
[ExportGroup("Movement")]
|
||||||
[Export]
|
[Export]
|
||||||
@@ -83,13 +62,6 @@ public partial class Enemy : CharacterBody3D,
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// Public stuff
|
|
||||||
public float CurrentHealth
|
|
||||||
{
|
|
||||||
get => CHealth.CurrentHealth;
|
|
||||||
set => CHealth.CurrentHealth = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region IForgeEntity
|
#region IForgeEntity
|
||||||
|
|
||||||
// Perfectly forward the IForgeEntity interface to the ForgeEntity component
|
// Perfectly forward the IForgeEntity interface to the ForgeEntity component
|
||||||
@@ -144,13 +116,7 @@ public partial class Enemy : CharacterBody3D,
|
|||||||
{
|
{
|
||||||
CMovement = GetNode<Node>("CMovement") as IMoveable ?? throw new Exception("Movement component not found");
|
CMovement = GetNode<Node>("CMovement") as IMoveable ?? throw new Exception("Movement component not found");
|
||||||
CMovement.RMovement = RMovement;
|
CMovement.RMovement = RMovement;
|
||||||
|
|
||||||
CDamageable = GetNode<Node>("CDamageable") as IDamageable ?? throw new Exception("Damageable component not found");
|
|
||||||
CHealth = GetNode<Node>("CHealth") as IHealthable ?? throw new Exception("Health component not found");
|
|
||||||
CKnockback = GetNode<Node>("CKnockback") as IKnockbackable ?? throw new Exception("Knockback component not found");
|
CKnockback = GetNode<Node>("CKnockback") as IKnockbackable ?? throw new Exception("Knockback component not found");
|
||||||
|
|
||||||
CHealth.RHealth = RHealth;
|
|
||||||
CHealth.CurrentHealth = RHealth.StartingHealth;
|
|
||||||
CKnockback.RKnockback = RKnockback;
|
CKnockback.RKnockback = RKnockback;
|
||||||
|
|
||||||
_hitAbilityHandle = Abilities.GrantAbilityPermanently(HitAbility.GetAbilityData(), 1, LevelComparison.None, this);
|
_hitAbilityHandle = Abilities.GrantAbilityPermanently(HitAbility.GetAbilityData(), 1, LevelComparison.None, this);
|
||||||
@@ -165,15 +131,17 @@ public partial class Enemy : CharacterBody3D,
|
|||||||
Events.Subscribe(Tag.RequestTag(TagsManager, "events.combat.hit"),
|
Events.Subscribe(Tag.RequestTag(TagsManager, "events.combat.hit"),
|
||||||
data => {GD.Print("Hit!");});
|
data => {GD.Print("Hit!");});
|
||||||
Events.Subscribe<DamageDone>(Tag.RequestTag(TagsManager, "events.combat.damage"), OnDamageReceived);
|
Events.Subscribe<DamageDone>(Tag.RequestTag(TagsManager, "events.combat.damage"), OnDamageReceived);
|
||||||
|
Events.Subscribe<KnockbackDone>(Tag.RequestTag(TagsManager, "events.combat.knockback_received"), OnKnockbackReceived);
|
||||||
Events.Subscribe(Tag.RequestTag(TagsManager, "events.combat.death"), OnDeath);
|
Events.Subscribe(Tag.RequestTag(TagsManager, "events.combat.death"), OnDeath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnKnockbackReceived(EventData<KnockbackDone> data)
|
||||||
|
{
|
||||||
|
RegisterKnockback(new KnockbackRecord(data.Payload.knockbackDirection, data.EventMagnitude));
|
||||||
|
}
|
||||||
|
|
||||||
public void SetupSignals()
|
public void SetupSignals()
|
||||||
{
|
{
|
||||||
// Anonymous function call to erase return values of ReduceHealth
|
|
||||||
// CDamageable.DamageTaken += (source, record) => ReduceHealth(source, record);
|
|
||||||
// CDamageable.DamageTaken += (_, record) => RegisterKnockback(new KnockbackRecord(record));
|
|
||||||
// CHealth.HealthDepleted += Kill;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void _PhysicsProcess(double delta)
|
public override void _PhysicsProcess(double delta)
|
||||||
@@ -213,7 +181,7 @@ public partial class Enemy : CharacterBody3D,
|
|||||||
|
|
||||||
public Vector3 ComputeVelocity(MovementInputs inputs)
|
public Vector3 ComputeVelocity(MovementInputs inputs)
|
||||||
{
|
{
|
||||||
return CMovement is null ? Vector3.Zero : CMovement.ComputeVelocity(inputs);
|
return CMovement.ComputeVelocity(inputs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnDamageReceived(EventData<DamageDone> data)
|
public void OnDamageReceived(EventData<DamageDone> data)
|
||||||
@@ -237,46 +205,10 @@ public partial class Enemy : CharacterBody3D,
|
|||||||
|
|
||||||
public void OnDeath(EventData data)
|
public void OnDeath(EventData data)
|
||||||
{
|
{
|
||||||
// Remove weapon that might be planted there
|
Kill();
|
||||||
foreach (var child in GetChildren())
|
|
||||||
{
|
|
||||||
if (child is not WeaponSystem system) continue;
|
|
||||||
CallDeferred(Node.MethodName.RemoveChild, system);
|
|
||||||
GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, system);
|
|
||||||
system.CallDeferred(Node3D.MethodName.SetGlobalPosition, GlobalPosition + Vector3.Up*EnemyHeight);
|
|
||||||
system.CallDeferred(WeaponSystem.MethodName.RethrowWeapon);
|
|
||||||
}
|
|
||||||
|
|
||||||
CallDeferred(Node.MethodName.QueueFree);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
public void Kill()
|
||||||
{
|
|
||||||
if (CDamageable is null)
|
|
||||||
return damageRecord with { Damage = new RDamage(0, damageRecord.Damage.DamageType) };
|
|
||||||
|
|
||||||
var finalDamage = CDamageable.TakeDamage(damageRecord);
|
|
||||||
DamageTaken?.Invoke(this, finalDamage);
|
|
||||||
return finalDamage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DamageRecord ComputeDamage(DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
if (CDamageable is null)
|
|
||||||
return damageRecord with { Damage = new RDamage(0, damageRecord.Damage.DamageType) };
|
|
||||||
|
|
||||||
return CDamageable.ComputeDamage(damageRecord);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HealthChangedRecord ReduceHealth(IDamageable source, DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
if (CHealth is null) return new HealthChangedRecord(0, 0, 0);
|
|
||||||
var record = CHealth.ReduceHealth(source, damageRecord);
|
|
||||||
HealthChanged?.Invoke(this, record);
|
|
||||||
return record;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Kill(IHealthable source)
|
|
||||||
{
|
{
|
||||||
// Remove weapon that might be planted there
|
// Remove weapon that might be planted there
|
||||||
foreach (var child in GetChildren())
|
foreach (var child in GetChildren())
|
||||||
@@ -292,24 +224,24 @@ public partial class Enemy : CharacterBody3D,
|
|||||||
|
|
||||||
foreach (var killable in DeathEffects.ToIKillables())
|
foreach (var killable in DeathEffects.ToIKillables())
|
||||||
{
|
{
|
||||||
killable.Kill(source);
|
killable.Kill();
|
||||||
}
|
}
|
||||||
CallDeferred(Node.MethodName.QueueFree);
|
CallDeferred(Node.MethodName.QueueFree);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterKnockback(KnockbackRecord knockbackRecord)
|
public void RegisterKnockback(KnockbackRecord knockbackRecord)
|
||||||
{
|
{
|
||||||
CKnockback.RegisterKnockback(knockbackRecord);
|
CKnockback!.RegisterKnockback(knockbackRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 ComputeKnockback()
|
public Vector3 ComputeKnockback()
|
||||||
{
|
{
|
||||||
return CKnockback.ComputeKnockback();
|
return CKnockback!.ComputeKnockback();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 GetTargetGlobalPosition()
|
public Vector3 GetTargetGlobalPosition()
|
||||||
{
|
{
|
||||||
return TargetComponent == null ? GlobalPosition : TargetComponent.GlobalPosition;
|
return TargetComponent.GlobalPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stun management
|
// Stun management
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
[gd_scene format=3 uid="uid://cmlud1hwkd6sv"]
|
[gd_scene format=3 uid="uid://cmlud1hwkd6sv"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bn7sc6id7n166" path="res://scenes/enemies/Enemy.cs" id="1_q8l7o"]
|
[ext_resource type="Script" uid="uid://bn7sc6id7n166" path="res://scenes/enemies/Enemy.cs" id="1_q8l7o"]
|
||||||
[ext_resource type="Script" uid="uid://b6y3ugfydvch0" path="res://scenes/components/damage/RDamageModifier.cs" id="2_1bsgx"]
|
|
||||||
[ext_resource type="Resource" uid="uid://qpdw62ubaclc" path="res://forge/resources/ability_datas/grounded_enemy_hit.tres" id="2_46wn3"]
|
[ext_resource type="Resource" uid="uid://qpdw62ubaclc" path="res://forge/resources/ability_datas/grounded_enemy_hit.tres" id="2_46wn3"]
|
||||||
[ext_resource type="Resource" uid="uid://dg1xbjhyhgnnk" path="res://scenes/enemies/flying_enemy/flying_enemy_health.tres" id="2_ma2bq"]
|
|
||||||
[ext_resource type="Resource" uid="uid://dgo65k2ceqfvy" path="res://scenes/enemies/flying_enemy/flying_enemy_damage.tres" id="2_on7rt"]
|
|
||||||
[ext_resource type="Resource" uid="uid://bwqjaom4k7rc3" path="res://scenes/enemies/flying_enemy/flying_enemy_movement.tres" id="4_dejyg"]
|
[ext_resource type="Resource" uid="uid://bwqjaom4k7rc3" path="res://scenes/enemies/flying_enemy/flying_enemy_movement.tres" id="4_dejyg"]
|
||||||
[ext_resource type="Script" uid="uid://bjwrpv3jpsc1e" path="res://scenes/components/health/CHealth.cs" id="4_ys4jv"]
|
|
||||||
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="7_2digf"]
|
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="7_2digf"]
|
||||||
[ext_resource type="Script" uid="uid://rpcbb54q4atx" path="res://forge/ForgeEntityNode.cs" id="7_46wn3"]
|
[ext_resource type="Script" uid="uid://rpcbb54q4atx" path="res://forge/ForgeEntityNode.cs" id="7_46wn3"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dmw5ibwrb483f" path="res://scenes/components/movement/CFlyingMovement.tscn" id="7_vaeds"]
|
[ext_resource type="PackedScene" uid="uid://dmw5ibwrb483f" path="res://scenes/components/movement/CFlyingMovement.tscn" id="7_vaeds"]
|
||||||
@@ -14,7 +10,6 @@
|
|||||||
[ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="8_46wn3"]
|
[ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="8_46wn3"]
|
||||||
[ext_resource type="Resource" uid="uid://bocsykxbh8l0g" path="res://forge/resources/tag_containers/enemy_base_tags.tres" id="8_oj1ws"]
|
[ext_resource type="Resource" uid="uid://bocsykxbh8l0g" path="res://forge/resources/tag_containers/enemy_base_tags.tres" id="8_oj1ws"]
|
||||||
[ext_resource type="Script" uid="uid://dtpxijlnb2c5" path="res://scenes/components/movement/RMovement.cs" id="8_on7rt"]
|
[ext_resource type="Script" uid="uid://dtpxijlnb2c5" path="res://scenes/components/movement/RMovement.cs" id="8_on7rt"]
|
||||||
[ext_resource type="Script" uid="uid://b0u23nkpaimyc" path="res://scenes/components/damage/CDamageable.cs" id="8_uotso"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bctpe34ddamg5" path="res://scenes/components/knockback/CKnockback.tscn" id="10_dejyg"]
|
[ext_resource type="PackedScene" uid="uid://bctpe34ddamg5" path="res://scenes/components/knockback/CKnockback.tscn" id="10_dejyg"]
|
||||||
[ext_resource type="Resource" uid="uid://dt7a1io5o0b8s" path="res://scenes/enemies/flying_enemy/flying_enemy_knockback.tres" id="11_mpa2u"]
|
[ext_resource type="Resource" uid="uid://dt7a1io5o0b8s" path="res://scenes/enemies/flying_enemy/flying_enemy_knockback.tres" id="11_mpa2u"]
|
||||||
|
|
||||||
@@ -30,19 +25,9 @@ Default = 1
|
|||||||
Min = 1
|
Min = 1
|
||||||
Max = 100
|
Max = 100
|
||||||
|
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_46wn3"]
|
[sub_resource type="ViewportTexture" id="ViewportTexture_ykkxn"]
|
||||||
viewport_path = NodePath("SubViewport")
|
viewport_path = NodePath("SubViewport")
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_jnv07"]
|
|
||||||
script = ExtResource("2_1bsgx")
|
|
||||||
metadata/_custom_type_script = "uid://b6y3ugfydvch0"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_53j1c"]
|
|
||||||
script = ExtResource("2_1bsgx")
|
|
||||||
DamageType = 3
|
|
||||||
Modifier = 1.0
|
|
||||||
metadata/_custom_type_script = "uid://b6y3ugfydvch0"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_on7rt"]
|
[sub_resource type="Resource" id="Resource_on7rt"]
|
||||||
script = ExtResource("8_on7rt")
|
script = ExtResource("8_on7rt")
|
||||||
Speed = 3.0
|
Speed = 3.0
|
||||||
@@ -74,9 +59,6 @@ motion_mode = 1
|
|||||||
script = ExtResource("1_q8l7o")
|
script = ExtResource("1_q8l7o")
|
||||||
HitAbility = ExtResource("2_46wn3")
|
HitAbility = ExtResource("2_46wn3")
|
||||||
EnemyHeight = 0.5
|
EnemyHeight = 0.5
|
||||||
RHealth = ExtResource("2_ma2bq")
|
|
||||||
DeathEffects = Array[Object]([])
|
|
||||||
RDamage = ExtResource("2_on7rt")
|
|
||||||
RKnockback = ExtResource("11_mpa2u")
|
RKnockback = ExtResource("11_mpa2u")
|
||||||
RMovement = ExtResource("4_dejyg")
|
RMovement = ExtResource("4_dejyg")
|
||||||
|
|
||||||
@@ -114,19 +96,9 @@ InitialAttributeValues = Dictionary[String, ExtResource("8_46wn3")]({
|
|||||||
})
|
})
|
||||||
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
||||||
|
|
||||||
[node name="CHealth" type="Node" parent="." unique_id=1717035166]
|
|
||||||
script = ExtResource("4_ys4jv")
|
|
||||||
RHealth = ExtResource("2_ma2bq")
|
|
||||||
metadata/_custom_type_script = "uid://bjwrpv3jpsc1e"
|
|
||||||
|
|
||||||
[node name="CHealthBar" parent="." unique_id=1635725931 instance=ExtResource("7_ykkxn")]
|
[node name="CHealthBar" parent="." unique_id=1635725931 instance=ExtResource("7_ykkxn")]
|
||||||
transform = Transform3D(0.3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.70000005, 0)
|
transform = Transform3D(0.3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.70000005, 0)
|
||||||
texture = SubResource("ViewportTexture_46wn3")
|
texture = SubResource("ViewportTexture_ykkxn")
|
||||||
|
|
||||||
[node name="CDamageable" type="Node" parent="." unique_id=1785297232]
|
|
||||||
script = ExtResource("8_uotso")
|
|
||||||
DamageModifiers = Array[Object]([SubResource("Resource_jnv07"), SubResource("Resource_53j1c")])
|
|
||||||
metadata/_custom_type_script = "uid://b0u23nkpaimyc"
|
|
||||||
|
|
||||||
[node name="CMovement" parent="." unique_id=1699571730 instance=ExtResource("7_vaeds")]
|
[node name="CMovement" parent="." unique_id=1699571730 instance=ExtResource("7_vaeds")]
|
||||||
RMovement = SubResource("Resource_on7rt")
|
RMovement = SubResource("Resource_on7rt")
|
||||||
|
|||||||
@@ -4,5 +4,5 @@
|
|||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_yq03x")
|
script = ExtResource("1_yq03x")
|
||||||
Modifier = 20.0
|
Modifier = 2.0
|
||||||
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
[gd_scene format=3 uid="uid://dxt0e2ugmttqq"]
|
[gd_scene format=3 uid="uid://dxt0e2ugmttqq"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bn7sc6id7n166" path="res://scenes/enemies/Enemy.cs" id="1_r6506"]
|
[ext_resource type="Script" uid="uid://bn7sc6id7n166" path="res://scenes/enemies/Enemy.cs" id="1_r6506"]
|
||||||
[ext_resource type="Resource" uid="uid://otfc2snh8umc" path="res://scenes/enemies/grounded_enemy/grounded_enemy_damage.tres" id="2_bn56u"]
|
|
||||||
[ext_resource type="Script" uid="uid://bjwrpv3jpsc1e" path="res://scenes/components/health/CHealth.cs" id="2_gsmti"]
|
|
||||||
[ext_resource type="Script" uid="uid://b6y3ugfydvch0" path="res://scenes/components/damage/RDamageModifier.cs" id="2_r3cnf"]
|
|
||||||
[ext_resource type="Resource" uid="uid://bohbojc68j7y1" path="res://scenes/enemies/grounded_enemy/grounded_enemy_health.tres" id="2_w4lm8"]
|
|
||||||
[ext_resource type="Resource" uid="uid://bqq6uukbdfysr" path="res://scenes/enemies/grounded_enemy/grounded_enemy_movement.tres" id="4_na24f"]
|
[ext_resource type="Resource" uid="uid://bqq6uukbdfysr" path="res://scenes/enemies/grounded_enemy/grounded_enemy_movement.tres" id="4_na24f"]
|
||||||
[ext_resource type="Resource" uid="uid://qpdw62ubaclc" path="res://forge/resources/ability_datas/grounded_enemy_hit.tres" id="6_4jf2q"]
|
[ext_resource type="Resource" uid="uid://qpdw62ubaclc" path="res://forge/resources/ability_datas/grounded_enemy_hit.tres" id="6_4jf2q"]
|
||||||
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="6_yk4hc"]
|
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="6_yk4hc"]
|
||||||
[ext_resource type="Script" uid="uid://b0u23nkpaimyc" path="res://scenes/components/damage/CDamageable.cs" id="7_1tw73"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bwx2um43k0ou4" path="res://scenes/components/health/CHealthbar.tscn" id="7_18xwy"]
|
[ext_resource type="PackedScene" uid="uid://bwx2um43k0ou4" path="res://scenes/components/health/CHealthbar.tscn" id="7_18xwy"]
|
||||||
[ext_resource type="Script" uid="uid://rpcbb54q4atx" path="res://forge/ForgeEntityNode.cs" id="7_f22p3"]
|
[ext_resource type="Script" uid="uid://rpcbb54q4atx" path="res://forge/ForgeEntityNode.cs" id="7_f22p3"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dbr7ioio158ew" path="res://scenes/components/movement/CGroundedMovement.tscn" id="7_qyswd"]
|
[ext_resource type="PackedScene" uid="uid://dbr7ioio158ew" path="res://scenes/components/movement/CGroundedMovement.tscn" id="7_qyswd"]
|
||||||
@@ -30,20 +25,9 @@ Default = 1
|
|||||||
Min = 1
|
Min = 1
|
||||||
Max = 100
|
Max = 100
|
||||||
|
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_4jf2q"]
|
[sub_resource type="ViewportTexture" id="ViewportTexture_18xwy"]
|
||||||
viewport_path = NodePath("SubViewport")
|
viewport_path = NodePath("SubViewport")
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_qj0ob"]
|
|
||||||
script = ExtResource("2_r3cnf")
|
|
||||||
Modifier = 1.0
|
|
||||||
metadata/_custom_type_script = "uid://b6y3ugfydvch0"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_18xwy"]
|
|
||||||
script = ExtResource("2_r3cnf")
|
|
||||||
DamageType = 3
|
|
||||||
Modifier = 1.0
|
|
||||||
metadata/_custom_type_script = "uid://b6y3ugfydvch0"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_6d4gl"]
|
[sub_resource type="Resource" id="Resource_6d4gl"]
|
||||||
script = ExtResource("8_6d4gl")
|
script = ExtResource("8_6d4gl")
|
||||||
Speed = 5.0
|
Speed = 5.0
|
||||||
@@ -74,9 +58,6 @@ collision_mask = 273
|
|||||||
script = ExtResource("1_r6506")
|
script = ExtResource("1_r6506")
|
||||||
HitAbility = ExtResource("6_4jf2q")
|
HitAbility = ExtResource("6_4jf2q")
|
||||||
EnemyHeight = 2.0
|
EnemyHeight = 2.0
|
||||||
RHealth = ExtResource("2_w4lm8")
|
|
||||||
DeathEffects = Array[Object]([])
|
|
||||||
RDamage = ExtResource("2_bn56u")
|
|
||||||
RKnockback = ExtResource("11_8k3xb")
|
RKnockback = ExtResource("11_8k3xb")
|
||||||
RMovement = ExtResource("4_na24f")
|
RMovement = ExtResource("4_na24f")
|
||||||
|
|
||||||
@@ -114,19 +95,9 @@ InitialAttributeValues = Dictionary[String, ExtResource("7_x50ya")]({
|
|||||||
})
|
})
|
||||||
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
||||||
|
|
||||||
[node name="CHealth" type="Node" parent="." unique_id=188153645]
|
|
||||||
script = ExtResource("2_gsmti")
|
|
||||||
RHealth = ExtResource("2_w4lm8")
|
|
||||||
metadata/_custom_type_script = "uid://bjwrpv3jpsc1e"
|
|
||||||
|
|
||||||
[node name="CHealthBar" parent="." unique_id=1278247727 instance=ExtResource("7_18xwy")]
|
[node name="CHealthBar" parent="." unique_id=1278247727 instance=ExtResource("7_18xwy")]
|
||||||
transform = Transform3D(0.4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.2, 0)
|
transform = Transform3D(0.4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.2, 0)
|
||||||
texture = SubResource("ViewportTexture_4jf2q")
|
texture = SubResource("ViewportTexture_18xwy")
|
||||||
|
|
||||||
[node name="CDamageable" type="Node" parent="." unique_id=1601518000]
|
|
||||||
script = ExtResource("7_1tw73")
|
|
||||||
DamageModifiers = Array[Object]([SubResource("Resource_qj0ob"), SubResource("Resource_18xwy")])
|
|
||||||
metadata/_custom_type_script = "uid://b0u23nkpaimyc"
|
|
||||||
|
|
||||||
[node name="CMovement" parent="." unique_id=1080640834 node_paths=PackedStringArray("WallInFrontRayCast") instance=ExtResource("7_qyswd")]
|
[node name="CMovement" parent="." unique_id=1080640834 node_paths=PackedStringArray("WallInFrontRayCast") instance=ExtResource("7_qyswd")]
|
||||||
RMovement = SubResource("Resource_6d4gl")
|
RMovement = SubResource("Resource_6d4gl")
|
||||||
|
|||||||
@@ -4,5 +4,5 @@
|
|||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_vdia8")
|
script = ExtResource("1_vdia8")
|
||||||
Modifier = 30.0
|
Modifier = 1.0
|
||||||
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
metadata/_custom_type_script = "uid://b44cse62qru7j"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_hsy8g")
|
script = ExtResource("1_hsy8g")
|
||||||
Speed = 5.0
|
Speed = 4.0
|
||||||
Acceleration = 3.0
|
Acceleration = 1.0
|
||||||
GravityModifier = 5.0
|
GravityModifier = 5.0
|
||||||
metadata/_custom_type_script = "uid://dtpxijlnb2c5"
|
metadata/_custom_type_script = "uid://dtpxijlnb2c5"
|
||||||
|
|||||||
@@ -1,22 +1,42 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using Chickensoft.AutoInject;
|
||||||
|
using Chickensoft.Introspection;
|
||||||
|
using Gamesmiths.Forge.Core;
|
||||||
|
using Gamesmiths.Forge.Cues;
|
||||||
|
using Gamesmiths.Forge.Tags;
|
||||||
using Movementtests.interfaces;
|
using Movementtests.interfaces;
|
||||||
|
using Movementtests.tools;
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_projectile.png")]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_projectile.png"), Meta(typeof(IAutoNode))]
|
||||||
public partial class Explosion : Area3D, IDamageDealer
|
public partial class Explosion : Area3D, IProvide<CuesManager>
|
||||||
{
|
{
|
||||||
[Export] public RDamage RDamage { get; set;}
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
[Export] public float Radius { get; set;}
|
|
||||||
|
[Dependency]
|
||||||
|
public CuesManager CuesManager => this.DependOn<CuesManager>();
|
||||||
|
CuesManager IProvide<CuesManager>.Value() => CuesManager;
|
||||||
|
|
||||||
|
[Export] public float Damage { get; set; } = 1.0f;
|
||||||
|
[Export] public float Radius { get; set; } = 1.0f;
|
||||||
[Export] public float ExplosionTime { get; set; } = 0.2f;
|
[Export] public float ExplosionTime { get; set; } = 0.2f;
|
||||||
|
|
||||||
public override void _Ready()
|
[Node("CollisionShape3D")] public required CollisionShape3D CollisionShape { get; set; }
|
||||||
{
|
[Node("MeshInstance3D")] public required MeshInstance3D CollisionMesh { get; set; }
|
||||||
var sphereShape = GetNode<CollisionShape3D>("CollisionShape3D").Shape as SphereShape3D;
|
[Node("ForgeEntityNode")] public required ForgeEntityNode ForgeEntityNode { get; set; }
|
||||||
sphereShape!.Radius = Radius;
|
|
||||||
var sphereMesh = GetNode<MeshInstance3D>("MeshInstance3D").Mesh as SphereMesh;
|
|
||||||
sphereMesh!.Radius = Radius;
|
|
||||||
sphereMesh!.Height = Radius*2f;
|
|
||||||
|
|
||||||
|
public void OnReady()
|
||||||
|
{
|
||||||
|
if (CollisionShape.Shape is SphereShape3D sphereShape) sphereShape.Radius = Radius;
|
||||||
|
if (CollisionMesh.Mesh is not SphereMesh sphereMesh) return;
|
||||||
|
sphereMesh.Radius = Radius;
|
||||||
|
sphereMesh.Height = Radius * 2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnResolved()
|
||||||
|
{
|
||||||
|
this.Provide();
|
||||||
GetTree().CreateTimer(ExplosionTime).Timeout += TriggerExplosion;
|
GetTree().CreateTimer(ExplosionTime).Timeout += TriggerExplosion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,12 +45,10 @@ public partial class Explosion : Area3D, IDamageDealer
|
|||||||
var bodies = GetOverlappingBodies();
|
var bodies = GetOverlappingBodies();
|
||||||
foreach (var body in bodies)
|
foreach (var body in bodies)
|
||||||
{
|
{
|
||||||
if (body is IDamageable damageable)
|
if (body is not IForgeEntity target) continue;
|
||||||
damageable.TakeDamage(new DamageRecord(GlobalPosition, RDamage));
|
foreach (var ability in ForgeEntityNode.Abilities.GrantedAbilities.Where(ability => ability.CanActivate(out _, target)))
|
||||||
if (body is IStunnable stunnable)
|
ability.Activate(out _, target, Damage);
|
||||||
stunnable.Stun();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QueueFree();
|
QueueFree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
[gd_scene format=3 uid="uid://duju3atqgltkg"]
|
[gd_scene format=3 uid="uid://duju3atqgltkg"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cnlu64l7oxvv3" path="res://scenes/explosion/Explosion.cs" id="1_82hkh"]
|
[ext_resource type="Script" uid="uid://cnlu64l7oxvv3" path="res://scenes/explosion/Explosion.cs" id="1_82hkh"]
|
||||||
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_hys74"]
|
[ext_resource type="Script" uid="uid://rpcbb54q4atx" path="res://forge/ForgeEntityNode.cs" id="3_wikc1"]
|
||||||
|
[ext_resource type="Script" uid="uid://dps0oef50noil" path="res://addons/forge/nodes/ForgeEffect.cs" id="4_f5lqq"]
|
||||||
[sub_resource type="Resource" id="Resource_ffdh3"]
|
[ext_resource type="Resource" uid="uid://nns16d5uhtl8" path="res://forge/resources/ability_datas/explosion_hit.tres" id="5_nphml"]
|
||||||
script = ExtResource("2_hys74")
|
[ext_resource type="Script" uid="uid://1hgogislo1l6" path="res://addons/forge/resources/magnitudes/ForgeScalableInt.cs" id="5_nqbbv"]
|
||||||
DamageDealt = 10.0
|
[ext_resource type="Script" uid="uid://b83hf13nj37k3" path="res://addons/forge/resources/ForgeEffectData.cs" id="8_qslwq"]
|
||||||
DamageType = 3
|
[ext_resource type="Script" uid="uid://cxihb42t2mfqi" path="res://addons/forge/nodes/ForgeAttributeSet.cs" id="10_1ve7p"]
|
||||||
metadata/_custom_type_script = "uid://jitubgv6judn"
|
[ext_resource type="Script" uid="uid://72kj3n4lm1em" path="res://addons/forge/resources/components/ForgeGrantAbilityConfig.cs" id="11_l63t1"]
|
||||||
|
[ext_resource type="Script" uid="uid://ccovd5i0wr3kk" path="res://addons/forge/editor/attributes/AttributeValues.cs" id="11_nqbbv"]
|
||||||
|
[ext_resource type="Script" uid="uid://b3wo2uge4ddnj" path="res://addons/forge/resources/components/GrantAbility.cs" id="12_e6gfx"]
|
||||||
|
|
||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_82hkh"]
|
[sub_resource type="SphereShape3D" id="SphereShape3D_82hkh"]
|
||||||
radius = 1.0
|
radius = 1.0
|
||||||
@@ -19,12 +21,45 @@ transparency = 1
|
|||||||
cull_mode = 2
|
cull_mode = 2
|
||||||
albedo_color = Color(0.9607843, 0.27058825, 0, 0.7176471)
|
albedo_color = Color(0.9607843, 0.27058825, 0, 0.7176471)
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_5c2oj"]
|
||||||
|
script = ExtResource("5_nqbbv")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_17s7w"]
|
||||||
|
script = ExtResource("11_l63t1")
|
||||||
|
AbilityData = ExtResource("5_nphml")
|
||||||
|
AbilityLevel = SubResource("Resource_5c2oj")
|
||||||
|
metadata/_custom_type_script = "uid://72kj3n4lm1em"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_pmtlp"]
|
||||||
|
script = ExtResource("12_e6gfx")
|
||||||
|
GrantAbilityConfigs = [SubResource("Resource_17s7w")]
|
||||||
|
metadata/_custom_type_script = "uid://b3wo2uge4ddnj"
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_pvvi5"]
|
||||||
|
script = ExtResource("5_nqbbv")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_4lkfq"]
|
||||||
|
script = ExtResource("5_nqbbv")
|
||||||
|
BaseValue = 1
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_pjqsn"]
|
||||||
|
script = ExtResource("8_qslwq")
|
||||||
|
Name = "Grant Explosion Ability"
|
||||||
|
Modifiers = []
|
||||||
|
Components = Array[Object]([SubResource("Resource_pmtlp")])
|
||||||
|
Executions = []
|
||||||
|
StackLimit = SubResource("Resource_4lkfq")
|
||||||
|
InitialStack = SubResource("Resource_pvvi5")
|
||||||
|
Cues = []
|
||||||
|
metadata/_custom_type_script = "uid://b83hf13nj37k3"
|
||||||
|
|
||||||
[node name="Explosion" type="Area3D" unique_id=1876014452]
|
[node name="Explosion" type="Area3D" unique_id=1876014452]
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
collision_mask = 16
|
collision_mask = 16
|
||||||
monitorable = false
|
monitorable = false
|
||||||
script = ExtResource("1_82hkh")
|
script = ExtResource("1_82hkh")
|
||||||
RDamage = SubResource("Resource_ffdh3")
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1259903749]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1259903749]
|
||||||
shape = SubResource("SphereShape3D_82hkh")
|
shape = SubResource("SphereShape3D_82hkh")
|
||||||
@@ -32,3 +67,23 @@ shape = SubResource("SphereShape3D_82hkh")
|
|||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1864409522]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=1864409522]
|
||||||
mesh = SubResource("SphereMesh_82hkh")
|
mesh = SubResource("SphereMesh_82hkh")
|
||||||
surface_material_override/0 = SubResource("StandardMaterial3D_hys74")
|
surface_material_override/0 = SubResource("StandardMaterial3D_hys74")
|
||||||
|
|
||||||
|
[node name="ForgeEntityNode" type="Node3D" parent="." unique_id=806020391]
|
||||||
|
script = ExtResource("3_wikc1")
|
||||||
|
metadata/_custom_type_script = "uid://rpcbb54q4atx"
|
||||||
|
|
||||||
|
[node name="ForgeEffect" type="Node" parent="ForgeEntityNode" unique_id=2068515708]
|
||||||
|
script = ExtResource("4_f5lqq")
|
||||||
|
EffectData = SubResource("Resource_pjqsn")
|
||||||
|
metadata/_custom_type_script = "uid://dps0oef50noil"
|
||||||
|
|
||||||
|
[node name="ForgeAttributeSet" type="Node" parent="ForgeEntityNode" unique_id=813420941]
|
||||||
|
script = ExtResource("10_1ve7p")
|
||||||
|
AttributeSetClass = "MetaAttributeSet"
|
||||||
|
InitialAttributeValues = Dictionary[String, ExtResource("11_nqbbv")]({
|
||||||
|
"IncomingDamage": Object(RefCounted,"script":ExtResource("11_nqbbv"),"Default":0,"Min":0,"Max":1000)
|
||||||
|
,
|
||||||
|
"Level": Object(RefCounted,"script":ExtResource("11_nqbbv"),"Default":1,"Min":1,"Max":1000)
|
||||||
|
|
||||||
|
})
|
||||||
|
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
||||||
|
|||||||
@@ -3,20 +3,15 @@
|
|||||||
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://scenes/player_controller/scripts/PlayerController.cs" id="1_poq2x"]
|
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://scenes/player_controller/scripts/PlayerController.cs" id="1_poq2x"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cf3rrgr1imvv4" path="res://scenes/path/path.tscn" id="2_6lejt"]
|
[ext_resource type="PackedScene" uid="uid://cf3rrgr1imvv4" path="res://scenes/path/path.tscn" id="2_6lejt"]
|
||||||
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_u8yay"]
|
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_u8yay"]
|
||||||
[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="PackedScene" uid="uid://c4ikbhojckpnc" path="res://scenes/components/health/CHealth.tscn" id="3_q7bng"]
|
|
||||||
[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://dgjsi1my7nlnk" path="res://forge/resources/ability_datas/player_hit.tres" id="4_u8yay"]
|
[ext_resource type="Resource" uid="uid://dgjsi1my7nlnk" path="res://forge/resources/ability_datas/player_hit.tres" id="4_u8yay"]
|
||||||
[ext_resource type="Resource" uid="uid://dh437cuxgjv6b" path="res://forge/resources/effect_datas/mana_regeneration.tres" id="5_2rkt1"]
|
[ext_resource type="Resource" uid="uid://dh437cuxgjv6b" path="res://forge/resources/effect_datas/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="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="Resource" uid="uid://b0ikxp5j8fn3n" path="res://forge/resources/ability_datas/on_hit_invinciblity.tres" id="5_u8yay"]
|
[ext_resource type="Resource" uid="uid://b0ikxp5j8fn3n" path="res://forge/resources/ability_datas/on_hit_invinciblity.tres" id="5_u8yay"]
|
||||||
[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://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://forge/resources/effect_datas/inhibit_mana_regen_temporarily.tres" id="6_u8yay"]
|
[ext_resource type="Resource" uid="uid://cffil4tic3ysg" path="res://forge/resources/effect_datas/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"]
|
||||||
@@ -75,11 +70,6 @@ script = ExtResource("11_u8yay")
|
|||||||
Tag = "immunity.damage"
|
Tag = "immunity.damage"
|
||||||
metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
metadata/_custom_type_script = "uid://dpakv7agvir6y"
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_cb2lu"]
|
|
||||||
script = ExtResource("2_x835q")
|
|
||||||
DamageDealt = 10.0
|
|
||||||
metadata/_custom_type_script = "uid://jitubgv6judn"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_abfq8"]
|
[sub_resource type="Resource" id="Resource_abfq8"]
|
||||||
script = ExtResource("3_cb2lu")
|
script = ExtResource("3_cb2lu")
|
||||||
Modifier = 5.0
|
Modifier = 5.0
|
||||||
@@ -165,7 +155,6 @@ EmpoweredActionEffects = [ExtResource("6_u8yay")]
|
|||||||
AimAssistStrength = 0.3
|
AimAssistStrength = 0.3
|
||||||
AimAssistReductionWhenCloseToTarget = 0.1
|
AimAssistReductionWhenCloseToTarget = 0.1
|
||||||
AimAssistReductionStartDistance = 8.0
|
AimAssistReductionStartDistance = 8.0
|
||||||
RDamage = SubResource("Resource_cb2lu")
|
|
||||||
RKnockback = SubResource("Resource_abfq8")
|
RKnockback = SubResource("Resource_abfq8")
|
||||||
TargetingDistance = 5.0
|
TargetingDistance = 5.0
|
||||||
Explosion = ExtResource("5_ue7xq")
|
Explosion = ExtResource("5_ue7xq")
|
||||||
@@ -242,12 +231,6 @@ InitialAttributeValues = Dictionary[String, ExtResource("11_2rkt1")]({
|
|||||||
})
|
})
|
||||||
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
metadata/_custom_type_script = "uid://cxihb42t2mfqi"
|
||||||
|
|
||||||
[node name="CHealth" parent="." unique_id=1244478698 instance=ExtResource("3_q7bng")]
|
|
||||||
RHealth = ExtResource("4_m8gvy")
|
|
||||||
|
|
||||||
[node name="CDamageable" parent="." unique_id=1375668972 instance=ExtResource("5_jb43f")]
|
|
||||||
DamageModifiers = Array[Object]([ExtResource("6_cmijs")])
|
|
||||||
|
|
||||||
[node name="CKnockback" parent="." unique_id=80423377 instance=ExtResource("7_x835q")]
|
[node name="CKnockback" parent="." unique_id=80423377 instance=ExtResource("7_x835q")]
|
||||||
RKnockback = ExtResource("8_m8gvy")
|
RKnockback = ExtResource("8_m8gvy")
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Movementtests.systems;
|
|||||||
|
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_sword.png"), Meta(typeof(IAutoNode))]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_sword.png"), Meta(typeof(IAutoNode))]
|
||||||
public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
public partial class WeaponSystem : RigidBody3D, IForgeEntity
|
||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
@@ -66,9 +66,9 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
|
|
||||||
#region Forge
|
#region Forge
|
||||||
|
|
||||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStartedFlyingAbilities = new ();
|
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStartedFlyingAbilities = new();
|
||||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStoppedFlyingAbilities = new ();
|
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStoppedFlyingAbilities = new();
|
||||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponFlyingTickAbilities = new ();
|
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponFlyingTickAbilities = new();
|
||||||
|
|
||||||
public Tag WeaponFlyingTickEventTag;
|
public Tag WeaponFlyingTickEventTag;
|
||||||
public Tag WeaponStartedFlyingEventTag;
|
public Tag WeaponStartedFlyingEventTag;
|
||||||
@@ -92,8 +92,6 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
#region Inspector
|
#region Inspector
|
||||||
[Export] public ForgeAbilityData? FlyingTickAbility { get; set; }
|
[Export] public ForgeAbilityData? FlyingTickAbility { get; set; }
|
||||||
|
|
||||||
[Export]
|
|
||||||
public RDamage RDamage { get; set; }
|
|
||||||
[Export(PropertyHint.Range, "0,2,0.01,or_greater")]
|
[Export(PropertyHint.Range, "0,2,0.01,or_greater")]
|
||||||
public float ThrowForce { get; set; } = 1f;
|
public float ThrowForce { get; set; } = 1f;
|
||||||
[Export(PropertyHint.Range, "0,0.2,0.01,or_greater")]
|
[Export(PropertyHint.Range, "0,0.2,0.01,or_greater")]
|
||||||
@@ -140,9 +138,9 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
|
|
||||||
#region Publics
|
#region Publics
|
||||||
|
|
||||||
public StateChartState InHandState = null!;
|
public StateChartState InHandState = null!;
|
||||||
public StateChartState FlyingState = null!;
|
public StateChartState FlyingState = null!;
|
||||||
public StateChartState PlantedState = null!;
|
public StateChartState PlantedState = null!;
|
||||||
|
|
||||||
public Vector3 PlantLocation { get; set; }
|
public Vector3 PlantLocation { get; set; }
|
||||||
public Vector3 PlantNormal { get; set; }
|
public Vector3 PlantNormal { get; set; }
|
||||||
@@ -343,15 +341,20 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
{
|
{
|
||||||
foreach (var weaponEvent in Enum.GetValues<WeaponEvent>())
|
foreach (var weaponEvent in Enum.GetValues<WeaponEvent>())
|
||||||
{
|
{
|
||||||
var abilities = GetGrantedAbilities(weaponEvent);
|
RemoveAbilitiesForEvent(weaponEvent);
|
||||||
foreach (var ability in abilities.Values)
|
|
||||||
{
|
|
||||||
EffectsManager.RemoveEffect(ability);
|
|
||||||
}
|
|
||||||
abilities.Clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RemoveAbilitiesForEvent(WeaponEvent weaponEvent)
|
||||||
|
{
|
||||||
|
var abilities = GetGrantedAbilities(weaponEvent);
|
||||||
|
foreach (var ability in abilities.Values)
|
||||||
|
{
|
||||||
|
EffectsManager.RemoveEffect(ability);
|
||||||
|
}
|
||||||
|
abilities.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
public Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> GetGrantedAbilities(WeaponEvent forEvent)
|
public Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> GetGrantedAbilities(WeaponEvent forEvent)
|
||||||
{
|
{
|
||||||
var abilitiesMap = new Dictionary<WeaponEvent, Dictionary<ForgeAbilityBehavior, ActiveEffectHandle>>
|
var abilitiesMap = new Dictionary<WeaponEvent, Dictionary<ForgeAbilityBehavior, ActiveEffectHandle>>
|
||||||
@@ -415,10 +418,10 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
|||||||
if (enemy is IForgeEntity victim) _plantedEntity = victim;
|
if (enemy is IForgeEntity victim) _plantedEntity = victim;
|
||||||
else _plantedEntity = null;
|
else _plantedEntity = null;
|
||||||
|
|
||||||
if (enemy is IDamageable damageable)
|
// if (enemy is IDamageable damageable)
|
||||||
{
|
// {
|
||||||
damageable.TakeDamage(new DamageRecord(GlobalPosition, RDamage));
|
// damageable.TakeDamage(new DamageRecord(GlobalPosition, RDamage));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RethrowWeapon()
|
public void RethrowWeapon()
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
[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://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_l1xlx"]
|
[ext_resource type="Script" uid="uid://cw525n4mjqgw0" path="res://addons/forge/resources/ForgeTagContainer.cs" id="2_l1xlx"]
|
||||||
[ext_resource type="Script" uid="uid://jitubgv6judn" path="res://scenes/components/damage/RDamage.cs" id="2_m0v1h"]
|
|
||||||
[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="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"]
|
||||||
@@ -13,16 +12,6 @@
|
|||||||
[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"]
|
||||||
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_jpdh0"]
|
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_jpdh0"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_06gln"]
|
|
||||||
script = ExtResource("2_l1xlx")
|
|
||||||
ContainerTags = Array[String](["weapon"])
|
|
||||||
metadata/_custom_type_script = "uid://cw525n4mjqgw0"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_jpdh0"]
|
|
||||||
script = ExtResource("2_m0v1h")
|
|
||||||
DamageDealt = 2.0
|
|
||||||
metadata/_custom_type_script = "uid://jitubgv6judn"
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_7bruw"]
|
[sub_resource type="Resource" id="Resource_7bruw"]
|
||||||
script = ExtResource("2_l1xlx")
|
script = ExtResource("2_l1xlx")
|
||||||
ContainerTags = Array[String](["weapon"])
|
ContainerTags = Array[String](["weapon"])
|
||||||
@@ -69,9 +58,7 @@ 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")
|
||||||
BaseTags = SubResource("Resource_06gln")
|
|
||||||
FlyingTickAbility = ExtResource("4_7bruw")
|
FlyingTickAbility = ExtResource("4_7bruw")
|
||||||
RDamage = SubResource("Resource_jpdh0")
|
|
||||||
|
|
||||||
[node name="ForgeEntityNode" type="Node3D" parent="." unique_id=1798885192]
|
[node name="ForgeEntityNode" type="Node3D" parent="." unique_id=1798885192]
|
||||||
script = ExtResource("5_7bruw")
|
script = ExtResource("5_7bruw")
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Chickensoft.AutoInject;
|
using Chickensoft.AutoInject;
|
||||||
using Chickensoft.Introspection;
|
using Chickensoft.Introspection;
|
||||||
|
using Chickensoft.Sync.Primitives;
|
||||||
using Gamesmiths.Forge.Abilities;
|
using Gamesmiths.Forge.Abilities;
|
||||||
using Gamesmiths.Forge.Attributes;
|
using Gamesmiths.Forge.Attributes;
|
||||||
using Gamesmiths.Forge.Core;
|
using Gamesmiths.Forge.Core;
|
||||||
@@ -25,6 +26,7 @@ using Movementtests.interfaces;
|
|||||||
using Movementtests.systems;
|
using Movementtests.systems;
|
||||||
using Movementtests.player_controller.Scripts;
|
using Movementtests.player_controller.Scripts;
|
||||||
using Movementtests.managers;
|
using Movementtests.managers;
|
||||||
|
using Movementtests.scenes.components.knockback;
|
||||||
using Movementtests.tools;
|
using Movementtests.tools;
|
||||||
using Movementtests.tools.calculators;
|
using Movementtests.tools.calculators;
|
||||||
using RustyOptions;
|
using RustyOptions;
|
||||||
@@ -34,7 +36,7 @@ public record struct EmpoweredActionPayload;
|
|||||||
|
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_character.png"), Meta(typeof(IAutoNode))]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_character.png"), Meta(typeof(IAutoNode))]
|
||||||
public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandler
|
public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandler, IDisposable
|
||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
@@ -74,10 +76,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
[Signal]
|
[Signal]
|
||||||
public delegate void PlayerDiedEventHandler();
|
public delegate void PlayerDiedEventHandler();
|
||||||
|
|
||||||
public event Action<IDamageable, DamageRecord> DamageTaken = null!;
|
|
||||||
public event Action<IHealthable, HealthChangedRecord> HealthChanged = null!;
|
|
||||||
public event Action<IHealthable> HealthDepleted = null!;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Nodes
|
#region Nodes
|
||||||
@@ -148,8 +146,8 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
[Export(PropertyHint.Range, "0,10f,0.1,or_greater")]
|
[Export(PropertyHint.Range, "0,10f,0.1,or_greater")]
|
||||||
public float AimAssistReductionStartDistance { get; set; } = 10f;
|
public float AimAssistReductionStartDistance { get; set; } = 10f;
|
||||||
|
|
||||||
[ExportGroup("Damage")] [Export] public RDamage RDamage { get; set; } = null!;
|
[ExportGroup("Damage")]
|
||||||
[Export] public RKnockback? RKnockback { get; set; } = null!;
|
[Export] public RKnockback? RKnockback { get; set; }
|
||||||
|
|
||||||
[ExportGroup("Targeting")]
|
[ExportGroup("Targeting")]
|
||||||
[Export(PropertyHint.Range, "0,20,0.1,or_greater")]
|
[Export(PropertyHint.Range, "0,20,0.1,or_greater")]
|
||||||
@@ -496,18 +494,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
WeaponHitbox.Monitoring = false;
|
WeaponHitbox.Monitoring = false;
|
||||||
WeaponHitbox.BodyEntered += RegisterHitEnnemy;
|
WeaponHitbox.BodyEntered += RegisterHitEnnemy;
|
||||||
|
|
||||||
// if (RHealth != null)
|
|
||||||
// {
|
|
||||||
// CHealth.RHealth = RHealth;
|
|
||||||
// CHealth.CurrentHealth = RHealth.StartingHealth;
|
|
||||||
// }
|
|
||||||
// if (RKnockback != null) CKnockback!.RKnockback = RKnockback;
|
|
||||||
//
|
|
||||||
// CDamageable.DamageTaken += (damageable, record) => ReduceHealth(damageable, record);
|
|
||||||
// CDamageable.DamageTaken += (_, record) => RegisterKnockback(new KnockbackRecord(record));
|
|
||||||
// CHealth.HealthChanged += PlayerUi.OnHealthChanged;
|
|
||||||
// CHealth.HealthDepleted += (_) => Kill();
|
|
||||||
|
|
||||||
#region StateManagement
|
#region StateManagement
|
||||||
|
|
||||||
_playerState = StateChart.Of(GetNode("StateChart"));
|
_playerState = StateChart.Of(GetNode("StateChart"));
|
||||||
@@ -743,14 +729,45 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Inventory changes signal binding
|
// Inventory changes signal binding
|
||||||
InventoryManager.WeaponEventAbilityAdded += OnWeaponEventAbilityAdded;
|
StartedFlyingBinding = InventoryManager.StartedFlyingAbilities.Bind();
|
||||||
InventoryManager.WeaponEventAbilityRemoved += OnWeaponEventAbilityRemoved;
|
StartedFlyingBinding
|
||||||
|
.OnAdd(behavior => WeaponSystem.GrantNewAbilityForEvent(WeaponSystem.WeaponEvent.StartedFlying, behavior))
|
||||||
|
.OnRemove(behavior => WeaponSystem.RemoveAbilityForEvent(WeaponSystem.WeaponEvent.StartedFlying, behavior))
|
||||||
|
.OnClear(() => WeaponSystem.RemoveAbilitiesForEvent(WeaponSystem.WeaponEvent.StartedFlying));
|
||||||
|
FlyingTickBinding = InventoryManager.FlyingTickAbilities.Bind();
|
||||||
|
FlyingTickBinding
|
||||||
|
.OnAdd(behavior => WeaponSystem.GrantNewAbilityForEvent(WeaponSystem.WeaponEvent.FlyingTick, behavior))
|
||||||
|
.OnRemove(behavior => WeaponSystem.RemoveAbilityForEvent(WeaponSystem.WeaponEvent.FlyingTick, behavior))
|
||||||
|
.OnClear(() => WeaponSystem.RemoveAbilitiesForEvent(WeaponSystem.WeaponEvent.FlyingTick));
|
||||||
|
StoppedFlyingBinding = InventoryManager.StoppedFlyingAbilities.Bind();
|
||||||
|
StoppedFlyingBinding
|
||||||
|
.OnAdd(behavior => WeaponSystem.GrantNewAbilityForEvent(WeaponSystem.WeaponEvent.StoppedFlying, behavior))
|
||||||
|
.OnRemove(behavior => WeaponSystem.RemoveAbilityForEvent(WeaponSystem.WeaponEvent.StoppedFlying, behavior))
|
||||||
|
.OnClear(() => WeaponSystem.RemoveAbilitiesForEvent(WeaponSystem.WeaponEvent.StoppedFlying));
|
||||||
|
|
||||||
|
// InventoryManager.WeaponEventAbilityAdded += OnWeaponEventAbilityAdded;
|
||||||
|
// InventoryManager.WeaponEventAbilityRemoved += OnWeaponEventAbilityRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AutoSet<ForgeAbilityBehavior>.Binding StartedFlyingBinding { get; set; }
|
||||||
|
public AutoSet<ForgeAbilityBehavior>.Binding FlyingTickBinding { get; set; }
|
||||||
|
public AutoSet<ForgeAbilityBehavior>.Binding StoppedFlyingBinding { get; set; }
|
||||||
|
|
||||||
|
public new void Dispose()
|
||||||
|
{
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
|
||||||
|
StartedFlyingBinding.Dispose();
|
||||||
|
FlyingTickBinding.Dispose();
|
||||||
|
StoppedFlyingBinding.Dispose();
|
||||||
|
|
||||||
|
base.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnExitTree()
|
public void OnExitTree()
|
||||||
{
|
{
|
||||||
InventoryManager.WeaponEventAbilityAdded -= OnWeaponEventAbilityAdded;
|
// InventoryManager.WeaponEventAbilityAdded -= OnWeaponEventAbilityAdded;
|
||||||
InventoryManager.WeaponEventAbilityRemoved -= OnWeaponEventAbilityRemoved;
|
// InventoryManager.WeaponEventAbilityRemoved -= OnWeaponEventAbilityRemoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -824,13 +841,9 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
|
|
||||||
public void SetPlayerHealthOverride(float newHealthValue)
|
public void SetPlayerHealthOverride(float newHealthValue)
|
||||||
{
|
{
|
||||||
// RHealth.StartingHealth = newHealthValue;
|
|
||||||
// CHealth!.CurrentHealth = newHealthValue;
|
|
||||||
// PlayerUi.Initialize(CHealth.CurrentHealth, Attributes["PlayerAttributeSet.Mana"].BaseValue);
|
|
||||||
}
|
}
|
||||||
public void SetPlayerDamageOverride(float newDamageValue)
|
public void SetPlayerDamageOverride(float newDamageValue)
|
||||||
{
|
{
|
||||||
RDamage.DamageDealt = newDamageValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -1230,6 +1243,13 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isInputtingForward = IsPlayerInputtingForward() || GetMoveInput().Length() < Mathf.Epsilon;
|
||||||
|
if (_isEnemyInDashAttackRange && isInputtingForward)
|
||||||
|
{
|
||||||
|
_playerState.SendEvent("dash_attack");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (GetMoveInput().Length() < Mathf.Epsilon) return;
|
if (GetMoveInput().Length() < Mathf.Epsilon) return;
|
||||||
|
|
||||||
// Buffer dash in case of mantle or inputting dash airborne before touching the ground without air dash available
|
// Buffer dash in case of mantle or inputting dash airborne before touching the ground without air dash available
|
||||||
@@ -1694,7 +1714,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
|
|
||||||
var transform = _customMantle ? _customMantleStartTransform : MantleSystem.GlobalTransform;
|
var transform = _customMantle ? _customMantleStartTransform : MantleSystem.GlobalTransform;
|
||||||
var curve = _customMantle ? _customMantleCurve : MantleSystem.MantleCurve;
|
var curve = _customMantle ? _customMantleCurve : MantleSystem.MantleCurve;
|
||||||
GetTree().GetRoot().AddChild(_mantlePath);
|
GetTree().GetCurrentScene().AddChild(_mantlePath);
|
||||||
_mantlePath.Setup(transform, curve);
|
_mantlePath.Setup(transform, curve);
|
||||||
_mantleStartPosition = GlobalPosition;
|
_mantleStartPosition = GlobalPosition;
|
||||||
|
|
||||||
@@ -1977,9 +1997,9 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
|
|
||||||
// Basic distance traveled explosion manipulation
|
// Basic distance traveled explosion manipulation
|
||||||
explosion.Radius = distanceTraveled;
|
explosion.Radius = distanceTraveled;
|
||||||
explosion.RDamage.DamageDealt = distanceTraveled;
|
explosion.Damage = distanceTraveled;
|
||||||
|
|
||||||
GetTree().GetRoot().AddChild(explosion);
|
GetTree().GetCurrentScene().AddChild(explosion);
|
||||||
explosion.GlobalPosition = GlobalPosition;
|
explosion.GlobalPosition = GlobalPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2368,7 +2388,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!CloseEnemyDetector.IsColliding())
|
if (!CloseEnemyDetector.IsColliding())
|
||||||
{
|
{
|
||||||
PlayerUi.SetEnemyTargetProperties(new PlayerUi.TargetProperties(enemyTargetState, positionOnScreen));
|
PlayerUi.SetEnemyTargetProperties(new PlayerUi.TargetProperties(enemyTargetState, positionOnScreen));
|
||||||
@@ -2387,37 +2406,15 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
// var targetDistance = _targetLocation.DistanceTo(GlobalPosition);
|
// var targetDistance = _targetLocation.DistanceTo(GlobalPosition);
|
||||||
positionOnScreen = Camera.UnprojectPosition(_targetLocation);
|
positionOnScreen = Camera.UnprojectPosition(_targetLocation);
|
||||||
|
|
||||||
var wouldKill = false;
|
// var wouldKill = false;
|
||||||
if (_targetObject is IHealthable h and IDamageable d)
|
// if (_targetObject is IHealthable h and IDamageable d)
|
||||||
{
|
// {
|
||||||
var wouldBeDamage = d.ComputeDamage(new DamageRecord(GlobalPosition, RDamage));
|
// var wouldBeDamage = d.ComputeDamage(new DamageRecord(GlobalPosition, RDamage));
|
||||||
if (h.CurrentHealth < wouldBeDamage.Damage.DamageDealt) wouldKill = true;
|
// if (h.CurrentHealth < wouldBeDamage.Damage.DamageDealt) wouldKill = true;
|
||||||
}
|
// }
|
||||||
_isEnemyInDashAttackRange = true;
|
_isEnemyInDashAttackRange = true;
|
||||||
enemyTargetState = wouldKill ? PlayerUi.TargetState.TargetWouldKill : PlayerUi.TargetState.TargetWouldNotKill;
|
// enemyTargetState = wouldKill ? PlayerUi.TargetState.TargetWouldKill : PlayerUi.TargetState.TargetWouldNotKill;
|
||||||
PlayerUi.SetEnemyTargetProperties(new PlayerUi.TargetProperties(enemyTargetState, positionOnScreen));
|
PlayerUi.SetEnemyTargetProperties(new PlayerUi.TargetProperties(PlayerUi.TargetState.TargetWouldNotKill, positionOnScreen));
|
||||||
}
|
|
||||||
|
|
||||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
if (IsInvincible)
|
|
||||||
return damageRecord with { Damage = new RDamage(0, damageRecord.Damage.DamageType) };
|
|
||||||
|
|
||||||
// var finalDamage = CDamageable!.TakeDamage(damageRecord);
|
|
||||||
// DamageTaken?.Invoke(this, finalDamage);
|
|
||||||
|
|
||||||
HeadSystem.OnGetHit();
|
|
||||||
_audioStream.SwitchToClipByName("damage_taken");
|
|
||||||
TriggerHitstop();
|
|
||||||
OnHitInvincibility();
|
|
||||||
|
|
||||||
return damageRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DamageRecord ComputeDamage(DamageRecord damageRecord)
|
|
||||||
{
|
|
||||||
// return CDamageable!.ComputeDamage(damageRecord);
|
|
||||||
return damageRecord;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnHitInvincibility()
|
public void OnHitInvincibility()
|
||||||
@@ -2443,11 +2440,10 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
private PhysicsDirectSpaceState3D _spaceState = null!;
|
private PhysicsDirectSpaceState3D _spaceState = null!;
|
||||||
public void StartDashAction(bool isParry)
|
public void StartDashAction(bool isParry)
|
||||||
{
|
{
|
||||||
if (isParry) HeadSystem.OnParry();
|
// if (isParry) HeadSystem.OnParry();
|
||||||
else HeadSystem.OnHit();
|
// else HeadSystem.OnHit();
|
||||||
|
// var streamName = isParry ? "parry" : "attacks";
|
||||||
var streamName = isParry ? "parry" : "attacks";
|
_audioStream.SwitchToClipByName("dash");
|
||||||
_audioStream.SwitchToClipByName(streamName);
|
|
||||||
IsInvincible = true;
|
IsInvincible = true;
|
||||||
|
|
||||||
var plannedDashLocation = _targetLocation + Vector3.Down*_playerHeight/2;
|
var plannedDashLocation = _targetLocation + Vector3.Down*_playerHeight/2;
|
||||||
@@ -2486,8 +2482,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
{
|
{
|
||||||
if (_targetObject is IForgeEntity entity)
|
if (_targetObject is IForgeEntity entity)
|
||||||
{
|
{
|
||||||
_hitEnemies.Add(entity);
|
TriggerSimpleDashThroughDamage(entity);
|
||||||
TriggerDamage();
|
|
||||||
}
|
}
|
||||||
if (_targetObject is IStunnable stunnable)
|
if (_targetObject is IStunnable stunnable)
|
||||||
{
|
{
|
||||||
@@ -2497,6 +2492,13 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
_playerState.SendEvent("attack_finished");
|
_playerState.SendEvent("attack_finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TriggerSimpleDashThroughDamage(IForgeEntity entity)
|
||||||
|
{
|
||||||
|
// Emulate normal hit
|
||||||
|
_hitEnemies.Add(entity);
|
||||||
|
TriggerDamage();
|
||||||
|
}
|
||||||
|
|
||||||
public void OnDashAttackEnded()
|
public void OnDashAttackEnded()
|
||||||
{
|
{
|
||||||
StopDashAction();
|
StopDashAction();
|
||||||
@@ -2512,7 +2514,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
|
|
||||||
public void ManualKnockback()
|
public void ManualKnockback()
|
||||||
{
|
{
|
||||||
Velocity = -_dashDirection*RKnockback.Modifier;
|
Velocity = -_dashDirection*RKnockback!.Modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3 ComputePositionAfterTargetedDash(Vector3 targetLocation, Vector3 targetHitLocation)
|
public static Vector3 ComputePositionAfterTargetedDash(Vector3 targetLocation, Vector3 targetHitLocation)
|
||||||
@@ -2585,11 +2587,10 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
|||||||
|
|
||||||
foreach (var entity in _hitEnemies)
|
foreach (var entity in _hitEnemies)
|
||||||
{
|
{
|
||||||
// TODO: WTF why doesn't health move
|
_hitAbilityHandle.Activate(out var flags, entity);
|
||||||
// GD.Print(entity.Attributes["EnemyAttributeSet.Health"].CurrentValue);
|
|
||||||
_hitAbilityHandle.Activate(out _, entity);
|
|
||||||
}
|
}
|
||||||
_hitEnemies.Clear();
|
_hitEnemies.Clear();
|
||||||
|
_hitAbilityHandle.Cancel();
|
||||||
|
|
||||||
HeadSystem.OnHitTarget();
|
HeadSystem.OnHitTarget();
|
||||||
_audioStream.SwitchToClipByName("hits");
|
_audioStream.SwitchToClipByName("hits");
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ public partial class Spawner : Node3D
|
|||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public RMovement? MovementInputs { get; set; }
|
public RMovement? MovementInputs { get; set; }
|
||||||
[Export]
|
|
||||||
public RHealth? HealthInputs { get; set; }
|
|
||||||
[Export]
|
|
||||||
public RDamage? DamageInputs { get; set; }
|
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public Node3D Target { get; set; }
|
public Node3D Target { get; set; }
|
||||||
@@ -43,8 +39,6 @@ public partial class Spawner : Node3D
|
|||||||
|
|
||||||
spawnedInstance.Target = Target;
|
spawnedInstance.Target = Target;
|
||||||
spawnedInstance.RMovement = MovementInputs;
|
spawnedInstance.RMovement = MovementInputs;
|
||||||
spawnedInstance.RDamage = DamageInputs;
|
|
||||||
spawnedInstance.RHealth = HealthInputs;
|
|
||||||
spawnedInstance.Init();
|
spawnedInstance.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using GdUnit4;
|
|
||||||
using static GdUnit4.Assertions;
|
|
||||||
using Movementtests.interfaces;
|
|
||||||
using Movementtests.systems.damage;
|
|
||||||
|
|
||||||
namespace Movementtests.tests;
|
|
||||||
|
|
||||||
[TestSuite, RequireGodotRuntime]
|
|
||||||
public class DamageComponentUnitTest
|
|
||||||
{
|
|
||||||
[TestCase]
|
|
||||||
public void DamageModifierAppliesWhenTypeMatches()
|
|
||||||
{
|
|
||||||
var input = new DamageRecord(Vector3.Zero, new RDamage(10.0f, EDamageTypes.Normal));
|
|
||||||
var modifier = new RDamageModifier(EDamageTypes.Normal, 2.0f);
|
|
||||||
var signalTriggered = false;
|
|
||||||
modifier.DamageTaken += (_, _) => signalTriggered = true;
|
|
||||||
|
|
||||||
var result = modifier.TakeDamage(input);
|
|
||||||
|
|
||||||
AssertFloat(result.Damage.DamageDealt).IsEqual(20.0f);
|
|
||||||
AssertBool(signalTriggered).IsTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestCase]
|
|
||||||
public void DamageModifierIgnoresWhenTypeDifferent()
|
|
||||||
{
|
|
||||||
var input = new DamageRecord(Vector3.Zero, new RDamage(10.0f, EDamageTypes.Normal));
|
|
||||||
var modifier = new RDamageModifier(EDamageTypes.Fire, 3.0f);
|
|
||||||
var signalTriggered = false;
|
|
||||||
modifier.DamageTaken += (_, _) => signalTriggered = true;
|
|
||||||
|
|
||||||
var result = modifier.TakeDamage(input);
|
|
||||||
|
|
||||||
AssertFloat(result.Damage.DamageDealt).IsEqual(0.0f);
|
|
||||||
AssertBool(signalTriggered).IsFalse(); // No damage actually taken
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestCase]
|
|
||||||
public void DamageableSumsAllModifiers()
|
|
||||||
{
|
|
||||||
var mod1 = new RDamageModifier(EDamageTypes.Normal, 1.0f);
|
|
||||||
var mod2 = new RDamageModifier(EDamageTypes.Normal, 0.5f);
|
|
||||||
|
|
||||||
var damageable = new CDamageable();
|
|
||||||
damageable.DamageModifiers = new[] { mod1, mod2 };
|
|
||||||
var signalTriggered = false;
|
|
||||||
damageable.DamageTaken += (_, _) => signalTriggered = true;
|
|
||||||
|
|
||||||
var input = new DamageRecord(Vector3.Zero, new RDamage(10.0f, EDamageTypes.Normal));
|
|
||||||
var result = damageable.TakeDamage(input);
|
|
||||||
|
|
||||||
AssertFloat(result.Damage.DamageDealt).IsEqual(15.0f);
|
|
||||||
AssertBool(signalTriggered).IsTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestCase]
|
|
||||||
public void ComputeDamageModifierAppliesWhenTypeMatches()
|
|
||||||
{
|
|
||||||
var input = new DamageRecord(Vector3.Zero, new RDamage(10.0f, EDamageTypes.Normal));
|
|
||||||
var modifier = new RDamageModifier(EDamageTypes.Normal, 2.0f);
|
|
||||||
var signalTriggered = false;
|
|
||||||
modifier.DamageTaken += (_, _) => signalTriggered = true;
|
|
||||||
|
|
||||||
var result = modifier.ComputeDamage(input);
|
|
||||||
|
|
||||||
AssertFloat(result.Damage.DamageDealt).IsEqual(20.0f);
|
|
||||||
AssertBool(signalTriggered).IsFalse();
|
|
||||||
}
|
|
||||||
[TestCase]
|
|
||||||
public void ComputeDamageModifierIgnoresWhenTypeDifferent()
|
|
||||||
{
|
|
||||||
var input = new DamageRecord(Vector3.Zero, new RDamage(10.0f, EDamageTypes.Normal));
|
|
||||||
var modifier = new RDamageModifier(EDamageTypes.Fire, 3.0f);
|
|
||||||
var signalTriggered = false;
|
|
||||||
modifier.DamageTaken += (_, _) => signalTriggered = true;
|
|
||||||
|
|
||||||
var result = modifier.ComputeDamage(input);
|
|
||||||
|
|
||||||
AssertFloat(result.Damage.DamageDealt).IsEqual(0.0f);
|
|
||||||
AssertBool(signalTriggered).IsFalse();
|
|
||||||
}
|
|
||||||
[TestCase]
|
|
||||||
public void ComputeDamageableSumsAllModifiers()
|
|
||||||
{
|
|
||||||
var mod1 = new RDamageModifier(EDamageTypes.Normal, 1.0f);
|
|
||||||
var mod2 = new RDamageModifier(EDamageTypes.Normal, 0.5f);
|
|
||||||
|
|
||||||
var cDamageable = new CDamageable();
|
|
||||||
cDamageable.DamageModifiers = new[] { mod1, mod2 };
|
|
||||||
var signalTriggered = false;
|
|
||||||
cDamageable.DamageTaken += (_, _) => signalTriggered = true;
|
|
||||||
|
|
||||||
var input = new DamageRecord(Vector3.Zero, new RDamage(10.0f, EDamageTypes.Normal));
|
|
||||||
var result = cDamageable.ComputeDamage(input);
|
|
||||||
|
|
||||||
AssertFloat(result.Damage.DamageDealt).IsEqual(15.0f);
|
|
||||||
AssertBool(signalTriggered).IsFalse();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://db6rva7uccppc
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using GdUnit4;
|
|
||||||
using static GdUnit4.Assertions;
|
|
||||||
using Movementtests.interfaces;
|
|
||||||
using Movementtests.systems.damage;
|
|
||||||
|
|
||||||
namespace Movementtests.tests;
|
|
||||||
|
|
||||||
[TestSuite, RequireGodotRuntime]
|
|
||||||
public class HealthComponentUnitTest
|
|
||||||
{
|
|
||||||
[TestCase]
|
|
||||||
public void ReadyInitializesCurrentHealth()
|
|
||||||
{
|
|
||||||
var cHealth = new CHealth();
|
|
||||||
cHealth.RHealth = new RHealth(150.0f);
|
|
||||||
cHealth._Ready();
|
|
||||||
AssertFloat(cHealth.CurrentHealth).IsEqual(150.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestCase]
|
|
||||||
public void ReduceHealthDecreasesAndDoesNotDeplete()
|
|
||||||
{
|
|
||||||
var cHealth = new CHealth();
|
|
||||||
cHealth.RHealth = new RHealth(100.0f);
|
|
||||||
cHealth.CurrentHealth = 100.0f;
|
|
||||||
|
|
||||||
var damage = new DamageRecord(Vector3.Zero, new RDamage(25.0f, EDamageTypes.Normal));
|
|
||||||
var record = cHealth.ReduceHealth(source: null!, damageRecord: damage);
|
|
||||||
|
|
||||||
AssertFloat(cHealth.CurrentHealth).IsEqual(75.0f);
|
|
||||||
AssertFloat(record.CurrentHealth).IsEqual(75.0f);
|
|
||||||
AssertFloat(record.PreviousHealth).IsEqual(100.0f);
|
|
||||||
AssertFloat(record.MaxHealth).IsEqual(100.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestCase]
|
|
||||||
public void ReduceHealthTriggersDepletionToZero()
|
|
||||||
{
|
|
||||||
var cHealth = new CHealth();
|
|
||||||
cHealth.RHealth = new RHealth(50.0f);
|
|
||||||
cHealth.CurrentHealth = 50.0f;
|
|
||||||
|
|
||||||
bool depleted = false;
|
|
||||||
cHealth.HealthDepleted += _ => depleted = true;
|
|
||||||
|
|
||||||
var damage = new DamageRecord(Vector3.Zero, new RDamage(100.0f, EDamageTypes.Normal));
|
|
||||||
var record = cHealth.ReduceHealth(source: null!, damageRecord: damage);
|
|
||||||
|
|
||||||
AssertBool(depleted).IsTrue();
|
|
||||||
AssertFloat(cHealth.CurrentHealth).IsEqual(0.0f);
|
|
||||||
AssertFloat(record.CurrentHealth).IsEqual(-50.0f);
|
|
||||||
AssertFloat(record.MaxHealth).IsEqual(50.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://bd52i51hncgmf
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using GdUnit4;
|
|
||||||
using static GdUnit4.Assertions;
|
|
||||||
using Movementtests.interfaces;
|
|
||||||
using Movementtests.systems.damage;
|
|
||||||
|
|
||||||
namespace Movementtests.tests;
|
|
||||||
|
|
||||||
[TestSuite, RequireGodotRuntime]
|
|
||||||
public class KnockbackComponentUnitTest
|
|
||||||
{
|
|
||||||
[TestCase]
|
|
||||||
public void RegisterAndComputeKnockback()
|
|
||||||
{
|
|
||||||
var cKnock = new CKnockback();
|
|
||||||
cKnock.RKnockback = new RKnockback(2.0f);
|
|
||||||
cKnock.GlobalPosition = Vector3.Zero;
|
|
||||||
|
|
||||||
var damage = new DamageRecord(new Vector3(10, 0, 0), new RDamage(0, EDamageTypes.Normal));
|
|
||||||
var record = new KnockbackRecord(damage, 1.5f);
|
|
||||||
|
|
||||||
cKnock.RegisterKnockback(record);
|
|
||||||
var force = cKnock.ComputeKnockback();
|
|
||||||
|
|
||||||
// Direction from source(10,0,0) to target(0,0,0) is (-1,0,0), scaled by modifier(2) and multiplier(1.5) => (-3,0,0)
|
|
||||||
AssertVector(force).IsEqual(new Vector3(-3, 0, 0));
|
|
||||||
|
|
||||||
// Second call returns zero since internal state resets
|
|
||||||
var second = cKnock.ComputeKnockback();
|
|
||||||
AssertVector(second).IsEqual(Vector3.Zero);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://bv0eionbgbig5
|
|
||||||
@@ -21,6 +21,8 @@ extends Node
|
|||||||
@onready var inventory_layer: CanvasLayer = $"../InventoryLayer"
|
@onready var inventory_layer: CanvasLayer = $"../InventoryLayer"
|
||||||
@onready var player: PlayerController = $"../Player"
|
@onready var player: PlayerController = $"../Player"
|
||||||
|
|
||||||
|
var inventory: OverlaidMenu = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
toolbox_action.triggered.connect(open_toolbox)
|
toolbox_action.triggered.connect(open_toolbox)
|
||||||
inventory_action.triggered.connect(open_inventory)
|
inventory_action.triggered.connect(open_inventory)
|
||||||
@@ -37,9 +39,11 @@ func open_toolbox() -> void:
|
|||||||
debug_layer.call_deferred("add_child", toolbox)
|
debug_layer.call_deferred("add_child", toolbox)
|
||||||
|
|
||||||
func open_inventory() -> void:
|
func open_inventory() -> void:
|
||||||
var inventory: Control = open_overlaid_menu(inventory_scene)
|
if inventory == null:
|
||||||
# inventory.player = player
|
inventory = open_overlaid_menu(inventory_scene)
|
||||||
inventory_layer.call_deferred("add_child", inventory)
|
inventory_layer.call_deferred("add_child", inventory)
|
||||||
|
return
|
||||||
|
inventory.show_menu()
|
||||||
|
|
||||||
func on_player_died() -> void:
|
func on_player_died() -> void:
|
||||||
var lost_menu: LevelLostMenu = open_overlaid_menu(lost_menu_scene)
|
var lost_menu: LevelLostMenu = open_overlaid_menu(lost_menu_scene)
|
||||||
|
|||||||
Reference in New Issue
Block a user