diff --git a/src/main/java/com/hbm/entity/projectile/EntityThrowableNT.java b/src/main/java/com/hbm/entity/projectile/EntityThrowableNT.java index 892e59e79..15cda441f 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityThrowableNT.java +++ b/src/main/java/com/hbm/entity/projectile/EntityThrowableNT.java @@ -234,27 +234,30 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile { } } - float hyp = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - - for(this.rotationPitch = (float) (Math.atan2(this.motionY, (double) hyp) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { - ; + if(!this.onGround) { + float hyp = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for(this.rotationPitch = (float) (Math.atan2(this.motionY, (double) hyp) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } + + while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while(this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; } - - while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - - while(this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - - while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float drag = this.getAirDrag(); double gravity = this.getGravityVelocity(); diff --git a/src/main/java/com/hbm/handler/guncfg/Gun9mmFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun9mmFactory.java index 827950fd8..2e7c68cc4 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun9mmFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun9mmFactory.java @@ -44,7 +44,7 @@ public class Gun9mmFactory { config.reloadSoundEnd = false; config.name = "mp40"; - config.manufacturer = EnumGunManufacturer.NAZI; + config.manufacturer = EnumGunManufacturer.ERFURT; config.config = new ArrayList(); config.config.add(BulletConfigSyncingUtil.P9_NORMAL); diff --git a/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java b/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java index 2d31dca38..d6516af60 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunGrenadeFactory.java @@ -2,6 +2,7 @@ package com.hbm.handler.guncfg; import java.util.ArrayList; +import com.hbm.entity.projectile.EntityBulletBaseNT; import com.hbm.explosion.ExplosionNukeSmall; import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfiguration; @@ -14,14 +15,20 @@ import com.hbm.lib.HbmCollection.EnumGunManufacturer; import com.hbm.particle.SpentCasing; import com.hbm.particle.SpentCasing.CasingType; import com.hbm.render.util.RenderScreenOverlay.Crosshair; +import com.hbm.util.TrackerUtil; + +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; public class GunGrenadeFactory { - + private static final CasingEjector EJECTOR_LAUNCHER; + private static final CasingEjector EJECTOR_CONGOLAKE; private static final SpentCasing CASING40MM; static { EJECTOR_LAUNCHER = new CasingEjector().setAngleRange(0.02F, 0.03F).setAfterReload(); + EJECTOR_CONGOLAKE = new CasingEjector().setMotion(0.3, 0.1, 0).setAngleRange(0.02F, 0.03F).setDelay(15); CASING40MM = new SpentCasing(CasingType.STRAIGHT).setScale(4F, 4F, 3F).setBounceMotion(0.02F, 0.03F).setColor(0x777777).setupSmoke(1F, 0.5D, 60, 40); } @@ -67,6 +74,47 @@ public class GunGrenadeFactory { return config; } + + public static GunConfiguration getCongoConfig() { + + GunConfiguration config = new GunConfiguration(); + + config.rateOfFire = 30; + config.roundsPerCycle = 1; + config.gunMode = GunConfiguration.MODE_NORMAL; + config.firingMode = GunConfiguration.FIRE_MANUAL; + config.reloadDuration = 20; + config.firingDuration = 0; + config.ammoCap = 4; + config.reloadType = GunConfiguration.RELOAD_SINGLE; + config.allowsInfinity = true; + config.crosshair = Crosshair.L_CIRCUMFLEX; + config.firingSound = "hbm:weapon.hkShoot"; + config.reloadSound = GunConfiguration.RSOUND_GRENADE; + config.reloadSoundEnd = false; + + config.name = "congoLake"; + config.manufacturer = EnumGunManufacturer.NAWS; + + config.config = new ArrayList(); + config.config.add(BulletConfigSyncingUtil.GRENADE_NORMAL); + config.config.add(BulletConfigSyncingUtil.GRENADE_HE); + config.config.add(BulletConfigSyncingUtil.GRENADE_INCENDIARY); + config.config.add(BulletConfigSyncingUtil.GRENADE_PHOSPHORUS); + config.config.add(BulletConfigSyncingUtil.GRENADE_CHEMICAL); + config.config.add(BulletConfigSyncingUtil.GRENADE_CONCUSSION); + config.config.add(BulletConfigSyncingUtil.GRENADE_FINNED); + config.config.add(BulletConfigSyncingUtil.GRENADE_SLEEK); + config.config.add(BulletConfigSyncingUtil.GRENADE_NUCLEAR); + config.config.add(BulletConfigSyncingUtil.GRENADE_TRACER); + config.config.add(BulletConfigSyncingUtil.GRENADE_KAMPF); + config.config.add(BulletConfigSyncingUtil.GRENADE_LEADBURSTER); + config.durability = 1500; + + config.ejector = EJECTOR_CONGOLAKE; + + return config; + } public static BulletConfiguration getGrenadeConfig() { @@ -265,7 +313,58 @@ public class GunGrenadeFactory { bullet.explosive = 0F; bullet.style = BulletConfiguration.STYLE_APDS; bullet.doesRicochet = false; - BulletConfigFactory.makeFlechette(bullet); + + bullet.bntImpact = (bulletnt, x, y, z, sideHit) -> { + + Vec3 vec = Vec3.createVectorHelper(0, 0, 1); + vec.rotateAroundX((float) -Math.toRadians(bulletnt.rotationPitch)); + vec.rotateAroundY((float) Math.toRadians(bulletnt.rotationYaw)); + + bulletnt.posX -= vec.xCoord * 0.1; + bulletnt.posY -= vec.yCoord * 0.1; + bulletnt.posZ -= vec.zCoord * 0.1; + + bulletnt.getStuck(x, y, z, sideHit); + }; + + bullet.bntUpdate = (bulletnt) -> { + if(bulletnt.worldObj.isRemote) return; + + switch(bulletnt.getStuckIn()) { + case 0: bulletnt.rotationPitch = (float) (90); break; + case 1: bulletnt.rotationPitch = (float) (-90); break; + case 2: bulletnt.rotationPitch = 0; bulletnt.rotationYaw = 0; break; + case 3: bulletnt.rotationPitch = 0; bulletnt.rotationYaw = (float) 180; break; + case 4: bulletnt.rotationPitch = 0; bulletnt.rotationYaw = 90; break; + case 5: bulletnt.rotationPitch = 0; bulletnt.rotationYaw = (float) -90; break; + } + + if(bulletnt.ticksInGround < 20) return; + int timer = bulletnt.ticksInGround - 20; + if(timer > 60) return; + + for(int i = 0; i < 5; i++) { + Vec3 vec = Vec3.createVectorHelper(0, 1, 0); + vec.rotateAroundX((float) Math.toRadians(11.25 * i)); + vec.rotateAroundZ((float) -Math.toRadians(13 * timer)); + vec.rotateAroundX((float) (bulletnt.rotationPitch * Math.PI / 180D)); + vec.rotateAroundY((float) (bulletnt.rotationYaw * Math.PI / 180)); + + EntityBulletBaseNT pellet = new EntityBulletBaseNT(bulletnt.worldObj, BulletConfigSyncingUtil.R556_NORMAL); + double dist = 0.5; + pellet.setPosition(bulletnt.posX + vec.xCoord * dist, bulletnt.posY + vec.yCoord * dist, bulletnt.posZ + vec.zCoord * dist); + double vel = 0.5; + pellet.motionX = vec.xCoord * vel; + pellet.motionY = vec.yCoord * vel; + pellet.motionZ = vec.zCoord * vel; + + float hyp = MathHelper.sqrt_double(pellet.motionX * pellet.motionX + pellet.motionZ * pellet.motionZ); + pellet.prevRotationYaw = pellet.rotationYaw = (float) (Math.atan2(pellet.motionX, pellet.motionZ) * 180.0D / Math.PI); + pellet.prevRotationPitch = pellet.rotationPitch = (float) (Math.atan2(pellet.motionY, (double) hyp) * 180.0D / Math.PI); + + bulletnt.worldObj.spawnEntityInWorld(pellet); + } + }; return bullet; } diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 8ec82b805..f4be014fc 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -1522,6 +1522,7 @@ public class ModItems { public static Item gun_panzerschreck; public static Item gun_quadro; public static Item gun_hk69; + public static Item gun_congolake; public static Item gun_stinger; public static Item gun_skystinger; public static Item gun_revolver; @@ -4127,6 +4128,7 @@ public class ModItems { gun_panzerschreck = new ItemGunBase(GunRocketFactory.getPanzConfig()).setUnlocalizedName("gun_panzerschreck").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_panzerschreck"); gun_quadro = new ItemGunBase(GunRocketFactory.getQuadroConfig()).setUnlocalizedName("gun_quadro").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_quadro"); gun_hk69 = new ItemGunBase(GunGrenadeFactory.getHK69Config()).setUnlocalizedName("gun_hk69").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_hk69"); + gun_congolake = new ItemGunBase(GunGrenadeFactory.getHK69Config()).setUnlocalizedName("gun_congolake").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_congolake"); gun_stinger = new ItemGunBase(GunRocketHomingFactory.getStingerConfig()).setUnlocalizedName("gun_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger"); gun_skystinger = new ItemGunBase(GunRocketHomingFactory.getSkyStingerConfig()).setUnlocalizedName("gun_skystinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_skystinger"); gun_revolver = new ItemGunBase(Gun357MagnumFactory.getRevolverConfig()).setUnlocalizedName("gun_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver"); @@ -6992,6 +6994,7 @@ public class ModItems { GameRegistry.registerItem(gun_panzerschreck, gun_panzerschreck.getUnlocalizedName()); GameRegistry.registerItem(gun_quadro, gun_quadro.getUnlocalizedName()); GameRegistry.registerItem(gun_hk69, gun_hk69.getUnlocalizedName()); + GameRegistry.registerItem(gun_congolake, gun_congolake.getUnlocalizedName()); GameRegistry.registerItem(gun_stinger, gun_stinger.getUnlocalizedName()); GameRegistry.registerItem(gun_fatman, gun_fatman.getUnlocalizedName()); GameRegistry.registerItem(gun_proto, gun_proto.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/lib/HbmCollection.java b/src/main/java/com/hbm/lib/HbmCollection.java index dba947b9b..6472f8338 100644 --- a/src/main/java/com/hbm/lib/HbmCollection.java +++ b/src/main/java/com/hbm/lib/HbmCollection.java @@ -133,8 +133,10 @@ public class HbmCollection { METRO, /**MWT Prototype Labs**/ MWT, + /**Naval Air Weapons Station**/ + NAWS, /**Erfurter Maschinenfabrik Geipel**/ - NAZI, + ERFURT, /**No manufacturer, just puts "-" **/ NONE, /**OxfordEM Technologies**/ diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 9c2194b06..a6bd587a5 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -1103,7 +1103,7 @@ gun.make.MANN=Open Mann Co. gun.make.MAXIM=Hiram Maxim gun.make.METRO=Metro Gunsmiths gun.make.MWT=MWT Prototype Labs -gun.make.NAZI=Erfurter Maschinenfabrik Geipel +gun.make.ERFURT=Erfurter Maschinenfabrik Geipel gun.make.NONE=- gun.make.RAYTHEON=Raytheon Missile Systems gun.make.REMINGTON=Remington Arms diff --git a/src/main/resources/assets/hbm/textures/items/boltgun.png b/src/main/resources/assets/hbm/textures/items/boltgun.png new file mode 100644 index 000000000..a45e128a7 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/boltgun.png differ diff --git a/src/main/resources/assets/hbm/textures/items/gun_ar15.png b/src/main/resources/assets/hbm/textures/items/gun_ar15.png new file mode 100644 index 000000000..032404fcc Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/gun_ar15.png differ diff --git a/src/main/resources/assets/hbm/textures/items/gun_bio_revolver.png b/src/main/resources/assets/hbm/textures/items/gun_bio_revolver.png new file mode 100644 index 000000000..ed11e32c0 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/gun_bio_revolver.png differ diff --git a/src/main/resources/assets/hbm/textures/items/gun_coilgun.png b/src/main/resources/assets/hbm/textures/items/gun_coilgun.png new file mode 100644 index 000000000..5c130d109 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/gun_coilgun.png differ diff --git a/src/main/resources/assets/hbm/textures/items/gun_flamer.png b/src/main/resources/assets/hbm/textures/items/gun_flamer.png new file mode 100644 index 000000000..6cf5d9530 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/gun_flamer.png differ diff --git a/src/main/resources/assets/hbm/textures/items/gun_spas12.png b/src/main/resources/assets/hbm/textures/items/gun_spas12.png new file mode 100644 index 000000000..b0420f777 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/gun_spas12.png differ