From d11c3fcc2f08f826c11eb02385588b311a00da71 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Thu, 4 Jun 2020 12:37:57 +0100 Subject: [PATCH] Carry excess progression over when upgrading --- .../java/electroblob/wizardry/item/ItemWand.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/electroblob/wizardry/item/ItemWand.java b/src/main/java/electroblob/wizardry/item/ItemWand.java index cb338bcc..e6820105 100644 --- a/src/main/java/electroblob/wizardry/item/ItemWand.java +++ b/src/main/java/electroblob/wizardry/item/ItemWand.java @@ -658,13 +658,15 @@ public class ItemWand extends Item implements IWorkbenchItem, ISpellCastingItem, || WandHelper.getProgression(wand) >= tier.progression) && tier == this.tier.next()){ - // We're not carrying over excess progression for now, but if we do want to, this is how -// if(!Wizardry.settings.legacyWandLevelling){ -// // Easy way to carry excess progression over to the new stack -// WandHelper.setProgression(wand, WandHelper.getProgression(wand) - tier.progression); -// } - - WandHelper.setProgression(wand, 0); + if(Wizardry.settings.legacyWandLevelling){ + // Progression has little meaning with legacy upgrade mechanics so just reset it + // In theory, you can get 'free' progression when upgrading since progression can't be negative, + // so the flipside of that is you lose any excess + WandHelper.setProgression(wand, 0); + }else{ + // Carry excess progression over to the new stack + WandHelper.setProgression(wand, WandHelper.getProgression(wand) - tier.progression); + } if(player != null) WizardData.get(player).setTierReached(tier);