v1.0.0 finilization
This commit is contained in:
parent
4394ba4541
commit
b962ede72d
12 changed files with 123 additions and 61 deletions
|
@ -38,6 +38,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile
|
|||
private int ticksInAir = 0;
|
||||
private int ricochetCounter = 0;
|
||||
private boolean scheduledForDeath = false;
|
||||
private boolean isSilkTouch = false;
|
||||
|
||||
//Custom variables
|
||||
private int maxRicochet = 0;
|
||||
|
@ -288,6 +289,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile
|
|||
|
||||
par1NBTTagCompound.setTag("Effects", effectList);
|
||||
par1NBTTagCompound.setInteger("blocksBroken", blocksBroken);
|
||||
par1NBTTagCompound.setBoolean("isSilkTouch", isSilkTouch);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -303,6 +305,8 @@ public class EntitySpellProjectile extends Entity implements IProjectile
|
|||
inData = par1NBTTagCompound.getByte("inData") & 255;
|
||||
inGround = par1NBTTagCompound.getByte("inGround") == 1;
|
||||
blocksBroken = par1NBTTagCompound.getInteger("blocksBroken");
|
||||
isSilkTouch = par1NBTTagCompound.getBoolean("isSilkTouch");
|
||||
|
||||
|
||||
NBTTagList tagList = par1NBTTagCompound.getTagList("Effects");
|
||||
|
||||
|
@ -580,4 +584,14 @@ public class EntitySpellProjectile extends Entity implements IProjectile
|
|||
{
|
||||
this.blocksBroken = blocksBroken;
|
||||
}
|
||||
|
||||
public boolean getIsSilkTouch()
|
||||
{
|
||||
return this.isSilkTouch;
|
||||
}
|
||||
|
||||
public void setIsSilkTouch(boolean bool)
|
||||
{
|
||||
this.isSilkTouch = bool;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ public class SpellParadigmProjectile extends SpellParadigm
|
|||
public List<IProjectileUpdateEffect> updateEffectList;
|
||||
public boolean penetration;
|
||||
public int ricochetMax;
|
||||
public boolean isSilkTouch;
|
||||
|
||||
public SpellParadigmProjectile()
|
||||
{
|
||||
|
@ -33,6 +34,7 @@ public class SpellParadigmProjectile extends SpellParadigm
|
|||
this.updateEffectList = new ArrayList();
|
||||
this.penetration = false;
|
||||
this.ricochetMax = 0;
|
||||
this.isSilkTouch = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,7 +72,8 @@ public class SpellParadigmProjectile extends SpellParadigm
|
|||
proj.setImpactList(impactList);
|
||||
proj.setUpdateEffectList(updateEffectList);
|
||||
proj.setPenetration(penetration);
|
||||
proj.setRicochetMax(ricochetMax);
|
||||
proj.setRicochetMax(ricochetMax);
|
||||
proj.setIsSilkTouch(isSilkTouch);
|
||||
proj.setSpellEffectList(bufferedEffectList);
|
||||
}
|
||||
|
||||
|
|
|
@ -136,8 +136,7 @@ public class SpellEffectEarth extends SpellEffect
|
|||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
return (int)(250*(1.2*this.potencyEnhancement+1)*(3*this.powerEnhancement+2.5)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,7 +32,7 @@ public class SpellEffectWind extends SpellEffect
|
|||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.ricochetMax+=this.potencyEnhancement;
|
||||
parad.isSilkTouch = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,7 +86,7 @@ public class SpellEffectWind extends SpellEffect
|
|||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
//TODO parad.addWorldEffect(new MeleeEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
parad.addWorldEffect(new MeleeEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -158,7 +158,6 @@ public class SpellEffectWind extends SpellEffect
|
|||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
return (int)(100*(1.0*this.potencyEnhancement+1)*(0.7*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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