76 lines
2.1 KiB
C#
76 lines
2.1 KiB
C#
namespace GameServer.Dungeon;
|
|
|
|
public class TickResult
|
|
{
|
|
public List<DamageEvent> DamageEvents { get; set; } = new();
|
|
public List<DeathEvent> DeathEvents { get; set; } = new();
|
|
public List<AbilityEvent> AbilityEvents { get; set; } = new();
|
|
public List<ProjectileHitEvent> ProjectileHitEvents { get; set; } = new();
|
|
public List<ProjectileExpiredEvent> ProjectileExpiredEvents { get; set; } = new();
|
|
public DungeonPhase Phase { get; set; }
|
|
}
|
|
|
|
public class DamageEvent
|
|
{
|
|
public EntityType SourceType { get; set; }
|
|
public int SourceId { get; set; }
|
|
public EntityType TargetType { get; set; }
|
|
public int TargetId { get; set; }
|
|
public int Damage { get; set; }
|
|
|
|
/// <summary>
|
|
/// Damage type key (e.g., "physical", "fire", "poison")
|
|
/// </summary>
|
|
public string DamageTypeKey { get; set; } = "physical";
|
|
|
|
/// <summary>
|
|
/// True if damage was reduced by resistance
|
|
/// </summary>
|
|
public bool WasResisted { get; set; }
|
|
|
|
/// <summary>
|
|
/// True if damage was increased by weakness
|
|
/// </summary>
|
|
public bool WasWeakness { get; set; }
|
|
|
|
/// <summary>
|
|
/// True if target was immune (0 damage)
|
|
/// </summary>
|
|
public bool WasImmune { get; set; }
|
|
}
|
|
|
|
public class DeathEvent
|
|
{
|
|
public EntityType EntityType { get; set; }
|
|
public int EntityId { get; set; }
|
|
public string EntityName { get; set; } = "";
|
|
public EntityType KillerType { get; set; }
|
|
public int KillerId { get; set; }
|
|
public string KillerName { get; set; } = "";
|
|
public int XpReward { get; set; }
|
|
}
|
|
|
|
public enum EntityType
|
|
{
|
|
Player,
|
|
Mob,
|
|
Chest
|
|
}
|
|
|
|
public class ProjectileHitEvent
|
|
{
|
|
public int ProjectileId { get; set; }
|
|
public EntityType TargetType { get; set; }
|
|
public int TargetId { get; set; }
|
|
public float X { get; set; }
|
|
public float Y { get; set; }
|
|
}
|
|
|
|
public class ProjectileExpiredEvent
|
|
{
|
|
public int ProjectileId { get; set; }
|
|
public float X { get; set; }
|
|
public float Y { get; set; }
|
|
public string Reason { get; set; } = "range"; // "range", "wall", or "hit"
|
|
}
|