using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using DataServer.Data.Enums;
namespace DataServer.Data.Entities;
///
/// Definition for a mob ability that can be assigned to mobs
///
[Table("dungeon_mob_abilities")]
public class MobAbilityDefinition
{
[Key]
public int Id { get; set; }
[Required]
[MaxLength(64)]
public string Name { get; set; } = "";
[MaxLength(256)]
public string Description { get; set; } = "";
///
/// Internal key for referencing (e.g., "skeleton_arrow", "boss_slam")
///
[Required]
[MaxLength(64)]
public string Key { get; set; } = "";
public MobAbilityType AbilityType { get; set; } = MobAbilityType.MeleeAttack;
public MobAbilityTargeting Targeting { get; set; } = MobAbilityTargeting.CurrentTarget;
// === Damage/Healing ===
/// Base damage or healing amount
public int BaseDamage { get; set; } = 10;
/// Damage scaling per dungeon tier
public float DamagePerTier { get; set; } = 1.15f;
/// Damage type key (references DamageResistanceType)
[MaxLength(32)]
public string DamageTypeKey { get; set; } = "physical";
// === Range & Area ===
/// Maximum range to use ability
public float Range { get; set; } = 40f;
/// AOE radius (0 for single target)
public float AoeRadius { get; set; } = 0f;
/// Cone angle in degrees (for cone attacks)
public float ConeAngle { get; set; } = 0f;
// === Timing ===
/// Cooldown in seconds between uses
public float Cooldown { get; set; } = 5f;
/// Cast time in seconds (0 for instant)
public float CastTime { get; set; } = 0f;
/// Animation duration in seconds
public float AnimationDuration { get; set; } = 0.5f;
// === Projectile (if applicable) ===
/// Projectile speed (if projectile type)
public float ProjectileSpeed { get; set; } = 300f;
/// Projectile sprite path
[MaxLength(256)]
public string? ProjectileSprite { get; set; }
// === Status Effects ===
/// Duration of any applied status effect
public float EffectDuration { get; set; } = 3f;
/// Damage per tick for DOT effects
public int DotDamagePerTick { get; set; } = 5;
/// Tick interval for DOT effects
public float DotTickInterval { get; set; } = 1f;
/// Slow/speed modifier (0.5 = 50% slow)
public float SpeedModifier { get; set; } = 0.5f;
/// Knockback/pull distance
public float DisplacementDistance { get; set; } = 100f;
// === Summoning ===
/// Mob definition ID to summon
public int? SummonMobId { get; set; }
/// Number of mobs to summon
public int SummonCount { get; set; } = 1;
// === Buff/Debuff ===
/// Stat modifier percentage (1.5 = +50%, 0.5 = -50%)
public float StatModifier { get; set; } = 1.0f;
/// Which stat to modify (damage, defense, speed, etc.)
[MaxLength(32)]
public string? AffectedStat { get; set; }
// === Conditions ===
/// Only usable below this HP percentage (0-1)
public float? HpThresholdBelow { get; set; }
/// Only usable above this HP percentage (0-1)
public float? HpThresholdAbove { get; set; }
/// Minimum number of targets in range to use
public int? MinTargetsInRange { get; set; }
/// Priority for AI ability selection (higher = more likely)
public int Priority { get; set; } = 1;
// === Mana/Resource Cost ===
public int ManaCost { get; set; } = 0;
// === Animation ===
///
/// Animation key to play (e.g., "attack", "cast", "special1")
/// Client will look for [animation]_[direction] sprites
///
[MaxLength(32)]
public string AnimationKey { get; set; } = "attack";
///
/// Sound effect key to play
///
[MaxLength(64)]
public string? SoundEffectKey { get; set; }
///
/// Visual effect to spawn (particle effect key)
///
[MaxLength(64)]
public string? VisualEffectKey { get; set; }
public bool IsEnabled { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}