v1.0.0 finilization
This commit is contained in:
parent
4394ba4541
commit
b962ede72d
12 changed files with 123 additions and 61 deletions
|
@ -1,7 +1,5 @@
|
|||
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;
|
||||
|
@ -52,13 +50,25 @@ public class ProjectileEnvironmentalEarth extends ProjectileUpdateEffect
|
|||
if(!worldObj.isAirBlock(posX+i, posY+j, posZ+k)&&blocksBroken<maxBlocks)
|
||||
{
|
||||
Block block = Block.blocksList[worldObj.getBlockId(posX+i, posY+j, posZ+k)];
|
||||
int meta = worldObj.getBlockMetadata(posX+i, posY+j, posZ+k);
|
||||
if(block == null || block.getBlockHardness(worldObj, posX+i, posY+j, posZ+k)==-1 || SpellHelper.isBlockFluid(block))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(((EntitySpellProjectile)projectile).getIsSilkTouch()&&block.canSilkHarvest(worldObj, ((EntitySpellProjectile)projectile).shootingEntity, posX+i, posY+j, posZ+k, meta))
|
||||
{
|
||||
ItemStack stack = new ItemStack(block,1,meta);
|
||||
EntityItem itemEntity = new EntityItem(worldObj,posX+i+0.5, posY+j+0.5, posZ+k+0.5,stack);
|
||||
worldObj.spawnEntityInWorld(itemEntity);
|
||||
worldObj.setBlockToAir(posX+i, posY+j, posZ+k);
|
||||
}else
|
||||
{
|
||||
worldObj.destroyBlock(posX+i, posY+j, posZ+k, true);
|
||||
}
|
||||
//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.destroyBlock(posX+i, posY+j, posZ+k, true);
|
||||
|
||||
|
||||
blocksBroken++;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
|
@ -17,28 +21,16 @@ public class SelfEnvironmentalEarth extends SelfSpellEffect
|
|||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
int horizRadius = this.powerUpgrades + 1;
|
||||
int vertRadius = this.potencyUpgrades + 2;
|
||||
float radius = this.powerUpgrades*2 + 1.5f;
|
||||
int dur = this.powerUpgrades*5*20 + 60;
|
||||
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(player);
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ, radius, radius);
|
||||
|
||||
int posX = (int)(blockVec.xCoord);
|
||||
int posY = (int)(blockVec.yCoord);
|
||||
int posZ = (int)(blockVec.zCoord);
|
||||
|
||||
for(int i=-horizRadius; i<=horizRadius; i++)
|
||||
for(Entity entity : entities)
|
||||
{
|
||||
for(int j=0; j<vertRadius; j++)
|
||||
if(entity instanceof EntityLiving)
|
||||
{
|
||||
for(int k=-horizRadius; k<=horizRadius; k++)
|
||||
{
|
||||
// if(k==0&&i==0)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
BlockTeleposer.swapBlocks(world, world, posX + i, posY + j, posZ+k, posX+i, posY+j-vertRadius, posZ+k);
|
||||
}
|
||||
((EntityLiving) entity).addPotionEffect(new PotionEffect(Potion.weakness.id,dur,this.potencyUpgrades));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ public class MeleeEnvironmentalIce extends ExtrapolatedMeleeEntityEffect
|
|||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
|
||||
{
|
||||
//TODO Change to an Ice Cage
|
||||
for(int i=0;i<=this.powerUpgrades;i++)
|
||||
{
|
||||
double randX = (world.rand.nextDouble()-world.rand.nextDouble())*3;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityFallingSand;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
@ -12,38 +14,22 @@ public class MeleeEnvironmentalWind extends MeleeSpellCenteredWorldEffect
|
|||
public MeleeEnvironmentalWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power + 2);
|
||||
this.setRange(5*power + 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
|
||||
{
|
||||
int radius = this.potencyUpgrades;
|
||||
double wantedVel = 0.5d;
|
||||
int radius = 5*this.potencyUpgrades + 3;
|
||||
|
||||
for(int i=-radius; i<=radius; i++)
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius);
|
||||
|
||||
for(Entity entity : entities)
|
||||
{
|
||||
for(int j=-radius; j<=radius; j++)
|
||||
if(entity instanceof EntityItem)
|
||||
{
|
||||
for(int k=-radius; k<=radius; k++)
|
||||
{
|
||||
Block block = Block.blocksList[world.getBlockId(posX+i, posY+j, posZ+k)];
|
||||
int meta = world.getBlockMetadata(posX+i, posY+j, posZ+k);
|
||||
|
||||
if(SpellHelper.isBlockFluid(block)&&world.rand.nextFloat()<0.9f)
|
||||
{
|
||||
EntityFallingSand liquid = new EntityFallingSand(world, posX+i, posY+j, posZ+k, block.blockID, meta);
|
||||
|
||||
if(liquid!=null)
|
||||
{
|
||||
liquid.motionX = (world.rand.nextDouble()-world.rand.nextDouble())*wantedVel;
|
||||
liquid.motionY = (world.rand.nextDouble()-world.rand.nextDouble())*wantedVel;
|
||||
liquid.motionZ = (world.rand.nextDouble()-world.rand.nextDouble())*wantedVel;
|
||||
|
||||
world.spawnEntityInWorld(liquid);
|
||||
}
|
||||
}
|
||||
}
|
||||
((EntityItem)entity).delayBeforeCanPickup = 0;
|
||||
entity.onCollideWithPlayer((EntityPlayer)player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue