Skip to content

Commit

Permalink
Reduce damage for arrows/bolts a bit by a flat amount. This is done i…
Browse files Browse the repository at this point in the history
…n a hacky way to support compatibility with existing items.
  • Loading branch information
bonii-xx committed Jan 30, 2015
1 parent bf0c012 commit 53ae13f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/tconstruct/library/entity/ProjectileBase.java
Expand Up @@ -24,6 +24,7 @@
import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.AbilityHelper;
import tconstruct.library.tools.ToolCore;
import tconstruct.weaponry.entity.ArrowEntity;

import java.util.List;

Expand Down Expand Up @@ -183,7 +184,9 @@ public void onHitEntity(MovingObjectPosition movingobjectposition) {
NBTTagCompound tags = returnStack.getTagCompound().getCompoundTag("InfiTool");
float speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);

speed = Math.max(0, speed-2);
// yay for balance on existing stuff.. sigh
if(this instanceof ArrowEntity)
speed = Math.max(0, speed-2);

// absolute distance travelled minus the current tick
float distance = speed * (this.ticksInAir-1);
Expand Down Expand Up @@ -217,6 +220,10 @@ public void onHitEntity(MovingObjectPosition movingobjectposition) {
// add quartz damage
damage += (totalAttack - baseAttack);

// we substract flat damage for balance ;-;
if(this instanceof ArrowEntity)
damage = Math.max(0, damage - 5f);

boolean shotByPlayer = this.shootingEntity != null && this.shootingEntity instanceof EntityPlayer;

// Damage calculations and stuff. For reference see AbilityHelper.onLeftClickEntity
Expand Down

0 comments on commit 53ae13f

Please sign in to comment.