CTT/Unity/Assets/Hotfix/Logic/Behaviour/Game/Helper/ItemHelper.cs

17 lines
560 B
C#

using System;
namespace ET
{
public static class ItemHelper
{
private const float reduceCoe = 0.8f;
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,
var qual when qual <= Quality.UnCommon => oldValue * (reduceCoe * reduceCoe),
_ => throw new ArgumentOutOfRangeException(nameof (quality), quality, null)
};
}
}