diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 00a2ee037..4b5ffdf44 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -33,6 +33,7 @@ achievement.FOEQ.desc=Sende ein Relais in den Mars-...ich meine Duna-Orbit. potion.hbm_taint=Verdorben potion.hbm_taint_boost=Verdorbenes Herz potion.hbm_radiation=Strahlenkrankheit +potion.hbm_bang=! ! ! hbmfluid.none=Nichts hbmfluid.water=Wasser @@ -160,6 +161,7 @@ death.attack.boxcar=%1$s wurde von einem fallenden Güterwagon zermatscht. Autsc death.attack.broadcast=%1$s wurde das Gehirn geschmolzen. death.attack.ams=%1$s wurde in tödlichen Teilchen gebadet, die von der Menschheit erst benannt werden müssen. death.attack.amsCore=%1$s wurde vom Feuer einer Singularität verdampft. +death.attack.bang=%1$s wurde in mundgerechte Stücke zerfetzt. item.redstone_sword.name=Redstoneschwert item.big_sword.name=Großes Schwert diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 228f950e7..01f68c050 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -33,6 +33,7 @@ achievement.FOEQ.desc=Send a relay into martian...I mean dunaian orbit. potion.hbm_taint=Tainted potion.hbm_taint_boost=Tainted Heart potion.hbm_radiation=Radiation Sickness +potion.hbm_bang=! ! ! hbmfluid.none=None hbmfluid.water=Water @@ -160,6 +161,7 @@ death.attack.boxcar=%1$s was smushed by a falling boxcar. Oh well. death.attack.broadcast=%1$s got their brain melted. death.attack.ams=%1$s was bathed in deadly particles that have yet to be named by human science. death.attack.amsCore=%1$s was vaporized in the fire of a singularity. +death.attack.bang=%1$s was blasted into bite-sized pieces. item.redstone_sword.name=Redstone Sword item.big_sword.name=Great Sword diff --git a/assets/hbm/sounds.json b/assets/hbm/sounds.json index c750727a9..4c54ca7a4 100644 --- a/assets/hbm/sounds.json +++ b/assets/hbm/sounds.json @@ -67,6 +67,7 @@ "weapon.ciwsFiringLoop": {"category": "player", "sounds": [{"name": "weapon/ciwsFiringLoop", "stream": false}]}, "weapon.ciwsSpinup": {"category": "player", "sounds": [{"name": "weapon/ciwsSpinup", "stream": false}]}, "weapon.ciwsSpindown": {"category": "player", "sounds": [{"name": "weapon/ciwsSpindown", "stream": false}]}, + "weapon.laserBang": {"category": "player", "sounds": ["weapon/laserBang1", "weapon/laserBang2", "weapon/laserBang3"]}, "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/laserBang1.ogg b/assets/hbm/sounds/weapon/laserBang1.ogg new file mode 100644 index 000000000..5d7c82007 Binary files /dev/null and b/assets/hbm/sounds/weapon/laserBang1.ogg differ diff --git a/assets/hbm/sounds/weapon/laserBang2.ogg b/assets/hbm/sounds/weapon/laserBang2.ogg new file mode 100644 index 000000000..a97420f50 Binary files /dev/null and b/assets/hbm/sounds/weapon/laserBang2.ogg differ diff --git a/assets/hbm/sounds/weapon/laserBang3.ogg b/assets/hbm/sounds/weapon/laserBang3.ogg new file mode 100644 index 000000000..97214f071 Binary files /dev/null and b/assets/hbm/sounds/weapon/laserBang3.ogg differ diff --git a/assets/hbm/textures/gui/potions.png b/assets/hbm/textures/gui/potions.png index 5133b4a25..6bbd7a9ef 100644 Binary files a/assets/hbm/textures/gui/potions.png and b/assets/hbm/textures/gui/potions.png differ diff --git a/assets/hbm/textures/items/gun_b93.png b/assets/hbm/textures/items/gun_b93.png new file mode 100644 index 000000000..0f6855a44 Binary files /dev/null and b/assets/hbm/textures/items/gun_b93.png differ diff --git a/assets/hbm/textures/models/selenium_engine_body.png b/assets/hbm/textures/models/selenium_engine_body.png new file mode 100644 index 000000000..22dc10490 Binary files /dev/null and b/assets/hbm/textures/models/selenium_engine_body.png differ diff --git a/assets/hbm/textures/models/selenium_engine_piston.png b/assets/hbm/textures/models/selenium_engine_piston.png new file mode 100644 index 000000000..ca96a1bb1 Binary files /dev/null and b/assets/hbm/textures/models/selenium_engine_piston.png differ diff --git a/assets/hbm/textures/models/selenium_engine_rotor.png b/assets/hbm/textures/models/selenium_engine_rotor.png new file mode 100644 index 000000000..d97da3598 Binary files /dev/null and b/assets/hbm/textures/models/selenium_engine_rotor.png differ diff --git a/com/hbm/blocks/bomb/NukeBoy.java b/com/hbm/blocks/bomb/NukeBoy.java index 08d7b6e2e..d3ec2ac36 100644 --- a/com/hbm/blocks/bomb/NukeBoy.java +++ b/com/hbm/blocks/bomb/NukeBoy.java @@ -152,11 +152,7 @@ public class NukeBoy extends BlockContainer implements IBomb { // ExplosionNukeAdvanced.mush(world, x, y, z); if (MainRegistry.enableNukeClouds) { - EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, MainRegistry.boyRadius * 0.005F); - entity2.posX = x; - entity2.posY = y; - entity2.posZ = z; - world.spawnEntityInWorld(entity2); + world.spawnEntityInWorld(EntityNukeCloudSmall.statFac(world, x, y, z, MainRegistry.boyRadius)); } else { EntityNukeCloudSmall entity2 = new EntityNukeCloudNoShroom(world, 3000); entity2.posX = x; diff --git a/com/hbm/blocks/test/TestEventTester.java b/com/hbm/blocks/test/TestEventTester.java index 3a9016ec0..6d108f92b 100644 --- a/com/hbm/blocks/test/TestEventTester.java +++ b/com/hbm/blocks/test/TestEventTester.java @@ -16,6 +16,7 @@ import com.hbm.explosion.ExplosionNukeRay; import com.hbm.explosion.ExplosionNukeRay.FloatTriplet; import com.hbm.main.MainRegistry; import com.hbm.main.ModEventHandler; +import com.hbm.potion.PotionEffectBang; import com.hbm.potion.PotionEffectTaint; import com.hbm.saveddata.SatelliteSaveStructure; import com.hbm.saveddata.SatelliteSavedData; @@ -25,6 +26,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.enchantment.EnchantmentProtection; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -256,8 +258,11 @@ public class TestEventTester extends Block { data.markDirty(); }*/ - if(!worldObj.isRemote) - buildEvent(worldObj, par2, par3, par4, 30); + + /*if(!worldObj.isRemote) + buildEvent(worldObj, par2, par3, par4, 30);*/ + + ((EntityLivingBase)par5EntityPlayer).addPotionEffect(new PotionEffect(PotionEffectBang.instance.id, 100, 0)); return true; } diff --git a/com/hbm/entity/effect/EntityFalloutRain.java b/com/hbm/entity/effect/EntityFalloutRain.java index e09d7243b..dc5a51d56 100644 --- a/com/hbm/entity/effect/EntityFalloutRain.java +++ b/com/hbm/entity/effect/EntityFalloutRain.java @@ -1,6 +1,7 @@ package com.hbm.entity.effect; import com.hbm.blocks.ModBlocks; +import com.hbm.explosion.NukeEnvironmentalEffect; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; @@ -46,8 +47,15 @@ public class EntityFalloutRain extends Entity { double dist = Math.sqrt(Math.pow(posX - x, 2) + Math.pow(posZ - z, 2)); - if(dist <= getScale() && worldObj.getBlock(x, y, z) == Blocks.grass) - worldObj.setBlock(x, y, z, ModBlocks.waste_earth); + if(dist <= getScale()) { + + if(rand.nextInt(50) == 0) { + NukeEnvironmentalEffect.applyStandardAOE(worldObj, x, y, z, 5, 3); + + } else if(worldObj.getBlock(x, y, z) == Blocks.grass) { + worldObj.setBlock(x, y, z, ModBlocks.waste_earth); + } + } } } diff --git a/com/hbm/entity/effect/EntityNukeCloudSmall.java b/com/hbm/entity/effect/EntityNukeCloudSmall.java index 6937cc07c..632b1c966 100644 --- a/com/hbm/entity/effect/EntityNukeCloudSmall.java +++ b/com/hbm/entity/effect/EntityNukeCloudSmall.java @@ -78,5 +78,15 @@ public class EntityNukeCloudSmall extends Entity { p_70014_1_.setFloat("scale", this.dataWatcher.getWatchableObjectFloat(18)); } + + public static EntityNukeCloudSmall statFac(World world, double x, double y, double z, float radius) { + + EntityNukeCloudSmall cloud = new EntityNukeCloudSmall(world, (int)radius * 5, radius * 0.005F); + cloud.posX = x; + cloud.posY = y; + cloud.posZ = z; + + return cloud; + } } diff --git a/com/hbm/entity/logic/EntityNukeExplosionMK4.java b/com/hbm/entity/logic/EntityNukeExplosionMK4.java index d4b4ec132..9d6f3be7e 100644 --- a/com/hbm/entity/logic/EntityNukeExplosionMK4.java +++ b/com/hbm/entity/logic/EntityNukeExplosionMK4.java @@ -50,11 +50,11 @@ public class EntityNukeExplosionMK4 extends Entity { if(explosion == null) { explosion = new ExplosionNukeRay(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, this.strength, this.count, this.speed, this.length); - if(!worldObj.isRemote) + /*if(!worldObj.isRemote) for(int x = (int) (posX - 1); x <= (int) (posX + 1); x++) for(int y = (int) (posY - 1); y <= (int) (posY + 1); y++) for(int z = (int) (posZ - 1); z <= (int) (posZ + 1); z++) - worldObj.setBlock(x, y, z, Blocks.air); + worldObj.setBlock(x, y, z, Blocks.air);*/ } //if(explosion.getStoredSize() < count / length) { diff --git a/com/hbm/entity/particle/EntityBSmokeFX.java b/com/hbm/entity/particle/EntityBSmokeFX.java index 3c293822a..372af265d 100644 --- a/com/hbm/entity/particle/EntityBSmokeFX.java +++ b/com/hbm/entity/particle/EntityBSmokeFX.java @@ -6,9 +6,6 @@ import net.minecraft.world.World; public class EntityBSmokeFX extends EntityModFX { - float smokeParticleScale; - public int particleAge; - public int maxAge; private static final String __OBFID = "CL_00000924"; public EntityBSmokeFX(World world) { diff --git a/com/hbm/entity/particle/EntityDSmokeFX.java b/com/hbm/entity/particle/EntityDSmokeFX.java index 63b17cc45..a85245e6c 100644 --- a/com/hbm/entity/particle/EntityDSmokeFX.java +++ b/com/hbm/entity/particle/EntityDSmokeFX.java @@ -4,9 +4,6 @@ import net.minecraft.world.World; public class EntityDSmokeFX extends EntityModFX { - float smokeParticleScale; - public int particleAge; - public int maxAge; private static final String __OBFID = "CL_00000924"; public EntityDSmokeFX(World world) { diff --git a/com/hbm/entity/particle/EntityModFX.java b/com/hbm/entity/particle/EntityModFX.java index 345cc113d..e416965d4 100644 --- a/com/hbm/entity/particle/EntityModFX.java +++ b/com/hbm/entity/particle/EntityModFX.java @@ -15,7 +15,6 @@ public class EntityModFX extends Entity public int particleTextureIndexY; public float particleTextureJitterX; public float particleTextureJitterY; - public int particleAge; public int particleMaxAge; public float particleScale; public float particleGravity; @@ -33,6 +32,9 @@ public class EntityModFX extends Entity public static double interpPosY; public static double interpPosZ; public static final String __OBFID = "CL_00000914"; + float smokeParticleScale; + public int particleAge; + public int maxAge; public EntityModFX(World world) { super(world); diff --git a/com/hbm/entity/particle/EntitySSmokeFX.java b/com/hbm/entity/particle/EntitySSmokeFX.java index 7b93f528d..1b0d87995 100644 --- a/com/hbm/entity/particle/EntitySSmokeFX.java +++ b/com/hbm/entity/particle/EntitySSmokeFX.java @@ -6,9 +6,6 @@ import net.minecraft.world.World; public class EntitySSmokeFX extends EntityModFX { - float smokeParticleScale; - public int particleAge; - public int maxAge; private static final String __OBFID = "CL_00000924"; public EntitySSmokeFX(World world) { diff --git a/com/hbm/entity/particle/EntitySmokeFX.java b/com/hbm/entity/particle/EntitySmokeFX.java index dd4ff0ee5..8ec8d32e9 100644 --- a/com/hbm/entity/particle/EntitySmokeFX.java +++ b/com/hbm/entity/particle/EntitySmokeFX.java @@ -6,9 +6,6 @@ import net.minecraft.world.World; public class EntitySmokeFX extends EntityModFX { - float smokeParticleScale; - public int particleAge; - public int maxAge; private static final String __OBFID = "CL_00000924"; public EntitySmokeFX(World world) { diff --git a/com/hbm/entity/projectile/EntityModBeam.java b/com/hbm/entity/projectile/EntityModBeam.java new file mode 100644 index 000000000..0b0a7480d --- /dev/null +++ b/com/hbm/entity/projectile/EntityModBeam.java @@ -0,0 +1,602 @@ +package com.hbm.entity.projectile; + +import java.util.List; + +import com.hbm.entity.effect.EntityBlackHole; +import com.hbm.entity.effect.EntityCloudFleija; +import com.hbm.entity.effect.EntityCloudFleijaRainbow; +import com.hbm.entity.effect.EntityNukeCloudSmall; +import com.hbm.entity.effect.EntityRagingVortex; +import com.hbm.entity.effect.EntityVortex; +import com.hbm.entity.grenade.EntityGrenadeZOMG; +import com.hbm.entity.logic.EntityNukeExplosionMK3; +import com.hbm.entity.logic.EntityNukeExplosionMK4; +import com.hbm.explosion.ExplosionChaos; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.explosion.ExplosionThermo; +import com.hbm.items.ModItems; +import com.hbm.lib.ModDamageSource; +import com.hbm.main.MainRegistry; +import com.hbm.potion.PotionEffectBang; + +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.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityModBeam extends Entity implements IProjectile +{ + private int field_145791_d = -1; + private int field_145792_e = -1; + private int field_145789_f = -1; + public double gravity = 0.0D; + private Block field_145790_g; + private int inData; + private boolean inGround; + /** 1 if the player can pick up the arrow */ + public int canBePickedUp; + /** Seems to be some sort of timer for animating an arrow. */ + public int arrowShake; + /** The owner of this arrow. */ + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + /** The amount of knockback an arrow applies when it hits a mob. */ + private int knockbackStrength; + private static final String __OBFID = "CL_00001715"; + public int mode = 0; + + + public EntityModBeam(World p_i1753_1_) + { + super(p_i1753_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityModBeam(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_) + { + super(p_i1754_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_); + this.yOffset = 0.0F; + } + + public EntityModBeam(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) + { + super(p_i1755_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1755_2_; + + if (p_i1755_2_ instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D; + double d0 = p_i1755_3_.posX - p_i1755_2_.posX; + double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY; + double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ; + double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + + if (d3 >= 1.0E-7D) + { + float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float)d3 * 0.2F; + this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_); + } + } + + public EntityModBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax, EntityGrenadeZOMG grenade) { + super(p_i1756_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1756_2_; + + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ, + grenade.rotationYaw, grenade.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) + * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) + * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI); + this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); + } + + public EntityModBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_) + { + super(p_i1756_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1756_2_; + + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); + this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); + } + + public EntityModBeam(World world, int x, int y, int z, double mx, double my, double mz, double grav) { + super(world); + this.posX = x + 0.5F; + this.posY = y + 0.5F; + this.posZ = z + 0.5F; + + this.motionX = mx; + this.motionY = my; + this.motionZ = mz; + + this.gravity = grav; + } + + @Override + protected void entityInit() + { + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. + */ + @Override + public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) + { + float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); + p_70186_1_ /= f2; + p_70186_3_ /= f2; + p_70186_5_ /= f2; + p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; + p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; + p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.002499999832361937D * p_70186_8_; + p_70186_1_ *= p_70186_7_; + p_70186_3_ *= p_70186_7_; + p_70186_5_ *= p_70186_7_; + this.motionX = p_70186_1_; + this.motionY = p_70186_3_; + this.motionZ = p_70186_5_; + float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + @Override + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) + { + this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); + this.setRotation(p_70056_7_, p_70056_8_); + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @Override + @SideOnly(Side.CLIENT) + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) + { + this.motionX = p_70016_1_; + this.motionY = p_70016_3_; + this.motionZ = p_70016_5_; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } + + /** + * Called to update the entity's position/logic. + */ + //@Override + @Override + public void onUpdate() + { + super.onUpdate(); + + if(this.ticksExisted > 100) + this.setDead(); + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + //this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); + } + + Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (block.getMaterial() != Material.air) + { + block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.setDead(); + explode(); + } + + if (this.arrowShake > 0) + { + --this.arrowShake; + } + else + { + ++this.ticksInAir; + Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); + vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + int i; + float f1; + + for (i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) + { + f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); + + if (movingobjectposition1 != null) + { + double d1 = vec31.distanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + + if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) + { + movingobjectposition = null; + } + } + + float f2; + float f4; + + if (movingobjectposition != null) + { + if (movingobjectposition.entityHit != null) + { + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int k = MathHelper.ceiling_double_int(f2 * this.damage); + + if (this.getIsCritical()) + { + k += this.rand.nextInt(k / 2 + 2); + } + + if(movingobjectposition.entityHit instanceof EntityLivingBase) { + ((EntityLivingBase)movingobjectposition.entityHit).addPotionEffect(new PotionEffect(PotionEffectBang.instance.id, 60, 0)); + } else { + explode(); + } + + this.setDead(); + } + else + { + this.field_145791_d = movingobjectposition.blockX; + this.field_145792_e = movingobjectposition.blockY; + this.field_145789_f = movingobjectposition.blockZ; + this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + float f3 = 0.99F; + f1 = 0.05F; + + if (this.isInWater()) + { + this.setDead(); + explode(); + } + + if (this.isWet()) + { + this.extinguish(); + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.func_145775_I(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound p_70014_1_) + { + p_70014_1_.setShort("xTile", (short)this.field_145791_d); + p_70014_1_.setShort("yTile", (short)this.field_145792_e); + p_70014_1_.setShort("zTile", (short)this.field_145789_f); + p_70014_1_.setShort("life", (short)this.ticksInGround); + p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g)); + p_70014_1_.setByte("inData", (byte)this.inData); + p_70014_1_.setByte("shake", (byte)this.arrowShake); + p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + p_70014_1_.setByte("pickup", (byte)this.canBePickedUp); + p_70014_1_.setDouble("damage", this.damage); + p_70014_1_.setInteger("mode", this.mode); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound p_70037_1_) + { + this.field_145791_d = p_70037_1_.getShort("xTile"); + this.field_145792_e = p_70037_1_.getShort("yTile"); + this.field_145789_f = p_70037_1_.getShort("zTile"); + this.ticksInGround = p_70037_1_.getShort("life"); + this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); + this.inData = p_70037_1_.getByte("inData") & 255; + this.arrowShake = p_70037_1_.getByte("shake") & 255; + this.inGround = p_70037_1_.getByte("inGround") == 1; + this.mode = p_70037_1_.getInteger("mode"); + + if (p_70037_1_.hasKey("damage", 99)) + { + this.damage = p_70037_1_.getDouble("damage"); + } + + if (p_70037_1_.hasKey("pickup", 99)) + { + this.canBePickedUp = p_70037_1_.getByte("pickup"); + } + else if (p_70037_1_.hasKey("player", 99)) + { + this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0; + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + @Override + protected boolean canTriggerWalking() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + public void setDamage(double p_70239_1_) + { + this.damage = p_70239_1_; + } + + public double getDamage() + { + return this.damage; + } + + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int p_70240_1_) + { + this.knockbackStrength = p_70240_1_; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + @Override + public boolean canAttackWithItem() + { + return false; + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind it. + */ + public void setIsCritical(boolean p_70243_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70243_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind it. + */ + public boolean getIsCritical() + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + return (b0 & 1) != 0; + } + + private void explode() { + if(!worldObj.isRemote) { + + if(mode == 0) { + ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, false); + } else if( mode == 1) { + ExplosionLarge.explodeFire(worldObj, posX, posY, posZ, 10, true, false, false); + } else if(mode == 2) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, + "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityNukeExplosionMK3 entity = new EntityNukeExplosionMK3(this.worldObj); + entity.posX = this.posX; + entity.posY = this.posY; + entity.posZ = this.posZ; + entity.destructionRange = 10; + entity.speed = 25; + entity.coefficient = 1.0F; + entity.waste = false; + + this.worldObj.spawnEntityInWorld(entity); + + EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 10); + cloud.posX = this.posX; + cloud.posY = this.posY; + cloud.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(cloud); + } else if(mode == 3) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, + "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityNukeExplosionMK3 entity = new EntityNukeExplosionMK3(this.worldObj); + entity.posX = this.posX; + entity.posY = this.posY; + entity.posZ = this.posZ; + entity.destructionRange = 20; + entity.speed = 25; + entity.coefficient = 1.0F; + entity.waste = false; + + this.worldObj.spawnEntityInWorld(entity); + + EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 20); + cloud.posX = this.posX; + cloud.posY = this.posY; + cloud.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(cloud); + } else if(mode == 4) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, + "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityVortex vortex = new EntityVortex(this.worldObj, 1F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else if(mode == 5) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, + "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityVortex vortex = new EntityVortex(this.worldObj, 2.5F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else if(mode == 6) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, + "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityRagingVortex vortex = new EntityRagingVortex(this.worldObj, 2.5F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else if(mode == 7) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, + "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityRagingVortex vortex = new EntityRagingVortex(this.worldObj, 5F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else if(mode == 8) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, + "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + EntityBlackHole vortex = new EntityBlackHole(this.worldObj, 2F); + vortex.posX = this.posX; + vortex.posY = this.posY; + vortex.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(vortex); + } else { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, + "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, MainRegistry.gadgetRadius, posX, posY, posZ)); + this.worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(worldObj, posX, posY, posZ, MainRegistry.gadgetRadius)); + } + } + } +} diff --git a/com/hbm/explosion/ExplosionNukeGeneric.java b/com/hbm/explosion/ExplosionNukeGeneric.java index bc29cb716..23f5e16b5 100644 --- a/com/hbm/explosion/ExplosionNukeGeneric.java +++ b/com/hbm/explosion/ExplosionNukeGeneric.java @@ -170,9 +170,9 @@ public class ExplosionNukeGeneric { entity.attackEntityFrom(ModDamageSource.nuclearBlast, 10F); entity.setFire(5); double d8 = EnchantmentProtection.func_92092_a(entity, d11); - entity.motionX += d5 * d8; - entity.motionY += d6 * d8; - entity.motionZ += d7 * d8; + entity.motionX += d5 * d8 * 0.2D; + entity.motionY += d6 * d8 * 0.2D; + entity.motionZ += d7 * d8 * 0.2D; } } } diff --git a/com/hbm/explosion/ExplosionNukeRay.java b/com/hbm/explosion/ExplosionNukeRay.java index 843b7f148..5c93f0a64 100644 --- a/com/hbm/explosion/ExplosionNukeRay.java +++ b/com/hbm/explosion/ExplosionNukeRay.java @@ -103,11 +103,15 @@ public class ExplosionNukeRay { public void processTip(int count) { int processedBlocks = 0; + int braker = 0; for(int l = 0; l < Integer.MAX_VALUE; l++) { - + if(processedBlocks >= count) return; + + if(braker >= count * 50) + return; if(l > affectedBlocks.size() - 1) break; @@ -137,6 +141,8 @@ public class ExplosionNukeRay { world.setBlock(x0, y0, z0, Blocks.air); processedBlocks++; } + + braker++; } affectedBlocks.remove(in); diff --git a/com/hbm/explosion/NukeEnvironmentalEffect.java b/com/hbm/explosion/NukeEnvironmentalEffect.java new file mode 100644 index 000000000..34bc0d643 --- /dev/null +++ b/com/hbm/explosion/NukeEnvironmentalEffect.java @@ -0,0 +1,111 @@ +package com.hbm.explosion; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class NukeEnvironmentalEffect { + + static Random rand = new Random(); + + /** + * Area of effect radiation effect. j > 0 for jagged edges of the spherical area. Args: world, x, y, z, radius, outer radius with random chance. + */ + public static void applyStandardAOE(World world, int x, int y, int z, int r, int j) { + + int r2 = r * r; + int r22 = r2 / 2; + for (int xx = -r; xx < r; xx++) { + int X = xx + x; + int XX = xx * xx; + for (int yy = -r; yy < r; yy++) { + int Y = yy + y; + int YY = XX + yy * yy; + for (int zz = -r; zz < r; zz++) { + int Z = zz + z; + int ZZ = YY + zz * zz; + if (ZZ < r22 + rand.nextInt(j)) { + applyStandardEffect(world, X, Y, Z); + } + } + } + } + } + + public static void applyStandardEffect(World world, int x, int y, int z) { + int chance = 100; + Block b = null; + int meta = 0; + + Block in = world.getBlock(x, y, z); + int inMeta = world.getBlockMetadata(x, y, z); + + if(in == Blocks.air) + return; + + //Task done by fallout effect entity. + /*if(in == Blocks.grass) { + b = ModBlocks.waste_earth; + + } else */ + + if(in == Blocks.sand) { + + if(inMeta == 1) + b = ModBlocks.waste_trinitite_red; + else + b = ModBlocks.waste_trinitite; + + chance = 20; + + } else if(in == Blocks.mycelium) { + b = ModBlocks.waste_mycelium; + + } else if(in == Blocks.log || in == Blocks.log2) { + b = ModBlocks.waste_log; + + } else if(in == Blocks.planks) { + b = ModBlocks.waste_planks; + + } else if(in == Blocks.mossy_cobblestone) { + b = ModBlocks.ore_oil; + chance = 50; + + } else if(in == Blocks.coal_ore) { + b = Blocks.diamond_ore; + chance = 10; + } else if(in == ModBlocks.ore_uranium) { + b = ModBlocks.ore_schrabidium; + chance = 10; + + } else if(in == ModBlocks.ore_nether_uranium) { + b = ModBlocks.ore_nether_schrabidium; + chance = 10; + + } else if(in == ModBlocks.ore_nether_plutonium) { + b = ModBlocks.ore_nether_schrabidium; + chance = 25; + + } else if(in == Blocks.brown_mushroom_block && inMeta == 10) { + b = ModBlocks.waste_planks; + + } else if(in == Blocks.red_mushroom_block && inMeta == 10) { + b = ModBlocks.waste_planks; + + } else if(in == Blocks.end_stone) { + b = ModBlocks.ore_tikite; + chance = 1; + + } else if(in == Blocks.clay) { + b = Blocks.hardened_clay; + } + + if(b != null && rand.nextInt(1000) < chance) + world.setBlock(x, y, z, b, meta, 2); + } + +} diff --git a/com/hbm/inventory/gui/GUIMachineSelenium.java b/com/hbm/inventory/gui/GUIMachineSelenium.java index f379892bd..d722ad6b1 100644 --- a/com/hbm/inventory/gui/GUIMachineSelenium.java +++ b/com/hbm/inventory/gui/GUIMachineSelenium.java @@ -44,7 +44,7 @@ public class GUIMachineSelenium extends GuiInfoContainer { " Biofuel (200 HE/t)", " NITAN Superfuel (2500 HE/t)", "(These numbers are base values,", - "actual consumption is based", + "actual output is based", "on piston count)" }; this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text); diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 0428af94a..8371b7eb7 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -1903,7 +1903,7 @@ public class ModItems { gun_bolt_action_green = new GunBoltAction().setUnlocalizedName("gun_bolt_action_green").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bolt_action_green"); gun_b92_ammo = new GunB92Cell().setUnlocalizedName("gun_b92_ammo").setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b92_ammo_alt"); gun_b92 = new GunB92().setUnlocalizedName("gun_b92").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b92"); - gun_b93 = new GunB92().setUnlocalizedName("gun_b93").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b93"); + gun_b93 = new GunB93().setUnlocalizedName("gun_b93").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_b93"); gun_xvl1456_ammo = new Item().setUnlocalizedName("gun_xvl1456_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_xvl1456_ammo"); gun_xvl1456 = new GunXVL1456().setUnlocalizedName("gun_xvl1456").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_xvl1456"); gun_osipr_ammo = new Item().setUnlocalizedName("gun_osipr_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_osipr_ammo"); diff --git a/com/hbm/items/weapon/GunB93.java b/com/hbm/items/weapon/GunB93.java new file mode 100644 index 000000000..36ba6293a --- /dev/null +++ b/com/hbm/items/weapon/GunB93.java @@ -0,0 +1,284 @@ +package com.hbm.items.weapon; + +import java.util.List; +import java.util.Random; + +import com.google.common.collect.Multimap; +import com.hbm.entity.effect.EntityCloudFleijaRainbow; +import com.hbm.entity.logic.EntityNukeExplosionMK3; +import com.hbm.entity.projectile.EntityBullet; +import com.hbm.entity.projectile.EntityExplosiveBeam; +import com.hbm.entity.projectile.EntityModBeam; +import com.hbm.items.ModItems; +import com.hbm.main.MainRegistry; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.ArrowLooseEvent; +import net.minecraftforge.event.entity.player.ArrowNockEvent; + +public class GunB93 extends Item { + + Random rand = new Random(); + + public int dmgMin = 16; + public int dmgMax = 28; + + public GunB93() { + + this.maxStackSize = 1; + } + + @Override + public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { + if (!p_77615_3_.isSneaking()) { + int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_; + + ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); + MinecraftForge.EVENT_BUS.post(event); + j = event.charge; + + boolean flag = true; + + if (flag) { + float f = j / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; + + if (j < 10.0D) { + return; + } + + if (j > 10.0F) { + f = 10.0F; + } + + if (!p_77615_2_.isRemote) { + + EntityModBeam entityarrow1; + entityarrow1 = new EntityModBeam(p_77615_2_, p_77615_3_, 3.0F); + entityarrow1.mode = getPower(p_77615_1_) - 1; + p_77615_1_.damageItem(1, p_77615_3_); + + p_77615_2_.spawnEntityInWorld(entityarrow1); + + p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.sparkShoot", 5.0F, 1.0F); + } + + setAnim(p_77615_1_, 1); + setPower(p_77615_1_, 0); + } + } else { + } + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean b) { + int j = getAnim(stack); + + if (j > 0) { + if (j < 30) + setAnim(stack, j + 1); + else + setAnim(stack, 0); + + if (j == 15) { + world.playSoundAtEntity(entity, "hbm:weapon.b92Reload", 2F, 0.9F); + setPower(stack, getPower(stack) + 1); + + if(getPower(stack) > 10) { + + setPower(stack, 0); + + if(!world.isRemote) { + world.playSoundEffect(entity.posX, entity.posY, entity.posZ, + "random.explode", 100.0f, world.rand.nextFloat() * 0.1F + 0.9F); + + EntityNukeExplosionMK3 exp = new EntityNukeExplosionMK3(world); + exp.posX = entity.posX; + exp.posY = entity.posY; + exp.posZ = entity.posZ; + exp.destructionRange = 50; + exp.speed = 25; + exp.coefficient = 1.0F; + exp.waste = false; + + world.spawnEntityInWorld(exp); + + EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, 50); + cloud.posX = entity.posX; + cloud.posY = entity.posY; + cloud.posZ = entity.posZ; + world.spawnEntityInWorld(cloud); + } + } + } + } + + } + + @Override + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + return p_77654_1_; + } + + /** + * How long it takes to use or consume an item + */ + @Override + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 72000; + } + + /** + * returns the action that specifies what animation to play when the items + * is being used + */ + @Override + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.bow; + } + + /** + * Called whenever this item is equipped and the right mouse button is + * pressed. Args: itemStack, world, entityPlayer + */ + @Override + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (!p_77659_3_.isSneaking() && getPower(p_77659_1_) > 0) { + ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_); + MinecraftForge.EVENT_BUS.post(event); + + if (this.getAnim(p_77659_1_) == 0) + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + } else { + if (getAnim(p_77659_1_) == 0) { + setAnim(p_77659_1_, 1); + } + } + + return p_77659_1_; + } + + /** + * Return the enchantability factor of the item, most of the time is based + * on material. + */ + @Override + public int getItemEnchantability() { + return 1; + } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { + + list.add("[LEGENDARY WEAPON]"); + } + + @Override + public Multimap getItemAttributeModifiers() { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), + new AttributeModifier(field_111210_e, "Weapon modifier", 3.5, 0)); + return multimap; + } + + private static int getAnim(ItemStack stack) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + return 0; + } + + return stack.stackTagCompound.getInteger("animation"); + + } + + private static void setAnim(ItemStack stack, int i) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + + stack.stackTagCompound.setInteger("animation", i); + + } + + private static int getPower(ItemStack stack) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + return 0; + } + + return stack.stackTagCompound.getInteger("energy"); + + } + + private static void setPower(ItemStack stack, int i) { + if (stack.stackTagCompound == null) { + stack.stackTagCompound = new NBTTagCompound(); + } + + stack.stackTagCompound.setInteger("energy", i); + + } + + public static float getRotationFromAnim(ItemStack stack) { + float rad = 0.0174533F; + rad *= 7.5F; + int i = getAnim(stack); + + if (i < 10) + return 0; + i -= 10; + + if (i < 6) + return rad * i; + if (i > 14) + return rad * (5 - (i - 15)); + return rad * 5; + } + + public static float getOffsetFromAnim(ItemStack stack) { + float i = getAnim(stack); + + if (i < 10) + return 0; + i -= 10; + + if (i < 10) + return i / 10; + else + return 2 - (i / 10); + } + + public static float getTransFromAnim(ItemStack stack) { + float i = getAnim(stack); + + if (i < 10) + return 0; + i -= 10; + + if (i > 4 && i < 10) + return (i - 5) * 0.05F; + + if (i > 9 && i < 15) + return (10 * 0.05F) - ((i - 5) * 0.05F); + + return 0; + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + + return EnumRarity.uncommon; + } +} diff --git a/com/hbm/lib/ModDamageSource.java b/com/hbm/lib/ModDamageSource.java index 1e01d3b98..0f85a72ad 100644 --- a/com/hbm/lib/ModDamageSource.java +++ b/com/hbm/lib/ModDamageSource.java @@ -36,6 +36,7 @@ public class ModDamageSource extends DamageSource { public static DamageSource ams = (new DamageSource("ams")).setDamageIsAbsolute().setDamageBypassesArmor(); public static DamageSource amsCore = (new DamageSource("amsCore")).setDamageIsAbsolute().setDamageBypassesArmor(); public static DamageSource broadcast = (new DamageSource("broadcast")).setDamageIsAbsolute().setDamageBypassesArmor(); + public static DamageSource bang = (new DamageSource("bang")).setDamageIsAbsolute().setDamageBypassesArmor(); public ModDamageSource(String p_i1566_1_) { super(p_i1566_1_); diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index c88fddf3e..069205f72 100644 --- a/com/hbm/main/ClientProxy.java +++ b/com/hbm/main/ClientProxy.java @@ -231,6 +231,7 @@ public class ClientProxy extends ServerProxy RenderingRegistry.registerEntityRenderingHandler(EntityMinerBeam.class, new RenderBeam3()); RenderingRegistry.registerEntityRenderingHandler(EntitySparkBeam.class, new RenderBeam4()); RenderingRegistry.registerEntityRenderingHandler(EntityExplosiveBeam.class, new RenderBeam5()); + RenderingRegistry.registerEntityRenderingHandler(EntityModBeam.class, new RenderBeam6()); RenderingRegistry.registerEntityRenderingHandler(EntityLN2.class, new RenderLN2(ModItems.energy_ball)); RenderingRegistry.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser()); @@ -314,9 +315,9 @@ public class ClientProxy extends ServerProxy RenderingRegistry.registerEntityRenderingHandler(EntityShrapnel.class, new RenderShrapnel()); RenderingRegistry.registerEntityRenderingHandler(EntityOilSpill.class, new RenderEmpty()); - RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new ModEffectRenderer(ModItems.nuclear_waste)); - RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new BSmokeRenderer(ModItems.nuclear_waste)); - RenderingRegistry.registerEntityRenderingHandler(EntityDSmokeFX.class, new DSmokeRenderer(ModItems.nuclear_waste)); + RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.smoke1, ModItems.smoke2, ModItems.smoke3, ModItems.smoke4, ModItems.smoke5, ModItems.smoke6, ModItems.smoke7, ModItems.smoke8 })); + RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.b_smoke1, ModItems.b_smoke2, ModItems.b_smoke3, ModItems.b_smoke4, ModItems.b_smoke5, ModItems.b_smoke6, ModItems.b_smoke7, ModItems.b_smoke8 })); + RenderingRegistry.registerEntityRenderingHandler(EntityDSmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.d_smoke1, ModItems.d_smoke2, ModItems.d_smoke3, ModItems.d_smoke4, ModItems.d_smoke5, ModItems.d_smoke6, ModItems.d_smoke7, ModItems.d_smoke8 })); RenderingRegistry.registerEntityRenderingHandler(EntitySSmokeFX.class, new SSmokeRenderer(ModItems.nuclear_waste)); RenderingRegistry.registerEntityRenderingHandler(EntityOilSpillFX.class, new SpillRenderer(ModItems.nuclear_waste)); RenderingRegistry.registerEntityRenderingHandler(EntityGasFX.class, new GasRenderer(ModItems.nuclear_waste)); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 3d4f896b9..15b89cb56 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -927,8 +927,8 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getFullBattery(ModItems.battery_su_l), new Object[] { " W ", "RPR", "CPC", 'W', ModItems.wire_copper, 'P', Items.paper, 'R', "dustRedstone", 'C', "dustCoal" })); GameRegistry.addShapelessRecipe(ItemBattery.getFullBattery(ModItems.battery_potato), new Object[] { Items.potato, ModItems.wire_aluminium, ModItems.wire_copper }); GameRegistry.addRecipe(new ShapelessOreRecipe(ItemBattery.getFullBattery(ModItems.battery_potatos), new Object[] { ItemBattery.getFullBattery(ModItems.battery_potato), ModItems.turret_chip, "dustRedstone" })); - GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getFullBattery(ModItems.battery_steam), new Object[] { "PMP", "ISI", "PCP", 'P', "plateCopper", 'M', ModItems.motor, 'C', ModItems.coil_tungsten, 'S', new ItemStack(ModItems.fluid_tank_full, 1, FluidType.WATER.getID()), 'I', ModItems.plate_polymer })); - GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getFullBattery(ModItems.battery_steam_large), new Object[] { "MPM", "ISI", "CPC", 'P', ModItems.board_copper, 'M', ModItems.motor, 'C', ModItems.coil_tungsten, 'S', new ItemStack(ModItems.fluid_barrel_full, 1, FluidType.WATER.getID()), 'I', "ingotPolymer" })); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.battery_steam), new Object[] { "PMP", "ISI", "PCP", 'P', "plateCopper", 'M', ModItems.motor, 'C', ModItems.coil_tungsten, 'S', new ItemStack(ModItems.fluid_tank_full, 1, FluidType.WATER.getID()), 'I', ModItems.plate_polymer })); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.battery_steam_large), new Object[] { "MPM", "ISI", "CPC", 'P', ModItems.board_copper, 'M', ModItems.motor, 'C', ModItems.coil_tungsten, 'S', new ItemStack(ModItems.fluid_barrel_full, 1, FluidType.WATER.getID()), 'I', "ingotPolymer" })); GameRegistry.addRecipe(new ItemStack(ModItems.schrabidium_helmet, 1), new Object[] { "EEE", "E E", 'E', ModItems.ingot_schrabidium }); GameRegistry.addRecipe(new ItemStack(ModItems.schrabidium_plate, 1), new Object[] { "E E", "EEE", "EEE", 'E', ModItems.ingot_schrabidium }); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index 32139aef6..043946bc9 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -147,6 +147,7 @@ import com.hbm.entity.projectile.EntityMeteor; import com.hbm.entity.projectile.EntityMinerBeam; import com.hbm.entity.projectile.EntityMiniMIRV; import com.hbm.entity.projectile.EntityMiniNuke; +import com.hbm.entity.projectile.EntityModBeam; import com.hbm.entity.projectile.EntityNightmareBlast; import com.hbm.entity.projectile.EntityOilSpill; import com.hbm.entity.projectile.EntityPlasmaBeam; @@ -743,6 +744,7 @@ public class MainRegistry EntityRegistry.registerModEntity(EntityRagingVortex.class, "entity_raging_vortex", 96, this, 250, 1, true); EntityRegistry.registerModEntity(EntityCarrier.class, "entity_missile_carrier", 97, this, 1000, 1, true); EntityRegistry.registerModEntity(EntityBooster.class, "entity_missile_booster", 98, this, 1000, 1, true); + EntityRegistry.registerModEntity(EntityModBeam.class, "entity_beam_bang", 99, this, 1000, 1, true); EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00); EntityRegistry.registerGlobalEntityID(EntityHunterChopper.class, "entity_mob_hunter_chopper", EntityRegistry.findGlobalUniqueEntityId(), 0x000020, 0x2D2D72); @@ -1299,7 +1301,7 @@ public class MainRegistry enableMeteorStrikes = config.get(Configuration.CATEGORY_GENERAL, "1.09_enableMeteorStrikes", true).getBoolean(true); enableMeteorShowers = config.get(Configuration.CATEGORY_GENERAL, "1.10_enableMeteorShowers", true).getBoolean(true); enableMeteorTails = config.get(Configuration.CATEGORY_GENERAL, "1.11_enableMeteorTails", true).getBoolean(true); - enableSpecialMeteors = config.get(Configuration.CATEGORY_GENERAL, "1.12_enableSpecialMeteors", true).getBoolean(true); + enableSpecialMeteors = config.get(Configuration.CATEGORY_GENERAL, "1.12_enableSpecialMeteors", false).getBoolean(false); Property PuraniumSpawn = config.get(Configuration.CATEGORY_GENERAL, "2.00_uraniumSpawnrate", 7); PuraniumSpawn.comment = "Ammount of uranium ore veins per chunk"; diff --git a/com/hbm/main/ResourceManager.java b/com/hbm/main/ResourceManager.java index a4b98a339..97ab999ae 100644 --- a/com/hbm/main/ResourceManager.java +++ b/com/hbm/main/ResourceManager.java @@ -127,6 +127,11 @@ public class ResourceManager { public static final ResourceLocation turbofan_body_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turbofan_body.png"); public static final ResourceLocation turbofan_blades_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turbofan_blades.png"); + //Selenium Engine + public static final ResourceLocation selenium_body_tex = new ResourceLocation(RefStrings.MODID, "textures/models/selenium_engine_body.png"); + public static final ResourceLocation selenium_piston_tex = new ResourceLocation(RefStrings.MODID, "textures/models/selenium_engine_piston.png"); + public static final ResourceLocation selenium_rotor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/selenium_engine_rotor.png"); + //Press public static final ResourceLocation press_body_tex = new ResourceLocation(RefStrings.MODID, "textures/models/press_body.png"); public static final ResourceLocation press_head_tex = new ResourceLocation(RefStrings.MODID, "textures/models/press_head.png"); diff --git a/com/hbm/potion/PotionEffectBang.java b/com/hbm/potion/PotionEffectBang.java new file mode 100644 index 000000000..c9bf8a15c --- /dev/null +++ b/com/hbm/potion/PotionEffectBang.java @@ -0,0 +1,56 @@ +package com.hbm.potion; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.bomb.BlockTaint; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.lib.Library; +import com.hbm.lib.ModDamageSource; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; + +public class PotionEffectBang extends Potion { + + public static PotionEffectBang instance = new PotionEffectBang(Library.getFirstNullIndex(1, Potion.potionTypes), true, 1118481); + Random rand = new Random(); + + public PotionEffectBang(int p_i1573_1_, boolean p_i1573_2_, int p_i1573_3_) { + super(p_i1573_1_, p_i1573_2_, p_i1573_3_); + this.setPotionName("potion.hbm_bang"); + this.setIconIndex(3, 0); + } + + @Override + @SideOnly(Side.CLIENT) + public int getStatusIconIndex() { + ResourceLocation loc = new ResourceLocation("hbm","textures/gui/potions.png"); + Minecraft.getMinecraft().renderEngine.bindTexture(loc); + return super.getStatusIconIndex(); + } + + + public void performEffect(EntityLivingBase entity, int level) + { + entity.attackEntityFrom(ModDamageSource.bang, 1000); + entity.setHealth(0.0F); + entity.setDead(); + + entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:weapon.laserBang", 100.0F, 1.0F); + //entity.worldObj.spawnParticle("hugeexplosion", entity.posX, entity.posY, entity.posZ, 0, 0, 0); + ExplosionLarge.spawnParticles(entity.worldObj, entity.posX, entity.posY, entity.posZ, 10); + } + + public boolean isReady(int par1, int par2) + { + return par1 <= 10; + } + +} diff --git a/com/hbm/render/entity/MultiCloudRenderer.java b/com/hbm/render/entity/MultiCloudRenderer.java new file mode 100644 index 000000000..b95e95e60 --- /dev/null +++ b/com/hbm/render/entity/MultiCloudRenderer.java @@ -0,0 +1,145 @@ +package com.hbm.render.entity; + +import java.util.Random; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import com.hbm.entity.particle.EntityBSmokeFX; +import com.hbm.entity.particle.EntityModFX; +import com.hbm.items.ModItems; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class MultiCloudRenderer extends Render { + private Item[] field_94151_a; + private int field_94150_f; + private static final String __OBFID = "CL_00001008"; + + public MultiCloudRenderer(Item[] p_i1259_1_, int p_i1259_2_) { + this.field_94151_a = p_i1259_1_; + this.field_94150_f = p_i1259_2_; + } + + public MultiCloudRenderer(Item[] p_i1260_1_) { + this(p_i1260_1_, 0); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, + * always casting down its argument and then handing it off to a worker + * function which does the actual work. In all probabilty, the class Render + * is generic (Render= fx.maxAge / 8 * 7) { + item = field_94151_a[7]; + } + + if (fx.particleAge < fx.maxAge / 8 * 7 && fx.particleAge >= fx.maxAge / 8 * 6) { + item = field_94151_a[6]; + } + + if (fx.particleAge < fx.maxAge / 8 * 6 && fx.particleAge >= fx.maxAge / 8 * 5) { + item = field_94151_a[5]; + } + + if (fx.particleAge < fx.maxAge / 8 * 5 && fx.particleAge >= fx.maxAge / 8 * 4) { + item = field_94151_a[4]; + } + + if (fx.particleAge < fx.maxAge / 8 * 4 && fx.particleAge >= fx.maxAge / 8 * 3) { + item = field_94151_a[3]; + } + + if (fx.particleAge < fx.maxAge / 8 * 3 && fx.particleAge >= fx.maxAge / 8 * 2) { + item = field_94151_a[2]; + } + + if (fx.particleAge < fx.maxAge / 8 * 2 && fx.particleAge >= fx.maxAge / 8 * 1) { + item = field_94151_a[1]; + } + + if (fx.particleAge < fx.maxAge / 8 && fx.particleAge >= 0) { + item = field_94151_a[0]; + } + + IIcon iicon = item.getIconFromDamage(field_94150_f); + + if (iicon != null) { + GL11.glPushMatrix(); + GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glScalef(7.5F, 7.5F, 7.5F); + + Random rand = new Random(100); + + for(int i = 0; i < 5; i++) { + + double dX = (rand.nextGaussian() - 1D) * 0.15D; + double dY = (rand.nextGaussian() - 1D) * 0.15D; + double dZ = (rand.nextGaussian() - 1D) * 0.15D; + double size = rand.nextDouble() * 0.5D + 0.25D; + + GL11.glTranslatef((float) dX, (float) dY, (float) dZ); + GL11.glScaled(size, size, size); + + GL11.glPushMatrix(); + this.bindEntityTexture(p_76986_1_); + Tessellator tessellator = Tessellator.instance; + this.func_77026_a(tessellator, iicon); + GL11.glPopMatrix(); + + GL11.glScaled(1/size, 1/size, 1/size); + GL11.glTranslatef((float) -dX, (float) -dY, (float) -dZ); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called + * unless you call Render.bindEntityTexture. + */ + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return TextureMap.locationItemsTexture; + } + + private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) { + float f = p_77026_2_.getMinU(); + float f1 = p_77026_2_.getMaxU(); + float f2 = p_77026_2_.getMinV(); + float f3 = p_77026_2_.getMaxV(); + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + p_77026_1_.startDrawingQuads(); + p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); + p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3); + p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3); + p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2); + p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2); + p_77026_1_.draw(); + } +} diff --git a/com/hbm/render/entity/RenderBeam6.java b/com/hbm/render/entity/RenderBeam6.java new file mode 100644 index 000000000..0994c124a --- /dev/null +++ b/com/hbm/render/entity/RenderBeam6.java @@ -0,0 +1,82 @@ +package com.hbm.render.entity; + +import java.util.Random; + +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderBeam6 extends Render { + + Random rand = new Random(); + + @Override + public void doRender(Entity rocket, double x, double y, double z, float p_76986_8_, float p_76986_9_) { + //float radius = 0.12F; + //float radius = 0.06F; + float radius = 0.175F; + int distance = 2; + Tessellator tessellator = Tessellator.instance; + + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glTranslatef((float) x, (float) y, (float) z); + + GL11.glRotatef(rocket.rotationYaw, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-rocket.rotationPitch, 1.0F, 0.0F, 0.0F); + + boolean red = System.currentTimeMillis() % 250 < 124; + boolean green = false; + boolean blue = !red; + + for (float o = 0; o <= radius; o += radius / 8) { + float color = 1f - (o * 8.333f); + if (color < 0) + color = 0; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f); + tessellator.addVertex(0 + o, 0 - o, 0); + tessellator.addVertex(0 + o, 0 + o, 0); + tessellator.addVertex(0 + o, 0 + o, 0 + distance); + tessellator.addVertex(0 + o, 0 - o, 0 + distance); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f); + tessellator.addVertex(0 - o, 0 - o, 0); + tessellator.addVertex(0 + o, 0 - o, 0); + tessellator.addVertex(0 + o, 0 - o, 0 + distance); + tessellator.addVertex(0 - o, 0 - o, 0 + distance); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f); + tessellator.addVertex(0 - o, 0 + o, 0); + tessellator.addVertex(0 - o, 0 - o, 0); + tessellator.addVertex(0 - o, 0 - o, 0 + distance); + tessellator.addVertex(0 - o, 0 + o, 0 + distance); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(red ? 1 : color, green ? 1 : color, blue ? 1 : color, 1f); + tessellator.addVertex(0 + o, 0 + o, 0); + tessellator.addVertex(0 - o, 0 + o, 0); + tessellator.addVertex(0 - o, 0 + o, 0 + distance); + tessellator.addVertex(0 + o, 0 + o, 0 + distance); + tessellator.draw(); + } + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return new ResourceLocation(RefStrings.MODID + ":textures/models/PlasmaBeam.png"); + } +} diff --git a/com/hbm/render/tileentity/RenderSelenium.java b/com/hbm/render/tileentity/RenderSelenium.java index 3c3a0eb6c..fbce8da1a 100644 --- a/com/hbm/render/tileentity/RenderSelenium.java +++ b/com/hbm/render/tileentity/RenderSelenium.java @@ -33,7 +33,7 @@ public class RenderSelenium extends TileEntitySpecialRenderer { GL11.glRotatef(0, 0F, 1F, 0F); break; } - bindTexture(ResourceManager.universal); + bindTexture(ResourceManager.selenium_body_tex); ResourceManager.selenium_body.renderAll(); GL11.glTranslated(0.0D, 1.0D, 0.0D); @@ -41,14 +41,17 @@ public class RenderSelenium extends TileEntitySpecialRenderer { int count = ((TileEntityMachineSeleniumEngine)tileEntity).pistonCount; float rot = 360F / count; - + + bindTexture(ResourceManager.selenium_piston_tex); for(int i = 0; i < count; i++) { ResourceManager.selenium_piston.renderAll(); GL11.glRotatef(rot, 0, 0, 1); } - GL11.glRotatef((System.currentTimeMillis() / 10) % 360, 0F, 0F, -1F); - + if(count > 2 && ((TileEntityMachineSeleniumEngine)tileEntity).hasAcceptableFuel() && ((TileEntityMachineSeleniumEngine)tileEntity).tank.getFill() > 0) + GL11.glRotatef((System.currentTimeMillis() / 2) % 360, 0F, 0F, -1F); + + bindTexture(ResourceManager.selenium_rotor_tex); ResourceManager.selenium_rotor.renderAll(); GL11.glPopMatrix(); diff --git a/com/hbm/tileentity/machine/TileEntityAMSBase.java b/com/hbm/tileentity/machine/TileEntityAMSBase.java index 12dabf501..506c54e66 100644 --- a/com/hbm/tileentity/machine/TileEntityAMSBase.java +++ b/com/hbm/tileentity/machine/TileEntityAMSBase.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.List; import com.hbm.blocks.ModBlocks; +import com.hbm.entity.effect.EntityCloudFleijaRainbow; +import com.hbm.entity.logic.EntityNukeExplosionMK4; import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.explosion.ExplosionLarge; import com.hbm.handler.FluidTypeHandler.FluidType; @@ -69,8 +71,8 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS public TileEntityAMSBase() { slots = new ItemStack[16]; tanks = new FluidTank[4]; - tanks[0] = new FluidTank(FluidType.WATER, 8000, 0); - tanks[1] = new FluidTank(FluidType.COOLANT, 8000, 1); + tanks[0] = new FluidTank(FluidType.COOLANT, 8000, 0); + tanks[1] = new FluidTank(FluidType.CRYOGEL, 8000, 1); tanks[2] = new FluidTank(FluidType.DEUTERIUM, 8000, 2); tanks[3] = new FluidTank(FluidType.TRITIUM, 8000, 3); } @@ -243,6 +245,9 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS if (!worldObj.isRemote) { + for(int i = 0; i < tanks.length; i++) + tanks[i].setFill(tanks[i].getMaxFill()); + if(!locked) { age++; @@ -323,7 +328,7 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS if(slots[8] != null && slots[9] != null && slots[10] != null && slots[11] != null && slots[12] != null && slots[8].getItem() instanceof ItemCatalyst && slots[9].getItem() instanceof ItemCatalyst && slots[10].getItem() instanceof ItemCatalyst && slots[11].getItem() instanceof ItemCatalyst && - slots[12].getItem() instanceof ItemAMSCore && hasResonators()) { + slots[12].getItem() instanceof ItemAMSCore && hasResonators() && efficiency > 0) { int a = ((ItemCatalyst)slots[8].getItem()).getColor(); int b = ((ItemCatalyst)slots[9].getItem()).getColor(); int c = ((ItemCatalyst)slots[10].getItem()).getColor(); @@ -356,7 +361,7 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS if(this.getFuelPower(tanks[2].getTankType()) > 0 && this.getFuelPower(tanks[3].getTankType()) > 0 && tanks[2].getFill() > 0 && tanks[3].getFill() > 0) { - power += (powerBase * powerMod * gauss(1, (heat - (maxHeat / 2)) / maxHeat)); + power += (powerBase * powerMod * gauss(1, (heat - (maxHeat / 2)) / maxHeat)) / 1000 * getFuelPower(tanks[2].getTankType()) * getFuelPower(tanks[3].getTankType()); heat += (heatBase * heatMod) / (float)(this.field / 100F); tanks[2].setFill((int)(tanks[2].getFill() - fuelBase * fuelMod)); tanks[3].setFill((int)(tanks[3].getFill() - fuelBase * fuelMod)); @@ -372,7 +377,7 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS heat = maxHeat; } - if(field < 2) + if(field <= 0) explode(); } } @@ -437,7 +442,21 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS } private void explode() { - + if(!worldObj.isRemote) { + + for(int i = 0; i < 10; i++) { + + EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, 100); + cloud.posX = xCoord + rand.nextInt(201) - 100; + cloud.posY = yCoord + rand.nextInt(201) - 100; + cloud.posZ = zCoord + rand.nextInt(201) - 100; + this.worldObj.spawnEntityInWorld(cloud); + } + + int radius = (int)(100 + (double)(tanks[2].getFill() + tanks[3].getFill()) / 16000D * 150); + + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFacExperimental(worldObj, 10, xCoord, yCoord, zCoord)); + } } private int getCoolingStrength(FluidType type) { @@ -458,9 +477,9 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS private int getFuelPower(FluidType type) { switch(type) { case DEUTERIUM: - return 50000; + return 50; case TRITIUM: - return 75000; + return 75; default: return 0; } @@ -538,7 +557,7 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS } - return false; + return true; } @Override diff --git a/com/hbm/tileentity/machine/TileEntityAMSEmitter.java b/com/hbm/tileentity/machine/TileEntityAMSEmitter.java index 0c66dcd25..a111636c8 100644 --- a/com/hbm/tileentity/machine/TileEntityAMSEmitter.java +++ b/com/hbm/tileentity/machine/TileEntityAMSEmitter.java @@ -328,6 +328,9 @@ public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory, warning = 3; } + tank.setTankType(FluidType.CRYOGEL); + tank.setFill(tank.getMaxFill()); + PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, locked ? 1 : 0, 0)); PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, efficiency, 1)); diff --git a/com/hbm/tileentity/machine/TileEntityAMSLimiter.java b/com/hbm/tileentity/machine/TileEntityAMSLimiter.java index d7179850f..912d78add 100644 --- a/com/hbm/tileentity/machine/TileEntityAMSLimiter.java +++ b/com/hbm/tileentity/machine/TileEntityAMSLimiter.java @@ -345,6 +345,9 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory, power = 0; warning = 3; } + + tank.setTankType(FluidType.CRYOGEL); + tank.setFill(tank.getMaxFill()); PacketDispatcher.wrapper.sendToAll(new AuxElectricityPacket(xCoord, yCoord, zCoord, power)); PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, locked ? 1 : 0, 0));