diff --git a/src/main/java/slimeknights/tconstruct/library/utils/ToolHelper.java b/src/main/java/slimeknights/tconstruct/library/utils/ToolHelper.java index 849b329f07e..75704b9a344 100644 --- a/src/main/java/slimeknights/tconstruct/library/utils/ToolHelper.java +++ b/src/main/java/slimeknights/tconstruct/library/utils/ToolHelper.java @@ -531,7 +531,7 @@ public static boolean attackEntity(ItemStack stack, ToolCore tool, EntityLivingB } } - // players base damage + // players base damage (includes tools damage stat) float baseDamage = (float)attacker.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue(); // missing because not supported by tcon tools: vanilla damage enchantments, we have our own modifiers @@ -539,7 +539,6 @@ public static boolean attackEntity(ItemStack stack, ToolCore tool, EntityLivingB float baseKnockback = attacker.isSprinting() ? 1 : 0; // tool damage - baseDamage += ToolHelper.getAttackStat(stack); baseDamage *= tool.damagePotential(); // calculate if it's a critical hit @@ -577,6 +576,11 @@ public static boolean attackEntity(ItemStack stack, ToolCore tool, EntityLivingB double oldVelY = target.motionY; double oldVelZ = target.motionZ; + // apply cooldown damage decrease + if(player != null) { + float f2 = player.getCooledAttackStrength(0.5F); + damage *= (0.2F + f2 * f2 * 0.8F); + } int hurtResistantTime = target.hurtResistantTime; // deal the damage @@ -666,6 +670,7 @@ public static boolean attackEntity(ItemStack stack, ToolCore tool, EntityLivingB int k = (int)(damageDealt * 0.5); ((WorldServer)player.worldObj).spawnParticle(EnumParticleTypes.DAMAGE_INDICATOR, targetEntity.posX, targetEntity.posY + (double)(targetEntity.height * 0.5F), targetEntity.posZ, k, 0.1D, 0.0D, 0.1D, 0.2D); } + player.resetCooldown(); } else { tool.reduceDurabilityOnHit(stack, null, damage); diff --git a/src/main/java/slimeknights/tconstruct/tools/item/BroadSword.java b/src/main/java/slimeknights/tconstruct/tools/item/BroadSword.java index 0550dad5e72..c4f69672617 100644 --- a/src/main/java/slimeknights/tconstruct/tools/item/BroadSword.java +++ b/src/main/java/slimeknights/tconstruct/tools/item/BroadSword.java @@ -104,7 +104,7 @@ public boolean dealDamage(ItemStack stack, EntityLivingBase player, EntityLiving public NBTTagCompound buildTag(List materials) { ToolNBT data = buildDefaultTag(materials); // 2 base damage, like vanilla swords - data.attack += 2f; + data.attack += 1f; return data.get(); } } diff --git a/src/main/java/slimeknights/tconstruct/tools/item/LongSword.java b/src/main/java/slimeknights/tconstruct/tools/item/LongSword.java index c95cfc9d92c..bab602c414c 100644 --- a/src/main/java/slimeknights/tconstruct/tools/item/LongSword.java +++ b/src/main/java/slimeknights/tconstruct/tools/item/LongSword.java @@ -114,8 +114,6 @@ public void onPlayerStoppedUsing(ItemStack stack, World world, EntityLivingBase public NBTTagCompound buildTag(List materials) { ToolNBT data = buildDefaultTag(materials); // a bit less base damage, but it has better scaling - data.attack += 1f; - data.attack = Math.max(1f, data.attack); return data.get(); } }