can plant weapon in targetables, dash towards it, jump in the air.
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 28s
Create tag and build when new code gets to main / Export (push) Failing after 1m47s

This commit is contained in:
2026-01-24 15:22:16 +01:00
parent b84b7e4dd5
commit 18c8b741dd
10 changed files with 116 additions and 36 deletions

View File

@@ -1,6 +1,7 @@
using System;
using Godot;
using Movementtests.interfaces;
using Movementtests.systems;
[GlobalClass]
public partial class Enemy : CharacterBody3D,
@@ -22,6 +23,8 @@ public partial class Enemy : CharacterBody3D,
// Public export components
[Export]
public Node3D Target { get; set; }
[Export]
public float EnemyHeight { get; set; } = 1f;
[ExportGroup("Health")]
[Export]
@@ -162,11 +165,23 @@ public partial class Enemy : CharacterBody3D,
public void Kill(IHealthable source)
{
// Remove weapon that might be planted there
foreach (var child in GetChildren())
{
if (child is WeaponSystem system)
{
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);
}
}
foreach (var killable in DeathEffects.ToIKillables())
{
killable.Kill(source);
}
QueueFree();
CallDeferred(Node.MethodName.QueueFree);
}
public void RegisterKnockback(IDamageable source, DamageRecord damageRecord)

View File

@@ -48,6 +48,7 @@ collision_layer = 16
collision_mask = 273
motion_mode = 1
script = ExtResource("1_q8l7o")
EnemyHeight = 0.5
RHealth = ExtResource("2_ma2bq")
DeathEffects = Array[Object]([])
RDamage = ExtResource("2_on7rt")

View File

@@ -4,5 +4,5 @@
[resource]
script = ExtResource("1_jht15")
StartingHealth = 50.0
StartingHealth = 10.0
metadata/_custom_type_script = "uid://baiapod3csndf"

View File

@@ -43,6 +43,7 @@ size = Vector3(1, 2, 1.5)
collision_layer = 16
collision_mask = 273
script = ExtResource("1_r6506")
EnemyHeight = 2.0
RHealth = ExtResource("2_w4lm8")
DeathEffects = Array[Object]([])
RDamage = ExtResource("2_bn56u")