Skip to content

Commit

Permalink
Let's try this... Tinker Projectiles now deal actual unclamped damage…
Browse files Browse the repository at this point in the history
… instead of capped to 1/2 heart steps damage.
  • Loading branch information
bonii-xx committed Oct 19, 2014
1 parent 11fcf21 commit 591954c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/tconstruct/library/entity/ProjectileBase.java
Expand Up @@ -177,8 +177,8 @@ public void onHitBlock(MovingObjectPosition movingobjectposition) {

public void onHitEntity(MovingObjectPosition movingobjectposition) {
NBTTagCompound tags = returnStack.getTagCompound().getCompoundTag("InfiTool");
double speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
int damage = MathHelper.ceiling_double_int(speed * tags.getInteger("Attack"));
float speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
float damage = speed * tags.getInteger("Attack");

// Damage calculations and stuff. For reference see AbilityHelper.onLeftClickEntity
ToolCore ammo = (ToolCore)returnStack.getItem();
Expand All @@ -187,7 +187,7 @@ public void onHitEntity(MovingObjectPosition movingobjectposition) {
// basically we pass the base damage to all modifiers and take the highest one
int baseDamage = 0;
for(ActiveToolMod toolmod : TConstructRegistry.activeModifiers) {
int dmg = toolmod.baseAttackDamage(baseDamage, damage, ammo, returnStack.getTagCompound(), tags, returnStack, (EntityPlayer)this.shootingEntity, movingobjectposition.entityHit);
int dmg = toolmod.baseAttackDamage(baseDamage, (int)damage, ammo, returnStack.getTagCompound(), tags, returnStack, (EntityPlayer)this.shootingEntity, movingobjectposition.entityHit);
if(dmg > baseDamage)
baseDamage = dmg;
}
Expand All @@ -213,13 +213,13 @@ public void onHitEntity(MovingObjectPosition movingobjectposition) {
int modDamage = 0;
for (ActiveToolMod mod : TConstructRegistry.activeModifiers)
{
modDamage += mod.attackDamage(modDamage, damage, ammo, returnStack.getTagCompound(), tags, returnStack, (EntityPlayer)this.shootingEntity, movingobjectposition.entityHit);
modDamage += mod.attackDamage(modDamage, (int)damage, ammo, returnStack.getTagCompound(), tags, returnStack, (EntityPlayer)this.shootingEntity, movingobjectposition.entityHit);
}
damage += modDamage;

// calculate critical damaaage
if (this.getIsCritical())
damage += this.rand.nextInt(damage / 2 + 2);
damage += this.rand.nextFloat() * (damage / 2f + 2f);

// and now we come to the part where we actually deal the damage!
if(!dealDamage(damage, ammo, tags, movingobjectposition.entityHit))
Expand Down

0 comments on commit 591954c

Please sign in to comment.