2016-07-03 12:34:40 -04:00
|
|
|
package WayofTime.bloodmagic.livingArmour.downgrade;
|
2016-06-27 15:07:00 -04:00
|
|
|
|
2017-08-14 20:53:42 -07:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
2018-02-15 18:49:01 -08:00
|
|
|
import WayofTime.bloodmagic.livingArmour.ILivingArmour;
|
|
|
|
import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade;
|
2017-08-15 21:30:48 -07:00
|
|
|
import com.google.common.collect.HashMultimap;
|
|
|
|
import com.google.common.collect.Multimap;
|
2016-10-02 15:03:31 -04:00
|
|
|
import net.minecraft.entity.SharedMonsterAttributes;
|
|
|
|
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
2016-06-27 15:07:00 -04:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import net.minecraft.world.World;
|
2017-02-13 19:38:08 -08:00
|
|
|
import org.apache.commons.codec.binary.StringUtils;
|
2016-10-02 15:03:31 -04:00
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
public class LivingArmourUpgradeSlowness extends LivingArmourUpgrade {
|
|
|
|
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 15:07:00 -04:00
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
public LivingArmourUpgradeSlowness(int level) {
|
2016-06-27 15:07:00 -04:00
|
|
|
super(level);
|
|
|
|
}
|
|
|
|
|
2016-10-02 15:03:31 -04:00
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public Multimap<String, AttributeModifier> getAttributeModifiers() {
|
2018-03-01 19:27:38 -08:00
|
|
|
Multimap<String, AttributeModifier> modifierMap = HashMultimap.create();
|
2016-10-02 15:03:31 -04:00
|
|
|
|
2017-02-13 19:38:08 -08:00
|
|
|
String name = getUniqueIdentifier() + "-SpeedModifier1";
|
|
|
|
modifierMap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "SpeedModifier1", speedModifier[this.level], 1));
|
2016-10-02 15:03:31 -04:00
|
|
|
|
|
|
|
return modifierMap;
|
|
|
|
}
|
|
|
|
|
2016-06-27 15:07:00 -04:00
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
|
2016-10-02 15:03:31 -04:00
|
|
|
|
2016-06-27 15:07:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public String getUniqueIdentifier() {
|
2017-08-14 20:53:42 -07:00
|
|
|
return BloodMagic.MODID + ".upgrade.slowness";
|
2016-06-27 15:07:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public int getMaxTier() {
|
2016-10-02 15:03:31 -04:00
|
|
|
return 10;
|
2016-06-27 15:07:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public int getCostOfUpgrade() {
|
2016-06-27 15:07:00 -04:00
|
|
|
return costs[this.level];
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public void writeToNBT(NBTTagCompound tag) {
|
2016-06-27 15:07:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public void readFromNBT(NBTTagCompound tag) {
|
2016-06-27 15:07:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public String getUnlocalizedName() {
|
2016-06-27 15:07:00 -04:00
|
|
|
return tooltipBase + "slowness";
|
|
|
|
}
|
2016-10-09 10:44:50 -04:00
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public boolean isDowngrade() {
|
2016-10-09 10:44:50 -04:00
|
|
|
return true;
|
|
|
|
}
|
2016-06-27 15:07:00 -04:00
|
|
|
}
|