Add bonus special upgrade slots to non-elemental wands
This commit is contained in:
@@ -14,6 +14,8 @@ public final class Constants {
|
|||||||
public static final int GRAND_CRYSTAL_MANA = 400;
|
public static final int GRAND_CRYSTAL_MANA = 400;
|
||||||
/** The maximum number of one type of wand upgrade which can be applied to a wand. */
|
/** The maximum number of one type of wand upgrade which can be applied to a wand. */
|
||||||
public static final int UPGRADE_STACK_LIMIT = 3;
|
public static final int UPGRADE_STACK_LIMIT = 3;
|
||||||
|
/** The bonus amount of wand upgrades that can be applied to a non-elemental wand. */
|
||||||
|
public static final int NON_ELEMENTAL_UPGRADE_BONUS = 3;
|
||||||
/** The fraction by which cooldowns are reduced for each level of cooldown upgrade. */
|
/** The fraction by which cooldowns are reduced for each level of cooldown upgrade. */
|
||||||
public static final float COOLDOWN_REDUCTION_PER_LEVEL = 0.15f;
|
public static final float COOLDOWN_REDUCTION_PER_LEVEL = 0.15f;
|
||||||
/** The fraction by which maximum charge is increased for each level of storage upgrade. */
|
/** The fraction by which maximum charge is increased for each level of storage upgrade. */
|
||||||
|
|||||||
@@ -706,7 +706,10 @@ public class ItemWand extends Item implements IWorkbenchItem, ISpellCastingItem,
|
|||||||
// Special upgrades
|
// Special upgrades
|
||||||
Item specialUpgrade = upgrade.getItem();
|
Item specialUpgrade = upgrade.getItem();
|
||||||
|
|
||||||
if(WandHelper.getTotalUpgrades(wand) < this.tier.upgradeLimit
|
int maxUpgrades = this.tier.upgradeLimit;
|
||||||
|
if(this.element == Element.MAGIC) maxUpgrades += Constants.NON_ELEMENTAL_UPGRADE_BONUS;
|
||||||
|
|
||||||
|
if(WandHelper.getTotalUpgrades(wand) < maxUpgrades
|
||||||
&& WandHelper.getUpgradeLevel(wand, specialUpgrade) < Constants.UPGRADE_STACK_LIMIT){
|
&& WandHelper.getUpgradeLevel(wand, specialUpgrade) < Constants.UPGRADE_STACK_LIMIT){
|
||||||
|
|
||||||
// Used to preserve existing mana when upgrading storage rather than creating free mana.
|
// Used to preserve existing mana when upgrading storage rather than creating free mana.
|
||||||
|
|||||||
Reference in New Issue
Block a user