mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 05:44:36 +01:00
Leveling up relics with already leveled relics adds the correct amount of exp now
This commit is contained in:
@@ -416,6 +416,7 @@ public class InventoryService extends BaseGameService {
|
||||
int maxLevel = equip.getExcel().getRelicExcel().getMaxLevel();
|
||||
int level = equip.getLevel();
|
||||
int exp = equip.getExp();
|
||||
int totalExp = equip.getTotalExp();
|
||||
int upgrades = 0;
|
||||
int reqExp = GameData.getRelicExpRequired(equip.getExcel().getRelicExcel().getExpType(), level);
|
||||
|
||||
@@ -423,6 +424,7 @@ public class InventoryService extends BaseGameService {
|
||||
// Do calculations
|
||||
int toGain = Math.min(expGain, reqExp - exp);
|
||||
exp += toGain;
|
||||
totalExp += toGain;
|
||||
expGain -= toGain;
|
||||
// Level up
|
||||
if (exp >= reqExp) {
|
||||
@@ -446,6 +448,7 @@ public class InventoryService extends BaseGameService {
|
||||
// Done
|
||||
equip.setLevel(level);
|
||||
equip.setExp(exp);
|
||||
equip.setTotalExp(totalExp);
|
||||
|
||||
equip.save();
|
||||
player.save();
|
||||
|
||||
Reference in New Issue
Block a user