Run formatter

This commit is contained in:
Nicholas Ignoffo 2017-08-15 21:30:48 -07:00
parent 61c44a831b
commit 08258fd6ef
606 changed files with 13464 additions and 22975 deletions

View file

@ -1,26 +1,22 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeArrowProtect extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 4, 9, 16, 30, 60, 90, 125, 165, 210, 250 };
public static final double[] protectionLevel = new double[] { 0.1, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.77, 0.80, 0.83 };
public class LivingArmourUpgradeArrowProtect extends LivingArmourUpgrade {
public static final int[] costs = new int[]{4, 9, 16, 30, 60, 90, 125, 165, 210, 250};
public static final double[] protectionLevel = new double[]{0.1, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.77, 0.80, 0.83};
public LivingArmourUpgradeArrowProtect(int level)
{
public LivingArmourUpgradeArrowProtect(int level) {
super(level);
}
@Override
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
{
if (source.isProjectile())
{
public double getArmourProtection(EntityLivingBase wearer, DamageSource source) {
if (source.isProjectile()) {
return protectionLevel[this.level];
}
@ -28,38 +24,32 @@ public class LivingArmourUpgradeArrowProtect extends LivingArmourUpgrade
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.arrowProtect";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 10; // Set to here until I can add more upgrades to it.
}
@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 + "arrowProtect";
}
}

View file

@ -7,60 +7,50 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class LivingArmourUpgradeArrowShot extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 20, 50, 90, 160, 290 };
public static final int[] extraArrow = new int[] { 1, 2, 3, 4, 5 };
public class LivingArmourUpgradeArrowShot extends LivingArmourUpgrade {
public static final int[] costs = new int[]{20, 50, 90, 160, 290};
public static final int[] extraArrow = new int[]{1, 2, 3, 4, 5};
public LivingArmourUpgradeArrowShot(int level)
{
public LivingArmourUpgradeArrowShot(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.arrowShot";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 5; // Set to here until I can add more upgrades to it.
}
@Override
public int getCostOfUpgrade()
{
public int getCostOfUpgrade() {
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
public void writeToNBT(NBTTagCompound tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
public void readFromNBT(NBTTagCompound tag) {
}
@Override
public String getUnlocalizedName()
{
public String getUnlocalizedName() {
return tooltipBase + "arrowShot";
}
public int getExtraArrows()
{
public int getExtraArrows() {
return extraArrow[this.level];
}
}

View file

@ -1,74 +1,63 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeCriticalStrike extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 5, 12, 22, 35, 49 };
public static final double[] damageBoost = new double[] { 0.1, 0.2, 0.3, 0.4, 0.5 };
public class LivingArmourUpgradeCriticalStrike extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 12, 22, 35, 49};
public static final double[] damageBoost = new double[]{0.1, 0.2, 0.3, 0.4, 0.5};
public LivingArmourUpgradeCriticalStrike(int level)
{
public LivingArmourUpgradeCriticalStrike(int level) {
super(level);
}
@Override
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon)
{
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon) {
boolean flag = wearer.fallDistance > 0.0F && !wearer.onGround && !wearer.isOnLadder() && !wearer.isInWater() && !wearer.isPotionActive(MobEffects.BLINDNESS) && !wearer.isRiding() && !wearer.isSprinting();
if (flag)
{
if (flag) {
return getDamageModifier() * damage;
}
return 0;
}
public double getDamageModifier()
{
public double getDamageModifier() {
return damageBoost[this.level];
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.criticalStrike";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 5;
}
@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 + "criticalStrike";
}
}

View file

@ -1,90 +1,75 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import java.util.HashMap;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.livingArmour.LivingArmour;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.livingArmour.LivingArmour;
public class LivingArmourUpgradeDigging extends LivingArmourUpgrade
{
import java.util.HashMap;
public class LivingArmourUpgradeDigging extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 10, 18, 32, 60, 90, 140, 180, 240, 300};
public static final int[] digSpeedTime = new int[]{0, 50, 60, 100, 100, 100, 100, 150, 150, 150};
public static final int[] digSpeedLevel = new int[]{0, 0, 0, 1, 1, 1, 1, 1, 2, 2};
public static final double[] digSpeedModifier = new double[]{1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 2, 2.2, 2.5};
public static HashMap<ILivingArmour, Boolean> changeMap = new HashMap<ILivingArmour, Boolean>();
public static final int[] costs = new int[] { 5, 10, 18, 32, 60, 90, 140, 180, 240, 300 };
public static final int[] digSpeedTime = new int[] { 0, 50, 60, 100, 100, 100, 100, 150, 150, 150 };
public static final int[] digSpeedLevel = new int[] { 0, 0, 0, 1, 1, 1, 1, 1, 2, 2 };
public static final double[] digSpeedModifier = new double[] { 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 2, 2.2, 2.5 };
public static void hasDug(LivingArmour armour)
{
changeMap.put(armour, true);
}
public LivingArmourUpgradeDigging(int level)
{
public LivingArmourUpgradeDigging(int level) {
super(level);
}
@Override
public double getMiningSpeedModifier(EntityPlayer player)
{
public double getMiningSpeedModifier(EntityPlayer player) {
return digSpeedModifier[this.level];
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
if (changeMap.containsKey(livingArmour) && changeMap.get(livingArmour))
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
if (changeMap.containsKey(livingArmour) && changeMap.get(livingArmour)) {
changeMap.put(livingArmour, false);
if (digSpeedTime[this.level] > 0)
{
if (digSpeedTime[this.level] > 0) {
player.addPotionEffect(new PotionEffect(MobEffects.SPEED, digSpeedTime[this.level], digSpeedLevel[this.level], false, false));
}
}
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.digging";
}
@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 + "digging";
}
public static void hasDug(LivingArmour armour) {
changeMap.put(armour, true);
}
}

View file

@ -7,54 +7,45 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class LivingArmourUpgradeElytra extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 20 };
public class LivingArmourUpgradeElytra extends LivingArmourUpgrade {
public static final int[] costs = new int[]{20};
public LivingArmourUpgradeElytra(int level)
{
public LivingArmourUpgradeElytra(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.elytra";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 1; // Set to here until I can add more upgrades to it.
}
@Override
public int getCostOfUpgrade()
{
public int getCostOfUpgrade() {
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
public void writeToNBT(NBTTagCompound tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
public void readFromNBT(NBTTagCompound tag) {
}
@Override
public String getUnlocalizedName()
{
public String getUnlocalizedName() {
return tooltipBase + "elytra";
}
}

View file

@ -4,54 +4,45 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.nbt.NBTTagCompound;
public class LivingArmourUpgradeExperience extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 7, 13, 22, 40, 65, 90, 130, 180, 250, 350 };
public static final double[] experienceModifier = new double[] { 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05, 1.2, 1.35, 1.5 };
public class LivingArmourUpgradeExperience extends LivingArmourUpgrade {
public static final int[] costs = new int[]{7, 13, 22, 40, 65, 90, 130, 180, 250, 350};
public static final double[] experienceModifier = new double[]{0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05, 1.2, 1.35, 1.5};
public LivingArmourUpgradeExperience(int level)
{
public LivingArmourUpgradeExperience(int level) {
super(level);
}
public double getExperienceModifier()
{
public double getExperienceModifier() {
return experienceModifier[this.level];
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.experienced";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 10; // Set to here until I can add more upgrades to it.
}
@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 + "experienced";
}
}

View file

@ -6,21 +6,17 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
public class LivingArmourUpgradeFallProtect extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 2, 5, 9, 15, 25 };
public static final double[] protectionLevel = new double[] { 0.2, 0.4, 0.6, 0.8, 1 };
public class LivingArmourUpgradeFallProtect extends LivingArmourUpgrade {
public static final int[] costs = new int[]{2, 5, 9, 15, 25};
public static final double[] protectionLevel = new double[]{0.2, 0.4, 0.6, 0.8, 1};
public LivingArmourUpgradeFallProtect(int level)
{
public LivingArmourUpgradeFallProtect(int level) {
super(level);
}
@Override
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
{
if (source.equals(DamageSource.FALL))
{
public double getArmourProtection(EntityLivingBase wearer, DamageSource source) {
if (source.equals(DamageSource.FALL)) {
return protectionLevel[this.level];
}
@ -28,38 +24,32 @@ public class LivingArmourUpgradeFallProtect extends LivingArmourUpgrade
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.fallProtect";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 5; // Set to here until I can add more upgrades to it.
}
@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 + "fallProtect";
}
}

View file

@ -1,80 +1,69 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.util.helper.TextHelper;
public class LivingArmourUpgradeFireResist extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 2, 6, 14, 25, 40 };
public static final int[] fireCooldownTime = new int[] { 5 * 60 * 20, 5 * 60 * 20, 4 * 60 * 20, 3 * 60 * 20, 2 * 60 * 20 };
public static final int[] fireResistDuration = new int[] { 30 * 20, 30 * 20, 40 * 20, 50 * 20, 60 * 20 };
public class LivingArmourUpgradeFireResist extends LivingArmourUpgrade {
public static final int[] costs = new int[]{2, 6, 14, 25, 40};
public static final int[] fireCooldownTime = new int[]{5 * 60 * 20, 5 * 60 * 20, 4 * 60 * 20, 3 * 60 * 20, 2 * 60 * 20};
public static final int[] fireResistDuration = new int[]{30 * 20, 30 * 20, 40 * 20, 50 * 20, 60 * 20};
public int fireCooldown = 0;
public LivingArmourUpgradeFireResist(int level)
{
public LivingArmourUpgradeFireResist(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
if (player.isBurning() && fireCooldown <= 0)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
if (player.isBurning() && fireCooldown <= 0) {
player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, fireResistDuration[this.level]));
fireCooldown = fireCooldownTime[this.level];
player.sendStatusMessage(new TextComponentString(TextHelper.localizeEffect(chatBase + "fireRemove")), true);
} else if (fireCooldown > 0)
{
} else if (fireCooldown > 0) {
fireCooldown--;
}
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.fireResist";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 5; // Set to here until I can add more upgrades to it.
}
@Override
public int getCostOfUpgrade()
{
public int getCostOfUpgrade() {
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
public void writeToNBT(NBTTagCompound tag) {
tag.setInteger(Constants.NBT.UPGRADE_FIRE_TIMER, fireCooldown);
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
public void readFromNBT(NBTTagCompound tag) {
fireCooldown = tag.getInteger(Constants.NBT.UPGRADE_FIRE_TIMER);
}
@Override
public String getUnlocalizedName()
{
public String getUnlocalizedName() {
return tooltipBase + "fireResist";
}
}

View file

@ -1,72 +1,61 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeGraveDigger extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 5, 12, 20, 35, 49, 78, 110, 160, 215, 320 };
public static final double[] damageBoost = new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
public class LivingArmourUpgradeGraveDigger extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 12, 20, 35, 49, 78, 110, 160, 215, 320};
public static final double[] damageBoost = new double[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
public LivingArmourUpgradeGraveDigger(int level)
{
public LivingArmourUpgradeGraveDigger(int level) {
super(level);
}
@Override
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon)
{
if (!weapon.isEmpty() && weapon.getItem() instanceof ItemSpade)
{
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon) {
if (!weapon.isEmpty() && weapon.getItem() instanceof ItemSpade) {
return getDamageModifier();
}
return 0;
}
public double getDamageModifier()
{
public double getDamageModifier() {
return damageBoost[this.level];
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.graveDigger";
}
@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 + "graveDigger";
}
}

View file

@ -1,91 +1,78 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.util.helper.TextHelper;
public class LivingArmourUpgradeGrimReaperSprint extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 20, 50, 130, 270, 450, 580, 700, 800, 900, 1000 };
public static final int[] rebirthDelay = new int[] { 20 * 60 * 60, 20 * 60 * 50, 20 * 60 * 45, 20 * 60 * 40, 20 * 60 * 30, 20 * 60 * 25, 20 * 60 * 15, 20 * 60 * 10, 20 * 60 * 5, 20 * 60 };
public static final int[] strengthDuration = new int[] { 0, 0, 100, 100, 200, 200, 200, 300, 300, 400 };
public static final int[] strengthValue = new int[] { 0, 0, 0, 0, 0, 1, 1, 2, 2, 3 };
public static final int[] resistanceDuration = new int[] { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 };
public static final int[] resistanceValue = new int[] { 0, 0, 0, 0, 0, 1, 1, 2, 2, 3 };
public static final float[] healthOnRevive = new float[] { 0.2f, 0.2f, 0.3f, 0.3f, 0.4f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f };
public class LivingArmourUpgradeGrimReaperSprint extends LivingArmourUpgrade {
public static final int[] costs = new int[]{20, 50, 130, 270, 450, 580, 700, 800, 900, 1000};
public static final int[] rebirthDelay = new int[]{20 * 60 * 60, 20 * 60 * 50, 20 * 60 * 45, 20 * 60 * 40, 20 * 60 * 30, 20 * 60 * 25, 20 * 60 * 15, 20 * 60 * 10, 20 * 60 * 5, 20 * 60};
public static final int[] strengthDuration = new int[]{0, 0, 100, 100, 200, 200, 200, 300, 300, 400};
public static final int[] strengthValue = new int[]{0, 0, 0, 0, 0, 1, 1, 2, 2, 3};
public static final int[] resistanceDuration = new int[]{100, 100, 100, 100, 100, 100, 100, 100, 100, 100};
public static final int[] resistanceValue = new int[]{0, 0, 0, 0, 0, 1, 1, 2, 2, 3};
public static final float[] healthOnRevive = new float[]{0.2f, 0.2f, 0.3f, 0.3f, 0.4f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f};
public int deathTimer = 0;
public LivingArmourUpgradeGrimReaperSprint(int level)
{
public LivingArmourUpgradeGrimReaperSprint(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
if (deathTimer > 0)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
if (deathTimer > 0) {
deathTimer--;
}
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.grimReaper";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 10;
}
@Override
public int getCostOfUpgrade()
{
public int getCostOfUpgrade() {
return costs[this.level];
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
public void readFromNBT(NBTTagCompound tag) {
deathTimer = tag.getInteger(BloodMagic.MODID + ".tracker.grimReaper");
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
public void writeToNBT(NBTTagCompound tag) {
tag.setInteger(BloodMagic.MODID + ".tracker.grimReaper", deathTimer);
}
@Override
public String getUnlocalizedName()
{
public String getUnlocalizedName() {
return tooltipBase + "grimReaper";
}
public void applyEffectOnRebirth(EntityPlayer player)
{
public void applyEffectOnRebirth(EntityPlayer player) {
player.setHealth(player.getMaxHealth() * healthOnRevive[this.level]);
int strDur = strengthDuration[this.level];
if (strDur > 0)
{
if (strDur > 0) {
player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, strDur, strengthValue[this.level]));
}
int resDur = resistanceDuration[this.level];
if (resDur > 0)
{
if (resDur > 0) {
player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, resDur, resistanceValue[this.level]));
}
@ -93,8 +80,7 @@ public class LivingArmourUpgradeGrimReaperSprint extends LivingArmourUpgrade
player.sendStatusMessage(new TextComponentString(TextHelper.localizeEffect(chatBase + "grimReaper")), true);
}
public boolean canSavePlayer(EntityPlayer player)
{
public boolean canSavePlayer(EntityPlayer player) {
return deathTimer <= 0;
}
}

View file

@ -14,25 +14,21 @@ import org.apache.commons.codec.binary.StringUtils;
import java.util.UUID;
public class LivingArmourUpgradeHealthboost extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 5, 12, 20, 35, 49, 78, 110, 160, 215, 320 };
public static final int[] healthModifier = new int[] { 4, 8, 12, 16, 20, 26, 32, 38, 44, 50 };
public class LivingArmourUpgradeHealthboost extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 12, 20, 35, 49, 78, 110, 160, 215, 320};
public static final int[] healthModifier = new int[]{4, 8, 12, 16, 20, 26, 32, 38, 44, 50};
public LivingArmourUpgradeHealthboost(int level)
{
public LivingArmourUpgradeHealthboost(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
}
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers()
{
public Multimap<String, AttributeModifier> getAttributeModifiers() {
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
String name = getUniqueIdentifier() + "-HealthModifier1";
@ -42,38 +38,32 @@ public class LivingArmourUpgradeHealthboost extends LivingArmourUpgrade
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.health";
}
@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 + "health";
}
}

View file

@ -1,75 +1,63 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeJump extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 3, 6, 11, 23, 37, 50, 70, 100, 140, 200 };
public static final double[] jumpModifier = new double[] { 0.10, 0.2, 0.3, 0.4, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5 };
public static final double[] fallModifier = new double[] { 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.8, 0.85 };
public class LivingArmourUpgradeJump extends LivingArmourUpgrade {
public static final int[] costs = new int[]{3, 6, 11, 23, 37, 50, 70, 100, 140, 200};
public static final double[] jumpModifier = new double[]{0.10, 0.2, 0.3, 0.4, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5};
public static final double[] fallModifier = new double[]{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.8, 0.85};
public LivingArmourUpgradeJump(int level)
{
public LivingArmourUpgradeJump(int level) {
super(level);
}
public double getJumpModifier()
{
public double getJumpModifier() {
return jumpModifier[this.level];
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.jump";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 10; // Set to here until I can add more upgrades to it.
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
if (!world.isRemote)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
if (!world.isRemote) {
double motionY = player.motionY;
if (motionY < 0)
{
if (motionY < 0) {
player.fallDistance = (float) Math.max(0, player.fallDistance + motionY * fallModifier[this.level]);
}
}
}
@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 + "jump";
}
}

View file

@ -11,27 +11,23 @@ import org.apache.commons.codec.binary.StringUtils;
import java.util.UUID;
public class LivingArmourUpgradeKnockbackResist extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 3, 7, 13, 26, 42 };
public static final double[] kbModifier = new double[] { 0.2, 0.4, 0.6, 0.8, 1.0 };
public static final int[] healthModifier = new int[] { 0, 0, 0, 4, 10 };
public class LivingArmourUpgradeKnockbackResist extends LivingArmourUpgrade {
public static final int[] costs = new int[]{3, 7, 13, 26, 42};
public static final double[] kbModifier = new double[]{0.2, 0.4, 0.6, 0.8, 1.0};
public static final int[] healthModifier = new int[]{0, 0, 0, 4, 10};
public LivingArmourUpgradeKnockbackResist(int level)
{
public LivingArmourUpgradeKnockbackResist(int level) {
super(level);
}
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers()
{
public Multimap<String, AttributeModifier> getAttributeModifiers() {
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
String name = getUniqueIdentifier() + "-KnockbackModifier1";
modifierMap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "KnockbackModifier1", kbModifier[this.level], 0));
if (healthModifier[this.level] > 0)
{
if (healthModifier[this.level] > 0) {
name = getUniqueIdentifier() + "-HealthModifier1";
modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "HealthModifier1", healthModifier[this.level], 0));
}
@ -40,38 +36,32 @@ public class LivingArmourUpgradeKnockbackResist extends LivingArmourUpgrade
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.knockback";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 5;
}
@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 + "knockback";
}
}

View file

@ -14,25 +14,21 @@ import org.apache.commons.codec.binary.StringUtils;
import java.util.UUID;
public class LivingArmourUpgradeMeleeDamage extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 5, 12, 20, 35, 49, 78, 110, 160, 215, 320 };
public static final double[] meleeDamage = new double[] { 0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7 };
public class LivingArmourUpgradeMeleeDamage extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 12, 20, 35, 49, 78, 110, 160, 215, 320};
public static final double[] meleeDamage = new double[]{0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7};
public LivingArmourUpgradeMeleeDamage(int level)
{
public LivingArmourUpgradeMeleeDamage(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
}
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers()
{
public Multimap<String, AttributeModifier> getAttributeModifiers() {
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
String name = getUniqueIdentifier() + "-DamageModifier1";
@ -42,38 +38,32 @@ public class LivingArmourUpgradeMeleeDamage extends LivingArmourUpgrade
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.meleeDamage";
}
@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 + "meleeDamage";
}
}

View file

@ -1,6 +1,9 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
@ -8,84 +11,67 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeNightSight extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 5, 8, 15, 20, 34, 45, 70, 100, 150, 200 };
public static final double[] meleeDamage = new double[] { 0, 0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6 };
public class LivingArmourUpgradeNightSight extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 8, 15, 20, 34, 45, 70, 100, 150, 200};
public static final double[] meleeDamage = new double[]{0, 0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6};
public boolean isActive = false;
public LivingArmourUpgradeNightSight(int level)
{
public LivingArmourUpgradeNightSight(int level) {
super(level);
}
@Override
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon)
{
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon) {
return isActive ? meleeDamage[this.level] : 0;
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
if (world.getLight(player.getPosition()) <= 9)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
if (world.getLight(player.getPosition()) <= 9) {
isActive = true;
if (player.isPotionActive(MobEffects.NIGHT_VISION))
{
if (player.isPotionActive(MobEffects.NIGHT_VISION)) {
int dur = player.getActivePotionEffect(MobEffects.NIGHT_VISION).getDuration();
if (dur > 100 && dur < 20 * 60 * 20)
{
if (dur > 100 && dur < 20 * 60 * 20) {
//Don't override the potion effect if the other potion effect is sufficiently long.
return;
}
}
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, Constants.Misc.NIGHT_VISION_CONSTANT_BEGIN, 0, false, false));
} else
{
} else {
isActive = false;
}
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.nightSight";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 10; // Set to here until I can add more upgrades to it.
}
@Override
public int getCostOfUpgrade()
{
public int getCostOfUpgrade() {
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
public void writeToNBT(NBTTagCompound tag) {
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
public void readFromNBT(NBTTagCompound tag) {
}
@Override
public String getUnlocalizedName()
{
public String getUnlocalizedName() {
return tooltipBase + "nightSight";
}
}

View file

@ -6,21 +6,17 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
public class LivingArmourUpgradePhysicalProtect extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 5, 10, 18, 35, 65, 100, 140, 190, 250, 300 };
public static final double[] protectionLevel = new double[] { 0.1, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.77, 0.80, 0.83 };
public class LivingArmourUpgradePhysicalProtect extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 10, 18, 35, 65, 100, 140, 190, 250, 300};
public static final double[] protectionLevel = new double[]{0.1, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.77, 0.80, 0.83};
public LivingArmourUpgradePhysicalProtect(int level)
{
public LivingArmourUpgradePhysicalProtect(int level) {
super(level);
}
@Override
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
{
if (source.getTrueSource() != null && !source.isMagicDamage() && !source.isProjectile())
{
public double getArmourProtection(EntityLivingBase wearer, DamageSource source) {
if (source.getTrueSource() != null && !source.isMagicDamage() && !source.isProjectile()) {
return protectionLevel[this.level];
}
@ -28,38 +24,32 @@ public class LivingArmourUpgradePhysicalProtect extends LivingArmourUpgrade
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.physicalProtect";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 10; // Set to here until I can add more upgrades to it.
}
@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 + "physicalProtect";
}
}

View file

@ -1,82 +1,70 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.util.helper.TextHelper;
public class LivingArmourUpgradePoisonResist extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 2, 6, 14, 25, 40 };
public static final int[] poisonCooldownTime = new int[] { 1200, 800, 600, 300, 100 };
public static final int[] poisonMaxCure = new int[] { 0, 1, 2, 2, 3 };
public class LivingArmourUpgradePoisonResist extends LivingArmourUpgrade {
public static final int[] costs = new int[]{2, 6, 14, 25, 40};
public static final int[] poisonCooldownTime = new int[]{1200, 800, 600, 300, 100};
public static final int[] poisonMaxCure = new int[]{0, 1, 2, 2, 3};
public int poisonCooldown = 0;
public LivingArmourUpgradePoisonResist(int level)
{
public LivingArmourUpgradePoisonResist(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
if (player.isPotionActive(MobEffects.POISON) && poisonCooldown <= 0)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
if (player.isPotionActive(MobEffects.POISON) && poisonCooldown <= 0) {
PotionEffect eff = player.getActivePotionEffect(MobEffects.POISON);
if (eff.getAmplifier() <= poisonMaxCure[this.level])
{
if (eff.getAmplifier() <= poisonMaxCure[this.level]) {
player.removePotionEffect(MobEffects.POISON);
poisonCooldown = poisonCooldownTime[this.level];
player.sendStatusMessage(new TextComponentString(TextHelper.localize(chatBase + "poisonRemove")), true);
}
} else if (poisonCooldown > 0)
{
} else if (poisonCooldown > 0) {
poisonCooldown--;
}
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.poisonResist";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 5; // Set to here until I can add more upgrades to it.
}
@Override
public int getCostOfUpgrade()
{
public int getCostOfUpgrade() {
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
public void writeToNBT(NBTTagCompound tag) {
tag.setInteger(Constants.NBT.UPGRADE_POISON_TIMER, poisonCooldown);
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
public void readFromNBT(NBTTagCompound tag) {
poisonCooldown = tag.getInteger(Constants.NBT.UPGRADE_POISON_TIMER);
}
@Override
public String getUnlocalizedName()
{
public String getUnlocalizedName() {
return tooltipBase + "poisonResist";
}
}

View file

@ -1,87 +1,73 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeRepairing extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 15 };
public static final int[] repairDelay = new int[] { 200 };
public class LivingArmourUpgradeRepairing extends LivingArmourUpgrade {
public static final int[] costs = new int[]{15};
public static final int[] repairDelay = new int[]{200};
int maxRepair = 1;
int delay = 0;
public LivingArmourUpgradeRepairing(int level)
{
public LivingArmourUpgradeRepairing(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
if (delay <= 0)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
if (delay <= 0) {
delay = repairDelay[this.level];
EntityEquipmentSlot randomSlot = EntityEquipmentSlot.values()[2 + world.rand.nextInt(4)];
ItemStack repairStack = player.getItemStackFromSlot(randomSlot);
if (!repairStack.isEmpty())
{
if (repairStack.isItemStackDamageable() && repairStack.isItemDamaged())
{
if (!repairStack.isEmpty()) {
if (repairStack.isItemStackDamageable() && repairStack.isItemDamaged()) {
int toRepair = Math.min(maxRepair, repairStack.getItemDamage());
if (toRepair > 0)
{
if (toRepair > 0) {
repairStack.setItemDamage(repairStack.getItemDamage() - toRepair);
}
}
}
} else
{
} else {
delay--;
}
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.repair";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 1; // Set to here until I can add more upgrades to it.
}
@Override
public int getCostOfUpgrade()
{
public int getCostOfUpgrade() {
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
public void writeToNBT(NBTTagCompound tag) {
tag.setInteger("repairingDelay", delay);
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
public void readFromNBT(NBTTagCompound tag) {
delay = tag.getInteger("repairingDelay");
}
@Override
public String getUnlocalizedName()
{
public String getUnlocalizedName() {
return tooltipBase + "repair";
}
}

View file

@ -4,55 +4,46 @@ import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.nbt.NBTTagCompound;
public class LivingArmourUpgradeSelfSacrifice extends LivingArmourUpgrade
{
public class LivingArmourUpgradeSelfSacrifice extends LivingArmourUpgrade {
//TODO: Add extra effects for higher levels
public static final int[] costs = new int[] { 7, 13, 22, 40, 65, 90, 130, 180, 250, 350 };
public static final double[] sacrificeModifier = new double[] { 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05, 1.2, 1.35, 1.5 };
public static final int[] costs = new int[]{7, 13, 22, 40, 65, 90, 130, 180, 250, 350};
public static final double[] sacrificeModifier = new double[]{0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05, 1.2, 1.35, 1.5};
public LivingArmourUpgradeSelfSacrifice(int level)
{
public LivingArmourUpgradeSelfSacrifice(int level) {
super(level);
}
public double getSacrificeModifier()
{
public double getSacrificeModifier() {
return sacrificeModifier[this.level];
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.selfSacrifice";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 10; // Set to here until I can add more upgrades to it.
}
@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 + "selfSacrifice";
}
}

View file

@ -1,6 +1,8 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
@ -8,29 +10,23 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeSolarPowered extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 5, 12, 20, 35, 49, 78, 110, 160, 215, 320 };
public static final int[] regenCooldown = new int[] { 200, 180, 160, 120, 100, 80, 40, 20, 10, 10 };
public static final int[] fireResistCooldown = new int[] { 1, 1, 60 * 60, 50 * 60, 40 * 60, 35 * 60, 30 * 60, 25 * 60, 20 * 60, 10 * 60 };
public static final int[] fireResistTime = new int[] { 0, 0, 15 * 60, 20 * 60, 30 * 60, 35 * 60, 40 * 60, 50 * 60, 60 * 60, 100 * 60 };
public static final double[] protectionLevel = new double[] { 0.02, 0.04, 0.06, 0.08, 0.10, 0.13, 0.16, 0.19, 0.22, 0.25 };
public class LivingArmourUpgradeSolarPowered extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 12, 20, 35, 49, 78, 110, 160, 215, 320};
public static final int[] regenCooldown = new int[]{200, 180, 160, 120, 100, 80, 40, 20, 10, 10};
public static final int[] fireResistCooldown = new int[]{1, 1, 60 * 60, 50 * 60, 40 * 60, 35 * 60, 30 * 60, 25 * 60, 20 * 60, 10 * 60};
public static final int[] fireResistTime = new int[]{0, 0, 15 * 60, 20 * 60, 30 * 60, 35 * 60, 40 * 60, 50 * 60, 60 * 60, 100 * 60};
public static final double[] protectionLevel = new double[]{0.02, 0.04, 0.06, 0.08, 0.10, 0.13, 0.16, 0.19, 0.22, 0.25};
public int counter = 0;
public LivingArmourUpgradeSolarPowered(int level)
{
public LivingArmourUpgradeSolarPowered(int level) {
super(level);
}
@Override
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
{
if (wearer.getEntityWorld().canSeeSky(wearer.getPosition()) || wearer.getEntityWorld().provider.isDaytime())
{
public double getArmourProtection(EntityLivingBase wearer, DamageSource source) {
if (wearer.getEntityWorld().canSeeSky(wearer.getPosition()) || wearer.getEntityWorld().provider.isDaytime()) {
return protectionLevel[this.level];
}
@ -38,56 +34,46 @@ public class LivingArmourUpgradeSolarPowered extends LivingArmourUpgrade
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
{
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
counter++;
if (world.canSeeSky(player.getPosition()) || world.provider.isDaytime())
{
if (counter % regenCooldown[this.level] == 0 && player.getHealth() < player.getMaxHealth())
{
if (world.canSeeSky(player.getPosition()) || world.provider.isDaytime()) {
if (counter % regenCooldown[this.level] == 0 && player.getHealth() < player.getMaxHealth()) {
player.heal(1);
}
if (fireResistTime[this.level] != 0 && counter % fireResistCooldown[this.level] == 0)
{
if (fireResistTime[this.level] != 0 && counter % fireResistCooldown[this.level] == 0) {
player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, fireResistTime[this.level], 0, false, false));
}
}
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.solarPowered";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 10; // Set to here until I can add more upgrades to it.
}
@Override
public int getCostOfUpgrade()
{
public int getCostOfUpgrade() {
return costs[this.level];
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
public void writeToNBT(NBTTagCompound tag) {
tag.setInteger(BloodMagic.MODID + ".tracker.solarPowered", counter);
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
public void readFromNBT(NBTTagCompound tag) {
counter = tag.getInteger(BloodMagic.MODID + ".tracker.solarPowered");
}
@Override
public String getUnlocalizedName()
{
public String getUnlocalizedName() {
return tooltipBase + "solarPowered";
}
}

View file

@ -1,8 +1,10 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import java.util.UUID;
import WayofTime.bloodmagic.BloodMagic;
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;
@ -10,58 +12,46 @@ import net.minecraft.init.MobEffects;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
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 org.apache.commons.codec.binary.StringUtils;
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 };
import java.util.UUID;
public LivingArmourUpgradeSpeed(int level)
{
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) {
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<String, AttributeModifier> getAttributeModifiers()
{
public Multimap<String, AttributeModifier> getAttributeModifiers() {
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
// modifierMap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, 1), "Speed modifier" + 1, speedModifier[this.level], 1));
if (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));
}
@ -70,38 +60,32 @@ public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade
}
@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";
}
}

View file

@ -1,28 +1,24 @@
package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
public class LivingArmourUpgradeSprintAttack extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 3, 7, 15, 25, 40 };
public static final double[] damageBoost = new double[] { 0.5, 0.75, 1, 1.25, 1.5 };
public static final double[] knockbackModifier = new double[] { 1, 2, 3, 4, 5 };
public class LivingArmourUpgradeSprintAttack extends LivingArmourUpgrade {
public static final int[] costs = new int[]{3, 7, 15, 25, 40};
public static final double[] damageBoost = new double[]{0.5, 0.75, 1, 1.25, 1.5};
public static final double[] knockbackModifier = new double[]{1, 2, 3, 4, 5};
public LivingArmourUpgradeSprintAttack(int level)
{
public LivingArmourUpgradeSprintAttack(int level) {
super(level);
}
@Override
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon)
{
if (wearer.isSprinting())
{
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon) {
if (wearer.isSprinting()) {
return getDamageModifier();
}
@ -30,59 +26,49 @@ public class LivingArmourUpgradeSprintAttack extends LivingArmourUpgrade
}
@Override
public double getKnockbackOnHit(EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon)
{
if (wearer.isSprinting())
{
public double getKnockbackOnHit(EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon) {
if (wearer.isSprinting()) {
return getKnockbackModifier();
}
return 0;
}
public double getDamageModifier()
{
public double getDamageModifier() {
return damageBoost[this.level];
}
public double getKnockbackModifier()
{
public double getKnockbackModifier() {
return knockbackModifier[this.level];
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.sprintAttack";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 5;
}
@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 + "sprintAttack";
}
}

View file

@ -5,10 +5,9 @@ import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import net.minecraft.nbt.NBTTagCompound;
public class LivingArmourUpgradeStepAssist extends LivingArmourUpgrade
{
public static final int[] costs = new int[] { 20 };
public static final float[] assist = new float[] { Constants.Misc.ALTERED_STEP_HEIGHT };
public class LivingArmourUpgradeStepAssist extends LivingArmourUpgrade {
public static final int[] costs = new int[]{20};
public static final float[] assist = new float[]{Constants.Misc.ALTERED_STEP_HEIGHT};
// 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 };
@ -16,49 +15,41 @@ public class LivingArmourUpgradeStepAssist extends LivingArmourUpgrade
// 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 LivingArmourUpgradeStepAssist(int level)
{
public LivingArmourUpgradeStepAssist(int level) {
super(level);
}
@Override
public String getUniqueIdentifier()
{
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.stepAssist";
}
@Override
public int getMaxTier()
{
public int getMaxTier() {
return 1;
}
@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 + "stepAssist";
}
public float getStepAssist()
{
public float getStepAssist() {
return assist[this.level];
}
}