Files
2026-03-05 11:39:06 +08:00

54 lines
1.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Fantasy.Entitas;
using Fantasy.Entitas.Interface;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace Fantasy;
/// <summary>
/// 代表装备的某一个属性
/// </summary>
public class EquipAttr : Entity
{
[BsonElement("K")]
public int Key; // 属性数值对应的Key
[BsonElement("V")]
public int Value; // 属性对应额数值
[BsonElement("S")]
public int SValue; // 附加或强化属性的对应数值
[BsonIgnore]
public int ValidValue => Value + SValue; // 真实的数值
}
/// <summary>
/// 挂载到Item下的组件用来表示这个Item是一个装备
/// </summary>
public class EquipComponent : Entity, ISupportedDataBase
{
/// <summary>
/// 主属性
/// </summary>
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
public Dictionary<int, EquipAttr> MainAttrs = new Dictionary<int, EquipAttr>();
/// <summary>
/// 附加(副)属性
/// </summary>
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
public Dictionary<int, EquipAttr> EntryAttrs = new Dictionary<int, EquipAttr>();
/// <summary>
/// 词缀
/// </summary>
public List<uint> Affixs = new List<uint>();
public int DurableMax; // 耐久度上限
public int Durable; // 耐久度
}
/*
* {"sdfsdfsdfsdf":111}
* {"s":111}
* 2000,100 = 150 - 50 = 100
* 2001,200
*
* 优化后的处理方式
* 2000100 50 = 100 + 50 = 150
* 50 - 50 = 0 100 + 0 = 100
* 力量 + 50 (+20)
*/