namespace GameServer.Dungeon; public enum ProjectileSource { Mob, Player } /// /// A projectile in flight /// public class ProjectileInstance { public int Id { get; set; } // Source tracking public ProjectileSource SourceType { get; set; } public int SourceMobId { get; set; } // Used when SourceType = Mob public ulong SourcePlayerId { get; set; } // Used when SourceType = Player public int AbilityId { get; set; } // For mob abilities public float X { get; set; } public float Y { get; set; } public float VelocityX { get; set; } public float VelocityY { get; set; } public float Speed { get; set; } public float TargetX { get; set; } public float TargetY { get; set; } public int Damage { get; set; } public string DamageTypeKey { get; set; } = "physical"; public float AoeRadius { get; set; } public float DistanceTraveled { get; set; } public float MaxRange { get; set; } = 500f; public string SpriteKey { get; set; } = "projectile_default"; /// /// Whether projectile uses linear rendering (front/back frames) or spins /// public bool IsLinear { get; set; } = false; /// /// Front frame index for linear projectiles (arrow tip) /// public int FrontFrame { get; set; } = 0; /// /// Back frame index for linear projectiles (arrow tail) /// public int BackFrame { get; set; } = 0; // Player projectile properties /// /// Item definition ID of the ammunition used (for recovery) /// Null if not recoverable (mob projectiles, throwables that don't recover) /// public int? AmmunitionItemDefinitionId { get; set; } /// /// Recovery chance (0.0 to 1.0) for this specific projectile /// public float RecoveryChance { get; set; } = 0.05f; /// /// Whether this projectile can hit players (for PvP) /// public bool CanHitPlayers { get; set; } = false; /// /// Whether this projectile can hit mobs /// public bool CanHitMobs { get; set; } = true; } /// /// A persistent damage zone on the ground /// public class HazardZone { public int Id { get; set; } public int SourceMobId { get; set; } public float X { get; set; } public float Y { get; set; } public float Radius { get; set; } public int DamagePerTick { get; set; } public float TickInterval { get; set; } public float NextTickIn { get; set; } public float Duration { get; set; } public string DamageTypeKey { get; set; } = "fire"; public string VisualKey { get; set; } = "hazard_default"; } /// /// Event when an ability is used (for client animations) /// public class AbilityEvent { public EntityType SourceType { get; set; } public int SourceId { get; set; } public string AbilityKey { get; set; } = ""; public string AnimationKey { get; set; } = "attack"; public float TargetX { get; set; } public float TargetY { get; set; } public int? TargetId { get; set; } }