Add healing effect resource and integrate into game systems

This commit is contained in:
2025-10-29 02:27:50 +01:00
parent d046130f17
commit 853378c9c6
6 changed files with 18 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ public class EffectFactory
DamageEffectResource damage => new DamageEffect(damage.Amount),
HitscanEffectResource hitscan => new HitscanEffect(hitscan.Range),
ConsumeAmmoCostResource consumeAmmo => new ConsumeAmmoCost(consumeAmmo.AmmoId, consumeAmmo.Amount),
HealEffectResource heal => new HealEffect(heal.Amount),
_ => throw new ArgumentOutOfRangeException(nameof(resource),
$"Effect type {resource.GetType().Name} not recognized")
};

View File

@@ -83,7 +83,8 @@ public partial class GamePresenter : Node
_world.RegisterSystem(new WeaponSystem());
_world.RegisterSystem(new ProjectileSystem());
_world.RegisterSystem(new ProjectileInitializationSystem(_world));
_world.RegisterSystem(new HealingSystem(_world));
_world.RegisterSystem(new DamageSystem(_world));
_world.RegisterSystem(new ProjectileCleanupSystem());
_world.RegisterSystem(new DestructionSystem());

View File

@@ -0,0 +1,9 @@
using Godot;
namespace CryptonymThunder.Code.Resources;
[GlobalClass]
public partial class HealEffectResource : EffectResource
{
[Export(PropertyHint.Range, "1,1000,1")] public float Amount { get; set; } = 10f;
}

View File

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

View File

@@ -42,7 +42,9 @@ public class GodotWorldQuery(GamePresenter ownerNode) : IWorldQuery
return new HitResult
{
DidHit = true,
HitEntity = hitEntity
HitEntity = hitEntity,
Position = result["position"].AsVector3().ToGameCore(),
Normal = result["normal"].AsVector3().ToGameCore()
};
}
}