mirror of
https://github.com/Melledy/LunarCore.git
synced 2026-02-04 06:55:05 +01:00
Make maxCustomRelicLevel also limit the max sub stat count
This commit is contained in:
@@ -197,7 +197,10 @@ public class CommandArgs {
|
|||||||
} else if (item.getExcel().isRelic()) {
|
} else if (item.getExcel().isRelic()) {
|
||||||
// Sub stats
|
// Sub stats
|
||||||
if (this.getMap() != null) {
|
if (this.getMap() != null) {
|
||||||
|
// Reset substats first
|
||||||
item.resetSubAffixes();
|
item.resetSubAffixes();
|
||||||
|
|
||||||
|
int maxCount = (int) Math.floor(LunarCore.getConfig().getServerOptions().maxCustomRelicLevel / 3) + 1;
|
||||||
hasChanged = true;
|
hasChanged = true;
|
||||||
|
|
||||||
for (var entry : this.getMap().int2IntEntrySet()) {
|
for (var entry : this.getMap().int2IntEntrySet()) {
|
||||||
@@ -206,7 +209,9 @@ public class CommandArgs {
|
|||||||
var subAffix = GameData.getRelicSubAffixExcel(item.getExcel().getRelicExcel().getSubAffixGroup(), entry.getIntKey());
|
var subAffix = GameData.getRelicSubAffixExcel(item.getExcel().getRelicExcel().getSubAffixGroup(), entry.getIntKey());
|
||||||
if (subAffix == null) continue;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user