2016-07-03 16:34:40 +00:00
|
|
|
package WayofTime.bloodmagic.livingArmour.downgrade;
|
2016-06-27 19:07:00 +00:00
|
|
|
|
2016-10-02 19:03:31 +00:00
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
import net.minecraft.entity.SharedMonsterAttributes;
|
|
|
|
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
2016-06-27 19:07:00 +00:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.api.livingArmour.ILivingArmour;
|
|
|
|
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
|
|
|
|
2016-10-02 19:03:31 +00:00
|
|
|
import com.google.common.collect.HashMultimap;
|
|
|
|
import com.google.common.collect.Multimap;
|
|
|
|
|
2016-06-27 19:07:00 +00:00
|
|
|
public class LivingArmourUpgradeSlowness extends LivingArmourUpgrade
|
|
|
|
{
|
2016-10-02 19:03:31 +00:00
|
|
|
public static final int[] costs = new int[] { -10, -17, -23, -35, -48, -60, -80, -110, -160, -200 };
|
|
|
|
public static final double[] speedModifier = new double[] { -0.1, -0.2, -0.3, -0.4, -0.45, -0.5, -0.55, -0.6, -0.65, -0.7 };
|
2016-06-27 19:07:00 +00:00
|
|
|
|
|
|
|
public LivingArmourUpgradeSlowness(int level)
|
|
|
|
{
|
|
|
|
super(level);
|
|
|
|
}
|
|
|
|
|
2016-10-02 19:03:31 +00:00
|
|
|
@Override
|
|
|
|
public Multimap<String, AttributeModifier> getAttributeModifiers()
|
|
|
|
{
|
|
|
|
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
|
|
|
|
|
2016-12-13 03:56:36 +00:00
|
|
|
modifierMap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(85472, 8502), "speed modifier" + 2, speedModifier[this.level], 1));
|
2016-10-02 19:03:31 +00:00
|
|
|
|
|
|
|
return modifierMap;
|
|
|
|
}
|
|
|
|
|
2016-06-27 19:07:00 +00:00
|
|
|
@Override
|
|
|
|
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
|
|
|
|
{
|
2016-10-02 19:03:31 +00:00
|
|
|
|
2016-06-27 19:07:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getUniqueIdentifier()
|
|
|
|
{
|
|
|
|
return Constants.Mod.MODID + ".upgrade.slowness";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getMaxTier()
|
|
|
|
{
|
2016-10-02 19:03:31 +00:00
|
|
|
return 10;
|
2016-06-27 19:07:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getCostOfUpgrade()
|
|
|
|
{
|
|
|
|
return costs[this.level];
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeToNBT(NBTTagCompound tag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void readFromNBT(NBTTagCompound tag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getUnlocalizedName()
|
|
|
|
{
|
|
|
|
return tooltipBase + "slowness";
|
|
|
|
}
|
2016-10-09 14:44:50 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isDowngrade()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-06-27 19:07:00 +00:00
|
|
|
}
|