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

@ -0,0 +1,74 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
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.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public abstract class ExtrapolatedMeleeEntityEffect implements IMeleeSpellEntityEffect
{
protected float range;
protected float radius;
protected int powerUpgrades;
protected int potencyUpgrades;
protected int costUpgrades;
protected int maxHit;
public ExtrapolatedMeleeEntityEffect(int power, int potency, int cost)
{
this.powerUpgrades = power;
this.potencyUpgrades = potency;
this.costUpgrades = cost;
this.range = 0;
this.radius = 0;
this.maxHit = 1;
}
@Override
public void onEntityImpact(World world, EntityPlayer entityPlayer)
{
Vec3 lookVec = entityPlayer.getLook(range);
double x = entityPlayer.posX + lookVec.xCoord;
double y = entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord;
double z = entityPlayer.posZ + lookVec.zCoord;
List<Entity> entities = world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(x-0.5f, y-0.5f, z-0.5f, x + 0.5f, y + 0.5f, z + 0.5f).expand(radius, radius, radius));
int hit = 0;
if(entities!=null)
{
for(Entity entity : entities)
{
if(hit<maxHit&&!entity.equals(entityPlayer))
{
if(this.entityEffect(world, entity))
{
hit++;
}
}
}
}
}
protected abstract boolean entityEffect(World world, Entity entity);
public void setRange(float range)
{
this.range = range;
}
public void setRadius(float radius)
{
this.radius = radius;
}
public void setMaxNumberHit(int maxHit)
{
this.maxHit = maxHit;
}
}

View file

@ -0,0 +1,9 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public interface IMeleeSpellEntityEffect
{
public void onEntityImpact(World world, EntityPlayer entityPlayer);
}

View file

@ -0,0 +1,10 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public interface IMeleeSpellWorldEffect
{
public void onWorldEffect(World world, EntityPlayer entityPlayer);
}

View file

@ -0,0 +1,11 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.entity.Entity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public interface IProjectileImpactEffect
{
public void onEntityImpact(Entity mop);
public void onTileImpact(World world, MovingObjectPosition mop);
}

View file

@ -0,0 +1,8 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.entity.Entity;
public interface IProjectileUpdateEffect
{
public void onUpdateEffect(Entity projectile);
}

View file

@ -0,0 +1,9 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public interface ISelfSpellEffect
{
public void onSelfUse(World world, EntityPlayer player);
}

View file

@ -0,0 +1,21 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public abstract class MeleeSpellWorldEffect implements IMeleeSpellWorldEffect
{
protected int powerUpgrades;
protected int potencyUpgrades;
protected int costUpgrades;
public MeleeSpellWorldEffect(int power, int potency, int cost)
{
this.powerUpgrades = power;
this.potencyUpgrades = potency;
this.costUpgrades = cost;
}
@Override
public abstract void onWorldEffect(World world, EntityPlayer entityPlayer);
}

View file

@ -0,0 +1,15 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
public abstract class ProjectileImpactEffect implements IProjectileImpactEffect
{
protected int powerUpgrades;
protected int potencyUpgrades;
protected int costUpgrades;
public ProjectileImpactEffect(int power, int potency, int cost)
{
this.powerUpgrades = power;
this.potencyUpgrades = potency;
this.costUpgrades = cost;
}
}

View file

@ -0,0 +1,15 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
public abstract class ProjectileUpdateEffect implements IProjectileUpdateEffect
{
protected int powerUpgrades;
protected int potencyUpgrades;
protected int costUpgrades;
public ProjectileUpdateEffect(int power, int potency, int cost)
{
this.powerUpgrades = power;
this.potencyUpgrades = potency;
this.costUpgrades = cost;
}
}

View file

@ -0,0 +1,18 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public abstract class SelfSpellEffect implements ISelfSpellEffect
{
protected int powerUpgrades;
protected int potencyUpgrades;
protected int costUpgrades;
public SelfSpellEffect(int power, int potency, int cost)
{
this.powerUpgrades = power;
this.potencyUpgrades = potency;
this.costUpgrades = cost;
}
}

View file

@ -0,0 +1,44 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
public class ProjectileDefaultFire extends ProjectileImpactEffect
{
public ProjectileDefaultFire(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onEntityImpact(Entity mop)
{
mop.setFire((int)Math.pow(2,this.powerUpgrades));
}
@Override
public void onTileImpact(World world, MovingObjectPosition mop)
{
int x = mop.blockX;
int y = mop.blockY;
int z = mop.blockZ;
int range = 0;
for(int i=-range; i<=range;i++)
{
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, Blocks.fire);
}
}
}
}
}
}

View file

@ -0,0 +1,22 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ISelfSpellEffect;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class SelfDefaultFire extends SelfSpellEffect
{
public SelfDefaultFire(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
player.setFire((int)(10*Math.pow(1.5, powerUpgrades+1.5*potencyUpgrades)));
}
}

View file

@ -0,0 +1,24 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfDefensiveFire extends SelfSpellEffect {
public SelfDefensiveFire(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
// TODO Auto-generated method stub
world.playAuxSFXAtEntity(player, 1008, (int)player.posX, (int)player.posY, (int)player.posZ, 0);
}
}

View file

@ -0,0 +1,56 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfEnvironmentalFire extends SelfSpellEffect
{
public SelfEnvironmentalFire(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
int posX = (int) Math.round(player.posX - 0.5f);
int posY = (int) player.posY;
int posZ = (int) Math.round(player.posZ - 0.5f);
int powRadius = this.powerUpgrades;
int potRadius = this.potencyUpgrades-1;
for(int i=-powRadius;i<=powRadius;i++)
{
for(int j=-powRadius;j<=powRadius;j++)
{
for(int k=-powRadius;k<=powRadius;k++)
{
if(world.isAirBlock(posX+i, posY+j, posZ+k))
{
world.setBlock(posX+i, posY+j, posZ+k, Blocks.fire);
}
}
}
}
for(int i=-potRadius;i<=potRadius;i++)
{
for(int j=-potRadius;j<=potRadius;j++)
{
for(int k=-potRadius;k<=potRadius;k++)
{
if(!world.isAirBlock(posX+i, posY+j, posZ+k))
{
SpellHelper.smeltBlockInWorld(world, posX+i, posY+j, posZ+k);
}
}
}
}
}
}

View file

@ -0,0 +1,21 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfOffensiveFire extends SelfSpellEffect
{
public SelfOffensiveFire(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlameCloak.id,(this.powerUpgrades+1)*this.powerUpgrades,this.potencyUpgrades));
}
}

View file

@ -0,0 +1,27 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
public class MeleeDefaultIce extends ExtrapolatedMeleeEntityEffect {
public MeleeDefaultIce(int power, int potency, int cost)
{
super(power, potency, cost);
this.setRange(3+0.3f*potency);
this.setRadius(2+0.3f*potency);
this.setMaxNumberHit(potency+1);
}
@Override
protected boolean entityEffect(World world, Entity entity)
{
if(entity.hurtResistantTime>0)
{
entity.hurtResistantTime = Math.max(0, -(potencyUpgrades+1)+entity.hurtResistantTime);
}
return true;
}
}

View file

@ -0,0 +1,48 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect;
public class MeleeDefensiveIce extends MeleeSpellWorldEffect
{
public MeleeDefensiveIce(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onWorldEffect(World world, EntityPlayer entityPlayer)
{
ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec());
int width = this.powerUpgrades;
int height = this.powerUpgrades + 2;
int xOffset = look.offsetX;
int zOffset = look.offsetZ;
int range = this.potencyUpgrades + 1;
Vec3 lookVec = SpellHelper.getEntityBlockVector(entityPlayer);
int xStart = (int)(lookVec.xCoord) + range * xOffset;
int zStart = (int)(lookVec.zCoord) + range * zOffset;
int yStart = (int)(lookVec.yCoord);
for(int i=-width; i<=width; i++)
{
for(int j=0; j<height;j++)
{
if(world.isAirBlock(xStart + i*(zOffset), yStart + j, zStart + i*(xOffset)))
{
world.setBlock(xStart + i*(zOffset), yStart + j, zStart + i*(xOffset), Blocks.ice);
}
}
}
}
}

View file

@ -0,0 +1,38 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
public class MeleeEnvironmentalIce extends ExtrapolatedMeleeEntityEffect
{
public MeleeEnvironmentalIce(int power, int potency, int cost)
{
super(power, potency, cost);
this.setMaxNumberHit(1+potency);
this.setRadius(2);
this.setRange(3);
}
@Override
protected boolean entityEffect(World world, Entity entity)
{
for(int i=0;i<=this.powerUpgrades;i++)
{
double randX = (world.rand.nextDouble()-world.rand.nextDouble())*3;
double randY = -world.rand.nextDouble()*3;
double randZ = (world.rand.nextDouble()-world.rand.nextDouble())*3;
EntitySnowball snowball = new EntitySnowball(world, entity.posX-3*randX, entity.posY-3*randY, entity.posZ-3*randZ);
snowball.motionX = randX;
snowball.motionY = randY;
snowball.motionZ = randZ;
world.spawnEntityInWorld(snowball);
}
return true;
}
}

View file

@ -0,0 +1,45 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
public class MeleeOffensiveIce extends ExtrapolatedMeleeEntityEffect
{
public MeleeOffensiveIce(int power, int potency, int cost)
{
super(power, potency, cost);
this.setMaxNumberHit(1+potency);
this.setRadius(2);
this.setRange(3);
}
@Override
protected boolean entityEffect(World world, Entity entity)
{
Vec3 blockVector = SpellHelper.getEntityBlockVector(entity);
int posX = (int)(blockVector.xCoord);
int posY = (int)(blockVector.yCoord);
int posZ = (int)(blockVector.zCoord);
double yVel = 1*(0.3*this.powerUpgrades+0.90);
entity.motionY = yVel;
for(int i=0;i<2;i++)
{
if(world.isAirBlock(posX,posY+i,posZ))
{
world.setBlock(posX, posY+i, posZ, Blocks.ice);
}
}
entity.fallDistance = 0.0f;
return true;
}
}

View file

@ -0,0 +1,40 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
public class ProjectileDefaultIce extends ProjectileImpactEffect
{
public ProjectileDefaultIce(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onEntityImpact(Entity mop)
{
return;
}
@Override
public void onTileImpact(World world, MovingObjectPosition mop)
{
int horizRadius = this.powerUpgrades+1;
int vertRadius = this.potencyUpgrades;
ForgeDirection sideHit = ForgeDirection.getOrientation(mop.sideHit);
int posX = mop.blockX + sideHit.offsetX;
int posY = mop.blockY + sideHit.offsetY;
int posZ = mop.blockZ + sideHit.offsetZ;
if(world.isAirBlock(posX, posY, posZ))
{
world.setBlock(posX, posY, posZ, Blocks.ice);
}
}
}

View file

@ -0,0 +1,50 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
public class ProjectileDefensiveIce extends ProjectileImpactEffect
{
public ProjectileDefensiveIce(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onEntityImpact(Entity mop)
{
return;
}
@Override
public void onTileImpact(World world, MovingObjectPosition mop)
{
int horizRadius = this.powerUpgrades+1;
int vertRadius = this.potencyUpgrades;
int posX = mop.blockX;
int posY = mop.blockY;
int posZ = mop.blockZ;
for(int i=-horizRadius; i<=horizRadius; i++)
{
for(int k=-horizRadius; k<=horizRadius; k++)
{
for(int j=-vertRadius; j<=vertRadius; j++)
{
SpellHelper.freezeWaterBlock(world, posX+i, posY+j, posZ+k);
if(world.isAirBlock(posX+i, posY+j, posZ+k)&&!world.isAirBlock(posX+i, posY+j-1, posZ+k))
{
world.setBlock(posX+i, posY+j, posZ+k, Blocks.snow);
}
}
}
}
}
}

View file

@ -0,0 +1,39 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
public class ProjectileEnvironmentalIce extends ProjectileUpdateEffect
{
public ProjectileEnvironmentalIce(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 = this.potencyUpgrades+1;
int posX = (int)(posVec.xCoord);
int posY = (int)(posVec.yCoord);
int posZ = (int)(posVec.zCoord);
for(int i=-horizRange; i<=horizRange; i++)
{
for(int j=-vertRange; j<=vertRange; j++)
{
for(int k=-horizRange; k<=horizRange; k++)
{
SpellHelper.freezeWaterBlock(projectile.worldObj, posX+i, posY+j, posZ+k);
}
}
}
}
}

View file

@ -0,0 +1,32 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
public class ProjectileOffensiveIce extends ProjectileImpactEffect
{
public ProjectileOffensiveIce(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onEntityImpact(Entity mop)
{
if(mop instanceof EntityLivingBase)
{
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,60*(this.powerUpgrades+1),this.potencyUpgrades));
}
}
@Override
public void onTileImpact(World world, MovingObjectPosition mop)
{
return;
}
}

View file

@ -0,0 +1,43 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import ibxm.Player;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfDefaultIce extends SelfSpellEffect
{
public SelfDefaultIce(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
Vec3 blockVector = SpellHelper.getEntityBlockVector(player);
int posX = (int)(blockVector.xCoord);
int posY = (int)(blockVector.yCoord);
int posZ = (int)(blockVector.zCoord);
double yVel = 1*(0.4*this.powerUpgrades+0.75);
//PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(player.motionX, yVel, player.motionZ),(Player)player);
SpellHelper.setPlayerSpeedFromServer(player, player.motionX, yVel, player.motionZ);
for(int i=0;i<2;i++)
{
if(world.isAirBlock(posX,posY+i,posZ))
{
world.setBlock(posX, posY+i, posZ, Blocks.ice);
}
}
player.fallDistance = 0.0f;
}
}

View file

@ -0,0 +1,21 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfDefensiveIce extends SelfSpellEffect
{
public SelfDefensiveIce(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionIceCloak.id,300*(2*this.powerUpgrades+1),this.potencyUpgrades));
}
}

View file

@ -0,0 +1,46 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfEnvironmentalIce extends SelfSpellEffect
{
public SelfEnvironmentalIce(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(player.getLookVec());
int width = this.potencyUpgrades + 1;
int length = 5*this.powerUpgrades + 3;
int xOffset = look.offsetX;
int zOffset = look.offsetZ;
Vec3 lookVec = SpellHelper.getEntityBlockVector(player);
int xStart = (int)(lookVec.xCoord);
int zStart = (int)(lookVec.zCoord);
int yStart = (int)(lookVec.yCoord)-1;
for(int i=-width; i<=width; i++)
{
for(int j=0; j<length;j++)
{
if(world.isAirBlock(xStart + i*(zOffset) + j*(xOffset), yStart, zStart + i*(xOffset) + j*(zOffset)))
{
world.setBlock(xStart + i*(zOffset) + j*(xOffset), yStart, zStart + i*(xOffset) + j*(zOffset), Blocks.ice);
}
}
}
}
}

View file

@ -0,0 +1,52 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfOffensiveIce extends SelfSpellEffect
{
public SelfOffensiveIce(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onSelfUse(World world, EntityPlayer player)
{
double horizRadius = this.powerUpgrades+1;
double vertRadius = 0.5*this.powerUpgrades+1;
List<Entity> entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ,horizRadius, vertRadius);
if(entities==null)
{
return;
}
int i=0;
int number = this.powerUpgrades+1;
for(Entity entity : entities)
{
if(i>=number)
{
continue;
}
if(entity instanceof EntityLivingBase && !entity.equals(player))
{
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,60*(1+this.powerUpgrades),this.potencyUpgrades));
i++;
}
}
}
}