Make maxCustomRelicLevel also limit the max sub stat count

This commit is contained in:
Melledy
2023-12-15 06:24:11 -08:00
parent 6a6f0da807
commit 3b2633f78f

View File

@@ -197,7 +197,10 @@ public class CommandArgs {
} else if (item.getExcel().isRelic()) {
// Sub stats
if (this.getMap() != null) {
// Reset substats first
item.resetSubAffixes();
int maxCount = (int) Math.floor(LunarCore.getConfig().getServerOptions().maxCustomRelicLevel / 3) + 1;
hasChanged = true;
for (var entry : this.getMap().int2IntEntrySet()) {
@@ -206,7 +209,9 @@ public class CommandArgs {
var subAffix = GameData.getRelicSubAffixExcel(item.getExcel().getRelicExcel().getSubAffixGroup(), entry.getIntKey());
if (subAffix == null) continue;
item.getSubAffixes().add(new GameItemSubAffix(subAffix, entry.getIntValue()));
// Set count
int count = Math.min(entry.getIntValue(), maxCount);
item.getSubAffixes().add(new GameItemSubAffix(subAffix, count));
}
}