zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Unity/Assets/Hotfix/Logic/Behaviour/Game/Helper/ItemHelper.cs

23 lines
815 B
C#
Raw Normal View History

2021-05-02 01:19:35 +08:00
using System;
namespace ET
{
public static class ItemHelper
{
2021-05-05 13:36:19 +08:00
public static float GetRealMainValue(float oldValue, byte level)
{
return (float) (oldValue*Math.Pow(mainAddCoe, level));
}
private const float mainAddCoe = 1.1f;
2021-05-02 01:19:35 +08:00
private const float reduceCoe = 0.8f;
2021-05-02 23:18:14 +08:00
private const float reduceCoe1 = 0.6f;
2021-05-02 01:19:35 +08:00
public static float GetRealViceValue(float oldValue, Quality quality) => quality switch
{
var qual when qual >= Quality.Legendary => oldValue,
var qual when qual >= Quality.Rare => oldValue * reduceCoe,
2021-05-02 23:18:14 +08:00
var qual when qual <= Quality.UnCommon => oldValue * (reduceCoe * reduceCoe1),
2021-05-02 01:19:35 +08:00
_ => throw new ArgumentOutOfRangeException(nameof (quality), quality, null)
};
}
}