Added sentient armour gem recipe. Added ability for Tartaric gems to fill other gems.

This commit is contained in:
WayofTime 2016-01-26 07:56:17 -05:00
parent e2a007d932
commit 1242fefc30
8 changed files with 67 additions and 6 deletions

View file

@ -14,9 +14,9 @@ import WayofTime.bloodmagic.item.armour.ItemSentientArmour;
public class ItemSentientArmourGem extends Item
{
public static double[] willBracket = new double[] { 30, 200, 600, 1500, 4000, 6000, 8000 };
public static double[] consumptionPerHit = new double[] { 0.1, 0.12, 0.15, 0.2, 0.3, 0.35, 0.4 };
public static double[] extraProtectionLevel = new double[] { 0, 0.25, 0.5, 0.6, 0.7, 0.75, 0.85 };
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()
{
@ -52,7 +52,7 @@ public class ItemSentientArmourGem extends Item
if (bracket >= 0)
{
PlayerDemonWillHandler.consumeDemonWill(player, willBracket[bracket]);
// PlayerDemonWillHandler.consumeDemonWill(player, willBracket[bracket]);
ItemSentientArmour.convertPlayerArmour(player, consumptionPerHit[bracket], extraProtectionLevel[bracket]);
}
}

View file

@ -7,12 +7,14 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.soul.IDemonWill;
import WayofTime.bloodmagic.api.soul.IDemonWillGem;
import WayofTime.bloodmagic.api.soul.PlayerDemonWillHandler;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import WayofTime.bloodmagic.util.helper.TextHelper;
@ -37,6 +39,17 @@ public class ItemSoulGem extends Item implements IDemonWillGem
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{
double drain = Math.min(this.getWill(stack), this.getMaxWill(stack) / 10);
double filled = PlayerDemonWillHandler.addDemonWill(player, drain, stack);
this.drainWill(stack, filled);
return stack;
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List<ItemStack> list)