Air jump distance is now based off of how much the staff is charged up.

This commit is contained in:
allstar69 2013-07-23 08:47:37 -07:00
commit bae5961a48

View file

@ -30,13 +30,13 @@ public class ItemStaffAir extends ItemStaff {
itemStack.stackTagCompound.setInteger("maxChargeTime", 3 * 20); itemStack.stackTagCompound.setInteger("maxChargeTime", 3 * 20);
if (!world.isRemote)
{
if (currentItem != null) if (currentItem != null)
{ {
if (currentItem.itemID == itemStack.itemID) if (currentItem.itemID == itemStack.itemID)
{ {
player.fallDistance = 0.0F; player.fallDistance = 0.0F;
if (!world.isRemote)
MysticWorld.proxy.airFeetFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY + (player.height/itemStack.stackTagCompound.getInteger("maxChargeTime") * itemStack.stackTagCompound.getInteger("chargeTime")), (player.posZ - 0.5D) + rand.nextDouble(), 1.0f + ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime"))))); MysticWorld.proxy.airFeetFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY + (player.height/itemStack.stackTagCompound.getInteger("maxChargeTime") * itemStack.stackTagCompound.getInteger("chargeTime")), (player.posZ - 0.5D) + rand.nextDouble(), 1.0f + ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime")))));
if (!Mouse.isButtonDown(1)) if (!Mouse.isButtonDown(1))
@ -45,31 +45,35 @@ public class ItemStaffAir extends ItemStaff {
{ {
if (!(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))) if (!(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)))
{ {
world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)player.posX, (int)player.posY, (int)player.posZ, 0);
if (!world.isRemote) if (!world.isRemote)
{ {
world.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)player.posX, (int)player.posY, (int)player.posZ, 0);
world.spawnEntityInWorld(new EntityChargeAir(world, player, 1.0f + ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime")))), (float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / (double)itemStack.stackTagCompound.getInteger("maxChargeTime"))))); world.spawnEntityInWorld(new EntityChargeAir(world, player, 1.0f + ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime")))), (float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / (double)itemStack.stackTagCompound.getInteger("maxChargeTime")))));
itemStack.damageItem(1, player); itemStack.damageItem(1, player);
} }
} }
else
{
if (player.onGround)
{
world.playSoundEffect(player.posX, player.posY, player.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
itemStack.damageItem(1, player);
player.setVelocity(0.0D, 1.0D + (float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (2.5D * (1.0D / (double)itemStack.stackTagCompound.getInteger("maxChargeTime"))), 0.0D);
}
} }
} }
if (Mouse.isButtonDown(1)) itemStack.stackTagCompound.setInteger("chargeTime", 0);
itemStack.stackTagCompound.setBoolean("charging", false);
}
else
{ {
if (itemStack.stackTagCompound.getBoolean("charging") == true) if (itemStack.stackTagCompound.getBoolean("charging") == true)
{ {
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1); itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
} }
} }
else
{
itemStack.stackTagCompound.setInteger("chargeTime", 0);
itemStack.stackTagCompound.setBoolean("charging", false);
}
}
} }
} }
@ -90,16 +94,6 @@ public class ItemStaffAir extends ItemStaff {
itemStack.stackTagCompound.setBoolean("charging", true); itemStack.stackTagCompound.setBoolean("charging", true);
} }
if ((Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)))
{
if (player.onGround)
{
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
itemStack.damageItem(1, player);
player.addVelocity(0, 2.5, 0);
}
}
return itemStack; return itemStack;
} }