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 6efd8a8 commit 6dd171c
Show file tree
Hide file tree
Showing 14 changed files with 131 additions and 12 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-Chest
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.
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.
31 changes: 31 additions & 0 deletions src/main/java/tconstruct/client/TClientEvents.java
Expand Up @@ -15,8 +15,10 @@
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.ForgeHooksClient;
import net.minecraftforge.client.GuiIngameForge;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
Expand Down Expand Up @@ -239,6 +241,35 @@ public void drawTexturedModalRect (int par1, int par2, int par3, int par4, int p
}

double zLevel = 0;

@ForgeSubscribe
public void fovModifier(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);
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/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 @@ -583,7 +584,10 @@ void registerItems ()
GameRegistry.registerItem(TRepo.leggingsWood, "leggingsWood");
GameRegistry.registerItem(TRepo.bootsWood, "bootsWood");

// essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence");
TRepo.exoGoggles = new ExoArmor(PHConstruct.exoGoggles, EnumArmorPart.HELMET, "exosuit").setUnlocalizedName("tconstruct.exoGoggles");
TRepo.exoChest = new ExoArmor(PHConstruct.exoChest, EnumArmorPart.CHESTPLATE, "exosuit").setUnlocalizedName("tconstruct.exoChest");
TRepo.exoPants = new ExoArmor(PHConstruct.exoPants, EnumArmorPart.LEGGINGS, "exosuit").setUnlocalizedName("tconstruct.exoPants");
TRepo.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
7 changes: 6 additions & 1 deletion src/main/java/tconstruct/common/TRepo.java
Expand Up @@ -257,7 +257,12 @@ public class TRepo
public static Item leggingsWood;
public static Item bootsWood;
public static EnumArmorMaterial materialWood;


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

public static Fluid[] fluids = new Fluid[27];
public static Block[] fluidBlocks = new Block[26];
Expand Down
73 changes: 73 additions & 0 deletions src/main/java/tconstruct/items/armor/ExoArmor.java
@@ -0,0 +1,73 @@
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"); //These are temporary. Do not use them in release
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 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;
}
}
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/library/armor/ArmorCore.java
Expand Up @@ -19,7 +19,7 @@
public abstract class ArmorCore extends ItemArmor implements IEnergyContainerItem, ISpecialArmor
{

public static final String SET_NAME = "InfiArmor";
public static final String SET_NAME = "TinkerArmor";
public final EnumArmorPart armorPart;
private static final IBehaviorDispenseItem dispenserBehavior = new BehaviorDispenseArmorCopy();
public final int baseProtection;
Expand All @@ -31,7 +31,7 @@ public abstract class ArmorCore extends ItemArmor implements IEnergyContainerIte

public ArmorCore(int par1, int baseProtection, EnumArmorPart part)
{
super(par1, EnumArmorMaterial.CHAIN, 0, 0);
super(par1, EnumArmorMaterial.CHAIN, 0, part.getPartId());
this.maxStackSize = 1;
this.setMaxDamage(100);
this.setUnlocalizedName(SET_NAME);
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/tconstruct/util/config/PHConstruct.java
Expand Up @@ -248,8 +248,10 @@ public static void initProps (File confFile)
goldHead = config.getItem("Patterns and Misc", "Golden Head", 14113).getInt(14113);
jerky = config.getItem("Patterns and Misc", "Jerky", 14115).getInt(14115);

// spoolWire = config.getItem("Logic", "SpoolWire", 14120).getInt(14120);
// lengthWire = config.getItem("Logic", "LengthWire", 14121).getInt(14121);
exoGoggles = config.getItem("Equipables", "Exo-Goggles", 14116).getInt(14116);
exoChest = config.getItem("Equipables", "Exo-Chestpiece", 14117).getInt(14117);
exoPants = config.getItem("Equipables", "Exo-Legs", 14118).getInt(14118);
exoShoes = config.getItem("Equipables", "Exo-Boots", 14119).getInt(14119);

boolean ic2 = true;
boolean xycraft = true;
Expand Down Expand Up @@ -406,9 +408,6 @@ public static void initProps (File confFile)

public static int woodenRail;

// public static int signalBus;
// public static int signalTerminal;

//Crops
public static int oreBerry;
public static int oreBerrySecond;
Expand Down Expand Up @@ -576,9 +575,11 @@ public static void initProps (File confFile)
public static int knapsack;

public static int heartCanister;

// public static int spoolWire;
// public static int lengthWire;

public static int exoGoggles;
public static int exoChest;
public static int exoPants;
public static int exoShoes;

//Ore values
public static boolean generateCopper;
Expand Down

0 comments on commit 6dd171c

Please sign in to comment.