diff --git a/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java b/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java index 14457f25..ee645244 100644 --- a/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java +++ b/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java @@ -110,7 +110,7 @@ public abstract class BowBaseAmmo extends ProjectileWeapon { } @Override - protected Entity createProjectile(ItemStack arrows, World world, EntityPlayer player, float speed, float accuracy) { + protected Entity createProjectile(ItemStack arrows, World world, EntityPlayer player, float speed, float accuracy, float windup) { EntityArrow arrow; if(arrows.getItem() == Items.arrow) { @@ -126,6 +126,9 @@ public abstract class BowBaseAmmo extends ProjectileWeapon { if(player.capabilities.isCreativeMode) arrow.canBePickedUp = 2; + if(windup >= 1f) + arrow.setIsCritical(true); + return arrow; } diff --git a/src/main/java/tconstruct/library/weaponry/ProjectileWeapon.java b/src/main/java/tconstruct/library/weaponry/ProjectileWeapon.java index f6b4a7c1..acc1b6db 100644 --- a/src/main/java/tconstruct/library/weaponry/ProjectileWeapon.java +++ b/src/main/java/tconstruct/library/weaponry/ProjectileWeapon.java @@ -67,7 +67,7 @@ public abstract class ProjectileWeapon extends ToolCore implements IAccuracy, IW * @param accuracy the accuracy calculated for the projectile * @return A banana. */ - protected abstract Entity createProjectile(ItemStack ammo, World world, EntityPlayer player, float speed, float accuracy); + protected abstract Entity createProjectile(ItemStack ammo, World world, EntityPlayer player, float speed, float accuracy, float windup); /* Accuracy */ @@ -177,7 +177,7 @@ public abstract class ProjectileWeapon extends ToolCore implements IAccuracy, IW // take windup time into account projectileSpeed *= windup; - Entity projectile = createProjectile(ammo, world, player, projectileSpeed, accuracy); + Entity projectile = createProjectile(ammo, world, player, projectileSpeed, accuracy, windup); int reinforced = 0; diff --git a/src/main/java/tconstruct/weaponry/weapons/Crossbow.java b/src/main/java/tconstruct/weaponry/weapons/Crossbow.java index 85901261..33e8747a 100644 --- a/src/main/java/tconstruct/weaponry/weapons/Crossbow.java +++ b/src/main/java/tconstruct/weaponry/weapons/Crossbow.java @@ -216,7 +216,7 @@ public class Crossbow extends ProjectileWeapon { float windup = getWindupTime(weapon); // max windup time float accuracy = getAccuracy(weapon, (int)windup); - Entity projectile = createProjectile(ammo, world, player, projectileSpeed, accuracy); + Entity projectile = createProjectile(ammo, world, player, projectileSpeed, accuracy, 1.0f); int reinforced = 0; @@ -256,7 +256,7 @@ public class Crossbow extends ProjectileWeapon { } @Override - protected Entity createProjectile(ItemStack ammo, World world, EntityPlayer player, float speed, float accuracy) { + protected Entity createProjectile(ItemStack ammo, World world, EntityPlayer player, float speed, float accuracy, float windup) { EntityArrow arrow; ItemStack reference = ammo.copy(); diff --git a/src/main/java/tconstruct/weaponry/weapons/LongBow.java b/src/main/java/tconstruct/weaponry/weapons/LongBow.java index 256deb1c..9ee0ab99 100644 --- a/src/main/java/tconstruct/weaponry/weapons/LongBow.java +++ b/src/main/java/tconstruct/weaponry/weapons/LongBow.java @@ -32,7 +32,7 @@ public class LongBow extends BowBaseAmmo { } @Override - protected Entity createProjectile(ItemStack arrows, World world, EntityPlayer player, float speed, float accuracy) { + protected Entity createProjectile(ItemStack arrows, World world, EntityPlayer player, float speed, float accuracy, float windup) { if(arrows.getItem() instanceof ArrowAmmo) { // modify accuraccy of the arrow depending on its accuraccy and weight @@ -46,7 +46,7 @@ public class LongBow extends BowBaseAmmo { accuracy = 0; } - return super.createProjectile(arrows, world, player, speed, accuracy); + return super.createProjectile(arrows, world, player, speed, accuracy, windup); } @Override diff --git a/src/main/java/tconstruct/weaponry/weapons/ShortBow.java b/src/main/java/tconstruct/weaponry/weapons/ShortBow.java index 111684c2..11b4518f 100644 --- a/src/main/java/tconstruct/weaponry/weapons/ShortBow.java +++ b/src/main/java/tconstruct/weaponry/weapons/ShortBow.java @@ -26,7 +26,7 @@ public class ShortBow extends BowBaseAmmo { } @Override - protected Entity createProjectile(ItemStack arrows, World world, EntityPlayer player, float speed, float accuracy) { + protected Entity createProjectile(ItemStack arrows, World world, EntityPlayer player, float speed, float accuracy, float windup) { if(arrows.getItem() instanceof ArrowAmmo) { // modify accuraccy of the arrow depending on its accuraccy and weight @@ -40,7 +40,7 @@ public class ShortBow extends BowBaseAmmo { accuracy = 0; } - return super.createProjectile(arrows, world, player, speed, accuracy); + return super.createProjectile(arrows, world, player, speed, accuracy, windup); } @Override