Add attribute system with core stats and gameplay components

This commit is contained in:
2025-10-13 12:10:45 +02:00
commit ce3596efaa
55 changed files with 1161 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using GameCore.ECS;
using GameCore.ECS.Interfaces;
using GameCore.Events;
namespace GameCore.Combat;
public class ProjectileInitializationSystem : ISystem
{
private readonly World _world;
public ProjectileInitializationSystem(World world)
{
_world = world;
_world.Subscribe<EntitySpawnedEvent>(OnEntitySpawned);
}
public void Update(World world, float deltaTime)
{
}
private void OnEntitySpawned(EntitySpawnedEvent e)
{
var projComp = _world.GetComponent<ProjectileComponent>(e.NewEntity);
if (projComp == null) return;
var ownerWeapon = _world.GetComponent<WeaponComponent>(e.Owner);
if (ownerWeapon != null)
{
projComp.Owner = e.Owner;
projComp.OnHitEffects = ownerWeapon.OnHitEffects;
}
}
}