mirror of
https://github.com/Melledy/LunarCore.git
synced 2026-02-04 15:05:07 +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 maxLevel = equip.getExcel().getRelicExcel().getMaxLevel();
|
||||||
int level = equip.getLevel();
|
int level = equip.getLevel();
|
||||||
int exp = equip.getExp();
|
int exp = equip.getExp();
|
||||||
|
int totalExp = equip.getTotalExp();
|
||||||
int upgrades = 0;
|
int upgrades = 0;
|
||||||
int reqExp = GameData.getRelicExpRequired(equip.getExcel().getRelicExcel().getExpType(), level);
|
int reqExp = GameData.getRelicExpRequired(equip.getExcel().getRelicExcel().getExpType(), level);
|
||||||
|
|
||||||
@@ -423,6 +424,7 @@ public class InventoryService extends BaseGameService {
|
|||||||
// Do calculations
|
// Do calculations
|
||||||
int toGain = Math.min(expGain, reqExp - exp);
|
int toGain = Math.min(expGain, reqExp - exp);
|
||||||
exp += toGain;
|
exp += toGain;
|
||||||
|
totalExp += toGain;
|
||||||
expGain -= toGain;
|
expGain -= toGain;
|
||||||
// Level up
|
// Level up
|
||||||
if (exp >= reqExp) {
|
if (exp >= reqExp) {
|
||||||
@@ -446,6 +448,7 @@ public class InventoryService extends BaseGameService {
|
|||||||
// Done
|
// Done
|
||||||
equip.setLevel(level);
|
equip.setLevel(level);
|
||||||
equip.setExp(exp);
|
equip.setExp(exp);
|
||||||
|
equip.setTotalExp(totalExp);
|
||||||
|
|
||||||
equip.save();
|
equip.save();
|
||||||
player.save();
|
player.save();
|
||||||
|
|||||||
Reference in New Issue
Block a user