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)