Resistances + Dmg Types
This commit is contained in:
@@ -56,6 +56,34 @@ public class DungeonItemDefinition
|
||||
public int ManaRestore { get; set; } = 0;
|
||||
public int StaminaRestore { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Duration in seconds for consumable buff effects (resistances, stat boosts)
|
||||
/// 0 = instant effect only, no buff
|
||||
/// </summary>
|
||||
public int BuffDuration { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// JSON block for temporary resistance buffs when consumed
|
||||
/// Example: {"fire": 0.25, "poison": 0.5}
|
||||
/// Only applies if BuffDuration > 0
|
||||
/// </summary>
|
||||
[MaxLength(1024)]
|
||||
public string BuffResistancesJson { get; set; } = "{}";
|
||||
|
||||
/// <summary>
|
||||
/// Helper to get/set buff resistances dictionary
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public Dictionary<string, float> BuffResistances
|
||||
{
|
||||
get
|
||||
{
|
||||
try { return JsonSerializer.Deserialize<Dictionary<string, float>>(BuffResistancesJson) ?? new(); }
|
||||
catch { return new(); }
|
||||
}
|
||||
set { BuffResistancesJson = JsonSerializer.Serialize(value); }
|
||||
}
|
||||
|
||||
// Special
|
||||
public bool IsTeleportScroll { get; set; } = false;
|
||||
public int? TeachesSpellId { get; set; } // For spell tomes
|
||||
|
||||
@@ -35,6 +35,13 @@ public class DungeonMobDefinition
|
||||
public int BaseArmor { get; set; } = 0;
|
||||
public int BaseMagicResist { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Primary damage type key (references DamageResistanceType.Key)
|
||||
/// e.g., "physical", "fire", "poison"
|
||||
/// </summary>
|
||||
[MaxLength(32)]
|
||||
public string DamageTypeKey { get; set; } = "physical";
|
||||
|
||||
// Movement & Combat
|
||||
public float MoveSpeed { get; set; } = 60f;
|
||||
public float AttackRange { get; set; } = 40f; // Melee range ~40, ranged 150+
|
||||
|
||||
Reference in New Issue
Block a user