Resistance System
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DataServer.Data.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Defines a damage resistance type that can be applied to mobs, players, and items.
|
||||
/// This allows for dynamic resistance types beyond the base DamageType enum.
|
||||
/// </summary>
|
||||
[Table("damage_resistance_types")]
|
||||
public class DamageResistanceType
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Internal key name (lowercase, no spaces) - e.g., "fire", "ice", "bleed"
|
||||
/// Used in JSON resistance blocks
|
||||
/// </summary>
|
||||
[Required]
|
||||
[MaxLength(32)]
|
||||
public string Key { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Display name for UI - e.g., "Fire", "Ice", "Bleeding"
|
||||
/// </summary>
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public string DisplayName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Description of what this resistance does
|
||||
/// </summary>
|
||||
[MaxLength(256)]
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Hex color for UI display (e.g., "#ff4400" for fire)
|
||||
/// </summary>
|
||||
[MaxLength(16)]
|
||||
public string Color { get; set; } = "#888888";
|
||||
|
||||
/// <summary>
|
||||
/// Icon path on CDN (optional)
|
||||
/// </summary>
|
||||
[MaxLength(256)]
|
||||
public string? IconPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sort order for display in dropdowns
|
||||
/// </summary>
|
||||
public int SortOrder { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this resistance type is available for use
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
Reference in New Issue
Block a user