removed obsolete interfaces for health and damage
This commit is contained in:
@@ -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")]
|
||||
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
|
||||
@@ -21,8 +21,6 @@ using Node = Godot.Node;
|
||||
|
||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_beetle.png"), Meta(typeof(IAutoNode))]
|
||||
public partial class Enemy : CharacterBody3D,
|
||||
IDamageable,
|
||||
IHealthable,
|
||||
IKillable,
|
||||
IMoveable,
|
||||
ISpawnable,
|
||||
@@ -40,15 +38,6 @@ public partial class Enemy : CharacterBody3D,
|
||||
[Dependency]
|
||||
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
|
||||
|
||||
#region Inspector
|
||||
@@ -57,25 +46,14 @@ public partial class Enemy : CharacterBody3D,
|
||||
[Export]
|
||||
public Node3D? Target { get; set; }
|
||||
[Export] public required ForgeAbilityData HitAbility { get; set; }
|
||||
|
||||
[Export]
|
||||
public float EnemyHeight { get; set; } = 1f;
|
||||
|
||||
[ExportGroup("Health")]
|
||||
[Export]
|
||||
public RHealth RHealth { get; set; } = null!;
|
||||
[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!;
|
||||
public RDeathEffect[] DeathEffects { get; set; } = [];
|
||||
|
||||
[Export]
|
||||
public RKnockback? RKnockback { get; set; }
|
||||
public IKnockbackable CKnockback { get; set; } = null!;
|
||||
public IKnockbackable? CKnockback { get; set; }
|
||||
|
||||
[ExportGroup("Movement")]
|
||||
[Export]
|
||||
@@ -84,13 +62,6 @@ public partial class Enemy : CharacterBody3D,
|
||||
|
||||
#endregion
|
||||
|
||||
// Public stuff
|
||||
public float CurrentHealth
|
||||
{
|
||||
get => CHealth.CurrentHealth;
|
||||
set => CHealth.CurrentHealth = value;
|
||||
}
|
||||
|
||||
#region IForgeEntity
|
||||
|
||||
// Perfectly forward the IForgeEntity interface to the ForgeEntity component
|
||||
@@ -145,13 +116,7 @@ public partial class Enemy : CharacterBody3D,
|
||||
{
|
||||
CMovement = GetNode<Node>("CMovement") as IMoveable ?? throw new Exception("Movement component not found");
|
||||
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");
|
||||
|
||||
CHealth.RHealth = RHealth;
|
||||
CHealth.CurrentHealth = RHealth.StartingHealth;
|
||||
CKnockback.RKnockback = RKnockback;
|
||||
|
||||
_hitAbilityHandle = Abilities.GrantAbilityPermanently(HitAbility.GetAbilityData(), 1, LevelComparison.None, this);
|
||||
@@ -177,10 +142,6 @@ public partial class Enemy : CharacterBody3D,
|
||||
|
||||
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)
|
||||
@@ -220,7 +181,7 @@ public partial class Enemy : CharacterBody3D,
|
||||
|
||||
public Vector3 ComputeVelocity(MovementInputs inputs)
|
||||
{
|
||||
return CMovement is null ? Vector3.Zero : CMovement.ComputeVelocity(inputs);
|
||||
return CMovement.ComputeVelocity(inputs);
|
||||
}
|
||||
|
||||
public void OnDamageReceived(EventData<DamageDone> data)
|
||||
@@ -244,46 +205,10 @@ public partial class Enemy : CharacterBody3D,
|
||||
|
||||
public void OnDeath(EventData data)
|
||||
{
|
||||
// Remove weapon that might be planted there
|
||||
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);
|
||||
Kill();
|
||||
}
|
||||
|
||||
public DamageRecord TakeDamage(DamageRecord damageRecord)
|
||||
{
|
||||
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)
|
||||
public void Kill()
|
||||
{
|
||||
// Remove weapon that might be planted there
|
||||
foreach (var child in GetChildren())
|
||||
@@ -299,24 +224,24 @@ public partial class Enemy : CharacterBody3D,
|
||||
|
||||
foreach (var killable in DeathEffects.ToIKillables())
|
||||
{
|
||||
killable.Kill(source);
|
||||
killable.Kill();
|
||||
}
|
||||
CallDeferred(Node.MethodName.QueueFree);
|
||||
}
|
||||
|
||||
public void RegisterKnockback(KnockbackRecord knockbackRecord)
|
||||
{
|
||||
CKnockback.RegisterKnockback(knockbackRecord);
|
||||
CKnockback!.RegisterKnockback(knockbackRecord);
|
||||
}
|
||||
|
||||
public Vector3 ComputeKnockback()
|
||||
{
|
||||
return CKnockback.ComputeKnockback();
|
||||
return CKnockback!.ComputeKnockback();
|
||||
}
|
||||
|
||||
public Vector3 GetTargetGlobalPosition()
|
||||
{
|
||||
return TargetComponent == null ? GlobalPosition : TargetComponent.GlobalPosition;
|
||||
return TargetComponent.GlobalPosition;
|
||||
}
|
||||
|
||||
// Stun management
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
[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://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://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="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://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"]
|
||||
@@ -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="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://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="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
|
||||
Max = 100
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_46wn3"]
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_ykkxn"]
|
||||
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"]
|
||||
script = ExtResource("8_on7rt")
|
||||
Speed = 3.0
|
||||
@@ -74,9 +59,6 @@ motion_mode = 1
|
||||
script = ExtResource("1_q8l7o")
|
||||
HitAbility = ExtResource("2_46wn3")
|
||||
EnemyHeight = 0.5
|
||||
RHealth = ExtResource("2_ma2bq")
|
||||
DeathEffects = Array[Object]([])
|
||||
RDamage = ExtResource("2_on7rt")
|
||||
RKnockback = ExtResource("11_mpa2u")
|
||||
RMovement = ExtResource("4_dejyg")
|
||||
|
||||
@@ -114,19 +96,9 @@ InitialAttributeValues = Dictionary[String, ExtResource("8_46wn3")]({
|
||||
})
|
||||
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")]
|
||||
transform = Transform3D(0.3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.70000005, 0)
|
||||
texture = SubResource("ViewportTexture_46wn3")
|
||||
|
||||
[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"
|
||||
texture = SubResource("ViewportTexture_ykkxn")
|
||||
|
||||
[node name="CMovement" parent="." unique_id=1699571730 instance=ExtResource("7_vaeds")]
|
||||
RMovement = SubResource("Resource_on7rt")
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
[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="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://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://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="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"]
|
||||
@@ -30,20 +25,9 @@ Default = 1
|
||||
Min = 1
|
||||
Max = 100
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_4jf2q"]
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_18xwy"]
|
||||
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"]
|
||||
script = ExtResource("8_6d4gl")
|
||||
Speed = 5.0
|
||||
@@ -74,9 +58,6 @@ collision_mask = 273
|
||||
script = ExtResource("1_r6506")
|
||||
HitAbility = ExtResource("6_4jf2q")
|
||||
EnemyHeight = 2.0
|
||||
RHealth = ExtResource("2_w4lm8")
|
||||
DeathEffects = Array[Object]([])
|
||||
RDamage = ExtResource("2_bn56u")
|
||||
RKnockback = ExtResource("11_8k3xb")
|
||||
RMovement = ExtResource("4_na24f")
|
||||
|
||||
@@ -114,19 +95,9 @@ InitialAttributeValues = Dictionary[String, ExtResource("7_x50ya")]({
|
||||
})
|
||||
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")]
|
||||
transform = Transform3D(0.4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.2, 0)
|
||||
texture = SubResource("ViewportTexture_4jf2q")
|
||||
|
||||
[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"
|
||||
texture = SubResource("ViewportTexture_18xwy")
|
||||
|
||||
[node name="CMovement" parent="." unique_id=1080640834 node_paths=PackedStringArray("WallInFrontRayCast") instance=ExtResource("7_qyswd")]
|
||||
RMovement = SubResource("Resource_6d4gl")
|
||||
|
||||
@@ -10,15 +10,15 @@ using Movementtests.interfaces;
|
||||
using Movementtests.tools;
|
||||
|
||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_projectile.png"), Meta(typeof(IAutoNode))]
|
||||
public partial class Explosion : Area3D, IDamageDealer, IProvide<CuesManager>
|
||||
public partial class Explosion : Area3D, IProvide<CuesManager>
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Dependency]
|
||||
public CuesManager CuesManager => this.DependOn<CuesManager>();
|
||||
CuesManager IProvide<CuesManager>.Value() => CuesManager;
|
||||
|
||||
[Export] public RDamage RDamage { get; set; }
|
||||
|
||||
[Export] public float Damage { get; set; } = 1.0f;
|
||||
[Export] public float Radius { get; set; } = 1.0f;
|
||||
[Export] public float ExplosionTime { get; set; } = 0.2f;
|
||||
|
||||
@@ -47,7 +47,7 @@ public partial class Explosion : Area3D, IDamageDealer, IProvide<CuesManager>
|
||||
{
|
||||
if (body is not IForgeEntity target) continue;
|
||||
foreach (var ability in ForgeEntityNode.Abilities.GrantedAbilities.Where(ability => ability.CanActivate(out _, target)))
|
||||
ability.Activate(out _, target, RDamage.DamageDealt);
|
||||
ability.Activate(out _, target, Damage);
|
||||
}
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[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://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"]
|
||||
[ext_resource type="Resource" uid="uid://nns16d5uhtl8" path="res://forge/resources/ability_datas/explosion_hit.tres" id="5_nphml"]
|
||||
@@ -12,12 +11,6 @@
|
||||
[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="Resource" id="Resource_ffdh3"]
|
||||
script = ExtResource("2_hys74")
|
||||
DamageDealt = 10.0
|
||||
DamageType = 3
|
||||
metadata/_custom_type_script = "uid://jitubgv6judn"
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_82hkh"]
|
||||
radius = 1.0
|
||||
|
||||
@@ -67,7 +60,6 @@ collision_layer = 0
|
||||
collision_mask = 16
|
||||
monitorable = false
|
||||
script = ExtResource("1_82hkh")
|
||||
RDamage = SubResource("Resource_ffdh3")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1259903749]
|
||||
shape = SubResource("SphereShape3D_82hkh")
|
||||
|
||||
@@ -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="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://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="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://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://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://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="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://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"]
|
||||
@@ -75,11 +70,6 @@ script = ExtResource("11_u8yay")
|
||||
Tag = "immunity.damage"
|
||||
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"]
|
||||
script = ExtResource("3_cb2lu")
|
||||
Modifier = 5.0
|
||||
@@ -165,7 +155,6 @@ EmpoweredActionEffects = [ExtResource("6_u8yay")]
|
||||
AimAssistStrength = 0.3
|
||||
AimAssistReductionWhenCloseToTarget = 0.1
|
||||
AimAssistReductionStartDistance = 8.0
|
||||
RDamage = SubResource("Resource_cb2lu")
|
||||
RKnockback = SubResource("Resource_abfq8")
|
||||
TargetingDistance = 5.0
|
||||
Explosion = ExtResource("5_ue7xq")
|
||||
@@ -242,12 +231,6 @@ InitialAttributeValues = Dictionary[String, ExtResource("11_2rkt1")]({
|
||||
})
|
||||
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")]
|
||||
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))]
|
||||
public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
public partial class WeaponSystem : RigidBody3D, IForgeEntity
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
@@ -66,9 +66,9 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
|
||||
#region Forge
|
||||
|
||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStartedFlyingAbilities = new ();
|
||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStoppedFlyingAbilities = new ();
|
||||
private Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponFlyingTickAbilities = new ();
|
||||
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStartedFlyingAbilities = new();
|
||||
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponStoppedFlyingAbilities = new();
|
||||
private readonly Dictionary<ForgeAbilityBehavior, ActiveEffectHandle> _grantedWeaponFlyingTickAbilities = new();
|
||||
|
||||
public Tag WeaponFlyingTickEventTag;
|
||||
public Tag WeaponStartedFlyingEventTag;
|
||||
@@ -92,8 +92,6 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
#region Inspector
|
||||
[Export] public ForgeAbilityData? FlyingTickAbility { get; set; }
|
||||
|
||||
[Export]
|
||||
public RDamage RDamage { get; set; }
|
||||
[Export(PropertyHint.Range, "0,2,0.01,or_greater")]
|
||||
public float ThrowForce { get; set; } = 1f;
|
||||
[Export(PropertyHint.Range, "0,0.2,0.01,or_greater")]
|
||||
@@ -140,9 +138,9 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
|
||||
#region Publics
|
||||
|
||||
public StateChartState InHandState = null!;
|
||||
public StateChartState FlyingState = null!;
|
||||
public StateChartState PlantedState = null!;
|
||||
public StateChartState InHandState = null!;
|
||||
public StateChartState FlyingState = null!;
|
||||
public StateChartState PlantedState = null!;
|
||||
|
||||
public Vector3 PlantLocation { get; set; }
|
||||
public Vector3 PlantNormal { get; set; }
|
||||
@@ -420,10 +418,10 @@ public partial class WeaponSystem : RigidBody3D, IDamageDealer, IForgeEntity
|
||||
if (enemy is IForgeEntity victim) _plantedEntity = victim;
|
||||
else _plantedEntity = null;
|
||||
|
||||
if (enemy is IDamageable damageable)
|
||||
{
|
||||
damageable.TakeDamage(new DamageRecord(GlobalPosition, RDamage));
|
||||
}
|
||||
// if (enemy is IDamageable damageable)
|
||||
// {
|
||||
// damageable.TakeDamage(new DamageRecord(GlobalPosition, RDamage));
|
||||
// }
|
||||
}
|
||||
|
||||
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://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://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"]
|
||||
@@ -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://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"]
|
||||
script = ExtResource("2_l1xlx")
|
||||
ContainerTags = Array[String](["weapon"])
|
||||
@@ -69,9 +58,7 @@ continuous_cd = true
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 1
|
||||
script = ExtResource("1_csqwk")
|
||||
BaseTags = SubResource("Resource_06gln")
|
||||
FlyingTickAbility = ExtResource("4_7bruw")
|
||||
RDamage = SubResource("Resource_jpdh0")
|
||||
|
||||
[node name="ForgeEntityNode" type="Node3D" parent="." unique_id=1798885192]
|
||||
script = ExtResource("5_7bruw")
|
||||
|
||||
@@ -76,10 +76,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
[Signal]
|
||||
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
|
||||
|
||||
#region Nodes
|
||||
@@ -150,7 +146,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
[Export(PropertyHint.Range, "0,10f,0.1,or_greater")]
|
||||
public float AimAssistReductionStartDistance { get; set; } = 10f;
|
||||
|
||||
[ExportGroup("Damage")] [Export] public RDamage RDamage { get; set; } = null!;
|
||||
[ExportGroup("Damage")]
|
||||
[Export] public RKnockback? RKnockback { get; set; }
|
||||
|
||||
[ExportGroup("Targeting")]
|
||||
@@ -498,18 +494,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
WeaponHitbox.Monitoring = false;
|
||||
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
|
||||
|
||||
_playerState = StateChart.Of(GetNode("StateChart"));
|
||||
@@ -857,13 +841,9 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
|
||||
public void SetPlayerHealthOverride(float newHealthValue)
|
||||
{
|
||||
// RHealth.StartingHealth = newHealthValue;
|
||||
// CHealth!.CurrentHealth = newHealthValue;
|
||||
// PlayerUi.Initialize(CHealth.CurrentHealth, Attributes["PlayerAttributeSet.Mana"].BaseValue);
|
||||
}
|
||||
public void SetPlayerDamageOverride(float newDamageValue)
|
||||
{
|
||||
RDamage.DamageDealt = newDamageValue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1734,7 +1714,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
|
||||
var transform = _customMantle ? _customMantleStartTransform : MantleSystem.GlobalTransform;
|
||||
var curve = _customMantle ? _customMantleCurve : MantleSystem.MantleCurve;
|
||||
GetTree().GetRoot().AddChild(_mantlePath);
|
||||
GetTree().GetCurrentScene().AddChild(_mantlePath);
|
||||
_mantlePath.Setup(transform, curve);
|
||||
_mantleStartPosition = GlobalPosition;
|
||||
|
||||
@@ -2017,7 +1997,7 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
|
||||
// Basic distance traveled explosion manipulation
|
||||
explosion.Radius = distanceTraveled;
|
||||
explosion.RDamage.DamageDealt = distanceTraveled;
|
||||
explosion.Damage = distanceTraveled;
|
||||
|
||||
GetTree().GetCurrentScene().AddChild(explosion);
|
||||
explosion.GlobalPosition = GlobalPosition;
|
||||
@@ -2436,28 +2416,6 @@ public partial class PlayerController : CharacterBody3D, IForgeEntity, ICueHandl
|
||||
// enemyTargetState = wouldKill ? PlayerUi.TargetState.TargetWouldKill : PlayerUi.TargetState.TargetWouldNotKill;
|
||||
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()
|
||||
{
|
||||
|
||||
@@ -9,10 +9,6 @@ public partial class Spawner : Node3D
|
||||
|
||||
[Export]
|
||||
public RMovement? MovementInputs { get; set; }
|
||||
[Export]
|
||||
public RHealth? HealthInputs { get; set; }
|
||||
[Export]
|
||||
public RDamage? DamageInputs { get; set; }
|
||||
|
||||
[Export]
|
||||
public Node3D Target { get; set; }
|
||||
@@ -43,8 +39,6 @@ public partial class Spawner : Node3D
|
||||
|
||||
spawnedInstance.Target = Target;
|
||||
spawnedInstance.RMovement = MovementInputs;
|
||||
spawnedInstance.RDamage = DamageInputs;
|
||||
spawnedInstance.RHealth = HealthInputs;
|
||||
spawnedInstance.Init();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user