Files
DanhengServer-OpenSource/Common/Data/Excel/RogueBuffExcel.cs
Somebody 73a8743c71 Feature: Raid Save & Fix: Some bug
- It wont clear mission progress when quit a raid ( many bugs, like will cause client NPE )
- Fix any time the hero will cause Physics Weakness Effect
2024-07-06 22:05:24 +08:00

59 lines
1.8 KiB
C#

using EggLink.DanhengServer.Enums.Rogue;
using EggLink.DanhengServer.Proto;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace EggLink.DanhengServer.Data.Excel
{
[ResourceEntity("RogueBuff.json")]
public class RogueBuffExcel : ExcelResource
{
public int MazeBuffID { get; set; }
public int MazeBuffLevel { get; set; }
public int RogueBuffType { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public RogueBuffCategoryEnum RogueBuffCategory { get; set; }
public int RogueBuffTag { get; set; }
public int AeonID { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public RogueBuffAeonTypeEnum BattleEventBuffType { get; set; } = RogueBuffAeonTypeEnum.Normal;
public override int GetId()
{
return MazeBuffID * 100 + MazeBuffLevel;
}
public override void Loaded()
{
GameData.RogueBuffData.Add(GetId(), this);
if (BattleEventBuffType == RogueBuffAeonTypeEnum.BattleEventBuff)
{
GameData.RogueAeonBuffData.Add(AeonID, this);
} else if (BattleEventBuffType == RogueBuffAeonTypeEnum.BattleEventBuffEnhance)
{
if (GameData.RogueAeonEnhanceData.TryGetValue(AeonID, out var aeonBuff))
{
aeonBuff.Add(this);
}
else
{
GameData.RogueAeonEnhanceData.Add(AeonID, [this]);
}
}
}
public RogueCommonBuff ToProto()
{
return new()
{
BuffId = (uint)MazeBuffID,
BuffLevel = (uint)MazeBuffLevel,
};
}
public bool IsAeonBuff => BattleEventBuffType != RogueBuffAeonTypeEnum.Normal;
}
}