diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 8e7c45311..6dc5f5660 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -1300,6 +1300,7 @@ item.mask_of_infamy.name=Maske der Schande tile.det_cord.name=Det Cord tile.det_charge.name=Sprengladung +tile.det_nuke.name=Atomare Sprengladung tile.red_barrel.name=Explosives Fass tile.yellow_barrel.name=Radioaktives Fass diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 8c6c1d00f..5079bfab7 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -1300,6 +1300,7 @@ item.mask_of_infamy.name=Mask of Infamy tile.det_cord.name=Det Cord tile.det_charge.name=Explosive Charge +tile.det_nuke.name=Nuclear Charge tile.red_barrel.name=Explosive Barrel tile.yellow_barrel.name=Radioactive Barrel diff --git a/assets/hbm/textures/blocks/det_nuke.png b/assets/hbm/textures/blocks/det_nuke.png new file mode 100644 index 000000000..642279434 Binary files /dev/null and b/assets/hbm/textures/blocks/det_nuke.png differ diff --git a/assets/hbm/textures/blocks/det_nuke_top.png b/assets/hbm/textures/blocks/det_nuke_top.png new file mode 100644 index 000000000..446d9539b Binary files /dev/null and b/assets/hbm/textures/blocks/det_nuke_top.png differ diff --git a/com/hbm/blocks/ModBlocks.java b/com/hbm/blocks/ModBlocks.java index 5f13433d8..2701d2aba 100644 --- a/com/hbm/blocks/ModBlocks.java +++ b/com/hbm/blocks/ModBlocks.java @@ -175,6 +175,7 @@ public class ModBlocks { public static Block emp_bomb; public static Block det_cord; public static Block det_charge; + public static Block det_nuke; public static Block red_barrel; public static Block yellow_barrel; public static Block crashed_balefire; @@ -697,6 +698,7 @@ public class ModBlocks { emp_bomb = new BombFloat(Material.iron).setBlockName("emp_bomb").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F); det_cord = new DetCord(Material.iron).setBlockName("det_cord").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_cord"); det_charge = new DetCord(Material.iron).setBlockName("det_charge").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_charge"); + det_nuke = new DetCord(Material.iron).setBlockName("det_nuke").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_nuke"); red_barrel = new RedBarrel(Material.iron).setBlockName("red_barrel").setCreativeTab(MainRegistry.nukeTab).setHardness(0.5F).setResistance(2.5F); yellow_barrel = new YellowBarrel(Material.iron).setBlockName("yellow_barrel").setCreativeTab(MainRegistry.nukeTab).setHardness(0.5F).setResistance(2.5F); crashed_balefire = new BlockCrashedBomb(Material.iron).setBlockName("crashed_bomb").setCreativeTab(MainRegistry.nukeTab).setBlockUnbreakable().setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":crashed_balefire"); @@ -1127,6 +1129,7 @@ public class ModBlocks { //GameRegistry.registerBlock(rejuvinator, rejuvinator.getUnlocalizedName()); GameRegistry.registerBlock(det_cord, det_cord.getUnlocalizedName()); GameRegistry.registerBlock(det_charge, det_charge.getUnlocalizedName()); + GameRegistry.registerBlock(det_nuke, det_nuke.getUnlocalizedName()); GameRegistry.registerBlock(red_barrel, red_barrel.getUnlocalizedName()); GameRegistry.registerBlock(yellow_barrel, yellow_barrel.getUnlocalizedName()); diff --git a/com/hbm/blocks/bomb/DetCord.java b/com/hbm/blocks/bomb/DetCord.java index 800f6efbd..2c885f7f4 100644 --- a/com/hbm/blocks/bomb/DetCord.java +++ b/com/hbm/blocks/bomb/DetCord.java @@ -3,22 +3,52 @@ package com.hbm.blocks.bomb; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.entity.effect.EntityNukeCloudSmall; +import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.explosion.ExplosionLarge; import com.hbm.interfaces.IBomb; +import com.hbm.lib.RefStrings; +import com.hbm.main.MainRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; import net.minecraft.item.Item; +import net.minecraft.util.IIcon; import net.minecraft.world.Explosion; import net.minecraft.world.World; public class DetCord extends Block implements IBomb { + @SideOnly(Side.CLIENT) + private IIcon iconTop; + public DetCord(Material p_i45394_1_) { super(p_i45394_1_); } + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + + super.registerBlockIcons(iconRegister); + + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":det_nuke_top"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + + if(this != ModBlocks.det_nuke) + return this.blockIcon; + + return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); + } + @Override public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion p_149723_5_) { @@ -45,10 +75,21 @@ public class DetCord extends Block implements IBomb { if(!world.isRemote) { world.setBlock(x, y, z, Blocks.air); - if(this == ModBlocks.det_cord) + if(this == ModBlocks.det_cord) { world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 1.5F, true); - if(this == ModBlocks.det_charge) + } + if(this == ModBlocks.det_charge) { ExplosionLarge.explode(world, x, y, z, 15, true, false, false); + } + if(this == ModBlocks.det_nuke) { + world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, MainRegistry.missileRadius, x + 0.5, y + 0.5, z + 0.5)); + + EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, MainRegistry.missileRadius * 0.005F); + entity2.posX = x; + entity2.posY = y; + entity2.posZ = z; + world.spawnEntityInWorld(entity2); + } } } diff --git a/com/hbm/entity/logic/EntityNukeExplosionMK4.java b/com/hbm/entity/logic/EntityNukeExplosionMK4.java index c9c089bfa..4c16f0196 100644 --- a/com/hbm/entity/logic/EntityNukeExplosionMK4.java +++ b/com/hbm/entity/logic/EntityNukeExplosionMK4.java @@ -77,6 +77,8 @@ public class EntityNukeExplosionMK4 extends Entity { this.worldObj.spawnEntityInWorld(fallout); + this.setDead(); + } else { this.setDead(); } } diff --git a/com/hbm/entity/mob/EntityNuclearCreeper.java b/com/hbm/entity/mob/EntityNuclearCreeper.java index 9868d9ec2..ca29ab36b 100644 --- a/com/hbm/entity/mob/EntityNuclearCreeper.java +++ b/com/hbm/entity/mob/EntityNuclearCreeper.java @@ -256,31 +256,9 @@ public class EntityNuclearCreeper extends EntityMob { double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); if (d9 < wat) { - if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity)) - { - /*Library.damageSuit(((EntityPlayer)entity), 0); - Library.damageSuit(((EntityPlayer)entity), 1); - Library.damageSuit(((EntityPlayer)entity), 2); - Library.damageSuit(((EntityPlayer)entity), 3);*/ - - } else if(entity instanceof EntityCreeper) { - EntityNuclearCreeper creep = new EntityNuclearCreeper(this.worldObj); - creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); - //creep.setRotationYawHead(((EntityCreeper)entity).rotationYawHead); - if(!entity.isDead) - if(!worldObj.isRemote) - worldObj.spawnEntityInWorld(creep); - entity.setDead(); - } else if(entity instanceof EntityVillager) { - EntityZombie creep = new EntityZombie(this.worldObj); - creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); - entity.setDead(); - if(!this.worldObj.isRemote) - this.worldObj.spawnEntityInWorld(creep); - } else if(entity instanceof EntityLivingBase && !(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom) && !(entity instanceof EntityZombie)) + if(entity instanceof EntityLivingBase && !(entity instanceof EntityNuclearCreeper)) { - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.getId(), 5 * 20, 1)); - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 15 * 20, 0)); + Library.applyRadiation(entity, 20, 9, 5, 2); } } } diff --git a/com/hbm/items/special/ItemBattery.java b/com/hbm/items/special/ItemBattery.java index 9203cc9e9..aec9ec0f2 100644 --- a/com/hbm/items/special/ItemBattery.java +++ b/com/hbm/items/special/ItemBattery.java @@ -22,6 +22,7 @@ public class ItemBattery extends Item { this.chargeRate = chargeRate; this.dischargeRate = dischargeRate; this.setMaxDamage(100); + this.canRepair = false; } @Override diff --git a/com/hbm/items/special/ItemFuelRod.java b/com/hbm/items/special/ItemFuelRod.java index 7b120d746..c9e6a6d1d 100644 --- a/com/hbm/items/special/ItemFuelRod.java +++ b/com/hbm/items/special/ItemFuelRod.java @@ -17,6 +17,7 @@ public class ItemFuelRod extends ItemRadioactive { this.lifeTime = life; this.heat = heat; this.setMaxDamage(100); + this.canRepair = false; } @Override diff --git a/com/hbm/items/special/WatzFuel.java b/com/hbm/items/special/WatzFuel.java index 10f598d68..f338b93dc 100644 --- a/com/hbm/items/special/WatzFuel.java +++ b/com/hbm/items/special/WatzFuel.java @@ -33,6 +33,7 @@ public class WatzFuel extends ItemRadioactive { this.heatMultiplier = heatMultiplier; this.decayMultiplier = decayMultiplier; this.setMaxDamage(100); + this.canRepair = false; } @Override diff --git a/com/hbm/items/weapon/ItemClip.java b/com/hbm/items/weapon/ItemClip.java index 360fd9d82..f13661b02 100644 --- a/com/hbm/items/weapon/ItemClip.java +++ b/com/hbm/items/weapon/ItemClip.java @@ -294,6 +294,8 @@ public class ItemClip extends Item { player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_stinger_ammo, 2)); if(player.inventory.hasItem(ModItems.gun_fatman)) player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_fatman_ammo, 2)); + if(player.inventory.hasItem(ModItems.gun_proto)) + player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_fatman_ammo, 8)); if(player.inventory.hasItem(ModItems.gun_mirv)) player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_mirv_ammo, 1)); if(player.inventory.hasItem(ModItems.gun_bf)) diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 61b622353..f9d7768ae 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -882,6 +882,7 @@ public class CraftingManager { //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.therm_exo), 1), new Object[] { "TGT", "TUT", "TGT", 'T', "plateTitanium", 'U', ModItems.thermo_unit_exo, 'G', ModItems.circuit_gold })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.det_cord), 8), new Object[] { "TNT", "NGN", "TNT", 'T', "plateIron", 'N', "dustNiter", 'G', Items.gunpowder })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.det_charge), 1), new Object[] { "PDP", "DTD", "PDP", 'P', "plateSteel", 'D', ModBlocks.det_cord, 'T', Blocks.tnt })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.det_nuke), 1), new Object[] { "PDP", "DCD", "PDP", 'P', "plateDesh", 'D', ModBlocks.det_charge, 'C', ModItems.man_core })); ////GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.rejuvinator), 1), new Object[] { "TDT", "PCP", "TST", 'P', ModItems.pipes_steel, 'T', ModBlocks.factory_titanium_hull, 'D', "ingotDesh", 'S', "ingotSchrabidium", 'C', Items.clock })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.emp_bomb), 1), new Object[] { "LML", "LCL", "LML", 'L', "plateLead", 'M', ModItems.magnetron, 'C', ModItems.circuit_gold })); diff --git a/com/hbm/main/ModEventHandler.java b/com/hbm/main/ModEventHandler.java index f44f50def..8dfc75667 100644 --- a/com/hbm/main/ModEventHandler.java +++ b/com/hbm/main/ModEventHandler.java @@ -1,5 +1,7 @@ package com.hbm.main; +import java.util.ArrayList; +import java.util.List; import java.util.Random; import com.hbm.entity.missile.EntityMissileBaseAdvanced; @@ -90,7 +92,7 @@ public class ModEventHandler public void worldTick(WorldTickEvent event) { ///// - try { + //try { ///// if(event.world != null && !event.world.isRemote && event.world.provider.isSurfaceWorld() && MainRegistry.enableMeteorStrikes) { @@ -98,7 +100,7 @@ public class ModEventHandler if(!event.world.playerEntities.isEmpty()) { EntityPlayer p = (EntityPlayer)event.world.playerEntities.get(event.world.rand.nextInt(event.world.playerEntities.size())); - if(p.dimension == 0) { + if(p != null && p.dimension == 0) { EntityMeteor meteor = new EntityMeteor(event.world); meteor.posX = p.posX + event.world.rand.nextInt(201) - 100; meteor.posY = 384; @@ -127,16 +129,20 @@ public class ModEventHandler if(event.world != null && !event.world.isRemote) { if(!event.world.loadedEntityList.isEmpty()) { - for(Object e : event.world.loadedEntityList) { + + List oList = new ArrayList(); + oList.addAll(event.world.loadedEntityList); + + for(Object e : oList) { if(e instanceof EntityLivingBase) { EntityLivingBase entity = (EntityLivingBase) e; PotionEffect effect = entity.getActivePotionEffect(HbmPotion.radiation); - if(effect != null) { + if(effect != null && !entity.isDead && entity.getHealth() > 0) { if(entity instanceof EntityCreeper) { - if(event.world.rand.nextInt(5) == 0) { + if(event.world.rand.nextInt(5) == 0 ) { EntityNuclearCreeper creep = new EntityNuclearCreeper(event.world); creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); @@ -206,9 +212,10 @@ public class ModEventHandler } ////////////////////// - } catch(Exception x) { + /*} catch(Exception x) { + MainRegistry.logger.error("Ouchie, something has happened in the NTM world tick event."); - } + }*/ ////////////////////// }