Changed the Quick Feet upgrade and the speed boost sigil so that their speeds are applied when strafing and walking backwards as well.

Added the Disoriented Downgrade. Muahaha
This commit is contained in:
WayofTime 2016-09-29 16:37:41 -04:00
parent 1a510c694c
commit 006cbeaa83
4 changed files with 74 additions and 2 deletions

View file

@ -6,6 +6,7 @@ Version 2.1.0-64
- Added the Charging rune, which accumulates charge by using the LP from the Blood Altar (1 charge = 1 LP always). If enough charge is stored when crafting, the crafting occurs instantly. - Added the Charging rune, which accumulates charge by using the LP from the Blood Altar (1 charge = 1 LP always). If enough charge is stored when crafting, the crafting occurs instantly.
- Added the entries for the Rune of Augmented Capacity, Charging Rune, and Rune of Acceleration - Added the entries for the Rune of Augmented Capacity, Charging Rune, and Rune of Acceleration
- Fixed the Sigil of Translocation so that it does not crash when picking up certain blocks. Also removed the damned lightning. - Fixed the Sigil of Translocation so that it does not crash when picking up certain blocks. Also removed the damned lightning.
- Changed the Quick Feet upgrade and the speed boost sigil so that their speeds are applied when strafing and walking backwards as well.
------------------------------------------------------ ------------------------------------------------------
Version 2.1.0-63 Version 2.1.0-63

View file

@ -0,0 +1,69 @@
package WayofTime.bloodmagic.livingArmour.downgrade;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeDisoriented extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { -10, -20 };
public static final double[] chance = new double[] { 0.001, 0.002 };
public LivingArmourUpgradeDisoriented(int level)
{
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
if (world.isRemote && player.ticksExisted % 20 == 0 && world.rand.nextDouble() <= chance[this.level])
{
player.rotationYaw = (float) (world.rand.nextFloat() * 360);
player.rotationPitch = (float) (world.rand.nextFloat() * 180 - 90);
}
}
@Override
public boolean runOnClient()
{
return true;
}
@Override
public String getUniqueIdentifier()
{
return Constants.Mod.MODID + ".upgrade.disoriented";
}
@Override
public int getMaxTier()
{
return 2;
}
@Override
public int getCostOfUpgrade()
{
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
}
@Override
public String getUnlocalizedName()
{
return tooltipBase + "disoriented";
}
}

View file

@ -3,6 +3,7 @@ package WayofTime.bloodmagic.registry;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler; import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry; import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeCrippledArm; import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeCrippledArm;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeDisoriented;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeMeleeDecrease; import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeMeleeDecrease;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeQuenched; import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeQuenched;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeSlippery; import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeSlippery;
@ -102,5 +103,6 @@ public class ModArmourTrackers
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeBattleHungry(0)); LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeBattleHungry(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeQuenched(0)); LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeQuenched(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeMeleeDecrease(0)); LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeMeleeDecrease(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeDisoriented(0));
} }
} }

View file

@ -196,9 +196,9 @@ public class LivingArmourHandler
} }
} }
if (percentIncrease > 0 && (player.onGround || player.capabilities.isFlying) && player.moveForward > 0F) if (percentIncrease > 0 && (player.onGround || player.capabilities.isFlying) && (Math.abs(player.moveForward) > 0 || Math.abs(player.moveStrafing) > 0))
{ {
player.moveRelative(0F, 1F, player.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease); player.moveRelative(player.moveStrafing, player.moveForward, player.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease);
} }
} }
} }