diff --git a/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java b/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java index a0caea460..1b4cec380 100644 --- a/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java +++ b/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java @@ -3,28 +3,41 @@ package com.hbm.items.weapon; import java.util.List; import com.hbm.entity.projectile.EntityArtilleryShell; +import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionNukeSmall; +import com.hbm.lib.Library; import com.hbm.lib.RefStrings; import com.hbm.main.MainRegistry; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; +import com.hbm.potion.HbmPotion; +import com.hbm.util.ParticleUtil; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; public class ItemAmmoArty extends Item { - public static ArtilleryShell[] types = new ArtilleryShell[5]; + public static ArtilleryShell[] types = new ArtilleryShell[ /* >>> */ 6 /* <<< */ ]; public int NORMAL = 0; public int CLASSIC = 1; public int EXPLOSIVE = 2; public int MINI_NUKE = 3; public int NUKE = 4; + public int PHOSPHORUS = 5; public ItemAmmoArty() { this.setHasSubtypes(true); @@ -35,9 +48,12 @@ public class ItemAmmoArty extends Item { @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list) { - for(int i = 0; i < types.length; i++) { - list.add(new ItemStack(item, 1, i)); - } + list.add(new ItemStack(item, 1, NORMAL)); + list.add(new ItemStack(item, 1, CLASSIC)); + list.add(new ItemStack(item, 1, EXPLOSIVE)); + list.add(new ItemStack(item, 1, PHOSPHORUS)); + list.add(new ItemStack(item, 1, MINI_NUKE)); + list.add(new ItemStack(item, 1, NUKE)); } private IIcon[] icons = new IIcon[types.length]; @@ -108,5 +124,45 @@ public class ItemAmmoArty extends Item { shell.setDead(); } }; + this.types[PHOSPHORUS] = new ArtilleryShell("ammo_arty_phosphorus") { + @Override public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { + + Vec3 vec = Vec3.createVectorHelper(shell.motionX, shell.motionY, shell.motionZ).normalize(); + double x = mop.hitVec.xCoord - vec.xCoord; + double y = mop.hitVec.yCoord - vec.yCoord; + double z = mop.hitVec.zCoord - vec.zCoord; + shell.worldObj.newExplosion(shell, x, y, z, 15F, true, false); + + int radius = 15; + List hit = shell.worldObj.getEntitiesWithinAABBExcludingEntity(shell, AxisAlignedBB.getBoundingBox(shell.posX - radius, shell.posY - radius, shell.posZ - radius, shell.posX + radius, shell.posY + radius, shell.posZ + radius)); + + for(Entity e : hit) { + + if(!Library.isObstructed(shell.worldObj, shell.posX, shell.posY, shell.posZ, e.posX, e.posY + e.getEyeHeight(), e.posZ)) { + e.setFire(5); + + if(e instanceof EntityLivingBase) { + + PotionEffect eff = new PotionEffect(HbmPotion.phosphorus.id, 30 * 20, 0, true); + eff.getCurativeItems().clear(); + ((EntityLivingBase)e).addPotionEffect(eff); + } + } + } + + for(int i = 0; i < 5; i++) { + NBTTagCompound haze = new NBTTagCompound(); + haze.setString("type", "haze"); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(haze, x + shell.worldObj.rand.nextGaussian() * 10, y, z + shell.worldObj.rand.nextGaussian() * 10), new TargetPoint(shell.dimension, shell.posX, shell.posY, shell.posZ, 150)); + } + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "rbmkmush"); + data.setFloat("scale", 10); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord), new TargetPoint(shell.dimension, x, y, z, 250)); + + shell.setDead(); + } + }; } } diff --git a/src/main/java/com/hbm/particle/ParticleRBMKMush.java b/src/main/java/com/hbm/particle/ParticleRBMKMush.java index 9729fc5bb..4d72f6a63 100644 --- a/src/main/java/com/hbm/particle/ParticleRBMKMush.java +++ b/src/main/java/com/hbm/particle/ParticleRBMKMush.java @@ -72,6 +72,8 @@ public class ParticleRBMKMush extends EntityFX { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glAlphaFunc(GL11.GL_GREATER, 0); GL11.glDepthMask(false); RenderHelper.disableStandardItemLighting(); diff --git a/src/main/resources/assets/hbm/textures/items/ammo_arty_phosphorus.png b/src/main/resources/assets/hbm/textures/items/ammo_arty_phosphorus.png new file mode 100644 index 000000000..6a9e3ac25 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/ammo_arty_phosphorus.png differ diff --git a/src/main/resources/assets/hbm/textures/models/turrets/arty.png b/src/main/resources/assets/hbm/textures/models/turrets/arty.png index 9f87d6862..3097b0d92 100644 Binary files a/src/main/resources/assets/hbm/textures/models/turrets/arty.png and b/src/main/resources/assets/hbm/textures/models/turrets/arty.png differ