1.7.2 is almost ready!
This commit is contained in:
parent
d5ba110323
commit
fa6ccb83a1
21 changed files with 231 additions and 69 deletions
|
@ -209,7 +209,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile
|
|||
|
||||
Vec3 var17 = worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ);
|
||||
Vec3 var3 = worldObj.getWorldVec3Pool().getVecFromPool(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, true);
|
||||
MovingObjectPosition var4 = worldObj.func_147447_a(var17, var3, true, false, false);
|
||||
var17 = worldObj.getWorldVec3Pool().getVecFromPool(posX, posY, posZ);
|
||||
var3 = worldObj.getWorldVec3Pool().getVecFromPool(posX + motionX, posY + motionY, posZ + motionZ);
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
@ -114,8 +115,7 @@ public class SpellEffectEarth extends SpellEffect
|
|||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
return (int)(10*2*(0.1d*(this.potencyEnhancement+1))*Math.pow(3.47,this.potencyEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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+1;
|
||||
int vertRange = (int)(0.5*(this.powerUpgrades+1));
|
||||
int maxBlocks = (int)(2*Math.pow(3.47, this.potencyUpgrades));
|
||||
|
||||
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 = worldObj.getBlock(posX+i, posY+j, posZ+k);
|
||||
if(block == null || block.getBlockHardness(worldObj, posX+i, posY+j, posZ+k)==-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);
|
||||
worldObj.func_147480_a(posX+i, posY+j, posZ+k, true);
|
||||
|
||||
blocksBroken++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
((EntitySpellProjectile) projectile).setBlocksBroken(blocksBroken);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
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)
|
||||
{
|
||||
((EntityItem)entity).delayBeforeCanPickup = 0;
|
||||
entity.onCollideWithPlayer((EntityPlayer)shooter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue