From 6565a0734a1e512d1db33bbd93741f99e7adb655 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Mon, 2 Sep 2019 19:11:08 +0100 Subject: [PATCH] Add 5x progression modifier for casting an undiscovered spell for the first time --- src/main/java/electroblob/wizardry/item/ItemWand.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/electroblob/wizardry/item/ItemWand.java b/src/main/java/electroblob/wizardry/item/ItemWand.java index 1f663ff7..07a77143 100644 --- a/src/main/java/electroblob/wizardry/item/ItemWand.java +++ b/src/main/java/electroblob/wizardry/item/ItemWand.java @@ -73,6 +73,8 @@ public class ItemWand extends Item implements IWorkbenchItem, ISpellCastingItem, private static final int CONTINUOUS_TRACKING_INTERVAL = 20; /** The increase in progression for casting spells of the matching element. */ private static final float ELEMENTAL_PROGRESSION_MODIFIER = 1.2f; + /** The increase in progression for casting an undiscovered spell (can only happen once per spell for each player). */ + private static final float DISCOVERY_PROGRESSION_MODIFIER = 5f; /** The fraction of progression lost when all recently-cast spells are the same as the one being cast. */ private static final float MAX_PROGRESSION_REDUCTION = 0.75f; @@ -573,6 +575,11 @@ public class ItemWand extends Item implements IWorkbenchItem, ISpellCastingItem, progressionModifier *= ELEMENTAL_PROGRESSION_MODIFIER; } + if(WizardData.get(player) != null && !WizardData.get(player).hasSpellBeenDiscovered(spell)){ + // Casting an undiscovered spell now grants 5x progression + progressionModifier *= DISCOVERY_PROGRESSION_MODIFIER; + } + modifiers.set(SpellModifiers.PROGRESSION, progressionModifier, false); return modifiers;