From ebdc069563c07a59c4396fdf07ac19a586114c83 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sun, 10 Jan 2016 08:37:26 -0500 Subject: [PATCH] Tweaked Sentient Sword will drop rate --- changelog.txt | 6 +++ .../WayofTime/bloodmagic/api/Constants.java | 2 + .../item/soul/ItemSentientSword.java | 46 +++++++++++++++++-- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 8ae38c58..ce058c93 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,9 @@ +------------------------------------------------------ +Version 2.0.0-5 +------------------------------------------------------ +- Tweaked Sentient Sword's will drop rate + + ------------------------------------------------------ Version 2.0.0-4 ------------------------------------------------------ diff --git a/src/main/java/WayofTime/bloodmagic/api/Constants.java b/src/main/java/WayofTime/bloodmagic/api/Constants.java index 81956092..5f2c971a 100644 --- a/src/main/java/WayofTime/bloodmagic/api/Constants.java +++ b/src/main/java/WayofTime/bloodmagic/api/Constants.java @@ -79,6 +79,8 @@ public class Constants public static final String SOULS = "souls"; public static final String SOUL_SWORD_DAMAGE = "soulSwordDamage"; public static final String SOUL_SWORD_ACTIVE_DRAIN = "soulSwordActiveDrain"; + public static final String SOUL_SWORD_DROP = "soulSwordDrop"; + public static final String SOUL_SWORD_STATIC_DROP = "soulSwordStaticDrop"; public static final String SOUL_FORGE_BURN = "burnTime"; public static final String SOUL_FORGE_CONSUMED = "consumedSouls"; diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java index 13243cd3..28313a26 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java @@ -29,9 +29,11 @@ import com.google.common.collect.Multimap; public class ItemSentientSword extends ItemSword implements IDemonWillWeapon { - public int[] soulBracket = new int[] { 16 }; - public double[] damageAdded = new double[] { 1 }; - public double[] soulDrainPerSwing = new double[] { 0.1 }; + public int[] soulBracket = new int[] { 16, 60, 200, 400 }; + public double[] damageAdded = new double[] { 1, 1.5, 2, 2.5 }; + public double[] soulDrainPerSwing = new double[] { 0.05, 0.1, 0.2, 0.4 }; + public double[] soulDrop = new double[] { 2, 4, 8, 12 }; + public double[] staticDrop = new double[] { 1, 1, 2, 3 }; public ItemSentientSword() { @@ -59,6 +61,8 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon setDrainOfActivatedSword(stack, drain); setDamageOfActivatedSword(stack, 7 + extraDamage); + setStaticDropOfActivatedSword(stack, level >= 0 ? staticDrop[level] : 1); + setDropOfActivatedSword(stack, level >= 0 ? soulDrop[level] : 0); } return stack; @@ -148,7 +152,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon for (int i = 0; i <= looting; i++) { - ItemStack soulStack = soul.createWill(0, (getDamageOfActivatedSword(stack) - 7) / 2 * attackingEntity.worldObj.rand.nextDouble() + 0.5); + ItemStack soulStack = soul.createWill(0, this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)); soulList.add(soulStack); } } @@ -190,6 +194,40 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon tag.setDouble(Constants.NBT.SOUL_SWORD_ACTIVE_DRAIN, drain); } + public double getStaticDropOfActivatedSword(ItemStack stack) + { + NBTHelper.checkNBT(stack); + + NBTTagCompound tag = stack.getTagCompound(); + return tag.getDouble(Constants.NBT.SOUL_SWORD_STATIC_DROP); + } + + public void setStaticDropOfActivatedSword(ItemStack stack, double drop) + { + NBTHelper.checkNBT(stack); + + NBTTagCompound tag = stack.getTagCompound(); + + tag.setDouble(Constants.NBT.SOUL_SWORD_STATIC_DROP, drop); + } + + public double getDropOfActivatedSword(ItemStack stack) + { + NBTHelper.checkNBT(stack); + + NBTTagCompound tag = stack.getTagCompound(); + return tag.getDouble(Constants.NBT.SOUL_SWORD_DROP); + } + + public void setDropOfActivatedSword(ItemStack stack, double drop) + { + NBTHelper.checkNBT(stack); + + NBTTagCompound tag = stack.getTagCompound(); + + tag.setDouble(Constants.NBT.SOUL_SWORD_DROP, drop); + } + @Override public Multimap getAttributeModifiers(ItemStack stack) {