Reworked Tartaric Gems so that they contain specific demon will types (work for the future)
This commit is contained in:
parent
e681085d8b
commit
035ba94976
11 changed files with 142 additions and 76 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue