From 58ca46b6bd7e7d61ab998ec43f210d165dc4f4eb Mon Sep 17 00:00:00 2001 From: WayofTime Date: Fri, 30 Mar 2018 18:03:31 -0400 Subject: [PATCH] Disabled the added Health in the "Quick Feet" upgrade. --- changelog.txt | 2 + .../upgrade/LivingArmourUpgradeSpeed.java | 62 ++++++++++++------- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/changelog.txt b/changelog.txt index f385a646..beacb676 100644 --- a/changelog.txt +++ b/changelog.txt @@ -13,6 +13,8 @@ Version 2.2.8 - Increased the max number of items transferable by the Master Routing Node in its system to 64 per second. Will revisit this limit if I figure out a less silly upgrade system. - Added additional effects to the Sentient Bow when aspected to different Will types. - Added in book entries for the Teleport Array and the Turret Array. +- Fixed the Haste sigil and "Quick Feet" so that they work with MC's new movement method. +- Removed added health from "Quick Feet" - seriously, why was this a thing? ------------------------------------------------------ Version 2.2.7 diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java index 446decfb..d0392eec 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java @@ -16,76 +16,90 @@ import org.apache.commons.codec.binary.StringUtils; import java.util.UUID; -public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade { - public static final int[] costs = new int[]{3, 7, 13, 26, 42, 60, 90, 130, 180, 250}; - public static final double[] speedModifier = new double[]{0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5}; - public static final int[] sprintSpeedTime = new int[]{0, 0, 0, 0, 0, 20, 60, 60, 100, 200}; - public static final int[] sprintSpeedLevel = new int[]{0, 0, 0, 0, 0, 0, 0, 1, 1, 2}; - public static final int[] healthModifier = new int[]{0, 0, 0, 0, 0, 0, 0, 4, 10, 20}; - public static final int[] sprintRegenTime = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 25}; +public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade +{ + public static final int[] costs = new int[] { 3, 7, 13, 26, 42, 60, 90, 130, 180, 250 }; + public static final double[] speedModifier = new double[] { 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5 }; + public static final int[] sprintSpeedTime = new int[] { 0, 0, 0, 0, 0, 20, 60, 60, 100, 200 }; + public static final int[] sprintSpeedLevel = new int[] { 0, 0, 0, 0, 0, 0, 0, 1, 1, 2 }; + public static final int[] healthModifier = new int[] { 0, 0, 0, 0, 0, 0, 0, 4, 10, 20 }; + public static final int[] sprintRegenTime = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 25 }; - public LivingArmourUpgradeSpeed(int level) { + public LivingArmourUpgradeSpeed(int level) + { super(level); } - public double getSpeedModifier() { + public double getSpeedModifier() + { return speedModifier[this.level]; } @Override - public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) { - if (player.isSprinting()) { - if (sprintSpeedTime[this.level] > 0) { + public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) + { + if (player.isSprinting()) + { + if (sprintSpeedTime[this.level] > 0) + { player.addPotionEffect(new PotionEffect(MobEffects.SPEED, sprintSpeedTime[this.level], sprintSpeedLevel[this.level], false, false)); } - if (sprintRegenTime[this.level] > 0 && !player.isPotionActive(MobEffects.REGENERATION)) { + if (sprintRegenTime[this.level] > 0 && !player.isPotionActive(MobEffects.REGENERATION)) + { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, sprintRegenTime[this.level], 0, false, false)); } } } @Override - public Multimap getAttributeModifiers() { + public Multimap getAttributeModifiers() + { Multimap modifierMap = HashMultimap.create(); // modifierMap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, 1), "Speed modifier" + 1, speedModifier[this.level], 1)); - if (healthModifier[this.level] > 0) { - String name = getUniqueIdentifier() + "-HealthModifier1"; - modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "HealthModifier1", healthModifier[this.level], 0)); - } +// if (healthModifier[this.level] > 0) { +// String name = getUniqueIdentifier() + "-HealthModifier1"; +// modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "HealthModifier1", healthModifier[this.level], 0)); +// } return modifierMap; } @Override - public String getUniqueIdentifier() { + public String getUniqueIdentifier() + { return BloodMagic.MODID + ".upgrade.movement"; } @Override - public int getMaxTier() { + public int getMaxTier() + { return 10; } @Override - public int getCostOfUpgrade() { + public int getCostOfUpgrade() + { return costs[this.level]; } @Override - public void writeToNBT(NBTTagCompound tag) { + public void writeToNBT(NBTTagCompound tag) + { // EMPTY } @Override - public void readFromNBT(NBTTagCompound tag) { + public void readFromNBT(NBTTagCompound tag) + { // EMPTY } @Override - public String getUnlocalizedName() { + public String getUnlocalizedName() + { return tooltipBase + "speed"; } }