Throwing knives now crit when they're aimed long enough

This commit is contained in:
Bernhard Bonigl committed 2014-11-21 18:50:04 +01:00
1 parent d57f8b64a8
commit 40a2e91943
4 files changed
+12 -6

No files matched your search

@@ -1,6 +1,7 @@
package tconstruct.weaponry.weapons;
import net.minecraft.client.entity.EntityPlayerSP;
import tconstruct.library.entity.ProjectileBase;
import tconstruct.weaponry.client.CrosshairType;
import tconstruct.weaponry.entity.ThrowingKnifeEntity;
import tconstruct.library.weaponry.AmmoWeapon;
@@ -77,8 +78,13 @@ public class ThrowingKnife extends AmmoWeapon {
}
@Override
protected Entity createProjectile(ItemStack reference, World world, EntityPlayer player, float accuracy) {
return new ThrowingKnifeEntity(world, player, getProjectileSpeed(), accuracy, reference);
protected Entity createProjectile(ItemStack reference, World world, EntityPlayer player, float accuracy, int time) {
ProjectileBase knife = new ThrowingKnifeEntity(world, player, getProjectileSpeed(), accuracy, reference);
// if you aim long enough, it's a crit!
if(time >= this.getWindupTime(reference)*1.5f)
knife.setIsCritical(true);
return knife;
}
@Override