Initial Combat Implementation

This commit is contained in:
Luis Gonzalez
2026-05-31 21:35:12 -07:00
parent 7fa77ce821
commit 1f647dd5e1
166 changed files with 93337 additions and 91 deletions
@@ -0,0 +1,20 @@
using Unity.Entities;
namespace ProjectM.Simulation
{
/// <summary>
/// One pending hit against a damageable entity, queued as a per-entity buffer element. The server
/// appends a DamageEvent when a projectile hits (ProjectileDamageSystem), then HealthApplyDamageSystem
/// drains the buffer once per tick to subtract from Health. Buffering decouples hit detection from
/// health resolution and lets multiple simultaneous hits accumulate before being applied. Not
/// replicated — only Health.Current is a GhostField; the buffer is server-side and cleared each tick.
/// </summary>
public struct DamageEvent : IBufferElementData
{
/// <summary>Damage to subtract from the target's Health.Current (world health units).</summary>
public float Amount;
/// <summary>NetworkId of the firing player that caused this hit (attribution / self-hit filtering upstream).</summary>
public int SourceNetworkId;
}
}