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