From 219b997b24b5fa13cd09ef407372ace3f4433cfd Mon Sep 17 00:00:00 2001 From: WayofTime Date: Fri, 29 Jan 2016 21:08:30 -0500 Subject: [PATCH] Decreased effect of looting for the Sentient Sword. Allowed the sword to attack when deactivated. Allowed blocking with the sword. --- .../bloodmagic/item/soul/ItemSentientSword.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java index dd35125b..2b732cb1 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java @@ -47,7 +47,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if (player.isSneaking()) //TODO: change its state depending on soul consumption + if (player.isSneaking()) setActivated(stack, !getActivated(stack)); if (getActivated(stack)) @@ -64,6 +64,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon setDropOfActivatedSword(stack, level >= 0 ? soulDrop[level] : 0); } + player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); return stack; } @@ -121,11 +122,9 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon PlayerDemonWillHandler.consumeDemonWill(player, drain); } } - - return super.onLeftClickEntity(stack, player, entity); } - return true; + return super.onLeftClickEntity(stack, player, entity); } public boolean getActivated(ItemStack stack) @@ -156,8 +155,11 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon for (int i = 0; i <= looting; i++) { - ItemStack soulStack = soul.createWill(0, this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)); - soulList.add(soulStack); + if (i == 0 || attackingEntity.worldObj.rand.nextDouble() < 0.3) + { + ItemStack soulStack = soul.createWill(0, this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)); + soulList.add(soulStack); + } } }