Added Soft Fall and Strong Legs living armour upgrades.
This commit is contained in:
parent
f9bf63ccf1
commit
96ecd73286
14 changed files with 392 additions and 17 deletions
|
@ -1,17 +1,16 @@
|
|||
package WayofTime.bloodmagic.livingArmour.upgrade;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
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.Constants;
|
||||
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.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class LivingArmourUpgradeDigging extends LivingArmourUpgrade
|
||||
{
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
package WayofTime.bloodmagic.livingArmour.upgrade;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
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[] { 5, 10, 18, 35, 65, 100, 160, 220, 280, 350 };
|
||||
public static final double[] protectionLevel = new double[] { 0.2, 0.4, 0.6, 0.8, 1 };
|
||||
|
||||
public LivingArmourUpgradeFallProtect(int level)
|
||||
{
|
||||
super(level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
|
||||
{
|
||||
if (source.equals(DamageSource.fall))
|
||||
{
|
||||
return protectionLevel[this.level];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUniqueIdentifier()
|
||||
{
|
||||
return Constants.Mod.MODID + ".upgrade.fallProtect";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxTier()
|
||||
{
|
||||
return 5; // Set to here until I can add more upgrades to it.
|
||||
}
|
||||
|
||||
@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 + "fallProtect";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package WayofTime.bloodmagic.livingArmour.upgrade;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class LivingArmourUpgradeJump extends LivingArmourUpgrade
|
||||
{
|
||||
public static final int[] costs = new int[] { 7, 13, 22, 40, 65, 90, 130, 180, 250, 350 };
|
||||
public static final double[] jumpModifier = new double[] { 0.15, 0.3, 0.45, 0.6, 0.75, 0.9, 1.05, 1.2, 1.35, 1.5 };
|
||||
|
||||
public LivingArmourUpgradeJump(int level)
|
||||
{
|
||||
super(level);
|
||||
}
|
||||
|
||||
public double getJumpModifier()
|
||||
{
|
||||
return jumpModifier[this.level];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUniqueIdentifier()
|
||||
{
|
||||
return Constants.Mod.MODID + ".upgrade.jump";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxTier()
|
||||
{
|
||||
return 10; // Set to here until I can add more upgrades to it.
|
||||
}
|
||||
|
||||
@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 + "jump";
|
||||
}
|
||||
}
|
|
@ -19,7 +19,7 @@ public class LivingArmourUpgradePhysicalProtect extends LivingArmourUpgrade
|
|||
@Override
|
||||
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
|
||||
{
|
||||
if (source.getEntity() != null)
|
||||
if (source.getEntity() != null && !source.isMagicDamage() && !source.isProjectile())
|
||||
{
|
||||
return protectionLevel[this.level];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue