mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-03 04:36:03 +08:00
18 lines
542 B
C#
18 lines
542 B
C#
using EggLink.DanhengServer.Data;
|
|
|
|
namespace EggLink.DanhengServer.Util;
|
|
|
|
public static class GameTools
|
|
{
|
|
public static int GetRandomRelicMainAffix(int GroupId)
|
|
{
|
|
GameData.RelicMainAffixData.TryGetValue(GroupId, out var affixes);
|
|
if (affixes == null) return 0;
|
|
List<int> affixList = [];
|
|
foreach (var affix in affixes.Values)
|
|
if (affix.IsAvailable)
|
|
affixList.Add(affix.AffixID);
|
|
if (affixList.Count == 0) return 0;
|
|
return affixList.RandomElement();
|
|
}
|
|
} |