Skip to content

Commit

Permalink
Increase weight and weight-to-arpen ratio for bolts
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Nov 1, 2014
1 parent f94d9bf commit d26f176
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/weaponry/WeaponryHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ else if(event.tool instanceof BoltAmmo)
fletching = (FletchingMaterial) TConstructRegistry.getCustomMaterial(tags.getInteger("Accessory"), FletchlingLeafMaterial.class);

int durability = (int)((float)headMat.durability() * coreMat.handleDurability() * fletching.durabilityModifier);
float weight = head.mass + core.mass;
float weight = head.mass + core.mass*1.5f;
float accuracy = fletching.accuracy;
float breakChance = fletching.breakChance*3;
float shoddy = (headMat.shoddy() + coreMat.shoddy())/2f;
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/tconstruct/weaponry/entity/ArrowEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,23 @@ protected void playHitEntitySound() {
@Override
public boolean dealDamage(float damage, ToolCore ammo, NBTTagCompound tags, Entity entityHit)
{
boolean dealtDamage;
boolean dealtDamage = false;

//Minecraft.getMinecraft().thePlayer.sendChatMessage("Damage/Weight: " + damage + " - " + tags.getFloat("Mass"));

// we take the weight, and shift the damage done towards armor piercing, the more weight the arrow/bolt has!
float shift = (tags.getFloat("Mass") - 0.7f);
float shift = (tags.getFloat("Mass") - 0.7f)*armorPenetrationModifier();

if(shift < 0)
shift = 0;
if(shift > damage)
shift = damage;

damage -= shift;

// deal regular damage
dealtDamage = super.dealDamage(damage-shift, ammo, tags, entityHit);
if(damage > 0)
dealtDamage = super.dealDamage(damage, ammo, tags, entityHit);

// deal armor piercing damage
if(shift > 0) {
Expand All @@ -103,4 +106,6 @@ public boolean dealDamage(float damage, ToolCore ammo, NBTTagCompound tags, Enti

return dealtDamage;
}

protected float armorPenetrationModifier() { return 1.0f; }
}
5 changes: 5 additions & 0 deletions src/main/java/tconstruct/weaponry/entity/BoltEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ public BoltEntity(World world, EntityPlayer player, float speed, float accuracy,
protected void playHitBlockSound(int x, int y, int z) {
this.playSound("random.bowhit", 1.0F, 1.0F);
}

@Override
protected float armorPenetrationModifier() {
return 1.5f;
}
}

0 comments on commit d26f176

Please sign in to comment.