From dc775435bf6dc30b7c525820c9a090851a1e7342 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sat, 18 Jan 2014 21:27:08 -0500 Subject: [PATCH] Working on Spell Testing --- .../AlchemicalWizardry.java | 1 + .../alchemicalWizardry/ModItems.java | 4 +- .../common/BloodMagicConfiguration.java | 1 + .../common/items/ItemComplexSpellCrystal.java | 62 +++++++++++++++++++ .../spell/complex/SpellParadigmSelf.java | 2 +- .../spell/complex/effect/SpellEffectFire.java | 8 +-- .../effect/impactEffects/SelfDefaultFire.java | 13 ++++ 7 files changed, 84 insertions(+), 7 deletions(-) create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/SelfDefaultFire.java diff --git a/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 64723b9a..076163e1 100644 --- a/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -254,6 +254,7 @@ public class AlchemicalWizardry public static int itemKeyOfDiabloItemID; public static int energyBazookaItemID; public static int itemBloodLightSigilItemID; + public static int itemComplexSpellCrystalItemID; public static int testingBlockBlockID; public static int lifeEssenceFlowingBlockID; diff --git a/BM_src/WayofTime/alchemicalWizardry/ModItems.java b/BM_src/WayofTime/alchemicalWizardry/ModItems.java index 1adf0155..689d04b0 100644 --- a/BM_src/WayofTime/alchemicalWizardry/ModItems.java +++ b/BM_src/WayofTime/alchemicalWizardry/ModItems.java @@ -103,6 +103,7 @@ public class ModItems public static Item itemKeyOfDiablo; public static Item energyBazooka; public static Item itemBloodLightSigil; + public static Item itemComplexSpellCrystal; public static void init() { @@ -182,7 +183,6 @@ public class ModItems itemKeyOfDiablo = new ItemDiabloKey(AlchemicalWizardry.itemKeyOfDiabloItemID).setUnlocalizedName("itemDiabloKey"); energyBazooka = new EnergyBazooka(AlchemicalWizardry.energyBazookaItemID).setUnlocalizedName("energyBazooka"); itemBloodLightSigil = new ItemBloodLightSigil(AlchemicalWizardry.itemBloodLightSigilItemID).setUnlocalizedName("bloodLightSigil"); - - + itemComplexSpellCrystal = new ItemComplexSpellCrystal(AlchemicalWizardry.itemComplexSpellCrystalItemID).setUnlocalizedName("itemComplexSpellCrystal"); } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/BloodMagicConfiguration.java b/BM_src/WayofTime/alchemicalWizardry/common/BloodMagicConfiguration.java index ed66ab72..03cbb9af 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/BloodMagicConfiguration.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/BloodMagicConfiguration.java @@ -169,6 +169,7 @@ public class BloodMagicConfiguration AlchemicalWizardry.focusBloodBlastItemID = config.getItem("FocusBloodBlast", 17076).getInt(); AlchemicalWizardry.focusGravityWellItemID = config.getItem("FocusGravityWell", 17077).getInt(); AlchemicalWizardry.sigilOfMagnetismItemID = config.getItem("SigilOfMagnetism", 17080).getInt(); + AlchemicalWizardry.itemComplexSpellCrystalItemID = config.getItem("ComplexSpellCrystal",17081).getInt(); } catch (Exception e) diff --git a/BM_src/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java new file mode 100644 index 00000000..4237f01b --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/items/ItemComplexSpellCrystal.java @@ -0,0 +1,62 @@ +package WayofTime.alchemicalWizardry.common.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.AlchemicalWizardry; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; +import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemComplexSpellCrystal extends EnergyItems +{ + + public ItemComplexSpellCrystal(int id) + { + super(id); + this.maxStackSize = 1; + //setMaxDamage(1000); + setEnergyUsed(50); + setCreativeTab(AlchemicalWizardry.tabBloodMagic); + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add("I feel lighter already..."); + + if (!(par1ItemStack.stackTagCompound == null)) + { + par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName")); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:AirSigil"); + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer); + + if (par3EntityPlayer.isSneaking()) + { + return par1ItemStack; + } + + SpellParadigm parad = new SpellParadigmSelf(); + parad.addBufferedEffect(new SpellEffectFire()); + parad.castSpell(par2World, par3EntityPlayer, par1ItemStack); + + return par1ItemStack; + } +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java index 97f766ed..69457b41 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java @@ -49,6 +49,6 @@ public class SpellParadigmSelf extends SpellParadigm @Override public int getDefaultCost() { - return 0; + return 100; } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java index eaa460ab..02d6b329 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java @@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfDefaultFire; public class SpellEffectFire extends SpellEffect { @@ -10,7 +11,7 @@ public class SpellEffectFire extends SpellEffect @Override public void defaultModificationProjectile(SpellParadigmProjectile parad) { - + } @Override @@ -37,8 +38,7 @@ public class SpellEffectFire extends SpellEffect @Override public void defaultModificationSelf(SpellParadigmSelf parad) { - // TODO Auto-generated method stub - + parad.addSelfSpellEffect(new SelfDefaultFire()); } @Override @@ -122,7 +122,7 @@ public class SpellEffectFire extends SpellEffect protected int getCostForDefaultSelf() { // TODO Auto-generated method stub - return 0; + return 1000; } @Override diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/SelfDefaultFire.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/SelfDefaultFire.java new file mode 100644 index 00000000..2fb74331 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/SelfDefaultFire.java @@ -0,0 +1,13 @@ +package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class SelfDefaultFire implements ISelfSpellEffect +{ + @Override + public void onSelfUse(World world, EntityPlayer player) + { + player.setFire(500); + } +}