More base-work on Omega

This commit is contained in:
WayofTime 2015-03-19 15:26:03 -04:00
parent d7d8aedd42
commit 18d07baad3
10 changed files with 336 additions and 30 deletions

View file

@ -1,9 +1,17 @@
package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -12,6 +20,7 @@ public class OmegaArmourWind extends OmegaArmour
public OmegaArmourWind(int armorType)
{
super(armorType);
this.storeYLevel = true;
}
@Override
@ -33,4 +42,36 @@ public class OmegaArmourWind extends OmegaArmour
{
return new ModelOmegaWind(0.5f, false, false, true, false);
}
@Override
public Multimap getAttributeModifiers(ItemStack stack)
{
Multimap map = HashMultimap.create();
int yLevel = this.getYLevelStored(stack);
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85212 /** Random number **/, armorType), "Armor modifier" + armorType, getDefaultHealthBoost()*getHealthBoostModifierForLevel(yLevel), 0));
return map;
}
public float getDefaultHealthBoost()
{
switch(this.armorType)
{
case 0:
return 2.5f;
case 1:
return 4;
case 2:
return 3.5f;
case 3:
return 2;
}
return 0.25f;
}
public float getHealthBoostModifierForLevel(int yLevel)
{
return (float)Math.sqrt(((float)yLevel)/64f) * 1.5f - 1;
}
}