diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 8a0b0df7a..f30dad249 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -1472,7 +1472,7 @@ item.gun_immolator.name=Der Immolator item.gun_cryolator.name=Der Cryolator item.gun_mp.name=Maschinengewehr des Pazifisten item.gun_zomg.name=Singularitätsbetriebener Paarvernichtungsstrahl "ZOMG Kanone" -item.gun_emp.name=EMP-Strahler +item.gun_emp.name=EMP-Waffe item.gun_super_shotgun.name=Super Shotgun item.gun_moist_nugget.name=Mosin-Nagant item.gun_revolver_inverted.name=Umgedrehter Revolver diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 74a8459a5..a3f322036 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -1472,7 +1472,7 @@ item.gun_immolator.name=The Immolator item.gun_cryolator.name=The Cryolator item.gun_mp.name=Pacifist's Machine Gun item.gun_zomg.name=Singularity Powered Annihilation Ray "ZOMG Cannon" -item.gun_emp.name=EMP Ray +item.gun_emp.name=EMP Gun item.gun_super_shotgun.name=Super Shotgun item.gun_moist_nugget.name=Mosin-Nagant item.gun_revolver_inverted.name=Flipped Revolver diff --git a/assets/hbm/sounds.json b/assets/hbm/sounds.json index 8dbc8655a..f8b799efa 100644 --- a/assets/hbm/sounds.json +++ b/assets/hbm/sounds.json @@ -120,6 +120,7 @@ "weapon.hkReload": {"category": "player", "sounds": [{"name": "weapon/hkReload", "stream": false}]}, "weapon.deagleShoot": {"category": "player", "sounds": [{"name": "weapon/deagleShoot", "stream": false}]}, "weapon.tesla": {"category": "block", "sounds": ["weapon/tesla1", "weapon/tesla2", "weapon/tesla3", "weapon/tesla4"]}, + "weapon.teslaShoot": {"category": "player", "sounds": [{"name": "weapon/teslaShoot", "stream": false}]}, "weapon.reloadTurret": {"category": "player", "sounds": [{"name": "weapon/reloadTurret", "stream": false}]}, "weapon.switchmode1": {"category": "player", "sounds": [{"name": "weapon/switchmode1", "stream": false}]}, diff --git a/assets/hbm/sounds/weapon/teslaShoot.ogg b/assets/hbm/sounds/weapon/teslaShoot.ogg new file mode 100644 index 000000000..52674f049 Binary files /dev/null and b/assets/hbm/sounds/weapon/teslaShoot.ogg differ diff --git a/com/hbm/handler/BulletConfigSyncingUtil.java b/com/hbm/handler/BulletConfigSyncingUtil.java index c1b8da650..14312e7b2 100644 --- a/com/hbm/handler/BulletConfigSyncingUtil.java +++ b/com/hbm/handler/BulletConfigSyncingUtil.java @@ -110,6 +110,7 @@ public class BulletConfigSyncingUtil { public static int SPECIAL_OSIPR = i++; public static int SPECIAL_GAUSS = i++; public static int SPECIAL_GAUSS_CHARGED = i++; + public static int SPECIAL_EMP = i++; public static int G20_NORMAL_FIRE = i++; public static int G20_SHRAPNEL_FIRE = i++; @@ -226,6 +227,7 @@ public class BulletConfigSyncingUtil { configSet.put(SPECIAL_OSIPR, GunOSIPRFactory.getPulseConfig()); configSet.put(SPECIAL_GAUSS, GunGaussFactory.getGaussConfig()); configSet.put(SPECIAL_GAUSS_CHARGED, GunGaussFactory.getAltConfig()); + configSet.put(SPECIAL_EMP, GunEnergyFactory.getOrbusConfig()); configSet.put(G20_NORMAL_FIRE, Gun20GaugeFactory.get20GaugeConfig().setToFire(3)); configSet.put(G20_SHRAPNEL_FIRE, Gun20GaugeFactory.get20GaugeShrapnelConfig().setToFire(3)); diff --git a/com/hbm/handler/BulletConfiguration.java b/com/hbm/handler/BulletConfiguration.java index 32a1a8b0b..09f77410a 100644 --- a/com/hbm/handler/BulletConfiguration.java +++ b/com/hbm/handler/BulletConfiguration.java @@ -92,6 +92,7 @@ public class BulletConfiguration { public static final int STYLE_MIRV = 8; public static final int STYLE_GRENADE = 9; public static final int STYLE_BF = 10; + public static final int STYLE_ORB = 11; public static final int PLINK_NONE = 0; public static final int PLINK_BULLET = 1; diff --git a/com/hbm/handler/guncfg/Gun4GaugeFactory.java b/com/hbm/handler/guncfg/Gun4GaugeFactory.java index 552965fd4..e99acf9bd 100644 --- a/com/hbm/handler/guncfg/Gun4GaugeFactory.java +++ b/com/hbm/handler/guncfg/Gun4GaugeFactory.java @@ -74,8 +74,6 @@ public class Gun4GaugeFactory { bullet.ammo = ModItems.ammo_4gauge_slug; bullet.dmgMin = 15; bullet.dmgMax = 20; - bullet.bulletsMin *= 2; - bullet.bulletsMax *= 2; bullet.wear = 7; bullet.style = BulletConfiguration.STYLE_NORMAL; diff --git a/com/hbm/handler/guncfg/GunEnergyFactory.java b/com/hbm/handler/guncfg/GunEnergyFactory.java new file mode 100644 index 000000000..17ce170b1 --- /dev/null +++ b/com/hbm/handler/guncfg/GunEnergyFactory.java @@ -0,0 +1,74 @@ +package com.hbm.handler.guncfg; + +import java.util.ArrayList; + +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.BulletConfiguration; +import com.hbm.handler.GunConfiguration; +import com.hbm.items.ModItems; +import com.hbm.render.util.RenderScreenOverlay.Crosshair; + +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +public class GunEnergyFactory { + + public static GunConfiguration getEMPConfig() { + + GunConfiguration config = new GunConfiguration(); + + config.rateOfFire = 30; + config.roundsPerCycle = 1; + config.gunMode = GunConfiguration.MODE_NORMAL; + config.firingMode = GunConfiguration.FIRE_MANUAL; + config.hasReloadAnim = false; + config.hasFiringAnim = false; + config.hasSpinup = false; + config.hasSpindown = false; + config.reloadDuration = 10; + config.firingDuration = 0; + config.ammoCap = 0; + config.durability = 1500; + config.reloadType = GunConfiguration.RELOAD_NONE; + config.allowsInfinity = true; + config.crosshair = Crosshair.L_SPLIT; + config.firingSound = "hbm:weapon.teslaShoot"; + + config.name = "EMP Orb Projector"; + config.manufacturer = "MWT Prototype Labs"; + + config.config = new ArrayList(); + config.config.add(BulletConfigSyncingUtil.SPECIAL_EMP); + + return config; + } + + public static BulletConfiguration getOrbusConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.ammo = ModItems.gun_emp_ammo; + + bullet.velocity = 1F; + bullet.spread = 0.0F; + bullet.wear = 10; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.dmgMin = 10; + bullet.dmgMax = 12; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = false; + bullet.doesPenetrate = true; + bullet.doesBreakGlass = false; + bullet.style = BulletConfiguration.STYLE_ORB; + bullet.plink = BulletConfiguration.PLINK_NONE; + bullet.emp = 10; + + bullet.effects = new ArrayList(); + bullet.effects.add(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 1)); + bullet.effects.add(new PotionEffect(Potion.weakness.id, 10 * 20, 4)); + + return bullet; + } +} diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 64fdba6ea..4de6cc9f0 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -12,6 +12,7 @@ import com.hbm.handler.guncfg.Gun50AEFactory; import com.hbm.handler.guncfg.Gun50BMGFactory; import com.hbm.handler.guncfg.Gun5mmFactory; import com.hbm.handler.guncfg.Gun9mmFactory; +import com.hbm.handler.guncfg.GunEnergyFactory; import com.hbm.handler.guncfg.GunFatmanFactory; import com.hbm.handler.guncfg.GunGaussFactory; import com.hbm.handler.guncfg.GunGrenadeFactory; @@ -2941,7 +2942,7 @@ public class ModItems { gun_zomg = new GunZOMG().setUnlocalizedName("gun_zomg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_zomg"); gun_revolver_inverted = new GunSuicide().setUnlocalizedName("gun_revolver_inverted").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_inverted"); gun_emp_ammo = new Item().setUnlocalizedName("gun_emp_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_emp_ammo"); - gun_emp = new GunEMPRay().setUnlocalizedName("gun_emp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_emp"); + gun_emp = new ItemGunBase(GunEnergyFactory.getEMPConfig()).setUnlocalizedName("gun_emp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_emp"); gun_jack_ammo = new Item().setUnlocalizedName("gun_jack_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_jack_ammo"); gun_jack = new GunJack().setUnlocalizedName("gun_jack").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_jack"); gun_spark_ammo = new Item().setUnlocalizedName("gun_spark_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_spark_ammo"); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 9cadeb931..8745b35a4 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -1812,6 +1812,7 @@ public class CraftingManager { GameRegistry.addSmelting(ModItems.powder_lead, new ItemStack(ModItems.ingot_lead), 1.0F); GameRegistry.addSmelting(ModItems.powder_neptunium, new ItemStack(ModItems.ingot_neptunium), 1.0F); GameRegistry.addSmelting(ModItems.powder_schrabidium, new ItemStack(ModItems.ingot_schrabidium), 5.0F); + GameRegistry.addSmelting(ModItems.powder_euphemium, new ItemStack(ModItems.ingot_euphemium), 10.0F); GameRegistry.addSmelting(ModItems.powder_aluminium, new ItemStack(ModItems.ingot_aluminium), 1.0F); GameRegistry.addSmelting(ModItems.powder_beryllium, new ItemStack(ModItems.ingot_beryllium), 1.0F); GameRegistry.addSmelting(ModItems.powder_copper, new ItemStack(ModItems.ingot_copper), 1.0F); diff --git a/com/hbm/render/entity/projectile/RenderBullet.java b/com/hbm/render/entity/projectile/RenderBullet.java index 42751660e..fe61503b8 100644 --- a/com/hbm/render/entity/projectile/RenderBullet.java +++ b/com/hbm/render/entity/projectile/RenderBullet.java @@ -14,6 +14,7 @@ import com.hbm.render.model.ModelGrenade; import com.hbm.render.model.ModelMIRV; import com.hbm.render.model.ModelMiniNuke; import com.hbm.render.model.ModelRocket; +import com.hbm.render.util.RenderSparks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; @@ -67,6 +68,7 @@ public class RenderBullet extends Render { case BulletConfiguration.STYLE_NUKE: renderNuke(0); break; case BulletConfiguration.STYLE_MIRV: renderNuke(1); break; case BulletConfiguration.STYLE_BF: renderNuke(2); break; + case BulletConfiguration.STYLE_ORB: renderOrb(trail); break; default: renderBullet(trail); break; } @@ -166,6 +168,33 @@ public class RenderBullet extends Render { } + private void renderOrb(int type) { + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDepthMask(false); + + switch(type) { + case 0: + bindTexture(ResourceManager.tom_flame_tex); + ResourceManager.sphere_uv_anim.renderAll(); + GL11.glScalef(0.3F, 0.3F, 0.3F); + ResourceManager.sphere_uv_anim.renderAll(); + GL11.glScalef(1F/0.3F, 1F/0.3F, 1F/0.3F); + for(int i = 0; i < 5; i++) + RenderSparks.renderSpark((int) (System.currentTimeMillis() / 100 + 100 * i), 0, 0, 0, 0.5F, 2, 2, 0x8080FF, 0xFFFFFF); + break; + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthMask(true); + + } + private void renderFlechette() { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); diff --git a/com/hbm/tileentity/machine/TileEntityMachineReactor.java b/com/hbm/tileentity/machine/TileEntityMachineReactor.java index 0797f9c44..9bb968039 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineReactor.java +++ b/com/hbm/tileentity/machine/TileEntityMachineReactor.java @@ -99,7 +99,7 @@ public class TileEntityMachineReactor extends TileEntity implements ISidedInvent @Override public boolean isItemValidForSlot(int i, ItemStack itemStack) { - return i == 2 ? false : (i == 1 ? hasItemPower(itemStack) : true); + return i == 2 ? false : (i == 0 ? hasItemPower(itemStack) : true); } public boolean hasItemPower(ItemStack itemStack) {