Limit cooldowns to a minimum of 1 tick and replace armour cooldown reductions with correct values, fixes #603

This commit is contained in:
Electroblob77
2021-01-31 15:50:55 +00:00
parent bba9fb68e6
commit cd6fa03990
2 changed files with 5 additions and 2 deletions
@@ -59,8 +59,8 @@ public class ItemWizardArmour extends ItemArmor implements IWorkbenchItem, IMana
WIZARD(Materials.SILK, () -> null, "wizard", 0.1f, 0, "hat", "robe", "leggings", "boots"),
SAGE(Materials.SAGE, () -> WizardryItems.resplendent_thread, "sage", 0.2f, 0, "hat", "robe", "leggings", "boots"),
BATTLEMAGE(Materials.BATTLEMAGE, () -> WizardryItems.crystal_silver_plating, "battlemage", 0.05f, 0.15f, "helmet", "chestplate", "leggings", "boots"),
WARLOCK(Materials.WARLOCK, () -> WizardryItems.ethereal_crystalweave, "warlock", 0.1f, 0.3f, "hood", "robe", "leggings", "boots");
BATTLEMAGE(Materials.BATTLEMAGE, () -> WizardryItems.crystal_silver_plating, "battlemage", 0.05f, 0.05f, "helmet", "chestplate", "leggings", "boots"),
WARLOCK(Materials.WARLOCK, () -> WizardryItems.ethereal_crystalweave, "warlock", 0.1f, 0.1f, "hood", "robe", "leggings", "boots");
/** The armour material to use for this armour class. */
final ArmorMaterial material;
@@ -251,6 +251,7 @@ public final class WandHelper {
for(int i = 0; i < cooldowns.length; i++){
if(cooldowns[i] > 0) cooldowns[i]--;
if(cooldowns[i] < 0) cooldowns[i] = 0; // In case it got broken
}
setCooldowns(wand, cooldowns);
@@ -312,6 +313,8 @@ public final class WandHelper {
// cast, which is impossible if there are no spells.
if(cooldowns.length <= selectedSpell) cooldowns = new int[spellCount];
if(cooldown <= 0) cooldown = 1;
cooldowns[selectedSpell] = cooldown;
setCooldowns(wand, cooldowns);