Updated Forge to 1813. Worked on the SentientArmour so that it is able to use the different will types depending on what is the highest.

This commit is contained in:
WayofTime 2016-03-29 09:22:25 -04:00
parent 4ea3e0ca92
commit 4a58fc5518
5 changed files with 217 additions and 64 deletions

View file

@ -18,10 +18,6 @@ import WayofTime.bloodmagic.item.armour.ItemSentientArmour;
public class ItemSentientArmourGem extends Item
{
public static double[] willBracket = new double[] { 30, 200, 600, 1500, 4000, 6000, 8000, 16000 };
public static double[] consumptionPerHit = new double[] { 0.1, 0.12, 0.15, 0.2, 0.3, 0.35, 0.4, 0.5 };
public static double[] extraProtectionLevel = new double[] { 0, 0.25, 0.5, 0.6, 0.7, 0.75, 0.85, 0.9 };
public ItemSentientArmourGem()
{
super();
@ -55,35 +51,16 @@ public class ItemSentientArmourGem extends Item
ItemSentientArmour.revertAllArmour(player);
} else
{
double will = PlayerDemonWillHandler.getTotalDemonWill(getCurrentType(stack), player);
EnumDemonWillType type = PlayerDemonWillHandler.getLargestWillType(player);
double will = PlayerDemonWillHandler.getTotalDemonWill(type, player);
int bracket = getWillBracket(will);
if (bracket >= 0)
{
// PlayerDemonWillHandler.consumeDemonWill(player, willBracket[bracket]);
ItemSentientArmour.convertPlayerArmour(player, consumptionPerHit[bracket], extraProtectionLevel[bracket]);
}
ItemSentientArmour.convertPlayerArmour(type, will, player);
}
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
}
public int getWillBracket(double will)
{
int bracket = -1;
for (int i = 0; i < willBracket.length; i++)
{
if (will >= willBracket[i])
{
bracket = i;
}
}
return bracket;
}
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining)
{