121212
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user