diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java index 46f57975..b4dcd944 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/EntitySpellProjectile.java @@ -12,6 +12,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatMessageComponent; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MathHelper; @@ -44,7 +45,6 @@ public class EntitySpellProjectile extends Entity implements IProjectile public List impactList = new ArrayList(); private boolean penetration = false; public List updateEffectList = new ArrayList(); - public List effectList = new LinkedList(); public List spellEffectList = new LinkedList(); public EntitySpellProjectile(World par1World) @@ -563,11 +563,6 @@ public class EntitySpellProjectile extends Entity implements IProjectile this.damage = damage; } - public void setEffectList(List stringList) - { - this.effectList = stringList; - } - public void setSpellEffectList(List list) { this.spellEffectList = list; diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java index d3f83d85..7c81d8aa 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmProjectile.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.spell.complex; import java.util.ArrayList; -import java.util.LinkedList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; @@ -12,17 +11,29 @@ import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileImpactEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileUpdateEffect; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; public class SpellParadigmProjectile extends SpellParadigm { - public DamageSource damageSource = DamageSource.generic; - public float damage = 1; - public int cost = 0; - public List impactList = new ArrayList(); - public List updateEffectList = new ArrayList(); - public boolean penetration = false; - public int ricochetMax = 0; + public DamageSource damageSource; + public float damage; + public int cost; + public List impactList; + public List updateEffectList; + public boolean penetration; + public int ricochetMax; + + public SpellParadigmProjectile() + { + this.damageSource = DamageSource.generic; + this.damage = 1; + this.cost = 0; + this.impactList = new ArrayList(); + this.updateEffectList = new ArrayList(); + this.penetration = false; + this.ricochetMax = 0; + } @Override public void enhanceParadigm(SpellEnhancement enh) @@ -41,51 +52,6 @@ public class SpellParadigmProjectile extends SpellParadigm EnergyItems.syphonBatteries(itemStack, entityPlayer, cost); } - public static SpellParadigmProjectile getParadigmForStringArray(List stringList) - { - SpellParadigmProjectile parad = new SpellParadigmProjectile(); - - try - { - for(String str : stringList) - { - Class clazz = Class.forName(str); - if(clazz!=null) - { - Object obj = clazz.newInstance(); - - if(obj instanceof SpellEffect) - { - parad.addBufferedEffect((SpellEffect)obj); - continue; - } - if(obj instanceof SpellModifier) - { - parad.modifyBufferedEffect((SpellModifier)obj); - continue; - } - if(obj instanceof SpellEnhancement) - { - parad.applyEnhancement((SpellEnhancement)obj); - continue; - } - } - } - - } catch (InstantiationException e) { - - e.printStackTrace(); - } catch (IllegalAccessException e) { - - e.printStackTrace(); - } catch (ClassNotFoundException e) { - - e.printStackTrace(); - } - - return parad; - } - public static SpellParadigmProjectile getParadigmForEffectArray(List effectList) { SpellParadigmProjectile parad = new SpellParadigmProjectile(); @@ -104,7 +70,6 @@ public class SpellParadigmProjectile extends SpellParadigm proj.setImpactList(impactList); proj.setUpdateEffectList(updateEffectList); proj.setPenetration(penetration); - proj.setEffectList(effectList); proj.setRicochetMax(ricochetMax); proj.setSpellEffectList(bufferedEffectList); } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java index 4726ddb3..94a7186a 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/SpellParadigmSelf.java @@ -55,48 +55,4 @@ public class SpellParadigmSelf extends SpellParadigm return 100; } - public static SpellParadigmSelf getParadigmForStringArray(List stringList) - { - SpellParadigmSelf parad = new SpellParadigmSelf(); - - try - { - for(String str : stringList) - { - Class clazz = Class.forName(str); - if(clazz!=null) - { - Object obj = clazz.newInstance(); - - if(obj instanceof SpellEffect) - { - parad.addBufferedEffect((SpellEffect)obj); - continue; - } - if(obj instanceof SpellModifier) - { - parad.modifyBufferedEffect((SpellModifier)obj); - continue; - } - if(obj instanceof SpellEnhancement) - { - parad.applyEnhancement((SpellEnhancement)obj); - continue; - } - } - } - - } catch (InstantiationException e) { - - e.printStackTrace(); - } catch (IllegalAccessException e) { - - e.printStackTrace(); - } catch (ClassNotFoundException e) { - - e.printStackTrace(); - } - - return parad; - } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java index 3ecd7438..7a090649 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffect.java @@ -20,6 +20,7 @@ public abstract class SpellEffect this.modifierState = SpellModifier.DEFAULT; this.powerEnhancement = 0; this.costEnhancement = 0; + this.potencyEnhancement = 0; } public void enhanceEffect(SpellEnhancement enh) @@ -176,6 +177,7 @@ public abstract class SpellEffect NBTTagCompound tag = new NBTTagCompound(); tag.setString("Class", this.getClass().getName()); + tag.setInteger("modifier", modifierState); tag.setInteger("power", powerEnhancement); tag.setInteger("cost", costEnhancement); tag.setInteger("potency", potencyEnhancement); @@ -195,6 +197,7 @@ public abstract class SpellEffect { SpellEffect eff = (SpellEffect) obj; + eff.modifierState = tag.getInteger("modifier"); eff.powerEnhancement = tag.getInteger("power"); eff.costEnhancement = tag.getInteger("cost"); eff.potencyEnhancement = tag.getInteger("potency"); 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 f4435fab..65fe51f7 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/SpellEffectFire.java @@ -3,7 +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.ProjectileDefaultFire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefaultFire; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefensiveFire; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfEnvironmentalFire; @@ -22,21 +22,24 @@ public class SpellEffectFire extends SpellEffect public void offensiveModificationProjectile(SpellParadigmProjectile parad) { // TODO Auto-generated method stub - + parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + parad.damage+=this.potencyEnhancement; } @Override public void defensiveModificationProjectile(SpellParadigmProjectile parad) { // TODO Auto-generated method stub - + parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + parad.damage+=this.potencyEnhancement; } @Override public void environmentalModificationProjectile(SpellParadigmProjectile parad) { // TODO Auto-generated method stub - + parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement)); + parad.damage+=this.potencyEnhancement; } @Override diff --git a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ProjectileDefaultFire.java b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefaultFire.java similarity index 63% rename from BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ProjectileDefaultFire.java rename to BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefaultFire.java index feedf4d6..435e3c72 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/ProjectileDefaultFire.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/spell/complex/effect/impactEffects/fire/ProjectileDefaultFire.java @@ -1,5 +1,6 @@ -package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects; +package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.util.MovingObjectPosition; @@ -24,10 +25,20 @@ public class ProjectileDefaultFire extends ProjectileImpactEffect int x = mop.blockX; int y = mop.blockY; int z = mop.blockZ; - - if(world.isAirBlock(x, y+1, z)) + int range = 0; + for(int i=-range; i<=range;i++) { - world.setBlock(x, y+1, z, Block.fire.blockID); + for(int j=-range; j<=range;j++) + { + for(int k=-range; k<=range; k++) + { + if(world.isAirBlock(x+i, y+j, z+k)) + { + world.setBlock(x+i, y+j, z+k, Block.fire.blockID); + } + } + } } + } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java index 3f7a981c..e6110498 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEnhancementBlock.java @@ -3,6 +3,8 @@ package WayofTime.alchemicalWizardry.common.tileEntity; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement; import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementCost; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementPotency; +import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancementPower; public class TESpellEnhancementBlock extends TESpellBlock { @@ -36,6 +38,28 @@ public class TESpellEnhancementBlock extends TESpellBlock public SpellEnhancement getSpellEnhancement() { + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + switch(meta) + { + case 0: + case 1: + case 2: + case 3: + case 4: + return new SpellEnhancementPower(); + case 5: + case 6: + case 7: + case 8: + case 9: + return new SpellEnhancementCost(); + case 10: + case 11: + case 12: + case 13: + case 14: + return new SpellEnhancementPotency(); + } return new SpellEnhancementCost(); } @@ -46,7 +70,29 @@ public class TESpellEnhancementBlock extends TESpellBlock public int enhancementType() //0 is power, 1 is cost, 2 is potency { - return 0; + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + switch(meta) + { + case 0: + case 1: + case 2: + case 3: + case 4: + return 0; + case 5: + case 6: + case 7: + case 8: + case 9: + return 1; + case 10: + case 11: + case 12: + case 13: + case 14: + return 2; + } + return 1; } public void doBadStuff() diff --git a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java index 9599d01a..73b39124 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java @@ -65,6 +65,7 @@ public class TESpellParadigmBlock extends TESpellBlock // spellParadSelf.castSpell(world, entity, spellCasterStack); // }else { + parad.applyAllSpellEffects(); parad.castSpell(world, entity, spellCasterStack); }