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
|
||||
|
||||
Reference in New Issue
Block a user