Reworked Tartaric Gems so that they contain specific demon will types (work for the future)

This commit is contained in:
WayofTime 2016-02-18 18:00:02 -05:00
parent e681085d8b
commit 035ba94976
11 changed files with 142 additions and 76 deletions

View file

@ -17,6 +17,7 @@ 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.EnumDemonWillType;
import WayofTime.bloodmagic.api.soul.PlayerDemonWillHandler;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import WayofTime.bloodmagic.registry.ModItems;
@ -33,6 +34,11 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor
setCreativeTab(BloodMagic.tabBloodMagic);
}
public EnumDemonWillType getDemonWillTypeConsumed(ItemStack stack)
{
return EnumDemonWillType.DEFAULT;
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack stack, DamageSource source, double damage, int slot)
{
@ -140,11 +146,13 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor
{
EntityPlayer player = (EntityPlayer) entity;
EnumDemonWillType type = getDemonWillTypeConsumed(stack);
double willRequired = this.getCostModifier(stack) * damage;
double willLeft = PlayerDemonWillHandler.getTotalDemonWill(player);
double willLeft = PlayerDemonWillHandler.getTotalDemonWill(type, player);
if (willLeft >= willRequired)
{
PlayerDemonWillHandler.consumeDemonWill(player, willRequired);
PlayerDemonWillHandler.consumeDemonWill(type, player, willRequired);
} else
{
this.revertArmour(player, stack);