diff --git a/Game/Dungeon/DungeonSimulation.cs b/Game/Dungeon/DungeonSimulation.cs index d1c14b8..14aa8c3 100644 --- a/Game/Dungeon/DungeonSimulation.cs +++ b/Game/Dungeon/DungeonSimulation.cs @@ -710,6 +710,7 @@ public partial class DungeonSimulation var projectile = new ProjectileInstance { Id = GetNextProjectileId(), + SpawnTick = CurrentTick, SourceType = ProjectileSource.Mob, SourceMobId = mob.Id, AbilityId = ability.Id, @@ -881,6 +882,11 @@ public partial class DungeonSimulation { foreach (var player in Players.Values.Where(p => p.IsAlive)) { + if (CurrentTick <= projectile.SpawnTick) + { + continue; + } + if (Distance(projectile.X, projectile.Y, player.X, player.Y) < 50) // Increased from 20 to account for projectile speed { // Hit! @@ -896,6 +902,7 @@ public partial class DungeonSimulation { var result = CombatCalculator.CalculateMobToPlayerDamage( sourceMob, player, projectile.DamageTypeKey, projectile.Damage, player.Resistances); + Console.WriteLine($"[ProjectileHit] Mob {sourceMob.Id} -> Player {player.CharacterId}: ability={ResolveProjectileAbilityKey(projectile)}, damage={result.FinalDamage}, type={projectile.DamageTypeKey}"); ApplyDamageToPlayer(sourceMob, player, result.FinalDamage, projectile.DamageTypeKey, result.WasResisted, result.WasWeakness); } } diff --git a/Game/Dungeon/ProjectileInstance.cs b/Game/Dungeon/ProjectileInstance.cs index 208cbda..3de5662 100644 --- a/Game/Dungeon/ProjectileInstance.cs +++ b/Game/Dungeon/ProjectileInstance.cs @@ -12,6 +12,7 @@ public enum ProjectileSource public class ProjectileInstance { public int Id { get; set; } + public long SpawnTick { get; set; } // Source tracking public ProjectileSource SourceType { get; set; }