That's one heck of a commit you've got there...

I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
Electroblob77
2019-08-18 00:04:18 +01:00
parent 2680d02304
commit f37812be3e
1564 changed files with 47652 additions and 12984 deletions
@@ -1,13 +1,9 @@
package electroblob.wizardry.spell;
import electroblob.wizardry.WizardData;
import electroblob.wizardry.constants.Constants;
import electroblob.wizardry.constants.Element;
import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.data.WizardData;
import electroblob.wizardry.registry.WizardryEnchantments;
import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.SpellModifiers;
@@ -15,9 +11,7 @@ import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
@@ -30,7 +24,8 @@ public class FreezingWeapon extends Spell {
public static final String FREEZING_ARROW_NBT_KEY = "frostLevel";
public FreezingWeapon(){
super("freezing_weapon", Tier.ADVANCED, Element.ICE, SpellType.UTILITY, 35, 70, EnumAction.BOW, false);
super("freezing_weapon", EnumAction.BOW, false);
addProperties(EFFECT_DURATION);
}
@Override
@@ -42,17 +37,17 @@ public class FreezingWeapon extends Spell {
for(ItemStack stack : WizardryUtilities.getPrioritisedHotbarAndOffhand(caster)){
if((stack.getItem() instanceof ItemSword || stack.getItem() instanceof ItemBow)
if((ImbueWeapon.isSword(stack.getItem()) || ImbueWeapon.isBow(stack.getItem()))
&& !EnchantmentHelper.getEnchantments(stack).containsKey(WizardryEnchantments.freezing_weapon)){
// The enchantment level as determined by the damage multiplier. The + 0.5f is so that
// weird float processing doesn't incorrectly round it down.
stack.addEnchantment(WizardryEnchantments.freezing_weapon,
modifiers.get(SpellModifiers.POTENCY) == 1.0f ? 1
: (int)((modifiers.get(SpellModifiers.POTENCY) - 1.0f)
/ Constants.DAMAGE_INCREASE_PER_TIER + 0.5f));
/ Constants.POTENCY_INCREASE_PER_TIER + 0.5f));
WizardData.get(caster).setImbuementDuration(WizardryEnchantments.freezing_weapon,
(int)(900 * modifiers.get(WizardryItems.duration_upgrade)));
(int)(getProperty(EFFECT_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)));
if(world.isRemote){
for(int i=0; i<10; i++){
@@ -63,7 +58,7 @@ public class FreezingWeapon extends Spell {
}
}
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_CONJURATION, 1, 1);
this.playSound(world, caster, ticksInUse, -1, modifiers);
return true;
}