This commit is contained in:
Putoo
2026-06-30 18:05:40 +08:00
parent 93d21ba9fd
commit 7ce9787172
13 changed files with 558 additions and 42 deletions

View File

@@ -1,4 +1,5 @@
namespace Application.Domain;
namespace Application.Domain;
public class GameAttrTool
{
@@ -134,6 +135,7 @@ public class GameAttrTool
main.PalsyAtkLess += vice.PalsyAtkLess;
return main;
}
public static decimal GetAttrItemValue(string attrCode, List<AttrItem> AttrData, decimal unit)
{
decimal result = 0.00M;
@@ -167,4 +169,49 @@ public class GameAttrTool
return result;
}
public static async Task<UserAttrModel> CheckRoleLoadBuff(UserAttrModel temp, List<unit_user_load> loadBuff)
{
foreach (var item in loadBuff)
{
if (item.code == nameof(GameEnum.AttrCode.Slow))
{
decimal radio = item.count * 0.05M;
temp.agility = Convert.ToInt32(temp.agility * (1.0M - radio));
}
else if (item.code == nameof(GameEnum.AttrCode.Poison))
{
decimal radio = item.count * 0.08M;
temp.upBlood = Convert.ToInt32(temp.upBlood * (1.0M - radio));
}
else if (item.code == nameof(GameEnum.AttrCode.Curse))
{
decimal radio = item.count * 0.08M;
temp.minAtk = Convert.ToInt32(temp.minAtk * (1.0M - radio));
temp.maxAtk = Convert.ToInt32(temp.maxAtk * (1.0M - radio));
}
else if (item.code == nameof(GameEnum.AttrCode.Weaken))
{
decimal radio = item.count * 0.02M;
temp.Crit = temp.Crit - radio;
}
else if (item.code == nameof(GameEnum.AttrCode.Depressed))
{
decimal radio = item.count * 0.07M;
temp.upMorale = Convert.ToInt32(temp.upMorale * (1.0M - radio));
}
else if (item.code == nameof(GameEnum.AttrCode.Breach))
{
decimal radio = item.count * 0.04M;
temp.defense = Convert.ToInt32(temp.defense * (1.0M - radio));
}
else if (item.code == nameof(GameEnum.AttrCode.PalsyAtk))
{
decimal radio = item.count * 0.1M;
temp.Atk_Next -= radio;
}
}
return temp;
}
}