complete project reorganization
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 55s
Create tag and build when new code gets to main / Test (push) Successful in 7m7s
Create tag and build when new code gets to main / Export (push) Successful in 9m56s

This commit is contained in:
2026-02-04 11:20:00 +01:00
parent b6e8d0b590
commit cd519e528f
824 changed files with 397 additions and 16380 deletions

View File

@@ -0,0 +1,35 @@
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;
public event Action<IHealthable> HealthDepleted;
[Export]
public RHealth RHealth { get; set; }
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;
}
}

View File

@@ -0,0 +1 @@
uid://bjwrpv3jpsc1e

View File

@@ -0,0 +1,6 @@
[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")

View File

@@ -0,0 +1,14 @@
using Godot;
using System;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_heart.png")]
public partial class CHealthbar : Sprite3D
{
private Healthbar _healthbar;
public Healthbar Healthbar => _healthbar;
public override void _Ready()
{
_healthbar = GetNode<Healthbar>("%Healthbar");
}
}

View File

@@ -0,0 +1 @@
uid://chfb3cjo6exga

View File

@@ -0,0 +1,32 @@
[gd_scene format=3 uid="uid://bwx2um43k0ou4"]
[ext_resource type="Script" uid="uid://chfb3cjo6exga" path="res://scenes/components/health/CHealthbar.cs" id="1_w5itk"]
[ext_resource type="PackedScene" uid="uid://cyw8p0p6a78tl" path="res://scenes/ui/healthbar/healthbar.tscn" id="2_w5itk"]
[sub_resource type="ViewportTexture" id="ViewportTexture_jkj2g"]
viewport_path = NodePath("SubViewport")
[node name="CHealthBar" type="Sprite3D" unique_id=1527974573]
billboard = 1
double_sided = false
no_depth_test = true
texture = SubResource("ViewportTexture_jkj2g")
script = ExtResource("1_w5itk")
[node name="SubViewport" type="SubViewport" parent="." unique_id=791051331]
transparent_bg = true
size = Vector2i(520, 20)
[node name="Healthbar" parent="SubViewport" unique_id=739464079 instance=ExtResource("2_w5itk")]
unique_name_in_owner = true
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -120.0
offset_top = -4.0
offset_right = 120.0
offset_bottom = 4.0
grow_horizontal = 2
grow_vertical = 2

View File

@@ -0,0 +1,12 @@
using Godot;
using System;
using Movementtests.interfaces;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_thunder.png")]
public partial class RDeathEffect : Resource, IKillable
{
public void Kill(IHealthable source)
{
GD.Print($"Death Effect triggered on {source}");
}
}

View File

@@ -0,0 +1 @@
uid://b4cwruitopcee

View File

@@ -0,0 +1,16 @@
using Godot;
using System;
using Movementtests.interfaces;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/white/icon_heart.png")]
public partial class RHealth : Resource
{
[Export]
public float StartingHealth { get; set;}
public RHealth() : this(100.0f) {}
public RHealth(float startingHealth)
{
StartingHealth = startingHealth;
}
}

View File

@@ -0,0 +1 @@
uid://baiapod3csndf