1.7.2 commit

This commit is contained in:
WayofTime 2014-02-14 15:20:20 -05:00
parent 92e097eaa2
commit 9aaa65feb4
548 changed files with 46982 additions and 2 deletions

View file

@ -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.earth.ProjectileEnvironmentalEarth;
public class SpellEffectEarth extends SpellEffect
{
@ -30,7 +31,7 @@ public class SpellEffectEarth extends SpellEffect
@Override
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
{
// TODO Auto-generated method stub
parad.addUpdateEffect(new ProjectileEnvironmentalEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}

View file

@ -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.wind.ProjectileEnvironmentalWind;
public class SpellEffectWind extends SpellEffect
{
@ -30,7 +31,7 @@ public class SpellEffectWind extends SpellEffect
@Override
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
{
// TODO Auto-generated method stub
parad.addUpdateEffect(new ProjectileEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}

View file

@ -0,0 +1,66 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
public class ProjectileEnvironmentalEarth extends ProjectileUpdateEffect
{
public ProjectileEnvironmentalEarth(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onUpdateEffect(Entity projectile)
{
Vec3 posVec = SpellHelper.getEntityBlockVector(projectile);
int horizRange = this.powerUpgrades+2;
int vertRange = 0*this.potencyUpgrades+1;
int maxBlocks = (int)(2*Math.pow(this.potencyUpgrades,3)) + 3;
int posX = (int)(posVec.xCoord);
int posY = (int)(posVec.yCoord);
int posZ = (int)(posVec.zCoord);
World worldObj = projectile.worldObj;
if(projectile instanceof EntitySpellProjectile)
{
int blocksBroken = ((EntitySpellProjectile) projectile).getBlocksBroken();
if(blocksBroken>=maxBlocks)
{
return;
}
for(int i=-horizRange; i<=horizRange; i++)
{
for(int j=-vertRange; j<=vertRange; j++)
{
for(int k=-horizRange; k<=horizRange; k++)
{
if(!worldObj.isAirBlock(posX+i, posY+j, posZ+k)&&blocksBroken<maxBlocks)
{
Block block = Block.blocksList[worldObj.getBlockId(posX+i, posY+j, posZ+k)];
if(block == null || block.blockHardness==-1)
{
continue;
}
//block.breakBlock(worldObj, posX+i, posY+j, posZ+k, block.blockID, worldObj.getBlockMetadata(posX+i, posY+j, posZ+k));
worldObj.destroyBlock(posX+i, posY+j, posZ+k, true);
blocksBroken++;
}
}
}
}
((EntitySpellProjectile) projectile).setBlocksBroken(blocksBroken);
}
}
}

View file

@ -0,0 +1,52 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
public class ProjectileEnvironmentalWind extends ProjectileUpdateEffect
{
public ProjectileEnvironmentalWind(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onUpdateEffect(Entity projectile)
{
Vec3 posVec = SpellHelper.getEntityBlockVector(projectile);
int horizRange = this.powerUpgrades+1;
int vertRange = 1*this.potencyUpgrades+1;
World worldObj = projectile.worldObj;
if(projectile instanceof EntitySpellProjectile)
{
Entity shooter = ((EntitySpellProjectile) projectile).shootingEntity;
if(shooter instanceof EntityPlayer)
{
List<Entity> entitylist = SpellHelper.getEntitiesInRange(worldObj, projectile.posX, projectile.posY, projectile.posZ, horizRange, vertRange);
if(entitylist !=null)
{
for(Entity entity : entitylist)
{
if(entity instanceof EntityItem)
{
entity.onCollideWithPlayer((EntityPlayer)shooter);
}
}
}
}
}
}
}