From 276504acbd40450559912d9a15364a754d972f4c Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sat, 18 Jan 2014 20:29:20 -0500 Subject: [PATCH] More code, testing things --- .../AlchemicalWizardry.java | 2 +- .../complex/IMeleeSpellEntityEffect.java | 9 +++++ .../spell/complex/IMeleeSpellWorldEffect.java | 10 ++++++ .../spell/complex/ISelfSpellEffect.java | 9 +++++ .../common/spell/complex/SpellParadigm.java | 4 +-- .../spell/complex/SpellParadigmMelee.java | 33 ++++++++++++++++--- .../complex/SpellParadigmProjectile.java | 22 +++++++++++-- .../spell/complex/SpellParadigmSelf.java | 28 ++++++++++++++-- 8 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/spell/complex/IMeleeSpellEntityEffect.java create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/spell/complex/IMeleeSpellWorldEffect.java create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/spell/complex/ISelfSpellEffect.java diff --git a/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index b27bfbb1..64723b9a 100644 --- a/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/BM_src/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -753,7 +753,7 @@ public class AlchemicalWizardry AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.tennebrae), 5, new ItemStack[]{simpleCatalystStack, new ItemStack(Item.coal), new ItemStack(Item.coal), new ItemStack(Block.obsidian), new ItemStack(Item.clay)}, 2); AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.magicales), 5, new ItemStack[]{redstoneStack, simpleCatalystStack, new ItemStack(Item.gunpowder), new ItemStack(Item.glowstone), new ItemStack(Item.glowstone)}, 2); AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.mundanePowerCatalyst), 10, new ItemStack[]{glowstoneDustStack, glowstoneDustStack, glowstoneDustStack, new ItemStack(ModItems.weakBindingAgent), simpleCatalystStack}, 3); - AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.mundaneLengtheningCatalyst), 15, new ItemStack[]{redstoneStack, redstoneStack, redstoneStack, new ItemStack(ModItems.weakBindingAgent), simpleCatalystStack}, 3); + AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.mundaneLengtheningCatalyst), 10, new ItemStack[]{redstoneStack, redstoneStack, redstoneStack, new ItemStack(ModItems.weakBindingAgent), simpleCatalystStack}, 3); AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.averagePowerCatalyst), 20, new ItemStack[]{new ItemStack(ModItems.mundanePowerCatalyst), new ItemStack(ModItems.mundanePowerCatalyst), new ItemStack(ModItems.standardBindingAgent)}, 4); AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.averageLengtheningCatalyst), 20, new ItemStack[]{new ItemStack(ModItems.mundaneLengtheningCatalyst), new ItemStack(ModItems.mundaneLengtheningCatalyst), new ItemStack(ModItems.standardBindingAgent)}, 4); AlchemyRecipeRegistry.registerRecipe(new ItemStack(ModItems.greaterPowerCatalyst), 30, new ItemStack[]{new ItemStack(ModItems.averagePowerCatalyst), new ItemStack(ModItems.averagePowerCatalyst), new ItemStack(ModItems.incendium)}, 4); diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/IMeleeSpellEntityEffect.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/IMeleeSpellEntityEffect.java new file mode 100644 index 00000000..0ab028f8 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/IMeleeSpellEntityEffect.java @@ -0,0 +1,9 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public interface IMeleeSpellEntityEffect +{ + public void onEntityImpact(World world, Entity entity); +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/IMeleeSpellWorldEffect.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/IMeleeSpellWorldEffect.java new file mode 100644 index 00000000..23905916 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/IMeleeSpellWorldEffect.java @@ -0,0 +1,10 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public interface IMeleeSpellWorldEffect +{ + public void onWorldEffect(World world, EntityPlayer entityPlayer); +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/ISelfSpellEffect.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/ISelfSpellEffect.java new file mode 100644 index 00000000..7b37a0f6 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/ISelfSpellEffect.java @@ -0,0 +1,9 @@ +package WayofTime.alchemicalWizardry.common.spell.complex; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public interface ISelfSpellEffect +{ + public void onSelfUse(World world, EntityPlayer player); +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java index 59307d57..1eaae817 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigm.java @@ -111,10 +111,10 @@ public abstract class SpellParadigm } } - + return (int)(cost*Math.sqrt(this.bufferedEffectList.size())); } - return cost; + return getDefaultCost(); } public abstract int getDefaultCost(); diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java index 8c1eedbf..b4185dfa 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmMelee.java @@ -1,13 +1,24 @@ package WayofTime.alchemicalWizardry.common.spell.complex; -import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; public class SpellParadigmMelee extends SpellParadigm { - + private List entityEffectList; + private List worldEffectList; + + public SpellParadigmMelee() + { + this.entityEffectList = new ArrayList(); + this.worldEffectList = new ArrayList(); + } + @Override public void enhanceParadigm(SpellEnhancement enh) { @@ -22,11 +33,25 @@ public class SpellParadigmMelee extends SpellParadigm } + public void addEntityEffect(IMeleeSpellEntityEffect eff) + { + if(eff!=null) + { + this.entityEffectList.add(eff); + } + } + + public void addWorldEffect(IMeleeSpellWorldEffect eff) + { + if(eff!=null) + { + this.worldEffectList.add(eff); + } + } + @Override public int getDefaultCost() { - // TODO Auto-generated method stub return 0; } - } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java index 6d9e39f3..b170b635 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java @@ -8,6 +8,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.world.World; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; @@ -24,7 +25,6 @@ public class SpellParadigmProjectile extends SpellParadigm @Override public void enhanceParadigm(SpellEnhancement enh) { - // TODO Auto-generated method stub } @@ -34,6 +34,9 @@ public class SpellParadigmProjectile extends SpellParadigm EntitySpellProjectile proj = new EntitySpellProjectile(world, entityPlayer); this.prepareProjectile(proj); world.spawnEntityInWorld(proj); + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); } public static SpellParadigmProjectile getParadigmForStringArray(List stringList) @@ -90,11 +93,26 @@ public class SpellParadigmProjectile extends SpellParadigm proj.setEffectList(effectList); proj.setRicochetMax(ricochetMax); } + + public void addImpactEffect(IProjectileImpactEffect eff) + { + if(eff!=null) + { + this.impactList.add(eff); + } + } + + public void addUpdateEffect(IProjectileUpdateEffect eff) + { + if(eff!=null) + { + this.updateEffectList.add(eff); + } + } @Override public int getDefaultCost() { - // TODO Auto-generated method stub return 50; } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java index 69881f77..6538c59b 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java @@ -1,5 +1,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex; +import java.util.ArrayList; +import java.util.List; + +import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -7,6 +11,13 @@ import net.minecraft.world.World; public class SpellParadigmSelf extends SpellParadigm { + public List selfSpellEffectList; + + public SpellParadigmSelf() + { + selfSpellEffectList = new ArrayList(); + } + @Override public void enhanceParadigm(SpellEnhancement enh) { @@ -16,14 +27,27 @@ public class SpellParadigmSelf extends SpellParadigm @Override public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) { - // TODO Auto-generated method stub + for(ISelfSpellEffect eff : selfSpellEffectList) + { + eff.onSelfUse(world, entityPlayer); + } + int cost = this.getTotalCost(); + + EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); } + public void addSelfSpellEffect(ISelfSpellEffect eff) + { + if(eff!=null) + { + this.selfSpellEffectList.add(eff); + } + } + @Override public int getDefaultCost() { - return 0; } }