Add 5x progression modifier for casting an undiscovered spell for the first time

This commit is contained in:
Electroblob77
2019-09-02 19:11:08 +01:00
parent 0aac70c5fb
commit 6565a0734a
@@ -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;