Finished the Dulled Blade downgrade

This commit is contained in:
WayofTime 2016-09-27 21:10:09 -04:00
parent 8d2ea249ac
commit 1a510c694c
4 changed files with 83 additions and 2 deletions

View file

@ -0,0 +1,77 @@
package WayofTime.bloodmagic.livingArmour.downgrade;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import java.util.UUID;
public class LivingArmourUpgradeMeleeDecrease extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { -10, -17, -28, -42, -60, -80, -100, -125, -160, -200 };
public static final double[] meleeDamage = new double[] { -0.1, -0.2, -0.25, -0.3, -0.35, -0.4, -0.5, -0.6, -0.7, -0.8 };
public LivingArmourUpgradeMeleeDecrease(int level)
{
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
}
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers()
{
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0271023, 5321), "damage modifier" + 2, meleeDamage[this.level], 1));
return modifierMap;
}
@Override
public String getUniqueIdentifier()
{
return Constants.Mod.MODID + ".upgrade.meleeDecrease";
}
@Override
public int getMaxTier()
{
return 10;
}
@Override
public int getCostOfUpgrade()
{
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
// EMPTY
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
// EMPTY
}
@Override
public String getUnlocalizedName()
{
return tooltipBase + "meleeDecrease";
}
}

View file

@ -3,6 +3,7 @@ package WayofTime.bloodmagic.registry;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeCrippledArm;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeMeleeDecrease;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeQuenched;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeSlippery;
import WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeSlowness;
@ -93,11 +94,13 @@ public class ModArmourTrackers
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeCriticalStrike(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeElytra(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeFireResist(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeNightSight(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeSlowness(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeCrippledArm(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeNightSight(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeSlippery(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeBattleHungry(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeQuenched(0));
LivingArmourHandler.registerArmourUpgrade(new LivingArmourUpgradeMeleeDecrease(0));
}
}

View file

@ -61,7 +61,7 @@ public class LivingArmourHandler
}
}
if (event.getItemStack().getItemUseAction() == EnumAction.DRINK)
if (event.getItemStack() != null && event.getItemStack().getItemUseAction() == EnumAction.DRINK)
{
//TODO: See if the item is a splash potion? Those should be usable.
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.quenched", chestStack);

View file

@ -493,6 +493,7 @@ tooltip.BloodMagic.livingArmour.upgrade.crippledArm=Crippled Arm
tooltip.BloodMagic.livingArmour.upgrade.slippery=Loose Traction
tooltip.BloodMagic.livingArmour.upgrade.battleHunger=Battle Hungry
tooltip.BloodMagic.livingArmour.upgrade.quenched=Quenched
tooltip.BloodMagic.livingArmour.upgrade.meleeDecrease=Dulled Blade
tooltip.BloodMagic.livingArmour.upgrade.level=%s (Level %d)
tooltip.BloodMagic.livingArmour.upgrade.progress=%s (%d/100)
tooltip.BloodMagic.livingArmour.upgrade.points=&6Upgrade points: %s / %s