Skip to content

Commit

Permalink
Exo-Armor start
Browse files Browse the repository at this point in the history
  • Loading branch information
mDiyo committed Dec 5, 2013
1 parent 2e99697 commit 384d1e0
Show file tree
Hide file tree
Showing 17 changed files with 152 additions and 343 deletions.
5 changes: 5 additions & 0 deletions resources/assets/tinker/lang/en_US.lang
Expand Up @@ -257,6 +257,11 @@ item.tconstruct.chestplateWood.name=Wooden Chestplate
item.tconstruct.leggingsWood.name=Wooden Leggings
item.tconstruct.bootsWood.name=Wooden Boots

item.tconstruct.exoGoggles.name=Exo-Goggles
item.tconstruct.exoChest.name=Exo-Chestpiece
item.tconstruct.exoPants.name=Exo-Legs
item.tconstruct.exoShoes.name=Exo-Shoes

item.tconstruct.jerky.beef.name=Beef Jerky
item.tconstruct.jerky.pig.name=Bacon Jerky
item.tconstruct.jerky.chicken.name=Chicken Jerky
Expand Down
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/assets/tinker/textures/armor/wood_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/tconstruct/client/TClientEvents.java
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.attributes.AttributeInstance;
import net.minecraft.item.Item;
import net.minecraft.potion.*;
import net.minecraft.util.*;
import net.minecraftforge.client.GuiIngameForge;
Expand Down Expand Up @@ -237,6 +238,35 @@ public void drawTexturedModalRect (int par1, int par2, int par3, int par4, int p

double zLevel = 0;

@ForgeSubscribe
public void getFOV(FOVUpdateEvent event)
{
float f = 1.0F;

if (event.entity.capabilities.isFlying)
{
f *= 1.1F;
}

if (event.entity.isUsingItem() && event.entity.getItemInUse().itemID == Item.bow.itemID)
{
int i = event.entity.getItemInUseDuration();
float f1 = (float) i / 20.0F;

if (f1 > 1.0F)
{
f1 = 1.0F;
}
else
{
f1 *= f1;
}

f *= 1.0F - f1 * 0.15F;
}
event.newfov = f;
}

/* Armor */
ModelBiped model = new ModelBiped(5f);
WingModel wings = new WingModel();
Expand Down
34 changes: 16 additions & 18 deletions src/tconstruct/common/TContent.java
Expand Up @@ -2,6 +2,7 @@

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import tconstruct.library.armor.EnumArmorPart;
import tconstruct.library.crafting.ToolBuilder;

import cpw.mods.fml.common.*;
Expand Down Expand Up @@ -266,10 +267,6 @@ public class TContent implements IFuelHandler
public static ModLapis modL;

//Wearables
public static Item heavyHelmet;
public static Item heavyChestplate;
public static Item heavyPants;
public static Item heavyBoots;
public static Item glove;
public static Item knapsack;

Expand All @@ -289,13 +286,12 @@ public class TContent implements IFuelHandler
public static Item leggingsWood;
public static Item bootsWood;
public static EnumArmorMaterial materialWood;

//Signal & Logic
public static Block signalBus;
public static Block signalTerminal;

public static Item spoolWire;
public static Item lengthWire;

//Armor - exosuit
public static Item exoGoggles;
public static Item exoChest;
public static Item exoPants;
public static Item exoShoes;

//Temporary items
//public static Item armorTest = new ArmorStandard(2445, 4, EnumArmorPart.HELMET).setCreativeTab(CreativeTabs.tabAllSearch);
Expand Down Expand Up @@ -961,16 +957,10 @@ void registerItems ()
GameRegistry.registerItem(jerky, "jerky");

//Wearables
//heavyHelmet = new TArmorBase(PHConstruct.heavyHelmet, 0).setUnlocalizedName("tconstruct.HeavyHelmet");
heartCanister = new HeartCanister(PHConstruct.heartCanister).setUnlocalizedName("tconstruct.canister");
//heavyBoots = new TArmorBase(PHConstruct.heavyBoots, 3).setUnlocalizedName("tconstruct.HeavyBoots");
//glove = new Glove(PHConstruct.glove).setUnlocalizedName("tconstruct.Glove");
knapsack = new Knapsack(PHConstruct.knapsack).setUnlocalizedName("tconstruct.storage");
goldHead = new GoldenHead(PHConstruct.goldHead, 4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 10, 0, 1.0F).setUnlocalizedName("goldenhead");
//GameRegistry.registerItem(heavyHelmet, "heavyHelmet");
GameRegistry.registerItem(heartCanister, "heartCanister");
//GameRegistry.registerItem(heavyBoots, "heavyBoots");
//GameRegistry.registerItem(glove, "glove");
GameRegistry.registerItem(knapsack, "knapsack");
GameRegistry.registerItem(goldHead, "goldHead");

Expand All @@ -985,7 +975,10 @@ void registerItems ()
GameRegistry.registerItem(leggingsWood, "leggingsWood");
GameRegistry.registerItem(bootsWood, "bootsWood");

// essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence");
exoGoggles = new ExoArmor(PHConstruct.exoGoggles, EnumArmorPart.HELMET, "exosuit").setUnlocalizedName("tconstruct.exoGoggles");
exoChest = new ExoArmor(PHConstruct.exoChest, EnumArmorPart.CHESTPLATE, "exosuit").setUnlocalizedName("tconstruct.exoChest");
exoPants = new ExoArmor(PHConstruct.exoPants, EnumArmorPart.LEGGINGS, "exosuit").setUnlocalizedName("tconstruct.exoPants");
exoShoes = new ExoArmor(PHConstruct.exoShoes, EnumArmorPart.BOOTS, "exosuit").setUnlocalizedName("tconstruct.exoShoes");

String[] materialStrings = { "paperStack", "greenSlimeCrystal", "searedBrick", "ingotCobalt", "ingotArdite", "ingotManyullyn", "mossBall", "lavaCrystal", "necroticBone", "ingotCopper",
"ingotTin", "ingotAluminum", "rawAluminum", "ingotBronze", "ingotAluminumBrass", "ingotAlumite", "ingotSteel", "blueSlimeCrystal", "ingotObsidian", "nuggetIron", "nuggetCopper",
Expand Down Expand Up @@ -1241,6 +1234,11 @@ private void addRecipesForCraftingTable ()
GameRegistry.addRecipe(new ShapedOreRecipe(chestplateWood, new Object[] { "w w", "www", "www", 'w', "logWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(leggingsWood, new Object[] { "www", "w w", "w w", 'w', "logWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(bootsWood, new Object[] { "w w", "w w", 'w', "logWood" }));
//Exosuit recipes, bronze = 14
/*exoGoggles = new ExoArmor(PHConstruct.exoGoggles, EnumArmorPart.HELMET, "exosuit").setUnlocalizedName("tconstruct.exoGoggles");
exoChest = new ExoArmor(PHConstruct.exoChest, EnumArmorPart.CHESTPLATE, "exosuit").setUnlocalizedName("tconstruct.exoChest");
exoPants = new ExoArmor(PHConstruct.exoPants, EnumArmorPart.LEGGINGS, "exosuit").setUnlocalizedName("tconstruct.exoPants");
exoShoes = new ExoArmor(PHConstruct.exoShoes, EnumArmorPart.BOOTS, "exosuit").setUnlocalizedName("tconstruct.exoShoes");*/
// Metal conversion Recipes
GameRegistry.addRecipe(new ItemStack(metalBlock, 1, 3), patBlock, '#', new ItemStack(materials, 1, 9)); // Copper
GameRegistry.addRecipe(new ItemStack(metalBlock, 1, 5), patBlock, '#', new ItemStack(materials, 1, 10)); // Tin
Expand Down
80 changes: 80 additions & 0 deletions src/tconstruct/items/armor/ExoArmor.java
@@ -0,0 +1,80 @@
package tconstruct.items.armor;

import java.util.List;
import java.util.UUID;

import com.google.common.collect.Multimap;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.*;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.armor.ArmorCore;
import tconstruct.library.armor.EnumArmorPart;

public class ExoArmor extends ArmorCore
{
String textureName;
protected static final UUID speed = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CF");
protected static final UUID attack = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CE");
protected static final UUID health = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CD");
protected static final UUID knockback = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CC");
public ExoArmor(int id, EnumArmorPart part, String texture)
{
super(id, 0, part);
this.textureName = texture;
this.setCreativeTab(TConstructRegistry.materialTab);
}

@Override
public void registerIcons (IconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon("tinker:armor/" + textureName + "_"
+ (this.armorType == 0 ? "helmet" : this.armorType == 1 ? "chestplate" : this.armorType == 2 ? "leggings" : this.armorType == 3 ? "boots" : "helmet"));
}

@Override
public String getArmorTexture (ItemStack stack, Entity entity, int slot, int layer)
{
return "tinker:textures/armor/" + textureName + "_" + layer + ".png";
}

/*public Multimap getItemAttributeModifiers ()
{
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(speed, "Exosuit speed", (double) 0.5, 0));
return multimap;
}*/

public void getSubItems (int par1, CreativeTabs par2CreativeTabs, List par3List)
{
ItemStack armor = new ItemStack(par1, 1, 0);
NBTTagCompound baseTag = new NBTTagCompound();
NBTTagList list = new NBTTagList();

list.appendTag(getAttributeTag("generic.attackDamage", "ExoAttack", 10.0, true, knockback));
list.appendTag(getAttributeTag("generic.movementSpeed", "ExoSpeed", 1.5, false, speed));
list.appendTag(getAttributeTag("generic.maxHealth", "ExoHealth", 10.0, true, health));
list.appendTag(getAttributeTag("generic.knockbackResistance", "ExoKnockback", 0.5, false, knockback));

baseTag.setTag("AttributeModifiers", list);
armor.setTagCompound(baseTag);
par3List.add(armor);
}

private NBTTagCompound getAttributeTag(String attributeType, String modifierName, double amount, boolean flat, UUID uuid)
{
NBTTagCompound knockbackTag = new NBTTagCompound();
knockbackTag.setString("AttributeName", attributeType);
knockbackTag.setString("Name", modifierName);
knockbackTag.setDouble("Amount", amount);
knockbackTag.setInteger("Operation", flat ? 0 : 1);//0 = flat increase, 1 = % increase
knockbackTag.setLong("UUIDMost", uuid.getMostSignificantBits());
knockbackTag.setLong("UUIDLeast", uuid.getLeastSignificantBits());
return knockbackTag;
}
}
124 changes: 0 additions & 124 deletions src/tconstruct/items/armor/TArmorBase.java

This file was deleted.

0 comments on commit 384d1e0

Please sign in to comment.