Skip to content

Commit

Permalink
Crossbow Modifier Graphics \o/
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 16, 2014
1 parent a7f7258 commit 62905da
Show file tree
Hide file tree
Showing 33 changed files with 27 additions and 4 deletions.
Binary file modified resources/assets/tinker/textures/items/crossbow/_crossbow_1.xcf
Binary file not shown.
Binary file modified resources/assets/tinker/textures/items/crossbow/_crossbow_2.xcf
Binary file not shown.
Binary file modified resources/assets/tinker/textures/items/crossbow/_crossbow_3.xcf
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
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.
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.
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.
9 changes: 9 additions & 0 deletions src/main/java/tconstruct/modifiers/tools/ModFlux.java
Expand Up @@ -2,6 +2,9 @@

import cofh.api.energy.IEnergyContainerItem;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.library.tools.ToolCore;
Expand All @@ -23,6 +26,12 @@ public boolean matches (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");

// not on ammo weapons, since they don't have durability technically
String[] traits = ((ToolCore)tool.getItem()).getTraits();
for(String trait : traits)
if("ammo".equals(trait))
return false;

ItemStack foundBattery = null;
// try to find the battery in the input
for (ItemStack stack : input)
Expand Down
20 changes: 16 additions & 4 deletions src/main/java/tconstruct/weaponry/weapons/Crossbow.java
Expand Up @@ -301,13 +301,15 @@ public void playFiringSound(World world, EntityPlayer player, ItemStack weapon,

@Override
public IIcon getIcon(ItemStack stack, int renderPass) {
if(!animateLayer(renderPass))
if(!animateLayer(renderPass) && renderPass < getPartAmount())
return super.getIcon(stack, renderPass);

if(!stack.hasTagCompound())
return super.getIcon(stack, renderPass);

NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
if(tags == null || renderPass > 10)
return super.getIcon(stack, renderPass);

float progress;

Expand All @@ -318,10 +320,20 @@ else if(!tags.hasKey("Reloading"))
else
progress = getWindupProgress(stack, getWindupTime(stack) - tags.getInteger("Reloading"));

// effects aren't animated
// todo: make effects animated
if(renderPass >= getPartAmount())
// are we drawing an effect?
if(renderPass >= getPartAmount()) {
// is the effect animated?
String effect = "Effect" + (1 + renderPass - getPartAmount());
if(tags.hasKey(effect)) {
int index = tags.getInteger(effect);
if(animationEffectIcons.get(index) != null)
return getCorrectAnimationIcon(animationEffectIcons, index, progress);
else
// non-animated
return effectIcons.get(index);
}
return super.getIcon(stack, renderPass);
}

// get the correct icon
switch (renderPass)
Expand Down
2 changes: 2 additions & 0 deletions weaponry.txt
Expand Up @@ -7,6 +7,8 @@ TODO:
* Partbuilder stuff for weaponry stuff?
* Bring bowmaterial stats etc in line?
* Can't have flux or redstone or moss on ammo tools
* Knockback on projectiles knocks towards their moving direction
* Glassmakers Arrows :D

maybe give javelins slight armor piercing? or do they have that already?

0 comments on commit 62905da

Please sign in to comment.