Added damage boost and attack speed penalty for the Destructive sentient armour

This commit is contained in:
WayofTime 2016-03-31 12:37:39 -04:00
parent d7191d9f2e
commit b1a532950d
3 changed files with 76 additions and 3 deletions

View file

@ -260,7 +260,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
@Override @Override
public String getUnlocalizedName(ItemStack stack) public String getUnlocalizedName(ItemStack stack)
{ {
return super.getUnlocalizedName(stack) + names[armorType.getIndex()]; return super.getUnlocalizedName(stack) + names[3 - armorType.getIndex()];
} }
@Override @Override

View file

@ -47,8 +47,11 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
public static double[] extraProtectionLevel = new double[] { 0, 0.25, 0.5, 0.6, 0.7, 0.75, 0.85, 0.9 }; public static double[] extraProtectionLevel = new double[] { 0, 0.25, 0.5, 0.6, 0.7, 0.75, 0.85, 0.9 };
public static double[] steadfastProtectionLevel = new double[] { 0.25, 0.5, 0.6, 0.7, 0.75, 0.85, 0.9, 0.95 }; public static double[] steadfastProtectionLevel = new double[] { 0.25, 0.5, 0.6, 0.7, 0.75, 0.85, 0.9, 0.95 };
public static double[] healthBonus = new double[] { 3, 6, 9, 12, 15, 20, 25 }; public static double[] healthBonus = new double[] { 3, 6, 9, 12, 15, 20, 25, 30 };
public static double[] knockbackBonus = new double[] { 0.2, 0.4, 0.6, 0.8, 1, 1, 1 }; public static double[] knockbackBonus = new double[] { 0.2, 0.4, 0.6, 0.8, 1, 1, 1, 1 };
public static double[] damageBoost = new double[] { 0.03, 0.06, 0.09, 0.12, 0.15, 0.18, 0.22, 0.25 };
public static double[] attackSpeed = new double[] { -0.02, -0.04, -0.06, -0.08, -0.1, -0.12, -0.14, -0.16 };
public static double[] speedBonus = new double[] { 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4 }; public static double[] speedBonus = new double[] { 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4 };
@ -374,6 +377,8 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 318145), "Armor modifier", this.getHealthBonus(stack), 0)); multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 318145), "Armor modifier", this.getHealthBonus(stack), 0));
multimap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 8145), "Armor modifier", this.getKnockbackResistance(stack), 0)); multimap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 8145), "Armor modifier", this.getKnockbackResistance(stack), 0));
multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 94021), "Armor modifier", this.getSpeedBoost(stack), 2)); multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 94021), "Armor modifier", this.getSpeedBoost(stack), 2));
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 96721), "Armor modifier", this.getDamageBoost(stack), 2));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 73245), "Armor modifier", this.getAttackSpeedBoost(stack), 2));
} }
return multimap; return multimap;
} }
@ -503,6 +508,8 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
this.setHealthBonus(armourStack, this.getHealthModifier(type, willBracket)); this.setHealthBonus(armourStack, this.getHealthModifier(type, willBracket));
this.setKnockbackResistance(armourStack, getKnockbackModifier(type, willBracket)); this.setKnockbackResistance(armourStack, getKnockbackModifier(type, willBracket));
this.setSpeedBoost(armourStack, getSpeedModifier(type, willBracket)); this.setSpeedBoost(armourStack, getSpeedModifier(type, willBracket));
this.setDamageBoost(armourStack, getDamageModifier(type, willBracket));
this.setAttackSpeedBoost(armourStack, getAttackSpeedModifier(type, willBracket));
} }
} }
} }
@ -551,6 +558,28 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
} }
} }
public double getDamageModifier(EnumDemonWillType type, int willBracket)
{
switch (type)
{
case DESTRUCTIVE:
return damageBoost[willBracket];
default:
return 0;
}
}
public double getAttackSpeedModifier(EnumDemonWillType type, int willBracket)
{
switch (type)
{
case DESTRUCTIVE:
return attackSpeed[willBracket];
default:
return 0;
}
}
public static boolean canSustainArmour(EnumDemonWillType type, double willValue) public static boolean canSustainArmour(EnumDemonWillType type, double willValue)
{ {
return getWillBracket(willValue) >= 0; return getWillBracket(willValue) >= 0;
@ -621,4 +650,38 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
tag.setDouble("speed", speed); tag.setDouble("speed", speed);
} }
public double getDamageBoost(ItemStack stack)
{
NBTHelper.checkNBT(stack);
NBTTagCompound tag = stack.getTagCompound();
return tag.getDouble("damage");
}
public void setDamageBoost(ItemStack stack, double damage)
{
NBTHelper.checkNBT(stack);
NBTTagCompound tag = stack.getTagCompound();
tag.setDouble("damage", damage);
}
public double getAttackSpeedBoost(ItemStack stack)
{
NBTHelper.checkNBT(stack);
NBTTagCompound tag = stack.getTagCompound();
return tag.getDouble("attackSpeed");
}
public void setAttackSpeedBoost(ItemStack stack, double attackSpeed)
{
NBTHelper.checkNBT(stack);
NBTTagCompound tag = stack.getTagCompound();
tag.setDouble("attackSpeed", attackSpeed);
}
} }

View file

@ -258,6 +258,16 @@ public class ItemSoulGem extends Item implements IDemonWillGem, IMeshProvider, I
NBTTagCompound tag = soulGemStack.getTagCompound(); NBTTagCompound tag = soulGemStack.getTagCompound();
if (type == EnumDemonWillType.DEFAULT)
{
if (tag.hasKey(Constants.NBT.WILL_TYPE))
{
tag.removeTag(Constants.NBT.WILL_TYPE);
}
return;
}
tag.setString(Constants.NBT.WILL_TYPE, type.toString()); tag.setString(Constants.NBT.WILL_TYPE, type.toString());
} }