mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-26 07:29:00 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using RadicadeServer.RecNet.Enums.Store;
|
||||
|
||||
namespace RadicadeServer.Utils
|
||||
{
|
||||
public static class LevelRewardTable
|
||||
{
|
||||
public enum RewardKind
|
||||
{
|
||||
None,
|
||||
Consumable,
|
||||
Clothing
|
||||
}
|
||||
|
||||
public const int LastItemLevel = LevelUpGiftService.MaxLevel;
|
||||
|
||||
private static readonly HashSet<int> ConsumableLevels = [1, 3, 5, 7, 9];
|
||||
|
||||
private static readonly HashSet<int> ThreeStarLevels =
|
||||
[22, 24, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39];
|
||||
|
||||
private static readonly HashSet<int> FourStarLevels =
|
||||
[31, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49];
|
||||
|
||||
public static bool IsItemLevel(int level) => level >= 1 && level <= LastItemLevel;
|
||||
|
||||
public static RewardKind KindForLevel(int level)
|
||||
{
|
||||
if (level < 1 || level > LastItemLevel) return RewardKind.None;
|
||||
return ConsumableLevels.Contains(level) ? RewardKind.Consumable : RewardKind.Clothing;
|
||||
}
|
||||
|
||||
public static Rarity RarityForLevel(int level)
|
||||
{
|
||||
if (level == 50) return Rarity.Legendary;
|
||||
if (FourStarLevels.Contains(level)) return Rarity.Epic;
|
||||
if (ThreeStarLevels.Contains(level)) return Rarity.Rare;
|
||||
return Rarity.Uncommon;
|
||||
}
|
||||
|
||||
public static string StarLabel(Rarity rarity) => rarity switch
|
||||
{
|
||||
Rarity.Legendary => "5-star",
|
||||
Rarity.Epic => "4-star",
|
||||
Rarity.Rare => "3-star",
|
||||
Rarity.Uncommon => "2-star",
|
||||
_ => "1-star"
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user