Tweaked Sentient Sword will drop rate

This commit is contained in:
WayofTime 2016-01-10 08:37:26 -05:00
parent 1857f8785b
commit ebdc069563
3 changed files with 50 additions and 4 deletions

View file

@ -1,3 +1,9 @@
------------------------------------------------------
Version 2.0.0-5
------------------------------------------------------
- Tweaked Sentient Sword's will drop rate
------------------------------------------------------
Version 2.0.0-4
------------------------------------------------------

View file

@ -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";

View file

@ -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<String, AttributeModifier> getAttributeModifiers(ItemStack stack)
{