From fcfa5cee550a7f3dacf06f481c78413dbbcf9433 Mon Sep 17 00:00:00 2001 From: Pheonix Date: Sun, 19 Jun 2022 18:11:16 +0100 Subject: [PATCH 1/2] plentiful amounts of dosh --- .../java/com/hbm/crafting/WeaponRecipes.java | 2 + .../entity/projectile/EntityBulletBase.java | 1242 +++++++------- .../hbm/handler/BulletConfigSyncingUtil.java | 17 + .../com/hbm/handler/BulletConfiguration.java | 409 ++--- .../com/hbm/handler/GunConfiguration.java | 194 ++- .../hbm/handler/guncfg/GunPoweredFactory.java | 282 +++ src/main/java/com/hbm/items/ModItems.java | 4 + .../weapon/gununified/ItemEnergyGunBase.java | 331 ++++ src/main/java/com/hbm/main/ClientProxy.java | 1 + .../java/com/hbm/main/ResourceManager.java | 2 + src/main/java/com/hbm/main/ServerProxy.java | 3 +- .../entity/projectile/RenderBullet.java | 2 + .../item/weapon/ItemRenderWeaponGlass.java | 182 ++ .../com/hbm/render/util/RenderInfoSystem.java | 3 +- .../hbm/render/util/RenderScreenOverlay.java | 22 +- src/main/resources/assets/hbm/lang/en_US.lang | 11 +- .../hbm/models/weapons/glass_cannon.obj | 1506 +++++++++++++++++ .../models/weapons/glass_cannon_panel.png | Bin 0 -> 183 bytes 18 files changed, 3287 insertions(+), 926 deletions(-) create mode 100644 src/main/java/com/hbm/handler/guncfg/GunPoweredFactory.java create mode 100644 src/main/java/com/hbm/items/weapon/gununified/ItemEnergyGunBase.java create mode 100644 src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponGlass.java create mode 100644 src/main/resources/assets/hbm/models/weapons/glass_cannon.obj create mode 100644 src/main/resources/assets/hbm/textures/models/weapons/glass_cannon_panel.png diff --git a/src/main/java/com/hbm/crafting/WeaponRecipes.java b/src/main/java/com/hbm/crafting/WeaponRecipes.java index be12d3896..183cc1d43 100644 --- a/src/main/java/com/hbm/crafting/WeaponRecipes.java +++ b/src/main/java/com/hbm/crafting/WeaponRecipes.java @@ -2,6 +2,7 @@ package com.hbm.crafting; import com.hbm.blocks.ModBlocks; import com.hbm.inventory.OreDictManager; +import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.inventory.fluid.Fluids; import static com.hbm.inventory.OreDictManager.*; @@ -149,6 +150,7 @@ public class WeaponRecipes { //CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_darter, 1), new Object[] { "SST", " P", 'S', STEEL.plate(), 'T', ModItems.gas_empty, 'P', ANY_PLASTIC.ingot() }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fireext, 1), new Object[] { "HB", " T", 'H', ModItems.hull_small_steel, 'B', ModItems.bolt_tungsten, 'T', ModItems.tank_steel }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "TPS", "HHR", " L", 'T', ModItems.bolt_tungsten, 'P', STEEL.plate(), 'S', STEEL.ingot(), 'H', ModItems.hull_small_steel, 'R', ModItems.mechanism_rifle_1, 'L', ANY_PLASTIC.ingot()}); + CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_glass_cannon, 1), new Object[] { "GGC", "GTM", 'G', Item.getItemFromBlock(ModBlocks.glass_quartz), 'C', ModItems.battery_lithium_cell, 'T', ModItems.crt_display, 'M', ModItems.mechanism_special }); //Ammo assemblies CraftingManager.addRecipeAuto(new ItemStack(ModItems.pellet_flechette, 1), new Object[] { " L ", " L ", "LLL", 'L', PB.nugget() }); diff --git a/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java b/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java index ef9559883..8ba4652bb 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java +++ b/src/main/java/com/hbm/entity/projectile/EntityBulletBase.java @@ -1,621 +1,621 @@ -package com.hbm.entity.projectile; - -import java.lang.reflect.Field; -import java.util.List; - -import com.hbm.blocks.ModBlocks; -import com.hbm.blocks.generic.RedBarrel; -import com.hbm.entity.effect.EntityCloudFleijaRainbow; -import com.hbm.entity.effect.EntityEMPBlast; -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.ExplosionNukeGeneric; -import com.hbm.handler.BulletConfigSyncingUtil; -import com.hbm.handler.BulletConfiguration; -import com.hbm.main.MainRegistry; -import com.hbm.packet.AuxParticlePacketNT; -import com.hbm.packet.PacketDispatcher; -import com.hbm.potion.HbmPotion; -import com.hbm.util.ArmorUtil; -import com.hbm.util.BobMathUtil; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IProjectile; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -public class EntityBulletBase extends Entity implements IProjectile { - - private BulletConfiguration config; - public EntityLivingBase shooter; - public float overrideDamage; - - public BulletConfiguration getConfig() { - return config; - } - - public EntityBulletBase(World world) { - super(world); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - } - - public EntityBulletBase(World world, int config) { - super(world); - this.config = BulletConfigSyncingUtil.pullConfig(config); - this.dataWatcher.updateObject(18, config); - this.renderDistanceWeight = 10.0D; - - if(this.config == null) { - this.setDead(); - return; - } - - this.dataWatcher.updateObject(16, (byte)this.config.style); - this.dataWatcher.updateObject(17, (byte)this.config.trail); - - this.setSize(0.5F, 0.5F); - } - - public EntityBulletBase(World world, int config, EntityLivingBase entity) { - super(world); - this.config = BulletConfigSyncingUtil.pullConfig(config); - this.dataWatcher.updateObject(18, config); - shooter = entity; - - this.setLocationAndAngles(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ, entity.rotationYaw, entity.rotationPitch); - - double sideOffset = 0.16D; - - this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * sideOffset; - this.posY -= 0.1D; - this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * sideOffset; - this.setPosition(this.posX, this.posY, this.posZ); - - 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.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - - this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread); - - this.dataWatcher.updateObject(16, (byte)this.config.style); - this.dataWatcher.updateObject(17, (byte)this.config.trail); - } - - public EntityBulletBase(World world, int config, EntityLivingBase entity, EntityLivingBase target, float motion, float deviation) { - super(world); - - this.config = BulletConfigSyncingUtil.pullConfig(config); - this.dataWatcher.updateObject(18, config); - this.shooter = entity; - - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - - this.posY = entity.posY + entity.getEyeHeight() - 0.10000000149011612D; - double d0 = target.posX - entity.posX; - double d1 = target.boundingBox.minY + target.height / 3.0F - this.posY; - double d2 = target.posZ - entity.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(entity.posX + d4, this.posY, entity.posZ + d5, f2, f3); - this.yOffset = 0.0F; - this.setThrowableHeading(d0, d1, d2, motion, deviation); - } - - this.dataWatcher.updateObject(16, (byte)this.config.style); - this.dataWatcher.updateObject(17, (byte)this.config.trail); - } - - public boolean attackEntityFrom(DamageSource source, float amount) { - - this.setBeenAttacked(); - - if(source instanceof EntityDamageSource) { - EntityDamageSource dmg = (EntityDamageSource) source; - - if(dmg.damageType.equals("player")) { - this.motionX *= -1.5; - this.motionY *= -1.5; - this.motionZ *= -1.5; - return true; - } - } - return false; - } - - @Override - public void setThrowableHeading(double moX, double moY, double moZ, float mult1, float mult2) { - - float f2 = MathHelper.sqrt_double(moX * moX + moY * moY + moZ * moZ); - moX /= f2; - moY /= f2; - moZ /= f2; - moX += this.rand.nextGaussian() * mult2; - moY += this.rand.nextGaussian() * mult2; - moZ += this.rand.nextGaussian() * mult2; - moX *= mult1; - moY *= mult1; - moZ *= mult1; - this.motionX = moX; - this.motionY = moY; - this.motionZ = moZ; - - float f3 = MathHelper.sqrt_double(moX * moX + moZ * moZ); - this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(moX, moZ) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(moY, f3) * 180.0D / Math.PI); - } - - @Override - @SideOnly(Side.CLIENT) - public void setPositionAndRotation2(double x, double y, double z, float r0, float r1, int i) { - this.setPosition(x, y, z); - this.setRotation(r0, r1); - } - - @Override - @SideOnly(Side.CLIENT) - public void setVelocity(double x, double y, double z) { - this.motionX = x; - this.motionY = y; - this.motionZ = z; - - if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { - float f = MathHelper.sqrt_double(x * x + z * z); - this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(x, z) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(y, 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); - } - } - - @Override - protected void entityInit() { - //style - this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); - //trail - this.dataWatcher.addObject(17, Byte.valueOf((byte) 0)); - //bullet config sync - this.dataWatcher.addObject(18, Integer.valueOf((int) 0)); - } - - @Override - public void onUpdate() { - super.onUpdate(); - - if(config == null) - config = BulletConfigSyncingUtil.pullConfig(dataWatcher.getWatchableObjectInt(18)); - - if(config == null){ - this.setDead(); - return; - } - - if(this.config.blackPowder && this.ticksExisted == 1) { - - for(int i = 0; i < 15; i++) { - double mod = rand.nextDouble(); - this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, - (this.motionX + rand.nextGaussian() * 0.05) * mod, - (this.motionY + rand.nextGaussian() * 0.05) * mod, - (this.motionZ + rand.nextGaussian() * 0.05) * mod); - } - - double mod = 0.5; - this.worldObj.spawnParticle("flame", this.posX + this.motionX * mod, this.posY + this.motionY * mod, this.posZ + this.motionZ * mod, 0, 0, 0); - } - - if(config.maxAge == 0) { - this.setDead(); - return; - } - - 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); - } - - /// ZONE 1 START /// - //entity and block collision, plinking - - /// ZONE 2 START /// - //entity detection - Vec3 vecOrigin = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - Vec3 vecDestination = Vec3.createVectorHelper(this.posX + this.motionX * this.config.velocity, this.posY + this.motionY * this.config.velocity, this.posZ + this.motionZ * this.config.velocity); - MovingObjectPosition movement = this.worldObj.func_147447_a(vecOrigin, vecDestination, false, true, false); - vecOrigin = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - vecDestination = Vec3.createVectorHelper(this.posX + this.motionX * this.config.velocity, this.posY + this.motionY * this.config.velocity, this.posZ + this.motionZ * this.config.velocity); - - Entity victim = null; - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX * this.config.velocity, this.motionY * this.config.velocity, this.motionZ * this.config.velocity).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.shooter)) { - f1 = 0.3F; - AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1); - MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vecOrigin, vecDestination); - - if (movingobjectposition1 != null) { - double d1 = vecOrigin.distanceTo(movingobjectposition1.hitVec); - - if (d1 < d0 || d0 == 0.0D) { - victim = entity1; - d0 = d1; - } - } - } - } - - if (victim != null) { - movement = new MovingObjectPosition(victim); - movement.hitVec.yCoord += victim.height * 0.5D; - } - - /// ZONE 2 END /// - - boolean didBounce = false; - - if (movement != null) { - - //handle entity collision - if(movement.entityHit != null) { - - DamageSource damagesource = this.config.getDamage(this, shooter); - - if(!worldObj.isRemote) { - if(!config.doesPenetrate) { - this.setPosition(movement.hitVec.xCoord, movement.hitVec.yCoord, movement.hitVec.zCoord); - onEntityImpact(victim); - } else { - onEntityHurt(victim); - } - } - - float damage = rand.nextFloat() * (config.dmgMax - config.dmgMin) + config.dmgMin; - - if(overrideDamage != 0) - damage = overrideDamage; - - if(!victim.attackEntityFrom(damagesource, damage)) { - - try { - Field lastDamage = ReflectionHelper.findField(EntityLivingBase.class, "lastDamage", "field_110153_bc"); - - float dmg = (float) damage + lastDamage.getFloat(victim); - - victim.attackEntityFrom(damagesource, dmg); - } catch (Exception x) { } - } - - //handle block collision - } else if(worldObj.getBlock(movement.blockX, movement.blockY, movement.blockZ).getMaterial() != Material.air) { - - boolean hRic = rand.nextInt(100) < config.HBRC; - boolean doesRic = config.doesRicochet || hRic; - - if(!config.isSpectral && !doesRic) { - this.setPosition(movement.hitVec.xCoord, movement.hitVec.yCoord, movement.hitVec.zCoord); - this.onBlockImpact(movement.blockX, movement.blockY, movement.blockZ); - } - - if(doesRic) { - - Vec3 face = null; - - switch(movement.sideHit) { - case 0: - face = Vec3.createVectorHelper(0, -1, 0); break; - case 1: - face = Vec3.createVectorHelper(0, 1, 0); break; - case 2: - face = Vec3.createVectorHelper(0, 0, 1); break; - case 3: - face = Vec3.createVectorHelper(0, 0, -1); break; - case 4: - face = Vec3.createVectorHelper(-1, 0, 0); break; - case 5: - face = Vec3.createVectorHelper(1, 0, 0); break; - } - - if(face != null) { - - Vec3 vel = Vec3.createVectorHelper(motionX, motionY, motionZ); - vel.normalize(); - - boolean lRic = rand.nextInt(100) < config.LBRC; - double angle = Math.abs(BobMathUtil.getCrossAngle(vel, face) - 90); - - if(hRic || (angle <= config.ricochetAngle && lRic)) { - switch(movement.sideHit) { - case 0: - case 1: - motionY *= -1; break; - case 2: - case 3: - motionZ *= -1; break; - case 4: - case 5: - motionX *= -1; break; - } - - if(config.plink == 1) - worldObj.playSoundAtEntity(this, "hbm:weapon.ricochet", 0.25F, 1.0F); - if(config.plink == 2) - worldObj.playSoundAtEntity(this, "hbm:weapon.gBounce", 1.0F, 1.0F); - - onRicochet(movement.blockX, movement.blockY, movement.blockZ); - - } else { - if(!worldObj.isRemote) { - this.setPosition(movement.hitVec.xCoord, movement.hitVec.yCoord, movement.hitVec.zCoord); - onBlockImpact(movement.blockX, movement.blockY, movement.blockZ); - } - } - - this.posX += (movement.hitVec.xCoord - this.posX) * 0.6; - this.posY += (movement.hitVec.yCoord - this.posY) * 0.6; - this.posZ += (movement.hitVec.zCoord - this.posZ) * 0.6; - - this.motionX *= config.bounceMod; - this.motionY *= config.bounceMod; - this.motionZ *= config.bounceMod; - - didBounce = true; - } - } - } - - } - - /// ZONE 1 END /// - - if(!didBounce) { - motionY -= config.gravity; - this.posX += this.motionX * this.config.velocity; - this.posY += this.motionY * this.config.velocity; - this.posZ += this.motionZ * this.config.velocity; - this.setPosition(this.posX, this.posY, this.posZ); - } - - /// SPECIAL UPDATE BEHAVIOR /// - if(this.config.bUpdate != null) - this.config.bUpdate.behaveUpdate(this); - - float f2; - this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - - while(this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - - while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - - if(this.ticksExisted > config.maxAge) - this.setDead(); - - if(worldObj.isRemote && !config.vPFX.isEmpty()) { - - double motion = Math.min(Vec3.createVectorHelper(motionX, motionY, motionZ).lengthVector(), 0.1); - - for(double d = 0; d < motion; d += 0.0625) { - - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("type", "vanillaExt"); - nbt.setString("mode", config.vPFX); - nbt.setDouble("posX", (this.lastTickPosX - this.posX) * d + this.posX); - nbt.setDouble("posY", (this.lastTickPosY - this.posY) * d + this.posY); - nbt.setDouble("posZ", (this.lastTickPosZ - this.posZ) * d + this.posZ); - MainRegistry.proxy.effectNT(nbt); - } - } - - //this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - //this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - } - - //for when a bullet dies by hitting a block - private void onBlockImpact(int bX, int bY, int bZ) { - - if(config.bImpact != null) - config.bImpact.behaveBlockHit(this, bX, bY, bZ); - - if(!worldObj.isRemote && !config.liveAfterImpact) - this.setDead(); - - if(config.incendiary > 0 && !this.worldObj.isRemote) { - if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX, (int)posY, (int)posZ, Blocks.fire); - if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX + 1, (int)posY, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX + 1, (int)posY, (int)posZ, Blocks.fire); - if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX - 1, (int)posY, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX - 1, (int)posY, (int)posZ, Blocks.fire); - if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY + 1, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX, (int)posY + 1, (int)posZ, Blocks.fire); - if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY - 1, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX, (int)posY - 1, (int)posZ, Blocks.fire); - if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY, (int)posZ + 1) == Blocks.air) worldObj.setBlock((int)posX, (int)posY, (int)posZ + 1, Blocks.fire); - if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY, (int)posZ - 1) == Blocks.air) worldObj.setBlock((int)posX, (int)posY, (int)posZ - 1, Blocks.fire); - } - - if(config.emp > 0) - ExplosionNukeGeneric.empBlast(this.worldObj, (int)(this.posX + 0.5D), (int)(this.posY + 0.5D), (int)(this.posZ + 0.5D), config.emp); - - if(config.emp > 3) { - if (!this.worldObj.isRemote) { - - EntityEMPBlast cloud = new EntityEMPBlast(this.worldObj, config.emp); - cloud.posX = this.posX; - cloud.posY = this.posY + 0.5F; - cloud.posZ = this.posZ; - - this.worldObj.spawnEntityInWorld(cloud); - } - } - - if(config.jolt > 0 && !worldObj.isRemote) - ExplosionLarge.jolt(worldObj, posX, posY, posZ, config.jolt, 150, 0.25); - - if(config.explosive > 0 && !worldObj.isRemote) - worldObj.newExplosion(this, posX, posY, posZ, config.explosive, config.incendiary > 0, config.blockDamage); - - if(config.shrapnel > 0 && !worldObj.isRemote) - ExplosionLarge.spawnShrapnels(worldObj, posX, posY, posZ, config.shrapnel); - - if(config.chlorine > 0 && !worldObj.isRemote) { - ExplosionChaos.spawnChlorine(worldObj, posX, posY, posZ, config.chlorine, 1.5, 0); - worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F); - } - - if(config.rainbow > 0 && !worldObj.isRemote) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, config.rainbow)); - - EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, config.rainbow); - cloud.posX = this.posX; - cloud.posY = this.posY; - cloud.posZ = this.posZ; - this.worldObj.spawnEntityInWorld(cloud); - } - - if(config.nuke > 0 && !worldObj.isRemote) { - worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, config.nuke, posX, posY, posZ).mute()); - NBTTagCompound data = new NBTTagCompound(); - data.setString("type", "muke"); - if(MainRegistry.polaroidID == 11 || rand.nextInt(100) == 0) data.setBoolean("balefire", true); - PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250)); - worldObj.playSoundEffect(posX, posY, posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F); - } - - if(config.destroysBlocks && !worldObj.isRemote) { - if(worldObj.getBlock(bX, bY, bZ).getBlockHardness(worldObj, bX, bY, bZ) <= 120) - worldObj.func_147480_a(bX, bY, bZ, false); - } else if(config.doesBreakGlass && !worldObj.isRemote) { - if(worldObj.getBlock(bX, bY, bZ) == Blocks.glass || - worldObj.getBlock(bX, bY, bZ) == Blocks.glass_pane || - worldObj.getBlock(bX, bY, bZ) == Blocks.stained_glass || - worldObj.getBlock(bX, bY, bZ) == Blocks.stained_glass_pane) - worldObj.func_147480_a(bX, bY, bZ, false); - - if(worldObj.getBlock(bX, bY, bZ) == ModBlocks.red_barrel) - ((RedBarrel) ModBlocks.red_barrel).explode(worldObj, bX, bY, bZ); - } - } - - //for when a bullet dies by hitting a block - private void onRicochet(int bX, int bY, int bZ) { - - if(config.bRicochet != null) - config.bRicochet.behaveBlockRicochet(this, bX, bY, bZ); - } - - //for when a bullet dies by hitting an entity - private void onEntityImpact(Entity e) { - onEntityHurt(e); - onBlockImpact(-1, -1, -1); - - if(config.bHit != null) - config.bHit.behaveEntityHit(this, e); - } - - //for when a bullet hurts an entity, not necessarily dying - private void onEntityHurt(Entity e) { - - if(config.bHurt != null) - config.bHurt.behaveEntityHurt(this, e); - - if(config.incendiary > 0 && !worldObj.isRemote) { - e.setFire(config.incendiary); - } - - if(config.leadChance > 0 && !worldObj.isRemote && worldObj.rand.nextInt(100) < config.leadChance && e instanceof EntityLivingBase) { - ((EntityLivingBase)e).addPotionEffect(new PotionEffect(HbmPotion.lead.id, 10 * 20, 0)); - } - - if(e instanceof EntityLivingBase && config.effects != null && !config.effects.isEmpty() && !worldObj.isRemote) { - - for(PotionEffect effect : config.effects) { - ((EntityLivingBase)e).addPotionEffect(new PotionEffect(effect)); - } - } - - if(config.instakill && e instanceof EntityLivingBase && !worldObj.isRemote) { - - if(!(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)) - ((EntityLivingBase)e).setHealth(0.0F); - } - - if(config.caustic > 0 && e instanceof EntityPlayer){ - ArmorUtil.damageSuit((EntityPlayer)e, 0, config.caustic); - ArmorUtil.damageSuit((EntityPlayer)e, 1, config.caustic); - ArmorUtil.damageSuit((EntityPlayer)e, 2, config.caustic); - ArmorUtil.damageSuit((EntityPlayer)e, 3, config.caustic); - } - } - - @Override - protected void readEntityFromNBT(NBTTagCompound nbt) { - - int cfg = nbt.getInteger("config"); - this.config = BulletConfigSyncingUtil.pullConfig(cfg); - - if(this.config == null) { - this.setDead(); - return; - } - - this.overrideDamage = nbt.getFloat("damage"); - - this.dataWatcher.updateObject(18, cfg); - - this.dataWatcher.updateObject(16, (byte)this.config.style); - this.dataWatcher.updateObject(17, (byte)this.config.trail); - } - - @Override - protected void writeEntityToNBT(NBTTagCompound nbt) { - - nbt.setInteger("config", dataWatcher.getWatchableObjectInt(18)); - - nbt.setFloat("damage", this.overrideDamage); - } - -} +package com.hbm.entity.projectile; + +import java.lang.reflect.Field; +import java.util.List; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.RedBarrel; +import com.hbm.entity.effect.EntityCloudFleijaRainbow; +import com.hbm.entity.effect.EntityEMPBlast; +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.ExplosionNukeGeneric; +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.BulletConfiguration; +import com.hbm.main.MainRegistry; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; +import com.hbm.potion.HbmPotion; +import com.hbm.util.ArmorUtil; +import com.hbm.util.BobMathUtil; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityBulletBase extends Entity implements IProjectile { + + private BulletConfiguration config; + public EntityLivingBase shooter; + public float overrideDamage; + + public BulletConfiguration getConfig() { + return config; + } + + public EntityBulletBase(World world) { + super(world); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityBulletBase(World world, int config) { + super(world); + this.config = BulletConfigSyncingUtil.pullConfig(config); + this.dataWatcher.updateObject(18, config); + this.renderDistanceWeight = 10.0D; + + if(this.config == null) { + this.setDead(); + return; + } + + this.dataWatcher.updateObject(16, (byte)this.config.style); + this.dataWatcher.updateObject(17, (byte)this.config.trail); + + this.setSize(0.5F, 0.5F); + } + + public EntityBulletBase(World world, int config, EntityLivingBase entity) { + super(world); + this.config = BulletConfigSyncingUtil.pullConfig(config); + this.dataWatcher.updateObject(18, config); + shooter = entity; + + this.setLocationAndAngles(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ, entity.rotationYaw, entity.rotationPitch); + + double sideOffset = 0.16D; + + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * sideOffset; + this.posY -= 0.1D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * sideOffset; + this.setPosition(this.posX, this.posY, this.posZ); + + 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.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread); + + this.dataWatcher.updateObject(16, (byte)this.config.style); + this.dataWatcher.updateObject(17, (byte)this.config.trail); + } + + public EntityBulletBase(World world, int config, EntityLivingBase entity, EntityLivingBase target, float motion, float deviation) { + super(world); + + this.config = BulletConfigSyncingUtil.pullConfig(config); + this.dataWatcher.updateObject(18, config); + this.shooter = entity; + + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + + this.posY = entity.posY + entity.getEyeHeight() - 0.10000000149011612D; + double d0 = target.posX - entity.posX; + double d1 = target.boundingBox.minY + target.height / 3.0F - this.posY; + double d2 = target.posZ - entity.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(entity.posX + d4, this.posY, entity.posZ + d5, f2, f3); + this.yOffset = 0.0F; + this.setThrowableHeading(d0, d1, d2, motion, deviation); + } + + this.dataWatcher.updateObject(16, (byte)this.config.style); + this.dataWatcher.updateObject(17, (byte)this.config.trail); + } + + public boolean attackEntityFrom(DamageSource source, float amount) { + + this.setBeenAttacked(); + + if(source instanceof EntityDamageSource) { + EntityDamageSource dmg = (EntityDamageSource) source; + + if(dmg.damageType.equals("player")) { + this.motionX *= -1.5; + this.motionY *= -1.5; + this.motionZ *= -1.5; + return true; + } + } + return false; + } + + @Override + public void setThrowableHeading(double moX, double moY, double moZ, float mult1, float mult2) { + + float f2 = MathHelper.sqrt_double(moX * moX + moY * moY + moZ * moZ); + moX /= f2; + moY /= f2; + moZ /= f2; + moX += this.rand.nextGaussian() * mult2; + moY += this.rand.nextGaussian() * mult2; + moZ += this.rand.nextGaussian() * mult2; + moX *= mult1; + moY *= mult1; + moZ *= mult1; + this.motionX = moX; + this.motionY = moY; + this.motionZ = moZ; + + float f3 = MathHelper.sqrt_double(moX * moX + moZ * moZ); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(moX, moZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(moY, f3) * 180.0D / Math.PI); + } + + @Override + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double x, double y, double z, float r0, float r1, int i) { + this.setPosition(x, y, z); + this.setRotation(r0, r1); + } + + @Override + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(y, 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); + } + } + + @Override + protected void entityInit() { + //style + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + //trail + this.dataWatcher.addObject(17, Byte.valueOf((byte) 0)); + //bullet config sync + this.dataWatcher.addObject(18, Integer.valueOf((int) 0)); + } + + @Override + public void onUpdate() { + super.onUpdate(); + + if(config == null) + config = BulletConfigSyncingUtil.pullConfig(dataWatcher.getWatchableObjectInt(18)); + + if(config == null){ + this.setDead(); + return; + } + + if(this.config.blackPowder && this.ticksExisted == 1) { + + for(int i = 0; i < 15; i++) { + double mod = rand.nextDouble(); + this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, + (this.motionX + rand.nextGaussian() * 0.05) * mod, + (this.motionY + rand.nextGaussian() * 0.05) * mod, + (this.motionZ + rand.nextGaussian() * 0.05) * mod); + } + + double mod = 0.5; + this.worldObj.spawnParticle("flame", this.posX + this.motionX * mod, this.posY + this.motionY * mod, this.posZ + this.motionZ * mod, 0, 0, 0); + } + + if(config.maxAge == 0) { + this.setDead(); + return; + } + + 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); + } + + /// ZONE 1 START /// + //entity and block collision, plinking + + /// ZONE 2 START /// + //entity detection + Vec3 vecOrigin = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vecDestination = Vec3.createVectorHelper(this.posX + this.motionX * this.config.velocity, this.posY + this.motionY * this.config.velocity, this.posZ + this.motionZ * this.config.velocity); + MovingObjectPosition movement = this.worldObj.func_147447_a(vecOrigin, vecDestination, false, true, false); + vecOrigin = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vecDestination = Vec3.createVectorHelper(this.posX + this.motionX * this.config.velocity, this.posY + this.motionY * this.config.velocity, this.posZ + this.motionZ * this.config.velocity); + + Entity victim = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX * this.config.velocity, this.motionY * this.config.velocity, this.motionZ * this.config.velocity).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.shooter)) { + f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vecOrigin, vecDestination); + + if (movingobjectposition1 != null) { + double d1 = vecOrigin.distanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) { + victim = entity1; + d0 = d1; + } + } + } + } + + if (victim != null) { + movement = new MovingObjectPosition(victim); + movement.hitVec.yCoord += victim.height * 0.5D; + } + + /// ZONE 2 END /// + + boolean didBounce = false; + + if (movement != null) { + + //handle entity collision + if(movement.entityHit != null) { + + DamageSource damagesource = this.config.getDamage(this, shooter); + + if(!worldObj.isRemote) { + if(!config.doesPenetrate) { + this.setPosition(movement.hitVec.xCoord, movement.hitVec.yCoord, movement.hitVec.zCoord); + onEntityImpact(victim); + } else { + onEntityHurt(victim); + } + } + + float damage = rand.nextFloat() * (config.dmgMax - config.dmgMin) + config.dmgMin; + + if(overrideDamage != 0) + damage = overrideDamage; + + if(!victim.attackEntityFrom(damagesource, damage)) { + + try { + Field lastDamage = ReflectionHelper.findField(EntityLivingBase.class, "lastDamage", "field_110153_bc"); + + float dmg = (float) damage + lastDamage.getFloat(victim); + + victim.attackEntityFrom(damagesource, dmg); + } catch (Exception x) { } + } + + //handle block collision + } else if(worldObj.getBlock(movement.blockX, movement.blockY, movement.blockZ).getMaterial() != Material.air) { + + boolean hRic = rand.nextInt(100) < config.HBRC; + boolean doesRic = config.doesRicochet || hRic; + + if(!config.isSpectral && !doesRic) { + this.setPosition(movement.hitVec.xCoord, movement.hitVec.yCoord, movement.hitVec.zCoord); + this.onBlockImpact(movement.blockX, movement.blockY, movement.blockZ); + } + + if(doesRic) { + + Vec3 face = null; + + switch(movement.sideHit) { + case 0: + face = Vec3.createVectorHelper(0, -1, 0); break; + case 1: + face = Vec3.createVectorHelper(0, 1, 0); break; + case 2: + face = Vec3.createVectorHelper(0, 0, 1); break; + case 3: + face = Vec3.createVectorHelper(0, 0, -1); break; + case 4: + face = Vec3.createVectorHelper(-1, 0, 0); break; + case 5: + face = Vec3.createVectorHelper(1, 0, 0); break; + } + + if(face != null) { + + Vec3 vel = Vec3.createVectorHelper(motionX, motionY, motionZ); + vel.normalize(); + + boolean lRic = rand.nextInt(100) < config.LBRC; + double angle = Math.abs(BobMathUtil.getCrossAngle(vel, face) - 90); + + if(hRic || (angle <= config.ricochetAngle && lRic)) { + switch(movement.sideHit) { + case 0: + case 1: + motionY *= -1; break; + case 2: + case 3: + motionZ *= -1; break; + case 4: + case 5: + motionX *= -1; break; + } + + if(config.plink == 1) + worldObj.playSoundAtEntity(this, "hbm:weapon.ricochet", 0.25F, 1.0F); + if(config.plink == 2) + worldObj.playSoundAtEntity(this, "hbm:weapon.gBounce", 1.0F, 1.0F); + + onRicochet(movement.blockX, movement.blockY, movement.blockZ); + + } else { + if(!worldObj.isRemote) { + this.setPosition(movement.hitVec.xCoord, movement.hitVec.yCoord, movement.hitVec.zCoord); + onBlockImpact(movement.blockX, movement.blockY, movement.blockZ); + } + } + + this.posX += (movement.hitVec.xCoord - this.posX) * 0.6; + this.posY += (movement.hitVec.yCoord - this.posY) * 0.6; + this.posZ += (movement.hitVec.zCoord - this.posZ) * 0.6; + + this.motionX *= config.bounceMod; + this.motionY *= config.bounceMod; + this.motionZ *= config.bounceMod; + + didBounce = true; + } + } + } + + } + + /// ZONE 1 END /// + + if(!didBounce) { + motionY -= config.gravity; + this.posX += this.motionX * this.config.velocity; + this.posY += this.motionY * this.config.velocity; + this.posZ += this.motionZ * this.config.velocity; + this.setPosition(this.posX, this.posY, this.posZ); + } + + /// SPECIAL UPDATE BEHAVIOR /// + if(this.config.bUpdate != null) + this.config.bUpdate.behaveUpdate(this); + + float f2; + this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while(this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + if(this.ticksExisted > config.maxAge) + this.setDead(); + + if(worldObj.isRemote && !config.vPFX.isEmpty()) { + + double motion = Math.min(Vec3.createVectorHelper(motionX, motionY, motionZ).lengthVector(), 0.1); + + for(double d = 0; d < motion; d += 0.0625) { + + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "vanillaExt"); + nbt.setString("mode", config.vPFX); + nbt.setDouble("posX", (this.lastTickPosX - this.posX) * d + this.posX); + nbt.setDouble("posY", (this.lastTickPosY - this.posY) * d + this.posY); + nbt.setDouble("posZ", (this.lastTickPosZ - this.posZ) * d + this.posZ); + MainRegistry.proxy.effectNT(nbt); + } + } + + //this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + //this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + } + + //for when a bullet dies by hitting a block + private void onBlockImpact(int bX, int bY, int bZ) { + + if(config.bImpact != null) + config.bImpact.behaveBlockHit(this, bX, bY, bZ); + + if(!worldObj.isRemote && !config.liveAfterImpact) + this.setDead(); + + if(config.incendiary > 0 && !this.worldObj.isRemote) { + if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX, (int)posY, (int)posZ, Blocks.fire); + if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX + 1, (int)posY, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX + 1, (int)posY, (int)posZ, Blocks.fire); + if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX - 1, (int)posY, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX - 1, (int)posY, (int)posZ, Blocks.fire); + if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY + 1, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX, (int)posY + 1, (int)posZ, Blocks.fire); + if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY - 1, (int)posZ) == Blocks.air) worldObj.setBlock((int)posX, (int)posY - 1, (int)posZ, Blocks.fire); + if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY, (int)posZ + 1) == Blocks.air) worldObj.setBlock((int)posX, (int)posY, (int)posZ + 1, Blocks.fire); + if(worldObj.rand.nextInt(3) == 0 && worldObj.getBlock((int)posX, (int)posY, (int)posZ - 1) == Blocks.air) worldObj.setBlock((int)posX, (int)posY, (int)posZ - 1, Blocks.fire); + } + + if(config.emp > 0) + ExplosionNukeGeneric.empBlast(this.worldObj, (int)(this.posX + 0.5D), (int)(this.posY + 0.5D), (int)(this.posZ + 0.5D), config.emp); + + if(config.emp > 3) { + if (!this.worldObj.isRemote) { + + EntityEMPBlast cloud = new EntityEMPBlast(this.worldObj, config.emp); + cloud.posX = this.posX; + cloud.posY = this.posY + 0.5F; + cloud.posZ = this.posZ; + + this.worldObj.spawnEntityInWorld(cloud); + } + } + + if(config.jolt > 0 && !worldObj.isRemote) + ExplosionLarge.jolt(worldObj, posX, posY, posZ, config.jolt, 150, 0.25); + + if(config.explosive > 0 && !worldObj.isRemote) + worldObj.newExplosion(this, posX, posY, posZ, config.explosive, config.incendiary > 0, config.blockDamage); + + if(config.shrapnel > 0 && !worldObj.isRemote) + ExplosionLarge.spawnShrapnels(worldObj, posX, posY, posZ, config.shrapnel); + + if(config.chlorine > 0 && !worldObj.isRemote) { + ExplosionChaos.spawnChlorine(worldObj, posX, posY, posZ, config.chlorine, 1.5, 0); + worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F); + } + + if(config.rainbow > 0 && !worldObj.isRemote) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0f, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + worldObj.spawnEntityInWorld(EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, config.rainbow)); + + EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(this.worldObj, config.rainbow); + cloud.posX = this.posX; + cloud.posY = this.posY; + cloud.posZ = this.posZ; + this.worldObj.spawnEntityInWorld(cloud); + } + + if(config.nuke > 0 && !worldObj.isRemote) { + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, config.nuke, posX, posY, posZ).mute()); + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "muke"); + if(MainRegistry.polaroidID == 11 || rand.nextInt(100) == 0) data.setBoolean("balefire", true); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250)); + worldObj.playSoundEffect(posX, posY, posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F); + } + + if(config.destroysBlocks && !worldObj.isRemote) { + if(worldObj.getBlock(bX, bY, bZ).getBlockHardness(worldObj, bX, bY, bZ) <= 120) + worldObj.func_147480_a(bX, bY, bZ, false); + } else if(config.doesBreakGlass && !worldObj.isRemote) { + if(worldObj.getBlock(bX, bY, bZ) == Blocks.glass || + worldObj.getBlock(bX, bY, bZ) == Blocks.glass_pane || + worldObj.getBlock(bX, bY, bZ) == Blocks.stained_glass || + worldObj.getBlock(bX, bY, bZ) == Blocks.stained_glass_pane) + worldObj.func_147480_a(bX, bY, bZ, false); + + if(worldObj.getBlock(bX, bY, bZ) == ModBlocks.red_barrel) + ((RedBarrel) ModBlocks.red_barrel).explode(worldObj, bX, bY, bZ); + } + } + + //for when a bullet dies by hitting a block + private void onRicochet(int bX, int bY, int bZ) { + + if(config.bRicochet != null) + config.bRicochet.behaveBlockRicochet(this, bX, bY, bZ); + } + + //for when a bullet dies by hitting an entity + private void onEntityImpact(Entity e) { + onEntityHurt(e); + onBlockImpact(-1, -1, -1); + + if(config.bHit != null) + config.bHit.behaveEntityHit(this, e); + } + + //for when a bullet hurts an entity, not necessarily dying + private void onEntityHurt(Entity e) { + + if(config.bHurt != null) + config.bHurt.behaveEntityHurt(this, e); + + if(config.incendiary > 0 && !worldObj.isRemote) { + e.setFire(config.incendiary); + } + + if(config.leadChance > 0 && !worldObj.isRemote && worldObj.rand.nextInt(100) < config.leadChance && e instanceof EntityLivingBase) { + ((EntityLivingBase)e).addPotionEffect(new PotionEffect(HbmPotion.lead.id, 10 * 20, 0)); + } + + if(e instanceof EntityLivingBase && config.effects != null && !config.effects.isEmpty() && !worldObj.isRemote) { + + for(PotionEffect effect : config.effects) { + ((EntityLivingBase)e).addPotionEffect(new PotionEffect(effect)); + } + } + + if(config.instakill && e instanceof EntityLivingBase && !worldObj.isRemote) { + + if(!(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)) + ((EntityLivingBase)e).setHealth(0.0F); + } + + if(config.caustic > 0 && e instanceof EntityPlayer){ + ArmorUtil.damageSuit((EntityPlayer)e, 0, config.caustic); + ArmorUtil.damageSuit((EntityPlayer)e, 1, config.caustic); + ArmorUtil.damageSuit((EntityPlayer)e, 2, config.caustic); + ArmorUtil.damageSuit((EntityPlayer)e, 3, config.caustic); + } + } + + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) { + + int cfg = nbt.getInteger("config"); + this.config = BulletConfigSyncingUtil.pullConfig(cfg); + + if(this.config == null) { + this.setDead(); + return; + } + + this.overrideDamage = nbt.getFloat("damage"); + + this.dataWatcher.updateObject(18, cfg); + + this.dataWatcher.updateObject(16, (byte)this.config.style); + this.dataWatcher.updateObject(17, (byte)this.config.trail); + } + + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) { + + nbt.setInteger("config", dataWatcher.getWatchableObjectInt(18)); + + nbt.setFloat("damage", this.overrideDamage); + } + +} diff --git a/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java b/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java index 60de27001..0386fa2c1 100644 --- a/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java +++ b/src/main/java/com/hbm/handler/BulletConfigSyncingUtil.java @@ -229,6 +229,14 @@ public class BulletConfigSyncingUtil { public static int DET_BOLT = i++; public static int TURBINE = i++; + + public static int GLASS_EMRADIO = i++; + public static int GLASS_EMMICRO = i++; + public static int GLASS_EMIR = i++; + public static int GLASS_EMVISIBLE = i++; + public static int GLASS_EMUV = i++; + public static int GLASS_EMXRAY = i++; + public static int GLASS_EMGAMMA = i++; public static int CHL_LR22 = i++; public static int CHL_LR22_FIRE = i++; @@ -472,6 +480,15 @@ public class BulletConfigSyncingUtil { configSet.put(DET_BOLT, GunDetonatorFactory.getLaserConfig()); configSet.put(TURBINE, GunEnergyFactory.getTurbineConfig()); + + configSet.put(GLASS_EMRADIO, GunPoweredFactory.getEMRadioConfig()); + configSet.put(GLASS_EMMICRO, GunPoweredFactory.getEMMicroConfig()); + configSet.put(GLASS_EMIR, GunPoweredFactory.getEMInfraredConfig()); + configSet.put(GLASS_EMVISIBLE, GunPoweredFactory.getEMVisibleConfig()); + configSet.put(GLASS_EMUV, GunPoweredFactory.getEMUVConfig()); + configSet.put(GLASS_EMXRAY, GunPoweredFactory.getEMXrayConfig()); + configSet.put(GLASS_EMGAMMA, GunPoweredFactory.getEMGammaConfig()); + configSet.put(CHL_LR22, Gun22LRFactory.get22LRConfig().setToHoming(ModItems.ammo_22lr_chlorophyte)); configSet.put(CHL_LR22_FIRE, Gun22LRFactory.get22LRConfig().setToFire(3).setToHoming(ModItems.ammo_22lr_chlorophyte)); diff --git a/src/main/java/com/hbm/handler/BulletConfiguration.java b/src/main/java/com/hbm/handler/BulletConfiguration.java index 4aa8c75ee..bf7a6f789 100644 --- a/src/main/java/com/hbm/handler/BulletConfiguration.java +++ b/src/main/java/com/hbm/handler/BulletConfiguration.java @@ -1,198 +1,211 @@ -package com.hbm.handler; - -import java.util.List; - -import com.hbm.entity.projectile.EntityBulletBase; -import com.hbm.handler.guncfg.BulletConfigFactory; -import com.hbm.interfaces.IBulletHitBehavior; -import com.hbm.interfaces.IBulletHurtBehavior; -import com.hbm.interfaces.IBulletImpactBehavior; -import com.hbm.interfaces.IBulletRicochetBehavior; -import com.hbm.interfaces.IBulletUpdateBehavior; -import com.hbm.interfaces.Untested; -import com.hbm.lib.ModDamageSource; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.Item; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSourceIndirect; - -public class BulletConfiguration { - - //what item this specific configuration consumes - public Item ammo; - //how many ammo units one item restores - public int ammoCount = 1; - //how fast the bullet is (in sanics per second, or sps) - public float velocity; - //spread of bullets in gaussian range - public float spread; - //weapon durability reduced (centered around 10) - public int wear; - //greatest amount of pellets created each shot - public int bulletsMin; - //least amount of pellets created each shot - public int bulletsMax; - - //damage bounds - public float dmgMin; - public float dmgMax; - - //acceleration torwards neg Y - public double gravity; - //max age in ticks before despawning - public int maxAge; - - //whether the projectile should be able to bounce off of blocks - public boolean doesRicochet; - //the maximum angle at which the projectile should bounce - public double ricochetAngle; - //lower bound ricochet chance (below R angle) - public int LBRC; - //higher bound ricochet chance (above R angle) - public int HBRC; - //how much of the initial velocity is kept after bouncing - public double bounceMod; - - //whether or not the bullet should penetrate mobs - public boolean doesPenetrate; - //whether or not the bullet should phase through blocks - public boolean isSpectral; - //whether or not the bullet should break glass - public boolean doesBreakGlass; - //whether the bullet should stay alive after colliding with a block - public boolean liveAfterImpact; - - //creates a "muzzle flash" and a ton of smoke with every projectile spawned - public boolean blackPowder = false; - - //bullet effects - public List effects; - public int incendiary; - public int emp; - public boolean blockDamage = true; - public float explosive; - public double jolt; - public int rainbow; - public int nuke; - public int shrapnel; - public int chlorine; - public int leadChance; - public int caustic; - public boolean destroysBlocks; - public boolean instakill; - public IBulletHurtBehavior bHurt; - public IBulletHitBehavior bHit; - public IBulletRicochetBehavior bRicochet; - public IBulletImpactBehavior bImpact; - public IBulletUpdateBehavior bUpdate; - - //appearance - public int style; - //additional appearance data, i.e. particle effects - public int trail; - //ricochet sound type - public int plink; - //vanilla particle FX - public String vPFX = ""; - - public String damageType = ModDamageSource.s_bullet; - public boolean dmgProj = true; - public boolean dmgFire = false; - public boolean dmgExplosion = false; - public boolean dmgBypass = false; - - public static final int STYLE_NONE = -1; - public static final int STYLE_NORMAL = 0; - public static final int STYLE_PISTOL = 1; - public static final int STYLE_FLECHETTE = 2; - public static final int STYLE_PELLET = 3; - public static final int STYLE_BOLT = 4; - public static final int STYLE_FOLLY = 5; - public static final int STYLE_ROCKET = 6; - public static final int STYLE_STINGER = 7; - public static final int STYLE_NUKE = 8; - public static final int STYLE_MIRV = 9; - public static final int STYLE_GRENADE = 10; - public static final int STYLE_BF = 11; - public static final int STYLE_ORB = 12; - public static final int STYLE_METEOR = 13; - public static final int STYLE_APDS = 14; - public static final int STYLE_BLADE = 15; - public static final int STYLE_BARREL = 16; - - public static final int PLINK_NONE = 0; - public static final int PLINK_BULLET = 1; - public static final int PLINK_GRENADE = 2; - public static final int PLINK_ENERGY = 3; - public static final int PLINK_SING = 4; - - public static final int BOLT_LACUNAE = 0; - public static final int BOLT_NIGHTMARE = 1; - public static final int BOLT_LASER = 2; - public static final int BOLT_ZOMG = 3; - public static final int BOLT_WORM = 4; - - public BulletConfiguration setToBolt(int trail) { - - this.style = STYLE_BOLT; - this.trail = trail; - return this; - } - - public BulletConfiguration setToFire(int duration) { - - this.incendiary = duration; - return this; - } - - public BulletConfiguration setToGuided() { - - this.bUpdate = BulletConfigFactory.getLaserSteering(); - this.doesRicochet = false; - return this; - } - - public BulletConfiguration setToHoming(Item ammo) { - - this.ammo = ammo; - this.bUpdate = BulletConfigFactory.getHomingBehavior(200, 45); - this.dmgMin *= 1.5F; - this.dmgMax *= 1.5F; - this.wear *= 0.5; - this.doesRicochet = false; - this.doesPenetrate = false; - this.vPFX = "greendust"; - return this; - } - - public BulletConfiguration accuracyMod(float mod) { - - this.spread *= mod; - return this; - } - - @Untested - public DamageSource getDamage(EntityBulletBase bullet, EntityLivingBase shooter) { - - DamageSource dmg; - - String unloc = damageType; - - if(unloc.equals(ModDamageSource.s_zomg_prefix)) - unloc += (bullet.worldObj.rand.nextInt(5) + 1); //pain - - if(shooter != null) - dmg = new EntityDamageSourceIndirect(unloc, bullet, shooter); - else - dmg = new DamageSource(unloc); - - if(this.dmgProj) dmg.setProjectile(); - if(this.dmgFire) dmg.setFireDamage(); - if(this.dmgExplosion) dmg.setExplosion(); - if(this.dmgBypass) dmg.setDamageBypassesArmor(); - - return dmg; - } -} +package com.hbm.handler; + +import java.util.List; + +import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.handler.guncfg.BulletConfigFactory; +import com.hbm.interfaces.IBulletHitBehavior; +import com.hbm.interfaces.IBulletHurtBehavior; +import com.hbm.interfaces.IBulletImpactBehavior; +import com.hbm.interfaces.IBulletRicochetBehavior; +import com.hbm.interfaces.IBulletUpdateBehavior; +import com.hbm.interfaces.Untested; +import com.hbm.lib.ModDamageSource; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; +import net.minecraft.util.EnumChatFormatting; + +public class BulletConfiguration { + + //what item this specific configuration consumes + public Item ammo; + //how many ammo units one item restores + public int ammoCount = 1; + //how fast the bullet is (in sanics per second, or sps) + public float velocity; + //spread of bullets in gaussian range + public float spread; + //weapon durability reduced (centered around 10) + public int wear; + //greatest amount of pellets created each shot + public int bulletsMin; + //least amount of pellets created each shot + public int bulletsMax; + + //damage bounds + public float dmgMin; + public float dmgMax; + + //acceleration torwards neg Y + public double gravity; + //max age in ticks before despawning + public int maxAge; + + //whether the projectile should be able to bounce off of blocks + public boolean doesRicochet; + //the maximum angle at which the projectile should bounce + public double ricochetAngle; + //lower bound ricochet chance (below R angle) + public int LBRC; + //higher bound ricochet chance (above R angle) + public int HBRC; + //how much of the initial velocity is kept after bouncing + public double bounceMod; + + //whether or not the bullet should penetrate mobs + public boolean doesPenetrate; + //whether or not the bullet should phase through blocks + public boolean isSpectral; + //whether or not the bullet should break glass + public boolean doesBreakGlass; + //whether the bullet should stay alive after colliding with a block + public boolean liveAfterImpact; + + //creates a "muzzle flash" and a ton of smoke with every projectile spawned + public boolean blackPowder = false; + + //bullet effects + public List effects; + public int incendiary; + public int emp; + public boolean blockDamage = true; + public float explosive; + public double jolt; + public int rainbow; + public int nuke; + public int shrapnel; + public int chlorine; + public int leadChance; + public int caustic; + public boolean destroysBlocks; + public boolean instakill; + public IBulletHurtBehavior bHurt; + public IBulletHitBehavior bHit; + public IBulletRicochetBehavior bRicochet; + public IBulletImpactBehavior bImpact; + public IBulletUpdateBehavior bUpdate; + + //appearance + public int style; + //additional appearance data, i.e. particle effects + public int trail; + //ricochet sound type + public int plink; + //vanilla particle FX + public String vPFX = ""; + + //energy projectiles + //power consumed per shot + public int dischargePerShot; + //unlocalised firing mode name + public String modeName; + //firing mode text colour + public EnumChatFormatting chatColour = EnumChatFormatting.WHITE; + //firing rate + public int firingRate; + + public String damageType = ModDamageSource.s_bullet; + public boolean dmgProj = true; + public boolean dmgFire = false; + public boolean dmgExplosion = false; + public boolean dmgBypass = false; + + public static final int STYLE_NONE = -1; + public static final int STYLE_NORMAL = 0; + public static final int STYLE_PISTOL = 1; + public static final int STYLE_FLECHETTE = 2; + public static final int STYLE_PELLET = 3; + public static final int STYLE_BOLT = 4; + public static final int STYLE_FOLLY = 5; + public static final int STYLE_ROCKET = 6; + public static final int STYLE_STINGER = 7; + public static final int STYLE_NUKE = 8; + public static final int STYLE_MIRV = 9; + public static final int STYLE_GRENADE = 10; + public static final int STYLE_BF = 11; + public static final int STYLE_ORB = 12; + public static final int STYLE_METEOR = 13; + public static final int STYLE_APDS = 14; + public static final int STYLE_BLADE = 15; + public static final int STYLE_BARREL = 16; + + public static final int PLINK_NONE = 0; + public static final int PLINK_BULLET = 1; + public static final int PLINK_GRENADE = 2; + public static final int PLINK_ENERGY = 3; + public static final int PLINK_SING = 4; + + public static final int BOLT_LACUNAE = 0; + public static final int BOLT_NIGHTMARE = 1; + public static final int BOLT_LASER = 2; + public static final int BOLT_ZOMG = 3; + public static final int BOLT_WORM = 4; + public static final int BOLT_GLASS_CYAN = 5; + public static final int BOLT_GLASS_BLUE = 6; + + public BulletConfiguration setToBolt(int trail) { + + this.style = STYLE_BOLT; + this.trail = trail; + return this; + } + + public BulletConfiguration setToFire(int duration) { + + this.incendiary = duration; + return this; + } + + public BulletConfiguration setToGuided() { + + this.bUpdate = BulletConfigFactory.getLaserSteering(); + this.doesRicochet = false; + return this; + } + + public BulletConfiguration setToHoming(Item ammo) { + + this.ammo = ammo; + this.bUpdate = BulletConfigFactory.getHomingBehavior(200, 45); + this.dmgMin *= 1.5F; + this.dmgMax *= 1.5F; + this.wear *= 0.5; + this.doesRicochet = false; + this.doesPenetrate = false; + this.vPFX = "greendust"; + return this; + } + + public BulletConfiguration accuracyMod(float mod) { + + this.spread *= mod; + return this; + } + + @Untested + public DamageSource getDamage(EntityBulletBase bullet, EntityLivingBase shooter) { + + DamageSource dmg; + + String unloc = damageType; + + if(unloc.equals(ModDamageSource.s_zomg_prefix)) + unloc += (bullet.worldObj.rand.nextInt(5) + 1); //pain + + if(shooter != null) + dmg = new EntityDamageSourceIndirect(unloc, bullet, shooter); + else + dmg = new DamageSource(unloc); + + if(this.dmgProj) dmg.setProjectile(); + if(this.dmgFire) dmg.setFireDamage(); + if(this.dmgExplosion) dmg.setExplosion(); + if(this.dmgBypass) dmg.setDamageBypassesArmor(); + + return dmg; + } +} diff --git a/src/main/java/com/hbm/handler/GunConfiguration.java b/src/main/java/com/hbm/handler/GunConfiguration.java index 2cee04fb5..1390bb5fb 100644 --- a/src/main/java/com/hbm/handler/GunConfiguration.java +++ b/src/main/java/com/hbm/handler/GunConfiguration.java @@ -1,93 +1,101 @@ -package com.hbm.handler; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import com.hbm.render.anim.BusAnimation; -import com.hbm.render.anim.HbmAnimations.AnimType; -import com.hbm.render.util.RenderScreenOverlay.Crosshair; - -public class GunConfiguration { - - /** - * alt function restrictions: - * alt can not be reloaded (reload type of 0, ammo cap of 0) - * alt cooldown and main cooldown are shared (alt cooldown will almoast always be greater or equal) - * alt is always the lower priority, mouse2 will be canceled then mouse1 is activated at the same time - * restrictions must be applied in gun's logic, mechanism may be dysfunctional if these rules are ignored - */ - - //amount of ticks between each bullet - public int rateOfFire; - //amount of bullets fired per delay passed - public int roundsPerCycle; - //0 = normal, 1 = release, 2 = both - public int gunMode; - //0 = manual, 1 = automatic - public int firingMode; - //weapon won't fire after weapon breaks (main only) - public int durability; - - //animations! - public HashMap animations = new HashMap(); - //whether ot not to disable crosshais when sneaking - public boolean hasSights; - - //how long the reload animation will play - //MUST BE GREATER THAN ZERO ! ! ! - public int reloadDuration; - //duration of every animation cycle - public int firingDuration; - //sound path to the reload sound - public String reloadSound = ""; - //sound path to the shooting sound - public String firingSound = ""; - public float firingPitch = 1.0F; - //whether the reload sound should be played at the beginning or at the end of the reload - public boolean reloadSoundEnd = true; - - //how much ammo the clip can hold, 0 if drawn from inventory - public int ammoCap; - //0 does not allow direct reload, 1 is full clip, 2 is single bullet - public int reloadType; - //whether or not the infinity enchantment should work - public boolean allowsInfinity; - //whether the ammo count should be displayed - public boolean showAmmo = true; - - public String name = ""; - public String manufacturer = ""; - public List comment = new ArrayList(); - - //bullet configs for main and alt fire - public List config = new ArrayList(); - - //crosshair - public Crosshair crosshair; - - public static final int MODE_NORMAL = 0; - public static final int MODE_RELEASE = 1; - public static final int MODE_BOTH = 1; - - public static final int FIRE_MANUAL = 0; - public static final int FIRE_AUTO = 1; - - public static final int RELOAD_NONE = 0; - public static final int RELOAD_FULL = 1; - public static final int RELOAD_SINGLE = 2; - - public static final String RSOUND_REVOLVER = "hbm:weapon.revolverReload"; - public static final String RSOUND_RIFLE = ""; - public static final String RSOUND_MAG = "hbm:weapon.magReload"; - public static final String RSOUND_SHOTGUN = "hbm:weapon.shotgunReload"; - public static final String RSOUND_LAUNCHER = "hbm:weapon.rpgReload"; - public static final String RSOUND_GRENADE = "hbm:weapon.hkReload"; - public static final String RSOUND_FATMAN = "hbm:weapon.fatmanReload"; - - public GunConfiguration silenced() { - this.firingSound = "hbm:weapon.silencerShoot"; - return this; - } - -} +package com.hbm.handler; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import com.hbm.render.anim.BusAnimation; +import com.hbm.render.anim.HbmAnimations.AnimType; +import com.hbm.render.util.RenderScreenOverlay.Crosshair; + +public class GunConfiguration { + + /** + * alt function restrictions: + * alt can not be reloaded (reload type of 0, ammo cap of 0) + * alt cooldown and main cooldown are shared (alt cooldown will almoast always be greater or equal) + * alt is always the lower priority, mouse2 will be canceled then mouse1 is activated at the same time + * restrictions must be applied in gun's logic, mechanism may be dysfunctional if these rules are ignored + */ + + //amount of ticks between each bullet + public int rateOfFire; + //amount of bullets fired per delay passed + public int roundsPerCycle; + //0 = normal, 1 = release, 2 = both + public int gunMode; + //0 = manual, 1 = automatic + public int firingMode; + //weapon won't fire after weapon breaks (main only) + public int durability; + + //animations! + public HashMap animations = new HashMap(); + //whether ot not to disable crosshais when sneaking + public boolean hasSights; + + //how long the reload animation will play + //MUST BE GREATER THAN ZERO ! ! ! + public int reloadDuration; + //duration of every animation cycle + public int firingDuration; + //sound path to the reload sound + public String reloadSound = ""; + //sound path to the shooting sound + public String firingSound = ""; + public float firingPitch = 1.0F; + //whether the reload sound should be played at the beginning or at the end of the reload + public boolean reloadSoundEnd = true; + + //how much ammo the clip can hold, 0 if drawn from inventory + public int ammoCap; + //0 does not allow direct reload, 1 is full clip, 2 is single bullet + public int reloadType; + //whether or not the infinity enchantment should work + public boolean allowsInfinity; + //whether the ammo count should be displayed + public boolean showAmmo = true; + + //for electrically powered weapons: + //the Maximum capacity of the gun + public int maxCharge; + //the rate at which the gun is charged + public int chargeRate; + //how much energy is discharged per shot + public int dischargePerShot; + + public String name = ""; + public String manufacturer = ""; + public List comment = new ArrayList(); + + //bullet configs for main and alt fire + public List config = new ArrayList(); + + //crosshair + public Crosshair crosshair; + + public static final int MODE_NORMAL = 0; + public static final int MODE_RELEASE = 1; + public static final int MODE_BOTH = 1; + + public static final int FIRE_MANUAL = 0; + public static final int FIRE_AUTO = 1; + + public static final int RELOAD_NONE = 0; + public static final int RELOAD_FULL = 1; + public static final int RELOAD_SINGLE = 2; + + public static final String RSOUND_REVOLVER = "hbm:weapon.revolverReload"; + public static final String RSOUND_RIFLE = ""; + public static final String RSOUND_MAG = "hbm:weapon.magReload"; + public static final String RSOUND_SHOTGUN = "hbm:weapon.shotgunReload"; + public static final String RSOUND_LAUNCHER = "hbm:weapon.rpgReload"; + public static final String RSOUND_GRENADE = "hbm:weapon.hkReload"; + public static final String RSOUND_FATMAN = "hbm:weapon.fatmanReload"; + + public GunConfiguration silenced() { + this.firingSound = "hbm:weapon.silencerShoot"; + return this; + } + +} diff --git a/src/main/java/com/hbm/handler/guncfg/GunPoweredFactory.java b/src/main/java/com/hbm/handler/guncfg/GunPoweredFactory.java new file mode 100644 index 000000000..24b5574df --- /dev/null +++ b/src/main/java/com/hbm/handler/guncfg/GunPoweredFactory.java @@ -0,0 +1,282 @@ +package com.hbm.handler.guncfg; + +import java.util.ArrayList; + +import com.hbm.blocks.ModBlocks; +import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.explosion.ExplosionNT; +import com.hbm.explosion.ExplosionNT.ExAttrib; +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.BulletConfiguration; +import com.hbm.handler.GunConfiguration; +import com.hbm.interfaces.IBulletImpactBehavior; +import com.hbm.items.ModItems; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; +import com.hbm.render.util.RenderScreenOverlay.Crosshair; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.block.Block; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; + +public class GunPoweredFactory { + + public static GunConfiguration getGlassCannonConfig() { + + GunConfiguration config = new GunConfiguration(); + + config.roundsPerCycle = 1; + config.gunMode = GunConfiguration.MODE_NORMAL; + config.firingMode = GunConfiguration.FIRE_AUTO; + config.firingDuration = 0; + config.durability = 2500; + config.allowsInfinity = false; + config.crosshair = Crosshair.BOX; + config.firingSound = "hbm:weapon.zomgShoot"; + config.maxCharge = 1_000_000; + config.chargeRate = 2500; + + config.name = "LIY2001 Anti-Material Electromagnetic Rifle Prototype"; + config.manufacturer = "OxfordEM technologies"; + + config.config = new ArrayList(); + config.config.add(BulletConfigSyncingUtil.GLASS_EMRADIO); + config.config.add(BulletConfigSyncingUtil.GLASS_EMMICRO); + config.config.add(BulletConfigSyncingUtil.GLASS_EMIR); + config.config.add(BulletConfigSyncingUtil.GLASS_EMVISIBLE); + config.config.add(BulletConfigSyncingUtil.GLASS_EMUV); + config.config.add(BulletConfigSyncingUtil.GLASS_EMXRAY); + config.config.add(BulletConfigSyncingUtil.GLASS_EMGAMMA); + + return config; + } + + /*public static BulletConfiguration getGlassBoltConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 2.0F; + bullet.spread = 0F; + bullet.dmgMin = 30; + bullet.dmgMax = 40; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 90; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 1; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.plink = BulletConfiguration.PLINK_ENERGY; + bullet.trail = BulletConfiguration.BOLT_LASER; + bullet.dischargePerShot = 1000; + bullet.firingRate = 5; + bullet.modeName = "testMode"; + bullet.chatColour = EnumChatFormatting.RED; + + return bullet; + }*/ + + public static BulletConfiguration getEMRadioConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 4.0F; + bullet.spread = 0F; + bullet.dmgMin = 35; + bullet.dmgMax = 45; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 90; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 1; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.trail = BulletConfiguration.BOLT_LASER; + bullet.plink = BulletConfiguration.PLINK_ENERGY; + bullet.dischargePerShot = 25_000; + bullet.firingRate = 20; + bullet.modeName = "weapon.elecGun.glass_cannon.radio"; + bullet.chatColour = EnumChatFormatting.DARK_RED; + + return bullet; + } + + public static BulletConfiguration getEMMicroConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 3.0F; + bullet.spread = 0F; + bullet.dmgMin = 18; + bullet.dmgMax = 22; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 90; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 1; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.trail = BulletConfiguration.BOLT_LASER; + bullet.dischargePerShot = 12_500; + bullet.firingRate = 15; + bullet.modeName = "weapon.elecGun.glass_cannon.micro"; + bullet.chatColour = EnumChatFormatting.RED; + + return bullet; + } + + public static BulletConfiguration getEMInfraredConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 2.0F; + bullet.spread = 0F; + bullet.dmgMin = 9; + bullet.dmgMax = 11; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 90; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 1; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.trail = BulletConfiguration.BOLT_LASER; + bullet.dischargePerShot = 6_000; + bullet.firingRate = 10; + bullet.modeName = "weapon.elecGun.glass_cannon.ir"; + bullet.chatColour = EnumChatFormatting.RED; + + return bullet; + } + + public static BulletConfiguration getEMVisibleConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 2.0F; + bullet.spread = 0F; + bullet.dmgMin = 4; + bullet.dmgMax = 6; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 90; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 1; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.trail = BulletConfiguration.BOLT_WORM; + bullet.dischargePerShot = 2_500; + bullet.firingRate = 5; + bullet.modeName = "weapon.elecGun.glass_cannon.visible"; + bullet.chatColour = EnumChatFormatting.GREEN; + + return bullet; + } + + public static BulletConfiguration getEMUVConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 2.0F; + bullet.spread = 0F; + bullet.dmgMin = 3; + bullet.dmgMax = 3; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 90; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 1; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.trail = BulletConfiguration.BOLT_GLASS_CYAN; + bullet.dischargePerShot = 1_200; + bullet.firingRate = 3; + bullet.modeName = "weapon.elecGun.glass_cannon.uv"; + bullet.chatColour = EnumChatFormatting.AQUA; + + return bullet; + } + + public static BulletConfiguration getEMXrayConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 2.0F; + bullet.spread = 0F; + bullet.dmgMin = 2; + bullet.dmgMax = 2; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 90; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 1; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.trail = BulletConfiguration.BOLT_GLASS_BLUE; + bullet.dischargePerShot = 800; + bullet.firingRate = 2; + bullet.modeName = "weapon.elecGun.glass_cannon.xray"; + bullet.chatColour = EnumChatFormatting.BLUE; + + return bullet; + } + + public static BulletConfiguration getEMGammaConfig() { + + BulletConfiguration bullet = new BulletConfiguration(); + + bullet.velocity = 2.0F; + bullet.spread = 0F; + bullet.dmgMin = 1; + bullet.dmgMax = 1; + bullet.bulletsMin = 1; + bullet.bulletsMax = 1; + bullet.gravity = 0D; + bullet.maxAge = 100; + bullet.doesRicochet = true; + bullet.ricochetAngle = 90; + bullet.HBRC = 2; + bullet.LBRC = 90; + bullet.bounceMod = 1; + bullet.doesPenetrate = true; + bullet.style = BulletConfiguration.STYLE_BOLT; + bullet.trail = BulletConfiguration.BOLT_LACUNAE; + bullet.dischargePerShot = 400; + bullet.firingRate = 1; + bullet.modeName = "weapon.elecGun.glass_cannon.gamma"; + bullet.chatColour = EnumChatFormatting.LIGHT_PURPLE; + + return bullet; + } + +} diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 9ee90e9e7..1da4f3130 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -28,6 +28,7 @@ import com.hbm.items.tool.*; import com.hbm.items.tool.ItemToolAbility.EnumToolType; import com.hbm.items.weapon.*; import com.hbm.items.weapon.ItemMissile.*; +import com.hbm.items.weapon.gununified.ItemEnergyGunBase; import com.hbm.lib.RefStrings; import com.hbm.main.MainRegistry; import com.hbm.potion.HbmPotion; @@ -1710,6 +1711,7 @@ public class ModItems { public static Item gun_waluigi; public static Item gun_darter; public static Item gun_detonator; + public static Item gun_glass_cannon; public static Item crucible; @@ -4439,6 +4441,7 @@ public class ModItems { gun_dampfmaschine = new GunDampfmaschine().setUnlocalizedName("gun_dampfmaschine").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_dampfmaschine"); gun_darter = new ItemGunDart(GunDartFactory.getDarterConfig()).setFull3D().setUnlocalizedName("gun_darter").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter"); gun_detonator = new ItemGunDetonator(GunDetonatorFactory.getDetonatorConfig()).setFull3D().setUnlocalizedName("gun_detonator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter"); + gun_glass_cannon = new ItemEnergyGunBase(GunPoweredFactory.getGlassCannonConfig()).setFull3D().setUnlocalizedName("gun_glass_cannon").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter"); ToolMaterial matCrucible = EnumHelper.addToolMaterial("CRUCIBLE", 10, 3, 50.0F, 100.0F, 0); crucible = new ItemCrucible(5000, 1F, matCrucible).setUnlocalizedName("crucible").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":crucible"); @@ -7217,6 +7220,7 @@ public class ModItems { GameRegistry.registerItem(gun_darter, gun_darter.getUnlocalizedName()); GameRegistry.registerItem(gun_detonator, gun_detonator.getUnlocalizedName()); GameRegistry.registerItem(crucible, crucible.getUnlocalizedName()); + GameRegistry.registerItem(gun_glass_cannon, gun_glass_cannon.getUnlocalizedName()); //Ammo GameRegistry.registerItem(gun_revolver_iron_ammo, gun_revolver_iron_ammo.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/items/weapon/gununified/ItemEnergyGunBase.java b/src/main/java/com/hbm/items/weapon/gununified/ItemEnergyGunBase.java new file mode 100644 index 000000000..b89869fc9 --- /dev/null +++ b/src/main/java/com/hbm/items/weapon/gununified/ItemEnergyGunBase.java @@ -0,0 +1,331 @@ +package com.hbm.items.weapon.gununified; + +import java.util.List; + +import org.lwjgl.input.Mouse; + +import com.hbm.config.GeneralConfig; +import com.hbm.entity.projectile.EntityBulletBase; +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.BulletConfiguration; +import com.hbm.handler.GunConfiguration; +import com.hbm.handler.HbmKeybinds; +import com.hbm.interfaces.IHoldableWeapon; +import com.hbm.items.machine.ItemBattery; +import com.hbm.items.weapon.ItemGunBase; +import com.hbm.main.MainRegistry; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.GunAnimationPacket; +import com.hbm.packet.GunButtonPacket; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.PlayerInformPacket; +import com.hbm.render.anim.HbmAnimations.AnimType; +import com.hbm.render.util.RenderScreenOverlay; +import com.hbm.render.util.RenderScreenOverlay.Crosshair; +import com.hbm.util.BobMathUtil; +import com.hbm.util.ChatBuilder; +import com.hbm.util.I18nUtil; + +import api.hbm.energy.IBatteryItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; +import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre; + +public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem { + + public ItemEnergyGunBase(GunConfiguration config) { + super(config); + } + + public ItemEnergyGunBase(GunConfiguration config, GunConfiguration alt) { + super(config, alt); + } + + @Override +public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + list.add("Energy Stored: " + BobMathUtil.getShortNumber(getCharge(stack)) + "/" + BobMathUtil.getShortNumber(mainConfig.maxCharge) + "HE"); + list.add("Charge rate: " + BobMathUtil.getShortNumber(mainConfig.chargeRate) + "HE/t"); + + BulletConfiguration config = getConfig(stack); + + list.add(""); + list.add("Mode: " + I18nUtil.resolveKey(config.modeName)); + list.add("Mode info:"); + list.add("Average damage: " + ((float)(config.dmgMax + config.dmgMin) / 2F)); + list.add("Firing Rate: " + BobMathUtil.roundDecimal((1F / (((float)config.firingRate) / 20F)), 2) + " rounds per second"); + list.add("Power Consumption per Shot: " + BobMathUtil.getShortNumber(config.dischargePerShot) + "HE"); + + list.add(""); + list.add("Name: " + mainConfig.name); + list.add("Manufacturer: " + mainConfig.manufacturer); + + if(!mainConfig.comment.isEmpty()) { + list.add(""); + for(String s : mainConfig.comment) + list.add(EnumChatFormatting.ITALIC + s); + } + } + + @Override + @SideOnly(Side.CLIENT) + protected void updateClient(ItemStack stack, World world, EntityPlayer entity, int slot, boolean isCurrentItem) { + + if(!world.isRemote) + return; + + boolean clickLeft = Mouse.isButtonDown(0); + boolean clickRight = Mouse.isButtonDown(1); + boolean left = m1; + boolean right = m2; + + if(isCurrentItem) { + if(left && right) { + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 0)); + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 1)); + m1 = false; + m2 = false; + } + + if(left && !clickLeft) { + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 0)); + m1 = false; + endActionClient(stack, world, entity, true); + } + + if(right && !clickRight) { + PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(false, (byte) 1)); + m2 = false; + endActionClient(stack, world, entity, false); + } + } + } + + protected void updateServer(ItemStack stack, World world, EntityPlayer player, int slot, boolean isCurrentItem) { + + if(getDelay(stack) > 0 && isCurrentItem) + setDelay(stack, getDelay(stack) - 1); + + if(getIsMouseDown(stack) && !(player.getHeldItem() == stack)) { + setIsMouseDown(stack, false); + } + + if(getIsAltDown(stack) && !isCurrentItem) { + setIsAltDown(stack, false); + } + + if(GeneralConfig.enableGuns && mainConfig.firingMode == 1 && getIsMouseDown(stack) && tryShoot(stack, world, player, isCurrentItem)) { + + fire(stack, world, player); + setDelay(stack, getConfig(stack).firingRate); + } + } + + protected boolean tryShoot(ItemStack stack, World world, EntityPlayer player, boolean main) { + + + if(main && getDelay(stack) == 0) { + return getConfig(stack).dischargePerShot <= getCharge(stack); + } + + return false; + } + + protected void fire(ItemStack stack, World world, EntityPlayer player) { + + BulletConfiguration config = getConfig(stack); + + int bullets = config.bulletsMin; + + for(int k = 0; k < mainConfig.roundsPerCycle; k++) { + + if(config.bulletsMax > config.bulletsMin) + bullets += world.rand.nextInt(config.bulletsMax - config.bulletsMin); + + for(int i = 0; i < bullets; i++) { + spawnProjectile(world, player, stack, BulletConfigSyncingUtil.getKey(config)); + } + + setCharge(stack, getCharge(stack) - config.dischargePerShot);; + } + + world.playSoundAtEntity(player, mainConfig.firingSound, 1.0F, mainConfig.firingPitch); + + if(player.getDisplayName().equals("Vic4Games")) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "justTilt"); + nbt.setInteger("time", mainConfig.rateOfFire + 1); + PacketDispatcher.wrapper.sendTo(new AuxParticlePacketNT(nbt, player.posX, player.posY, player.posZ), (EntityPlayerMP) player); + } + } + + protected void spawnProjectile(World world, EntityPlayer player, ItemStack stack, int config) { + + EntityBulletBase bullet = new EntityBulletBase(world, config, player); + world.spawnEntityInWorld(bullet); + + if(this.mainConfig.animations.containsKey(AnimType.CYCLE) && player instanceof EntityPlayerMP) + PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player); + + } + + public void startAction(ItemStack stack, World world, EntityPlayer player, boolean main) { + + if(mainConfig.firingMode == mainConfig.FIRE_MANUAL && main && tryShoot(stack, world, player, main)) { + fire(stack, world, player); + setDelay(stack, mainConfig.rateOfFire); + + } + + if(!main && stack.getItem() instanceof ItemEnergyGunBase) { + + byte mode = stack.hasTagCompound() ? stack.getTagCompound().getByte("mode") : 0; + + if(!stack.hasTagCompound()) + stack.stackTagCompound = new NBTTagCompound(); + + mode++; + if(mode >= mainConfig.config.size()) { + mode = 0; + } + + stack.getTagCompound().setByte("mode", mode); + + if(!world.isRemote) { + BulletConfiguration config = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(mode)); + //PacketDispatcher.wrapper.sendTo(new PlayerInformPacket("" + config.chatColour + config.modeName, MainRegistry.proxy.ID_GUN_MODE), (EntityPlayerMP)player); + + player.addChatMessage(ChatBuilder.start("") + .nextTranslation("weapon.elecGun.modeChange").color(EnumChatFormatting.WHITE) + .nextTranslation(" ") + .nextTranslation(config.modeName).color(config.chatColour).flush()); + } + } + } + + // yummy boilerplate + + public boolean showDurabilityBar(ItemStack stack) { + return true; + } + + public double getDurabilityForDisplay(ItemStack stack) { + return 1D - (double) getCharge(stack) / (double) getMaxCharge(); + } + + @Override + public void chargeBattery(ItemStack stack, long i) { + if(stack.getItem() instanceof ItemEnergyGunBase) { + if(stack.hasTagCompound()) { + stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") + i); + } else { + stack.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound.setLong("charge", i); + } + } + } + + @Override + public void setCharge(ItemStack stack, long i) { + if(stack.getItem() instanceof ItemEnergyGunBase) { + if(stack.hasTagCompound()) { + stack.stackTagCompound.setLong("charge", i); + } else { + stack.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound.setLong("charge", i); + } + } + } + + @Override + public void dischargeBattery(ItemStack stack, long i) { + if(stack.getItem() instanceof ItemEnergyGunBase) { + if(stack.hasTagCompound()) { + stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i); + } else { + stack.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase)stack.getItem()).mainConfig.maxCharge - i); + } + } + } + + @Override + public long getCharge(ItemStack stack) { + if(stack.getItem() instanceof ItemEnergyGunBase) { + if(stack.hasTagCompound()) { + return stack.stackTagCompound.getLong("charge"); + } else { + stack.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase) stack.getItem()).mainConfig.maxCharge); + return stack.stackTagCompound.getLong("charge"); + } + } + + return 0; + } + + @Override + public long getMaxCharge() { + return mainConfig.maxCharge; + } + + @Override + public long getChargeRate() { + return mainConfig.chargeRate; + } + + @Override + public long getDischargeRate() { + return 0; + } + + public BulletConfiguration getConfig(ItemStack stack) { + + byte mode = 0; + + if(stack.hasTagCompound()) + mode = stack.getTagCompound().getByte("mode"); + + return BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(mode)); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tab, List list) { + + ItemStack stack = new ItemStack(item); + stack.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound.setLong("charge", ((ItemEnergyGunBase) item).getMaxCharge()); + + list.add(stack); + } + + @Override + @SideOnly(Side.CLIENT) + public void renderHUD(Pre event, ElementType type, EntityPlayer player, ItemStack stack) { + + if(type == ElementType.CROSSHAIRS && GeneralConfig.enableCrosshairs) { + + event.setCanceled(true); + + if(!(mainConfig.hasSights && player.isSneaking())) + RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, ((IHoldableWeapon)player.getHeldItem().getItem()).getCrosshair()); + else + RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, Crosshair.NONE); + } + } + +} diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index c5f5a931b..005846438 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -468,6 +468,7 @@ public class ClientProxy extends ServerProxy { MinecraftForgeClient.registerItemRenderer(ModItems.gun_detonator, new ItemRenderDetonatorLaser()); MinecraftForgeClient.registerItemRenderer(ModItems.detonator_laser, new ItemRenderDetonatorLaser()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderWeaponSpas12()); + MinecraftForgeClient.registerItemRenderer(ModItems.gun_glass_cannon, new ItemRenderWeaponGlass()); //multitool MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool()); MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool()); diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 63b42b856..fe61e64fa 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -657,6 +657,7 @@ public class ResourceManager { public static final IModelCustom detonator_laser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/detonator_laser.obj")); public static final IModelCustom spas_12 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/spas-12.obj")); public static final IModelCustom nightmare_dark = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/nightmare_dark.obj")); + public static final IModelCustom glass_cannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/glass_cannon.obj")); public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj")); @@ -732,6 +733,7 @@ public class ResourceManager { public static final ResourceLocation rem700sat_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ff/rem700sat.png"); public static final ResourceLocation detonator_laser_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/detonator_laser.png"); public static final ResourceLocation spas_12_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/spas-12.png"); + public static final ResourceLocation glass_cannon_panel_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/glass_cannon_panel.png"); public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png"); diff --git a/src/main/java/com/hbm/main/ServerProxy.java b/src/main/java/com/hbm/main/ServerProxy.java index eaf324f5f..19d2e4609 100644 --- a/src/main/java/com/hbm/main/ServerProxy.java +++ b/src/main/java/com/hbm/main/ServerProxy.java @@ -12,7 +12,7 @@ import net.minecraft.world.World; public class ServerProxy { - //sort by estimated time of display. longer lasting ones should be sortet at the top. + //sort by estimated time of display. longer lasting ones should be sorted at the top. public static final int ID_DUCK = 0; public static final int ID_FILTER = 1; public static final int ID_COMPASS = 2; @@ -21,6 +21,7 @@ public class ServerProxy { public static final int ID_HUD = 5; public static final int ID_DETONATOR = 6; public static final int ID_FLUID_ID = 7; + public static final int ID_GUN_MODE = 8; public void registerRenderInfo() { } public void registerTileEntitySpecialRenderer() { } diff --git a/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java b/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java index 1fea2da35..3d11f351c 100644 --- a/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java +++ b/src/main/java/com/hbm/render/entity/projectile/RenderBullet.java @@ -321,6 +321,8 @@ public class RenderBullet extends Render { case BulletConfiguration.BOLT_NIGHTMARE: red = 1F; green = 1F; blue = 0F; break; case BulletConfiguration.BOLT_LACUNAE: red = 0.25F; green = 0F; blue = 0.75F; break; case BulletConfiguration.BOLT_WORM: red = 0F; green = 1F; blue = 0F; break; + case BulletConfiguration.BOLT_GLASS_CYAN: red = 0F; green = 1F; blue = 1F; break; + case BulletConfiguration.BOLT_GLASS_BLUE: red = 0F; green = 0F; blue = 1F; break; case BulletConfiguration.BOLT_ZOMG: Random rand = new Random(eID * eID); diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponGlass.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponGlass.java new file mode 100644 index 000000000..02464712e --- /dev/null +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponGlass.java @@ -0,0 +1,182 @@ +package com.hbm.render.item.weapon; + +import org.lwjgl.opengl.GL11; + +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.handler.BulletConfiguration; +import com.hbm.items.weapon.gununified.ItemEnergyGunBase; +import com.hbm.main.ResourceManager; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.client.IItemRenderer.ItemRendererHelper; + +public class ItemRenderWeaponGlass implements IItemRenderer { + + public ItemRenderWeaponGlass() { } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch(type) { + case EQUIPPED: + case EQUIPPED_FIRST_PERSON: + case ENTITY: + case INVENTORY: + return true; + default: return false; + } + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + + return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING); + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + + GL11.glPushMatrix(); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + + + switch(type) { + + case EQUIPPED_FIRST_PERSON: + + double s0 = 0.5D; + GL11.glRotated(25, 0, 0, 1); + GL11.glTranslated(2.5, 0.15, 0.5); + GL11.glRotated(90, 0, -1, 0); + GL11.glRotatef(90, 0, 1, 0); + GL11.glScaled(s0, s0, s0); + + break; + + case EQUIPPED: + + double scale = 0.25D; + GL11.glScaled(-scale, scale, scale); + GL11.glRotatef(20F, -3.0F, -0.75F, -1.0F); + GL11.glRotatef(-170, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-30F, 2.0F, -1F, -5.0F); + GL11.glTranslatef(5F, -0.35F, 0.25F); + + break; + + case ENTITY: + + double s1 = 0.5D; + GL11.glScaled(s1, s1, s1); + + break; + + case INVENTORY: + + double s = 1.65D; + GL11.glTranslatef(8F, 8F, 0F); + GL11.glRotated(90, 0, 0, 1); + GL11.glRotated(135, 0, 0, 1); + GL11.glScaled(s, s, s); + + break; + + default: break; + } + + GL11.glShadeModel(GL11.GL_SMOOTH); + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(0.9F, 1.0F, 1.0F, 0.5F); + GL11.glDepthMask(false); + + ResourceManager.glass_cannon.renderPart("Gun"); + + GL11.glDepthMask(true); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + + Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.glass_cannon_panel_tex); + ResourceManager.glass_cannon.renderPart("Panel"); + + GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + int color = 0xFFFFFF; + double freq = 1; + + if(item.getItem() instanceof ItemEnergyGunBase) { + BulletConfiguration config = ((ItemEnergyGunBase)item.getItem()).getConfig(item); + String name = config.modeName; + switch(name) { + case "weapon.elecGun.glass_cannon.radio": color = 0xaa2200; freq = 0.5; break; + case "weapon.elecGun.glass_cannon.micro": color = 0xdc221f; freq = 1; break; + case "weapon.elecGun.glass_cannon.ir": color = 0xfc3d3a; freq = 1.5; break; + case "weapon.elecGun.glass_cannon.visible": color = 0x8fe325; freq = 2; break; + case "weapon.elecGun.glass_cannon.uv": color = 0x37d5f3; freq = 2.5; break; + case "weapon.elecGun.glass_cannon.xray": color = 0x2542fd; freq = 3; break; + case "weapon.elecGun.glass_cannon.gamma": color = 0xdc20f3; freq = 3.5; break; + } + } + + float px = 0.0625F; + GL11.glTranslatef(-2F, px * 18, -px * 14); + GL11.glRotatef(90, 0, 1, 0); + GL11.glTranslatef(-0.7F, -0.86F, -0.33F); + + Tessellator tess = Tessellator.instance; + tess.startDrawing(GL11.GL_QUADS); + + int sub = 32; + double width = px * 21.25; + double len = width / sub; + double time = System.currentTimeMillis() / -100D; + double amplitude = 0.075; + + tess.setColorOpaque_I(color); + + for(int i = 0; i < sub; i++) { + double h0 = Math.sin(freq * i * 0.5 + time) * amplitude; + double h1 = Math.sin(freq * (i + 1) * 0.5 + time) * amplitude; + tess.addVertex(0, -px * 0.25 + h1, len * (i + 1)); + tess.addVertex(0, px * 0.25 + h1, len * (i + 1)); + tess.addVertex(0, px * 0.25 + h0, len * i); + tess.addVertex(0, -px * 0.25 + h0, len * i); + } + tess.setColorOpaque_F(1F, 1F, 1F); + + tess.draw(); + + GL11.glEnable(GL11.GL_TEXTURE_2D); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopAttrib(); + + GL11.glShadeModel(GL11.GL_FLAT); + + GL11.glPopMatrix(); + + } + +} diff --git a/src/main/java/com/hbm/render/util/RenderInfoSystem.java b/src/main/java/com/hbm/render/util/RenderInfoSystem.java index cf82bcebf..64864d24a 100644 --- a/src/main/java/com/hbm/render/util/RenderInfoSystem.java +++ b/src/main/java/com/hbm/render/util/RenderInfoSystem.java @@ -50,8 +50,9 @@ public class RenderInfoSystem { if(event.type != ElementType.CROSSHAIRS) return; - if(this.messages.isEmpty()) + if(this.messages.isEmpty()) { return; + } Minecraft mc = Minecraft.getMinecraft(); ScaledResolution resolution = event.resolution; diff --git a/src/main/java/com/hbm/render/util/RenderScreenOverlay.java b/src/main/java/com/hbm/render/util/RenderScreenOverlay.java index 0b4fac23d..37c302d5d 100644 --- a/src/main/java/com/hbm/render/util/RenderScreenOverlay.java +++ b/src/main/java/com/hbm/render/util/RenderScreenOverlay.java @@ -124,22 +124,22 @@ public class RenderScreenOverlay { int pZ = resolution.getScaledHeight() - 21; Minecraft.getMinecraft().renderEngine.bindTexture(misc); - gui.drawTexturedModalRect(pX, pZ + 16, 94, 0, 52, 3); - gui.drawTexturedModalRect(pX + 1, pZ + 16, 95, 3, 50 - dura, 3); + gui.drawTexturedModalRect(pX, pZ + 16, 94, 0, 52, 3); + gui.drawTexturedModalRect(pX + 1, pZ + 16, 95, 3, 50 - dura, 3); String cap = max == -1 ? ("∞") : ("" + max); if(renderCount) Minecraft.getMinecraft().fontRenderer.drawString(count + " / " + cap, pX + 16, pZ + 6, 0xFFFFFF); - - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderHelper.enableGUIStandardItemLighting(); - itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(ammo), pX, pZ); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - - GL11.glPopMatrix(); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(ammo), pX, pZ); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + + GL11.glPopMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons); } diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 33e0cd4bc..d5c251854 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -1749,6 +1749,7 @@ item.gun_fireext.name=Fire Extinguisher item.gun_flamer.name=Mister Topaz item.gun_flechette.name=Flechette Rifle item.gun_folly.name=Prototype Digamma "Folly" +item.gun_glass_cannon.name=The Glass Cannon item.gun_hk69.name=Grenade Pistol item.gun_hp.name=HPP Lazerjet item.gun_hp_ammo.name=Ink Cartridge @@ -4205,4 +4206,12 @@ weapon.ability.fire=Flaming weapon.ability.radiation=Radioactive Blade weapon.ability.phosphorus=Phosphorus Tip weapon.ability.stun=Stunning -weapon.ability.vampire=Vampire \ No newline at end of file +weapon.ability.vampire=Vampire +weapon.elecGun.modeChange=Firing Mode Changed to: +weapon.elecGun.glass_cannon.radio=Radio Waves +weapon.elecGun.glass_cannon.micro=Microwaves +weapon.elecGun.glass_cannon.ir=Infrared +weapon.elecGun.glass_cannon.visible=Visible Light +weapon.elecGun.glass_cannon.uv=Ultraviolet Light +weapon.elecGun.glass_cannon.xray=X-rays +weapon.elecGun.glass_cannon.gamma=Gamma rays \ No newline at end of file diff --git a/src/main/resources/assets/hbm/models/weapons/glass_cannon.obj b/src/main/resources/assets/hbm/models/weapons/glass_cannon.obj new file mode 100644 index 000000000..5d4801d84 --- /dev/null +++ b/src/main/resources/assets/hbm/models/weapons/glass_cannon.obj @@ -0,0 +1,1506 @@ +# Blender v2.79 (sub 0) OBJ File: 'glass cannon.blend' +# www.blender.org +mtllib glass_cannon.mtl +o Panel +v -0.957058 0.082710 -0.154169 +v -2.339931 0.082710 -0.154169 +v -0.957058 0.428428 -0.154169 +v -2.339931 0.428428 -0.154169 +vt 1.000000 0.000000 +vt 0.000000 1.000000 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vn -0.0000 -0.0000 -1.0000 +usemtl None +s off +f 2/1/1 3/2/1 1/3/1 +f 2/1/1 4/4/1 3/2/1 +o Gun +v -6.768132 -0.608651 -0.071183 +v -6.768132 -0.608651 0.177301 +v -6.768132 0.608651 -0.071183 +v -6.768132 0.608651 0.177301 +v -6.042235 -0.608651 -0.071183 +v -6.042235 -0.608651 0.177301 +v -4.416506 0.608651 -0.071183 +v -4.416506 0.608651 0.177301 +v -5.857340 -0.349853 -0.071183 +v -5.857340 -0.349853 0.177301 +v -4.575360 -0.070112 -0.071183 +v -4.575360 -0.070112 0.177301 +v -6.697397 0.000000 -0.071183 +v -6.697397 -0.000000 0.177301 +v -4.575360 0.069396 -0.071183 +v -4.575360 0.069396 0.177301 +v -4.416506 0.069396 -0.071183 +v -4.416506 0.069396 0.177301 +v -4.416506 0.228480 -0.071183 +v -4.416506 0.228480 0.177301 +v -3.717851 0.228480 0.177301 +v -3.717851 0.069396 0.177301 +v -3.717851 0.069396 -0.071183 +v -3.717851 0.228480 -0.071183 +v -3.460813 -0.005938 0.098521 +v -3.460813 -0.005938 0.007597 +v -3.475813 -0.096862 0.098521 +v -3.475813 -0.096862 0.007597 +v -3.551737 -0.005938 0.098521 +v -3.551737 -0.005938 0.007597 +v -3.551737 -0.096862 0.098521 +v -3.551737 -0.096862 0.007597 +v -3.493274 -0.202370 0.007597 +v -3.493274 -0.202370 0.098521 +v -3.534873 -0.202370 0.098521 +v -3.534873 -0.202370 0.007597 +v -3.471128 -0.233832 0.007597 +v -3.471128 -0.233832 0.098521 +v -3.512727 -0.233832 0.098521 +v -3.512727 -0.233832 0.007597 +v -3.426685 -0.262829 0.007597 +v -3.426685 -0.262829 0.098521 +v -3.468284 -0.262829 0.098521 +v -3.468284 -0.262829 0.007597 +v -2.995137 0.092476 0.206852 +v -2.995137 0.092476 -0.100735 +v -2.995137 -0.233488 0.206852 +v -2.995137 -0.233488 -0.100735 +v -3.229668 0.092476 0.206852 +v -3.229668 0.092476 -0.100735 +v -3.229668 -0.233488 0.206852 +v -3.229668 -0.233488 -0.100735 +v -2.922384 -0.587753 -0.062582 +v -2.922384 -0.587753 0.168700 +v -2.922384 0.070022 -0.062582 +v -2.922384 0.070022 0.168700 +v -2.041304 -0.474147 -0.062582 +v -2.041304 -0.474147 0.168700 +v -2.041304 0.070022 -0.062582 +v -2.041304 0.070022 0.168700 +v -2.481844 0.079575 -0.062582 +v -2.481844 0.079575 0.168700 +v -2.481844 -0.596840 -0.062582 +v -2.481844 -0.596840 0.168700 +v -2.848017 0.070022 -0.062582 +v -2.115671 0.070022 0.168700 +v -2.115671 -0.483735 -0.062582 +v -2.848017 -0.578164 0.168700 +v -2.115671 0.070022 -0.062582 +v -2.848017 0.070022 0.168700 +v -2.848017 -0.578164 -0.062582 +v -2.115671 -0.483735 0.168700 +v -3.019653 0.079575 -0.062582 +v -3.019653 -0.659359 -0.062582 +v -3.019653 -0.659359 0.168700 +v -3.019653 0.079575 0.168700 +v -2.750748 0.079575 -0.062582 +v -2.212940 0.079575 0.168700 +v -1.944035 0.079575 0.168700 +v -1.944035 -0.534320 -0.062582 +v -1.944035 0.079575 -0.062582 +v -1.944035 -0.534320 0.168700 +v -2.212940 -0.565580 -0.062582 +v -2.750748 -0.628100 0.168700 +v -2.212940 0.079575 -0.062582 +v -2.750748 0.079575 0.168700 +v -2.750748 -0.628100 -0.062582 +v -2.212940 -0.565580 0.168700 +v -2.115671 0.070022 -0.034995 +v -2.041304 0.070022 -0.034995 +v -2.041304 -0.474147 -0.034995 +v -2.115671 -0.483735 -0.034995 +v -2.848017 0.070022 0.141113 +v -2.922384 0.070022 0.141113 +v -2.922384 -0.587753 0.141113 +v -2.848017 -0.578164 0.141113 +v -2.922384 0.070022 -0.034995 +v -2.848017 0.070022 -0.034995 +v -2.848017 -0.578164 -0.034995 +v -2.922384 -0.587753 -0.034995 +v -2.041304 0.070022 0.141113 +v -2.115671 0.070022 0.141113 +v -2.115671 -0.483735 0.141113 +v -2.041304 -0.474147 0.141113 +v 0.174835 0.619878 0.053059 +v 0.525755 0.619878 0.053059 +v 0.174835 0.558203 -0.095838 +v 0.525755 0.558203 -0.095838 +v 0.174835 0.409306 -0.157513 +v 0.525755 0.409306 -0.157513 +v 0.174835 0.260410 -0.095838 +v 0.525755 0.260410 -0.095838 +v 0.174835 0.198735 0.053059 +v 0.525755 0.198735 0.053059 +v 0.174835 0.260410 0.201956 +v 0.525755 0.260410 0.201956 +v 0.174835 0.409306 0.263631 +v 0.525755 0.409306 0.263631 +v 0.174835 0.558203 0.201956 +v 0.525755 0.558203 0.201956 +v 0.797183 0.510280 -0.047914 +v 0.797183 0.552104 0.053059 +v 0.797183 0.409306 -0.089739 +v 0.797183 0.308333 -0.047914 +v 0.797183 0.266509 0.053059 +v 0.797183 0.308333 0.154032 +v 0.797183 0.409306 0.195857 +v 0.797183 0.510280 0.154032 +v 5.754774 0.510280 -0.047914 +v 5.754774 0.552104 0.053060 +v 5.754774 0.409306 -0.089738 +v 5.754774 0.308333 -0.047914 +v 5.754774 0.266509 0.053060 +v 5.754774 0.308333 0.154033 +v 5.754774 0.409306 0.195857 +v 5.754774 0.510280 0.154033 +v 5.694566 0.218859 -0.116180 +v 5.694566 0.218859 0.222298 +v 5.694566 0.592156 -0.116180 +v 5.694566 0.592156 0.222298 +v 6.165412 0.218859 -0.116180 +v 6.165412 0.218859 0.222298 +v 6.165412 0.592156 -0.116180 +v 6.165412 0.592156 0.222298 +v 6.746629 0.632898 0.392439 +v 6.746629 0.632898 -0.286321 +v 6.746629 0.178117 -0.286321 +v 6.746629 0.178117 0.392439 +v 6.626379 0.468732 -0.251120 +v 6.626379 0.468732 0.357238 +v 6.626379 0.366923 -0.251120 +v 6.626379 0.366923 0.357238 +v 6.355749 0.294933 -0.171898 +v 6.355749 0.294933 0.278015 +v 6.168961 0.417828 -0.117219 +v 6.168960 0.417828 0.223336 +v 6.554389 0.540722 -0.230046 +v 6.554389 0.540722 0.336164 +v 6.355749 0.540722 -0.171898 +v 6.355749 0.540722 0.278015 +v 6.554389 0.294933 -0.230047 +v 6.554389 0.294933 0.336164 +v 6.746629 0.489125 -0.010440 +v 6.626379 0.468732 -0.018870 +v 6.605986 0.489125 -0.010440 +v 6.746629 0.425498 -0.036742 +v 6.626379 0.425498 -0.036742 +v 6.746629 0.335514 0.053059 +v 6.594971 0.335514 0.053059 +v 6.746629 0.361870 0.116558 +v 6.621326 0.361870 0.116558 +v 6.746629 0.489125 0.116558 +v 6.626379 0.468732 0.124988 +v 6.605986 0.489125 0.116558 +v 6.746629 0.515481 0.053059 +v 6.579631 0.515481 0.053059 +v 6.746629 0.361870 -0.010440 +v 6.621326 0.361870 -0.010440 +v 6.626379 0.366923 0.118647 +v 6.746629 0.425498 0.142860 +v 6.626379 0.425498 0.142860 +v 6.626379 0.366923 -0.012529 +v -0.561453 0.644182 -0.042506 +v -0.561453 0.644182 0.148624 +v -0.561453 0.789268 -0.042506 +v -0.561453 0.789268 0.148624 +v 0.278207 0.644182 -0.042506 +v 0.278207 0.644182 0.148624 +v 0.278207 0.789268 -0.042506 +v 0.278207 0.789268 0.148624 +v -0.364457 0.652663 0.053059 +v 0.223510 0.652663 0.053059 +v -0.364457 0.575695 -0.132757 +v 0.223510 0.575695 -0.132757 +v -0.364457 0.389880 -0.209724 +v 0.223510 0.389880 -0.209724 +v -0.364457 0.204064 -0.132757 +v 0.223510 0.204064 -0.132757 +v -0.364457 0.127097 0.053059 +v 0.223510 0.127097 0.053059 +v -0.364457 0.204064 0.238874 +v 0.223510 0.204064 0.238874 +v -0.364457 0.389880 0.315842 +v 0.223510 0.389880 0.315842 +v -0.364457 0.575695 0.238874 +v 0.223510 0.575695 0.238874 +v -0.928809 0.623811 0.053059 +v -0.272477 0.623811 0.053059 +v -0.928809 0.568069 -0.081513 +v -0.272477 0.568069 -0.081512 +v -0.928809 0.433498 -0.137254 +v -0.272477 0.433498 -0.137254 +v -0.928809 0.298927 -0.081513 +v -0.272477 0.298927 -0.081512 +v -0.928809 0.243185 0.053059 +v -0.272477 0.243185 0.053059 +v -0.928809 0.298927 0.187630 +v -0.272477 0.298927 0.187630 +v -0.928809 0.433498 0.243371 +v -0.272477 0.433498 0.243372 +v -0.928809 0.568069 0.187630 +v -0.272477 0.568069 0.187630 +v -2.722006 0.831465 0.160411 +v -2.722006 0.831465 -0.054293 +v -2.873636 0.831465 0.160411 +v -2.873636 0.831465 -0.054293 +v -2.749341 1.178037 0.160411 +v -2.722006 1.056201 0.160411 +v -2.722006 1.056201 -0.054293 +v -2.749341 1.178037 -0.054293 +v -2.873636 1.056201 0.160411 +v -2.846302 1.178037 0.160411 +v -2.846302 1.178037 -0.054293 +v -2.873636 1.056201 -0.054293 +v -2.535410 0.631368 -0.053731 +v -2.535410 0.631368 0.159848 +v -2.355120 0.631368 -0.053731 +v -2.355120 0.631368 0.159848 +v -2.535410 1.058757 0.012589 +v -2.535410 0.926045 -0.053731 +v -2.535410 1.019887 -0.034306 +v -2.535410 0.926045 0.159848 +v -2.535410 1.058757 0.093529 +v -2.535410 1.019887 0.140424 +v -2.355120 0.926045 -0.053731 +v -2.355120 1.058757 0.012589 +v -2.355120 1.019887 -0.034306 +v -2.355120 1.058757 0.093529 +v -2.355120 0.926045 0.159848 +v -2.355120 1.019887 0.140424 +v -3.295685 1.044175 0.053059 +v -2.232215 1.044175 0.053059 +v -3.295685 1.014676 -0.018158 +v -2.232215 1.014676 -0.018158 +v -3.295685 0.943459 -0.047656 +v -2.232215 0.943459 -0.047656 +v -3.295685 0.872243 -0.018158 +v -2.232215 0.872243 -0.018158 +v -3.295685 0.842744 0.053059 +v -2.232215 0.842744 0.053059 +v -3.295685 0.872243 0.124275 +v -2.232215 0.872243 0.124275 +v -3.295685 0.943459 0.153774 +v -2.232215 0.943459 0.153774 +v -3.295685 1.014676 0.124275 +v -2.232215 1.014676 0.124275 +v -3.793035 1.109163 0.053059 +v -3.793035 1.060629 -0.064112 +v -3.793035 0.943459 -0.112645 +v -3.793035 0.826289 -0.064112 +v -3.793035 0.777755 0.053059 +v -3.793035 0.826289 0.170229 +v -3.793035 0.943459 0.218762 +v -3.793035 1.060629 0.170229 +v -3.956283 1.075495 0.053059 +v -3.956283 1.027734 -0.042786 +v -3.956283 0.943459 -0.071803 +v -3.956283 0.859184 -0.042786 +v -3.956283 0.811424 0.053059 +v -3.956283 0.859184 0.148904 +v -3.956283 0.943459 0.177920 +v -3.956283 1.027734 0.148904 +v -1.434329 1.136439 -0.139921 +v -1.434329 1.216374 0.053059 +v -1.434329 0.943459 -0.219856 +v -1.434329 0.750480 -0.139921 +v -1.434329 0.670545 0.053059 +v -1.434329 0.750480 0.246039 +v -1.434329 0.943459 0.325973 +v -1.434329 1.136439 0.246039 +v -1.153869 1.075759 -0.111905 +v -1.153869 1.154267 0.053059 +v -1.153869 0.943459 -0.159600 +v -1.153869 0.811160 -0.111905 +v -1.153869 0.732651 0.053059 +v -1.153869 0.811160 0.218023 +v -1.153869 0.943459 0.265718 +v -1.153869 1.075759 0.218023 +v -3.720578 0.065730 0.246115 +v -3.720578 0.065730 -0.139997 +v -3.720578 0.283557 0.246115 +v -3.720578 0.283557 -0.139997 +v -0.363571 0.065730 0.246115 +v -0.363571 0.065730 -0.139997 +v -0.363571 0.283557 0.246115 +v -0.363571 0.283557 -0.139997 +v -3.682338 0.275609 0.258860 +v -3.682338 0.275609 -0.152742 +v -0.875427 0.275609 0.258860 +v -0.875427 0.275609 -0.152742 +v -3.682338 0.644558 0.175493 +v -3.682338 0.460708 0.258860 +v -3.682338 0.460708 -0.152742 +v -3.682338 0.644558 -0.069375 +v -0.875427 0.460708 0.258860 +v -0.875427 0.644558 0.175493 +v -0.875427 0.644558 -0.069375 +v -0.875427 0.460708 -0.152742 +v -4.216019 0.072342 -0.096029 +v -4.216019 0.072342 0.202147 +v -3.717665 0.072342 -0.096029 +v -3.717665 0.072342 0.202147 +v -4.167888 -0.452882 -0.096029 +v -4.216019 -0.419663 -0.018904 +v -4.216019 -0.419663 0.125021 +v -4.167888 -0.452882 0.202147 +v -3.717665 -0.385825 -0.018904 +v -3.717665 -0.299080 -0.096029 +v -3.717665 -0.299080 0.202147 +v -3.717665 -0.385825 0.125021 +v -4.216019 -0.168830 -0.018904 +v -4.216019 -0.081946 -0.096029 +v -4.216019 -0.081946 0.202147 +v -4.216019 -0.168830 0.125021 +v -4.289693 -0.011719 0.202147 +v -4.337946 -0.052607 0.125021 +v -4.337946 0.072342 0.125021 +v -4.289693 0.072342 0.202147 +v -4.289693 0.072342 -0.096029 +v -4.337946 0.072342 -0.018904 +v -4.289693 -0.011719 -0.096029 +v -4.337946 -0.052607 -0.018904 +v -3.923980 -0.621216 -0.018904 +v -3.971354 -0.588521 -0.096029 +v -3.971354 -0.588521 0.202147 +v -3.923980 -0.621216 0.125021 +v -4.074046 -1.052327 0.202147 +v -4.084821 -1.127861 0.125021 +v -4.084821 -1.127861 -0.018904 +v -4.074046 -1.052327 -0.096029 +v -4.110802 -0.871791 0.202147 +v -4.048686 -0.874538 0.125021 +v -4.048686 -0.874538 -0.018904 +v -4.110802 -0.871791 -0.096029 +v -4.043868 -1.042210 0.202147 +v -4.004060 -1.100786 0.125021 +v -4.043868 -1.042210 -0.096029 +v -4.004060 -1.100786 -0.018904 +v -4.039167 -1.014916 0.202147 +v -3.986495 -0.998795 0.125021 +v -4.039167 -1.014916 -0.096029 +v -3.986495 -0.998795 -0.018904 +v -4.422300 -0.875735 -0.096029 +v -4.465699 -0.934725 -0.018904 +v -4.428116 -0.811104 -0.096029 +v -4.479420 -0.782253 -0.018904 +v -4.428116 -0.811104 0.202147 +v -4.479420 -0.782253 0.125021 +v -4.422300 -0.875735 0.202147 +v -4.465699 -0.934725 0.125021 +v -3.212253 0.631368 -0.053731 +v -3.212253 0.631368 0.159848 +v -3.031964 0.631368 -0.053731 +v -3.031964 0.631368 0.159848 +v -3.212253 1.058757 0.012589 +v -3.212253 0.926045 -0.053731 +v -3.212253 1.019887 -0.034306 +v -3.212253 0.926045 0.159848 +v -3.212253 1.058757 0.093529 +v -3.212253 1.019887 0.140424 +v -3.031964 0.926045 -0.053731 +v -3.031964 1.058757 0.012589 +v -3.031964 1.019887 -0.034306 +v -3.031964 1.058757 0.093529 +v -3.031964 0.926045 0.159848 +v -3.031964 1.019887 0.140424 +v -1.693464 0.078085 0.206852 +v -1.693464 0.078085 -0.100735 +v -1.693464 -0.317987 0.206852 +v -1.693464 -0.317987 -0.100735 +v -1.975951 0.078085 0.206852 +v -1.975951 0.078085 -0.100735 +v -1.975951 -0.317987 0.206852 +v -1.975951 -0.317987 -0.100735 +v -3.221759 0.099040 0.152432 +v -3.221759 0.099040 -0.046314 +v -3.221759 -0.370375 0.152432 +v -3.221759 -0.370375 -0.046314 +v -3.726855 0.099040 0.152432 +v -3.726855 0.099040 -0.046314 +v -3.726855 -0.370375 0.152432 +v -3.726855 -0.370375 -0.046314 +v -3.245320 -0.018599 -0.046314 +v -3.245320 -0.018599 0.152432 +v -3.596445 -0.018599 -0.046314 +v -3.596445 -0.018599 0.152432 +v -3.245320 -0.344920 -0.046314 +v -3.245320 -0.344920 0.152432 +v -3.596445 -0.344920 -0.046314 +v -3.596445 -0.344920 0.152432 +v -1.153869 1.136439 -0.139921 +v -1.153869 1.216374 0.053059 +v -1.153869 0.943459 -0.219856 +v -1.153869 0.750480 -0.139921 +v -1.153869 0.670545 0.053059 +v -1.153869 0.750480 0.246039 +v -1.153869 0.943459 0.325973 +v -1.153869 1.136439 0.246039 +v -1.235700 1.075759 -0.111905 +v -1.235700 1.154267 0.053059 +v -1.235700 0.943459 -0.159600 +v -1.235700 0.811160 -0.111905 +v -1.235700 0.732651 0.053059 +v -1.235700 0.811160 0.218023 +v -1.235700 0.943459 0.265718 +v -1.235700 1.075759 0.218023 +v -3.956283 1.109163 0.053059 +v -3.956283 1.060629 -0.064112 +v -3.956283 0.943459 -0.112645 +v -3.956283 0.826289 -0.064112 +v -3.956283 0.777755 0.053059 +v -3.956283 0.826289 0.170229 +v -3.956283 0.943459 0.218762 +v -3.956283 1.060629 0.170229 +v -3.875059 1.075495 0.053059 +v -3.875059 1.027734 -0.042786 +v -3.875059 0.943459 -0.071803 +v -3.875059 0.859184 -0.042786 +v -3.875059 0.811424 0.053059 +v -3.875059 0.859184 0.148904 +v -3.875059 0.943459 0.177920 +v -3.875059 1.027734 0.148904 +vn -0.9933 -0.1154 0.0000 +vn 0.0000 1.0000 0.0000 +vn 0.8137 -0.5813 0.0000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 -0.0000 1.0000 +vn 0.2132 -0.9770 -0.0000 +vn 1.0000 0.0000 0.0000 +vn -0.9933 0.1154 0.0000 +vn 0.9867 -0.1628 -0.0000 +vn -1.0000 0.0000 0.0000 +vn 0.9866 -0.1633 0.0000 +vn -0.9875 -0.1578 0.0000 +vn -0.5464 -0.8375 0.0000 +vn 0.8177 0.5756 0.0000 +vn -0.8177 -0.5756 0.0000 +vn 0.5464 0.8375 0.0000 +vn 0.1155 -0.9933 0.0000 +vn -0.1279 0.9918 0.0000 +vn -0.0699 -0.9976 0.0000 +vn -0.2809 -0.0000 -0.9597 +vn -0.2809 0.0000 0.9597 +vn -0.0699 0.9976 0.0000 +vn 0.9757 0.2189 0.0000 +vn -0.9757 0.2189 0.0000 +vn 0.0000 0.4130 0.9107 +vn 0.0000 0.4130 -0.9107 +vn -0.2810 0.0000 0.9597 +vn -0.6302 0.7764 0.0000 +vn 0.1186 0.7021 -0.7021 +vn -0.6302 0.5490 -0.5490 +vn -0.6302 0.0000 -0.7764 +vn 0.1186 0.0000 -0.9929 +vn -0.6302 -0.5490 -0.5490 +vn 0.1186 -0.7021 -0.7021 +vn -0.6302 -0.7764 0.0000 +vn 0.1186 -0.9929 0.0000 +vn -0.6302 -0.5490 0.5490 +vn 0.1186 -0.7021 0.7021 +vn -0.6302 0.0000 0.7764 +vn 0.1258 0.0000 -0.9920 +vn 0.1258 -0.7015 -0.7015 +vn 0.1186 0.0000 0.9929 +vn -0.6302 0.5490 0.5490 +vn 0.1186 0.9929 0.0000 +vn 0.1258 0.0000 0.9920 +vn 0.6302 0.5490 0.5490 +vn 0.1258 0.7015 0.7015 +vn 0.1258 -0.9920 0.0000 +vn 0.1186 0.7021 0.7021 +vn 0.1258 -0.7015 0.7015 +vn 0.1258 0.9920 0.0000 +vn 0.1258 0.7015 -0.7015 +vn 0.6302 -0.7764 0.0000 +vn 0.6302 -0.5490 0.5490 +vn 0.6302 0.0000 -0.7764 +vn 0.6302 -0.5490 -0.5490 +vn 0.6302 0.5490 -0.5490 +vn 0.6302 0.7764 0.0000 +vn 0.6302 0.0000 0.7764 +vn -0.4610 0.4979 0.7346 +vn -0.4964 0.8681 0.0000 +vn -0.4610 0.4979 -0.7346 +vn 0.1087 0.0000 0.9940 +vn -0.0666 0.6393 -0.7660 +vn 0.1088 0.0000 -0.9940 +vn -0.4799 0.5389 0.6923 +vn -0.8040 0.0000 0.5946 +vn -0.6820 0.1808 -0.7086 +vn -0.0666 -0.6393 0.7660 +vn -0.0666 -0.6393 -0.7660 +vn -0.4609 -0.4979 -0.7346 +vn -0.0666 0.6393 0.7660 +vn -0.4964 -0.8681 0.0000 +vn -0.4610 -0.4979 0.7346 +vn -0.4763 -0.8399 0.2600 +vn -0.4799 -0.5389 0.6923 +vn 0.8042 -0.4200 0.4206 +vn -0.8040 0.0000 -0.5946 +vn -0.4799 -0.5389 -0.6923 +vn 0.8040 0.0000 -0.5946 +vn -0.6820 0.1807 0.7086 +vn -0.6820 -0.1808 0.7086 +vn 0.8040 0.0000 0.5946 +vn -0.4763 0.8399 -0.2600 +vn -0.4799 0.5389 -0.6923 +vn 0.8042 0.4200 -0.4206 +vn 0.8044 -0.5941 0.0000 +vn 0.8043 0.5941 0.0000 +vn -0.4763 -0.8399 -0.2600 +vn 0.8042 -0.4200 -0.4206 +vn -0.4763 0.8399 0.2600 +vn 0.8042 0.4200 0.4206 +vn -0.6381 0.7243 0.2611 +vn 0.6381 0.7243 -0.2611 +vn -0.6381 0.7243 -0.2611 +vn -0.6849 0.0742 -0.7248 +vn 0.6396 0.3961 -0.6587 +vn 0.6849 0.0742 -0.7248 +vn -0.6396 0.3961 -0.6587 +vn 0.6849 0.0742 0.7248 +vn -0.6396 0.3961 0.6587 +vn -0.6849 0.0742 0.7248 +vn 0.6396 0.3961 0.6587 +vn 0.0660 0.9978 0.0000 +vn -0.1089 0.7029 -0.7029 +vn 0.0660 0.7056 -0.7056 +vn -0.1089 0.0000 -0.9940 +vn 0.0660 0.0000 -0.9978 +vn 0.0660 -0.7056 -0.7056 +vn -0.1089 -0.7029 -0.7029 +vn 0.0660 -0.9978 0.0000 +vn -0.1089 -0.9940 0.0000 +vn 0.0660 -0.7056 0.7056 +vn -0.1089 -0.7029 0.7029 +vn 0.0660 0.0000 0.9978 +vn -0.1034 0.7033 -0.7033 +vn -0.1034 0.0000 -0.9946 +vn -0.1089 0.7029 0.7029 +vn 0.0660 0.7056 0.7056 +vn -0.1089 0.9940 0.0000 +vn 0.0639 -0.7056 -0.7056 +vn 0.0639 0.0000 -0.9979 +vn 0.0639 0.0000 0.9979 +vn 0.0639 -0.7056 0.7056 +vn 0.0639 -0.9979 0.0000 +vn 0.0639 0.7056 0.7056 +vn 0.0639 0.7056 -0.7056 +vn 0.0639 0.9979 0.0000 +vn -0.8031 0.3929 -0.4480 +vn -0.6191 0.7852 0.0000 +vn -0.8225 0.5687 0.0000 +vn -0.1034 0.0000 0.9946 +vn -0.1034 0.7033 0.7033 +vn -0.1034 -0.9946 0.0000 +vn -0.1034 -0.7033 0.7033 +vn -0.1034 0.9946 0.0000 +vn -0.1034 -0.7033 -0.7033 +vn -0.1089 0.0000 0.9940 +vn 0.8036 0.3997 0.4410 +vn 0.6220 0.7830 0.0000 +vn -0.8693 -0.3884 0.3058 +vn -0.7305 0.6500 -0.2097 +vn -0.8693 -0.3884 -0.3058 +vn 0.8837 -0.4029 0.2382 +vn 0.7873 -0.5250 -0.3232 +vn 0.8837 -0.4029 -0.2382 +vn 0.7873 -0.5250 0.3232 +vn 0.9305 0.0083 -0.3662 +vn 0.0000 0.7071 0.7071 +vn -0.4937 -0.1768 0.8514 +vn -0.3235 -0.2234 0.9195 +vn -0.9254 -0.3301 0.1863 +vn -0.9254 -0.3301 -0.1863 +vn 0.0000 0.7071 -0.7071 +vn -0.4937 -0.1768 -0.8514 +vn -0.3830 0.6126 -0.6914 +vn -0.9049 0.2744 -0.3253 +vn -0.9179 0.2646 0.2956 +vn -0.9049 0.2744 0.3253 +vn 0.9305 0.0083 0.3662 +vn 0.9467 0.1460 -0.2870 +vn -0.0716 -0.9338 -0.3504 +vn 0.7078 -0.6280 0.3234 +vn -0.0716 -0.9338 0.3504 +vn -0.7706 -0.5462 0.3284 +vn -0.9179 0.2646 -0.2956 +vn -0.7706 -0.5462 -0.3284 +vn 0.9467 0.1460 0.2870 +vn 0.7078 -0.6280 -0.3234 +vn -0.3525 0.1204 -0.9280 +vn -0.3235 -0.2234 -0.9195 +vn 0.3470 -0.2320 -0.9087 +vn -0.3525 0.1204 0.9280 +vn -0.7305 0.6500 0.2097 +vn 0.3470 -0.2320 0.9087 +vn 0.7021 -0.1205 0.7018 +vn 0.3184 -0.0011 0.9479 +vn 0.3184 -0.0011 -0.9479 +vn 0.4219 -0.3035 0.8543 +vn 0.4219 -0.3035 -0.8543 +vn 0.5235 0.0663 -0.8495 +vn -0.0263 -0.4615 -0.8867 +vn -0.0263 -0.4615 0.8867 +vn 0.5235 0.0663 0.8495 +vn -0.4544 -0.2443 -0.8566 +vn -0.5130 0.1193 -0.8501 +vn -0.4544 -0.2443 0.8566 +vn -0.5130 0.1193 0.8501 +vn 0.8036 -0.3997 0.4410 +vn 0.6381 0.0000 0.7699 +vn 0.7920 0.0000 0.6105 +vn 0.7920 0.0000 -0.6105 +vn 0.6306 -0.5212 -0.5750 +vn 0.8036 -0.3997 -0.4410 +vn 0.6306 0.5212 -0.5750 +vn 0.8036 0.3997 -0.4410 +vn 0.6306 0.5212 0.5750 +vn 0.8177 -0.5756 0.0000 +vn 0.6306 -0.5212 0.5750 +vn 0.6220 -0.7830 0.0000 +vn 0.6381 0.0000 -0.7699 +vn -0.8031 0.3929 0.4480 +vn -0.6406 0.0000 0.7678 +vn -0.7882 0.0000 0.6154 +vn -0.8031 -0.3929 0.4480 +vn -0.6191 -0.7852 0.0000 +vn -0.8225 -0.5687 0.0000 +vn -0.6309 -0.5116 -0.5832 +vn -0.8031 -0.3929 -0.4480 +vn -0.7882 0.0000 -0.6154 +vn -0.6309 0.5116 -0.5832 +vn -0.6309 0.5116 0.5832 +vn -0.6309 -0.5116 0.5832 +vn -0.6406 0.0000 -0.7678 +vn -0.6820 -0.1808 -0.7086 +vn 0.6381 0.7243 0.2611 +vn -0.3830 0.6126 0.6914 +vn 0.7021 -0.1205 -0.7018 +usemtl None_NONE +s off +f 18//2 7//2 17//2 +f 8//3 11//3 7//3 +f 14//4 9//4 13//4 +f 10//5 5//5 9//5 +f 19//6 13//6 7//6 +f 18//7 14//7 8//7 +f 16//8 13//8 15//8 +f 20//9 15//9 19//9 +f 6//10 17//10 5//10 +f 22//5 19//5 21//5 +f 21//5 26//5 22//5 +f 12//9 23//9 11//9 +f 25//9 27//9 28//9 +f 24//3 28//3 23//3 +f 23//6 27//6 21//6 +f 22//7 25//7 24//7 +f 31//11 30//11 29//11 +f 37//6 36//6 32//6 +f 33//12 36//12 35//12 +f 29//3 34//3 33//3 +f 31//7 33//7 35//7 +f 34//6 32//6 36//6 +f 37//6 44//6 40//6 +f 38//13 32//13 31//13 +f 40//14 35//14 36//14 +f 35//7 38//7 31//7 +f 48//15 43//15 44//15 +f 42//16 37//16 38//16 +f 44//17 39//17 40//17 +f 43//7 38//7 39//7 +f 47//5 45//5 46//5 +f 47//7 42//7 43//7 +f 41//6 48//6 44//6 +f 46//18 41//18 42//18 +f 51//9 50//9 49//9 +f 55//5 52//5 51//5 +f 53//12 56//12 55//12 +f 49//3 54//3 53//3 +f 49//7 55//7 51//7 +f 54//6 52//6 56//6 +f 79//12 77//12 78//12 +f 82//3 85//3 89//3 +f 83//9 84//9 85//9 +f 88//19 78//19 91//19 +f 66//7 92//7 82//7 +f 81//6 67//6 91//6 +f 92//19 67//19 87//19 +f 90//3 65//3 81//3 +f 80//3 81//3 77//3 +f 86//19 87//19 84//19 +f 90//7 68//7 66//7 +f 65//6 87//6 67//6 +f 68//19 91//19 67//19 +f 66//3 89//3 65//3 +f 57//6 77//6 59//6 +f 58//7 80//7 79//7 +f 59//6 81//6 69//6 +f 64//7 82//7 70//7 +f 61//6 85//6 84//6 +f 62//7 83//7 64//7 +f 71//6 84//6 87//6 +f 58//7 88//7 72//7 +f 63//6 89//6 85//6 +f 60//7 90//7 80//7 +f 57//6 91//6 78//6 +f 76//7 86//7 62//7 +f 75//6 81//6 91//6 +f 76//7 82//7 92//7 +f 72//7 90//7 74//7 +f 71//6 89//6 73//6 +f 93//6 95//6 96//6 +f 94//5 73//5 63//5 +f 95//12 63//12 61//12 +f 96//20 61//20 71//20 +f 93//9 71//9 73//9 +f 98//7 100//7 97//7 +f 98//5 74//5 60//5 +f 99//9 60//9 58//9 +f 100//20 58//20 72//20 +f 97//12 72//12 74//12 +f 101//6 103//6 104//6 +f 102//5 59//5 69//5 +f 103//12 69//12 75//12 +f 104//20 75//20 57//20 +f 101//9 57//9 59//9 +f 106//7 108//7 105//7 +f 106//5 64//5 70//5 +f 107//9 70//9 76//9 +f 108//20 76//20 62//20 +f 105//12 62//12 64//12 +f 117//12 119//12 123//12 +f 138//9 137//9 134//9 +f 142//12 143//12 141//12 +f 144//3 147//3 143//3 +f 145//21 152//21 146//21 +f 145//5 142//5 141//5 +f 147//6 141//6 143//6 +f 144//7 146//7 148//7 +f 181//9 172//9 151//9 +f 155//22 150//22 151//22 +f 148//23 160//23 164//23 +f 148//24 150//24 147//24 +f 159//22 145//22 147//22 +f 156//23 166//23 152//23 +f 179//9 167//9 150//9 +f 188//12 189//12 187//12 +f 190//3 193//3 189//3 +f 194//9 191//9 193//9 +f 192//5 187//5 191//5 +f 193//6 187//6 189//6 +f 190//7 192//7 194//7 +f 206//9 204//9 210//9 +f 203//12 205//12 209//12 +f 222//9 220//9 226//9 +f 219//12 221//12 225//12 +f 231//3 237//3 236//3 +f 229//5 228//5 227//5 +f 238//6 233//6 228//6 +f 227//9 233//9 232//9 +f 235//12 230//12 229//12 +f 232//25 234//25 231//25 +f 238//26 236//26 237//26 +f 232//7 235//7 229//7 +f 246//7 242//7 253//7 +f 242//5 239//5 241//5 +f 247//12 243//12 240//12 +f 252//9 242//9 241//9 +f 249//6 239//6 244//6 +f 305//12 304//12 303//12 +f 309//3 306//3 305//3 +f 307//9 310//9 309//9 +f 303//5 308//5 307//5 +f 303//7 309//7 305//7 +f 308//6 306//6 310//6 +f 320//3 318//3 315//3 +f 314//6 317//6 322//6 +f 311//5 314//5 313//5 +f 315//12 318//12 311//12 +f 314//9 321//9 320//9 +f 320//27 316//27 319//27 +f 318//28 322//28 317//28 +f 311//7 319//7 316//7 +f 324//3 325//3 323//3 +f 371//7 373//7 355//7 +f 326//9 334//9 325//9 +f 358//6 367//6 369//6 +f 323//3 344//3 324//3 +f 354//6 365//6 361//6 +f 337//7 330//7 333//7 +f 351//7 363//7 355//7 +f 332//6 327//6 336//6 +f 382//7 378//7 389//7 +f 378//5 375//5 377//5 +f 383//12 379//12 376//12 +f 388//9 378//9 377//9 +f 385//6 375//6 380//6 +f 393//9 392//9 391//9 +f 397//5 394//5 393//5 +f 395//12 398//12 397//12 +f 391//3 396//3 395//3 +f 391//7 397//7 393//7 +f 396//6 394//6 398//6 +f 401//9 400//9 399//9 +f 405//5 402//5 401//5 +f 403//12 406//12 405//12 +f 399//3 404//3 403//3 +f 410//7 403//7 405//7 +f 400//6 407//6 409//6 +f 414//9 409//9 410//9 +f 412//3 413//3 414//3 +f 402//6 413//6 411//6 +f 408//12 411//12 412//12 +f 410//5 407//5 408//5 +f 399//7 410//7 408//7 +f 295//9 416//9 296//9 +f 297//9 415//9 295//9 +f 297//9 418//9 417//9 +f 298//9 419//9 418//9 +f 300//9 419//9 299//9 +f 301//9 420//9 300//9 +f 301//9 422//9 421//9 +f 302//9 416//9 422//9 +f 428//9 427//9 430//9 +f 280//12 431//12 432//12 +f 281//12 432//12 433//12 +f 281//12 434//12 282//12 +f 282//12 435//12 283//12 +f 284//12 435//12 436//12 +f 285//12 436//12 437//12 +f 285//12 438//12 286//12 +f 286//12 431//12 279//12 +f 443//12 444//12 446//12 +f 18//2 8//2 7//2 +f 8//3 12//3 11//3 +f 14//4 10//4 9//4 +f 10//5 6//5 5//5 +f 17//6 7//6 13//6 +f 11//6 23//6 19//6 +f 19//6 15//6 13//6 +f 23//6 21//6 19//6 +f 5//6 17//6 13//6 +f 13//6 9//6 5//6 +f 11//6 19//6 7//6 +f 24//7 12//7 20//7 +f 18//7 6//7 14//7 +f 12//7 8//7 20//7 +f 20//7 22//7 24//7 +f 14//7 16//7 20//7 +f 6//7 10//7 14//7 +f 20//7 8//7 14//7 +f 16//8 14//8 13//8 +f 20//9 16//9 15//9 +f 6//10 18//10 17//10 +f 22//5 20//5 19//5 +f 21//5 27//5 26//5 +f 12//9 24//9 23//9 +f 25//9 26//9 27//9 +f 24//3 25//3 28//3 +f 23//6 28//6 27//6 +f 22//7 26//7 25//7 +f 31//11 32//11 30//11 +f 37//6 40//6 36//6 +f 33//12 34//12 36//12 +f 29//3 30//3 34//3 +f 31//7 29//7 33//7 +f 34//6 30//6 32//6 +f 37//6 41//6 44//6 +f 38//13 37//13 32//13 +f 40//14 39//14 35//14 +f 35//7 39//7 38//7 +f 48//15 47//15 43//15 +f 42//16 41//16 37//16 +f 44//17 43//17 39//17 +f 43//7 42//7 38//7 +f 47//5 48//5 45//5 +f 47//7 46//7 42//7 +f 41//6 45//6 48//6 +f 46//18 45//18 41//18 +f 51//9 52//9 50//9 +f 55//5 56//5 52//5 +f 53//12 54//12 56//12 +f 49//3 50//3 54//3 +f 49//7 53//7 55//7 +f 54//6 50//6 52//6 +f 79//12 80//12 77//12 +f 82//3 83//3 85//3 +f 83//9 86//9 84//9 +f 88//19 79//19 78//19 +f 66//7 68//7 92//7 +f 81//6 65//6 67//6 +f 92//19 68//19 67//19 +f 90//3 66//3 65//3 +f 80//3 90//3 81//3 +f 86//19 92//19 87//19 +f 90//7 88//7 68//7 +f 65//6 89//6 87//6 +f 68//19 88//19 91//19 +f 66//3 82//3 89//3 +f 57//6 78//6 77//6 +f 58//7 60//7 80//7 +f 59//6 77//6 81//6 +f 64//7 83//7 82//7 +f 61//6 63//6 85//6 +f 62//7 86//7 83//7 +f 71//6 61//6 84//6 +f 58//7 79//7 88//7 +f 63//6 73//6 89//6 +f 60//7 74//7 90//7 +f 57//6 75//6 91//6 +f 76//7 92//7 86//7 +f 75//6 69//6 81//6 +f 76//7 70//7 82//7 +f 72//7 88//7 90//7 +f 71//6 87//6 89//6 +f 93//6 94//6 95//6 +f 94//5 93//5 73//5 +f 95//12 94//12 63//12 +f 96//20 95//20 61//20 +f 93//9 96//9 71//9 +f 98//7 99//7 100//7 +f 98//5 97//5 74//5 +f 99//9 98//9 60//9 +f 100//20 99//20 58//20 +f 97//12 100//12 72//12 +f 101//6 102//6 103//6 +f 102//5 101//5 59//5 +f 103//12 102//12 69//12 +f 104//20 103//20 75//20 +f 101//9 104//9 57//9 +f 106//7 107//7 108//7 +f 106//5 105//5 64//5 +f 107//9 106//9 70//9 +f 108//20 107//20 76//20 +f 105//12 108//12 62//12 +f 123//12 109//12 117//12 +f 111//12 113//12 115//12 +f 115//12 117//12 109//12 +f 119//12 121//12 123//12 +f 109//12 111//12 115//12 +f 135//9 133//9 136//9 +f 134//9 140//9 138//9 +f 139//9 138//9 140//9 +f 137//9 136//9 134//9 +f 133//9 134//9 136//9 +f 142//12 144//12 143//12 +f 144//3 148//3 147//3 +f 145//21 151//21 152//21 +f 145//5 146//5 142//5 +f 147//6 145//6 141//6 +f 144//7 142//7 146//7 +f 151//9 150//9 170//9 +f 151//9 170//9 181//9 +f 184//9 149//9 152//9 +f 174//9 184//9 152//9 +f 152//9 151//9 172//9 +f 172//9 174//9 152//9 +f 151//22 145//22 157//22 +f 151//22 157//22 165//22 +f 153//22 161//22 150//22 +f 151//22 165//22 155//22 +f 155//22 153//22 150//22 +f 146//23 158//23 160//23 +f 164//23 162//23 149//23 +f 148//29 146//29 160//29 +f 164//23 149//23 148//23 +f 148//24 149//24 150//24 +f 147//22 150//22 163//22 +f 150//22 161//22 163//22 +f 159//22 157//22 145//22 +f 147//22 163//22 159//22 +f 149//23 162//23 154//23 +f 149//23 154//23 156//23 +f 158//23 146//23 152//23 +f 166//23 158//23 152//23 +f 152//23 149//23 156//23 +f 149//9 184//9 176//9 +f 149//9 176//9 179//9 +f 167//9 170//9 150//9 +f 150//9 149//9 179//9 +f 188//12 190//12 189//12 +f 190//3 194//3 193//3 +f 194//9 192//9 191//9 +f 192//5 188//5 187//5 +f 193//6 191//6 187//6 +f 190//7 188//7 192//7 +f 200//9 198//9 202//9 +f 196//9 210//9 204//9 +f 208//9 206//9 210//9 +f 204//9 202//9 196//9 +f 198//9 196//9 202//9 +f 209//12 195//12 203//12 +f 197//12 199//12 201//12 +f 201//12 203//12 195//12 +f 205//12 207//12 209//12 +f 195//12 197//12 201//12 +f 216//9 214//9 218//9 +f 212//9 226//9 220//9 +f 224//9 222//9 226//9 +f 220//9 218//9 212//9 +f 214//9 212//9 218//9 +f 225//12 211//12 219//12 +f 213//12 215//12 217//12 +f 217//12 219//12 211//12 +f 221//12 223//12 225//12 +f 211//12 213//12 217//12 +f 231//3 234//3 237//3 +f 229//5 230//5 228//5 +f 228//6 230//6 238//6 +f 238//6 237//6 234//6 +f 234//6 233//6 238//6 +f 227//9 228//9 233//9 +f 235//12 238//12 230//12 +f 232//25 233//25 234//25 +f 238//26 235//26 236//26 +f 229//7 227//7 232//7 +f 232//7 231//7 236//7 +f 236//7 235//7 232//7 +f 246//7 240//7 242//7 +f 242//5 240//5 239//5 +f 244//12 239//12 245//12 +f 240//12 246//12 248//12 +f 248//12 247//12 240//12 +f 243//12 245//12 239//12 +f 239//12 240//12 243//12 +f 241//9 249//9 251//9 +f 251//9 250//9 241//9 +f 252//9 254//9 242//9 +f 253//9 242//9 254//9 +f 241//9 250//9 252//9 +f 249//6 241//6 239//6 +f 305//12 306//12 304//12 +f 309//3 310//3 306//3 +f 307//9 308//9 310//9 +f 303//5 304//5 308//5 +f 303//7 307//7 309//7 +f 308//6 304//6 306//6 +f 320//3 321//3 318//3 +f 314//6 312//6 317//6 +f 311//5 312//5 314//5 +f 312//12 311//12 318//12 +f 316//12 315//12 311//12 +f 318//12 317//12 312//12 +f 320//9 319//9 313//9 +f 313//9 314//9 320//9 +f 322//9 321//9 314//9 +f 320//27 315//27 316//27 +f 318//28 321//28 322//28 +f 311//7 313//7 319//7 +f 324//3 326//3 325//3 +f 355//7 349//7 371//7 +f 330//7 371//7 349//7 +f 373//7 351//7 355//7 +f 332//9 325//9 331//9 +f 326//9 333//9 334//9 +f 334//9 331//9 325//9 +f 369//6 327//6 348//6 +f 358//6 354//6 367//6 +f 369//6 348//6 358//6 +f 342//3 324//3 341//3 +f 323//3 343//3 344//3 +f 344//3 341//3 324//3 +f 354//6 358//6 365//6 +f 333//7 326//7 337//7 +f 324//7 337//7 326//7 +f 330//7 349//7 333//7 +f 351//7 359//7 363//7 +f 336//6 323//6 325//6 +f 325//6 332//6 336//6 +f 348//6 327//6 332//6 +f 382//7 376//7 378//7 +f 378//5 376//5 375//5 +f 380//12 375//12 381//12 +f 376//12 382//12 384//12 +f 384//12 383//12 376//12 +f 379//12 381//12 375//12 +f 375//12 376//12 379//12 +f 377//9 385//9 387//9 +f 387//9 386//9 377//9 +f 388//9 390//9 378//9 +f 389//9 378//9 390//9 +f 377//9 386//9 388//9 +f 385//6 377//6 375//6 +f 393//9 394//9 392//9 +f 397//5 398//5 394//5 +f 395//12 396//12 398//12 +f 391//3 392//3 396//3 +f 391//7 395//7 397//7 +f 396//6 392//6 394//6 +f 401//9 402//9 400//9 +f 405//5 406//5 402//5 +f 403//12 404//12 406//12 +f 399//3 400//3 404//3 +f 405//7 401//7 414//7 +f 414//7 410//7 405//7 +f 401//7 412//7 414//7 +f 413//6 406//6 409//6 +f 404//6 400//6 409//6 +f 409//6 406//6 404//6 +f 414//9 413//9 409//9 +f 412//3 411//3 413//3 +f 407//6 400//6 402//6 +f 402//6 406//6 413//6 +f 411//6 407//6 402//6 +f 408//12 407//12 411//12 +f 410//5 409//5 407//5 +f 408//7 412//7 401//7 +f 399//7 403//7 410//7 +f 408//7 401//7 399//7 +f 295//9 415//9 416//9 +f 297//9 417//9 415//9 +f 297//9 298//9 418//9 +f 298//9 299//9 419//9 +f 300//9 420//9 419//9 +f 301//9 421//9 420//9 +f 301//9 302//9 422//9 +f 302//9 296//9 416//9 +f 425//9 423//9 426//9 +f 424//9 430//9 427//9 +f 429//9 428//9 430//9 +f 427//9 426//9 423//9 +f 423//9 424//9 427//9 +f 280//12 279//12 431//12 +f 281//12 280//12 432//12 +f 281//12 433//12 434//12 +f 282//12 434//12 435//12 +f 284//12 283//12 435//12 +f 285//12 284//12 436//12 +f 285//12 437//12 438//12 +f 286//12 438//12 431//12 +f 446//12 439//12 443//12 +f 440//12 441//12 442//12 +f 442//12 443//12 439//12 +f 444//12 445//12 446//12 +f 439//12 440//12 442//12 +s 1 +f 109//30 112//31 111//32 +f 112//31 113//33 111//32 +f 114//34 115//35 113//33 +f 116//36 117//37 115//35 +f 118//38 119//39 117//37 +f 120//40 121//41 119//39 +f 116//36 127//42 128//43 +f 122//44 123//45 121//41 +f 123//45 110//46 109//30 +f 131//47 140//48 132//49 +f 120//40 131//47 122//44 +f 118//38 128//43 129//50 +f 124//51 131//47 132//49 +f 112//31 127//42 114//34 +f 118//38 130//52 120//40 +f 110//46 132//49 126//53 +f 110//46 125//54 112//31 +f 130//52 137//55 138//56 +f 128//43 135//57 136//58 +f 126//53 133//59 125//54 +f 132//49 134//60 126//53 +f 131//47 138//56 139//61 +f 129//50 136//58 137//55 +f 125//54 135//57 127//42 +f 166//62 173//63 165//64 +f 160//65 157//66 159//67 +f 186//68 171//69 155//70 +f 164//71 159//67 163//72 +f 161//73 164//71 163//72 +f 158//74 165//64 157//66 +f 180//75 162//76 161//73 +f 169//77 168//78 167//79 +f 185//80 177//81 184//82 +f 185//80 156//83 154//84 +f 171//69 186//68 170//85 +f 175//86 183//87 174//88 +f 179//89 169//77 167//79 +f 172//90 175//86 174//88 +f 178//91 179//89 176//92 +f 182//93 172//90 181//94 +f 195//30 198//59 197//32 +f 197//32 200//57 199//33 +f 200//57 201//35 199//33 +f 202//58 203//37 201//35 +f 204//55 205//39 203//37 +f 206//56 207//41 205//39 +f 208//61 209//45 207//41 +f 209//45 196//60 195//30 +f 211//30 214//59 213//32 +f 213//32 216//57 215//33 +f 215//33 218//58 217//35 +f 218//58 219//37 217//35 +f 220//55 221//39 219//37 +f 221//39 224//61 223//41 +f 223//41 226//48 225//45 +f 225//45 212//60 211//30 +f 247//95 250//96 243//97 +f 244//98 251//99 249//100 +f 245//101 250//96 251//99 +f 253//102 248//103 246//104 +f 254//105 247//95 248//103 +f 255//106 258//107 257//108 +f 257//108 260//109 259//110 +f 260//109 261//111 259//110 +f 262//112 263//113 261//111 +f 264//114 265//115 263//113 +f 266//116 267//117 265//115 +f 260//109 287//118 289//119 +f 267//117 270//120 269//121 +f 269//121 256//122 255//106 +f 259//110 274//123 273//124 +f 277//125 436//39 276//126 +f 267//117 276//126 265//115 +f 261//111 275//127 274//123 +f 267//117 278//128 277//125 +f 259//110 272//129 257//108 +f 265//115 275//127 263//113 +f 269//121 271//130 278//128 +f 257//108 271//130 255//106 +f 284//131 443//132 283//133 +f 274//123 435//37 434//35 +f 273//124 432//32 272//129 +f 278//128 437//41 277//125 +f 276//126 435//37 275//127 +f 274//123 433//33 273//124 +f 272//129 431//30 271//130 +f 271//130 438//45 278//128 +f 293//134 422//48 294//135 +f 266//116 291//136 292//137 +f 270//120 288//138 256//122 +f 258//107 288//138 287//118 +f 260//109 290//139 262//112 +f 268//140 292//137 293//134 +f 262//112 291//136 264//114 +f 268//140 294//135 270//120 +f 298//141 427//142 299//16 +f 291//136 420//56 292//137 +f 290//139 417//57 418//58 +f 288//138 415//59 287//118 +f 294//135 416//60 288//138 +f 293//134 420//56 421//61 +f 290//139 419//55 291//136 +f 287//118 417//57 289//119 +f 340//143 344//144 346//145 +f 334//146 347//147 331//148 +f 350//149 357//150 347//147 +f 324//151 339//152 337//153 +f 338//154 346//145 335//155 +f 323//156 345//157 343//158 +f 328//159 372//160 329//161 +f 356//162 366//163 357//150 +f 353//164 360//165 352//166 +f 374//167 370//168 368//169 +f 364//170 362//171 366//163 +f 352//166 368//169 353//164 +f 327//172 335//155 336//173 +f 348//174 331//148 347//147 +f 330//175 338//154 329//161 +f 339//152 341//176 340//143 +f 345//157 344//144 343//158 +f 340//143 337//153 339//152 +f 336//173 346//145 345//157 +f 349//177 334//146 333//178 +f 350//149 355//179 356//162 +f 358//180 347//147 357//150 +f 364//170 359//181 360//165 +f 361//182 366//163 362//171 +f 357//150 365//183 358//180 +f 362//171 354//184 361//182 +f 351//185 360//165 359//181 +f 363//186 356//162 355//179 +f 367//187 370//168 369//188 +f 373//189 372//160 374//167 +f 330//175 372//160 371//190 +f 327//172 370//168 328//159 +f 354//184 368//169 367//187 +f 351//185 374//167 352//166 +f 329//161 335//155 328//159 +f 383//95 386//96 379//97 +f 380//98 387//99 385//100 +f 381//101 386//96 387//99 +f 389//102 384//103 382//104 +f 390//105 383//95 384//103 +f 295//191 425//192 297//193 +f 301//194 430//195 302//196 +f 299//16 428//197 300//198 +f 298//141 425//192 426//199 +f 296//200 423//201 295//191 +f 302//196 424//202 296//200 +f 300//198 429//203 301//194 +f 282//204 441//205 281//206 +f 280//207 439//208 279//209 +f 279//209 446//210 286//211 +f 285//212 444//213 284//131 +f 283//133 442//214 282//204 +f 281//206 440//215 280//207 +f 286//211 445//216 285//212 +f 109//30 110//46 112//31 +f 112//31 114//34 113//33 +f 114//34 116//36 115//35 +f 116//36 118//38 117//37 +f 118//38 120//40 119//39 +f 120//40 122//44 121//41 +f 116//36 114//34 127//42 +f 122//44 124//51 123//45 +f 123//45 124//51 110//46 +f 131//47 139//61 140//48 +f 120//40 130//52 131//47 +f 118//38 116//36 128//43 +f 124//51 122//44 131//47 +f 112//31 125//54 127//42 +f 118//38 129//50 130//52 +f 110//46 124//51 132//49 +f 110//46 126//53 125//54 +f 130//52 129//50 137//55 +f 128//43 127//42 135//57 +f 126//53 134//60 133//59 +f 132//49 140//48 134//60 +f 131//47 130//52 138//56 +f 129//50 128//43 136//58 +f 125//54 133//59 135//57 +f 155//70 165//64 186//68 +f 166//62 156//83 183//87 +f 166//62 183//87 175//86 +f 182//93 186//68 165//64 +f 166//62 175//86 173//63 +f 173//63 182//93 165//64 +f 160//65 158//74 157//66 +f 153//217 155//70 171//69 +f 171//69 168//78 153//217 +f 164//71 160//65 159//67 +f 161//73 162//76 164//71 +f 158//74 166//62 165//64 +f 161//73 153//217 168//78 +f 161//73 168//78 169//77 +f 177//81 154//84 162//76 +f 178//91 177//81 162//76 +f 161//73 169//77 180//75 +f 180//75 178//91 162//76 +f 170//85 167//79 168//78 +f 168//78 171//69 170//85 +f 176//92 184//82 177//81 +f 177//81 178//91 176//92 +f 154//84 177//81 185//80 +f 185//80 183//87 156//83 +f 181//94 170//85 186//68 +f 186//68 182//93 181//94 +f 184//82 174//88 183//87 +f 183//87 185//80 184//82 +f 179//89 180//75 169//77 +f 172//90 173//63 175//86 +f 178//91 180//75 179//89 +f 182//93 173//63 172//90 +f 195//30 196//60 198//59 +f 197//32 198//59 200//57 +f 200//57 202//58 201//35 +f 202//58 204//55 203//37 +f 204//55 206//56 205//39 +f 206//56 208//61 207//41 +f 208//61 210//48 209//45 +f 209//45 210//48 196//60 +f 211//30 212//60 214//59 +f 213//32 214//59 216//57 +f 215//33 216//57 218//58 +f 218//58 220//55 219//37 +f 220//55 222//56 221//39 +f 221//39 222//56 224//61 +f 223//41 224//61 226//48 +f 225//45 226//48 212//60 +f 247//95 252//218 250//96 +f 244//98 245//101 251//99 +f 245//101 243//97 250//96 +f 253//102 254//105 248//103 +f 254//105 252//218 247//95 +f 255//106 256//122 258//107 +f 257//108 258//107 260//109 +f 260//109 262//112 261//111 +f 262//112 264//114 263//113 +f 264//114 266//116 265//115 +f 266//116 268//140 267//117 +f 260//109 258//107 287//118 +f 267//117 268//140 270//120 +f 269//121 270//120 256//122 +f 259//110 261//111 274//123 +f 277//125 437//41 436//39 +f 267//117 277//125 276//126 +f 261//111 263//113 275//127 +f 267//117 269//121 278//128 +f 259//110 273//124 272//129 +f 265//115 276//126 275//127 +f 269//121 255//106 271//130 +f 257//108 272//129 271//130 +f 284//131 444//213 443//132 +f 274//123 275//127 435//37 +f 273//124 433//33 432//32 +f 278//128 438//45 437//41 +f 276//126 436//39 435//37 +f 274//123 434//35 433//33 +f 272//129 432//32 431//30 +f 271//130 431//30 438//45 +f 293//134 421//61 422//48 +f 266//116 264//114 291//136 +f 270//120 294//135 288//138 +f 258//107 256//122 288//138 +f 260//109 289//119 290//139 +f 268//140 266//116 292//137 +f 262//112 290//139 291//136 +f 268//140 293//134 294//135 +f 298//141 426//199 427//142 +f 291//136 419//55 420//56 +f 290//139 289//119 417//57 +f 288//138 416//60 415//59 +f 294//135 422//48 416//60 +f 293//134 292//137 420//56 +f 290//139 418//58 419//55 +f 287//118 415//59 417//57 +f 340//143 341//176 344//144 +f 334//146 350//149 347//147 +f 350//149 356//162 357//150 +f 324//151 342//219 339//152 +f 338//154 340//143 346//145 +f 323//156 336//173 345//157 +f 328//159 370//168 372//160 +f 356//162 364//170 366//163 +f 353//164 362//171 360//165 +f 374//167 372//160 370//168 +f 364//170 360//165 362//171 +f 352//166 374//167 368//169 +f 327//172 328//159 335//155 +f 348//174 332//220 331//148 +f 330//175 337//153 338//154 +f 339//152 342//219 341//176 +f 345//157 346//145 344//144 +f 340//143 338//154 337//153 +f 336//173 335//155 346//145 +f 349//177 350//149 334//146 +f 350//149 349//177 355//179 +f 358//180 348//174 347//147 +f 364//170 363//186 359//181 +f 361//182 365//183 366//163 +f 357//150 366//163 365//183 +f 362//171 353//164 354//184 +f 351//185 352//166 360//165 +f 363//186 364//170 356//162 +f 367//187 368//169 370//168 +f 373//189 371//190 372//160 +f 330//175 329//161 372//160 +f 327//172 369//188 370//168 +f 354//184 353//164 368//169 +f 351//185 373//189 374//167 +f 329//161 338//154 335//155 +f 383//95 388//218 386//96 +f 380//98 381//101 387//99 +f 381//101 379//97 386//96 +f 389//102 390//105 384//103 +f 390//105 388//218 383//95 +f 295//191 423//201 425//192 +f 301//194 429//203 430//195 +f 299//16 427//142 428//197 +f 298//141 297//193 425//192 +f 296//200 424//202 423//201 +f 302//196 430//195 424//202 +f 300//198 428//197 429//203 +f 282//204 442//214 441//205 +f 280//207 440//215 439//208 +f 279//209 439//208 446//210 +f 285//212 445//216 444//213 +f 283//133 443//132 442//214 +f 281//206 441//205 440//215 +f 286//211 446//210 445//216 diff --git a/src/main/resources/assets/hbm/textures/models/weapons/glass_cannon_panel.png b/src/main/resources/assets/hbm/textures/models/weapons/glass_cannon_panel.png new file mode 100644 index 0000000000000000000000000000000000000000..a1e40ff71fe14ef46224d2e090c0d80fa134ca38 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^0YEIm!VDx|d|UnmNHG=%xjQkeJ16rJ$YDu$^mSxl z*x1kgCy^D%7Y*~UCfeJVaJR*x382Ao> zFr%o3R|8N`+tbA{#Nu>vLWmNVff2`U0oE4D5T{NiEgr2*7sjc9!tTCH4!CG7FAz^; YXxhwZvC(*C8BiO8r>mdKI;Vst0O}kz$N&HU literal 0 HcmV?d00001 From b7ffa0f1d8a5fba0fe12dd2a35b396b324ef29ca Mon Sep 17 00:00:00 2001 From: Pheonix Date: Sun, 19 Jun 2022 18:23:38 +0100 Subject: [PATCH 2/2] some garbage i almost forgot --- .../java/com/hbm/handler/guncfg/GunPoweredFactory.java | 7 +++++++ src/main/java/com/hbm/render/util/RenderInfoSystem.java | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hbm/handler/guncfg/GunPoweredFactory.java b/src/main/java/com/hbm/handler/guncfg/GunPoweredFactory.java index 24b5574df..1ff48ac83 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunPoweredFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunPoweredFactory.java @@ -107,6 +107,7 @@ public class GunPoweredFactory { bullet.firingRate = 20; bullet.modeName = "weapon.elecGun.glass_cannon.radio"; bullet.chatColour = EnumChatFormatting.DARK_RED; + bullet.setToFire(200); return bullet; } @@ -135,6 +136,7 @@ public class GunPoweredFactory { bullet.firingRate = 15; bullet.modeName = "weapon.elecGun.glass_cannon.micro"; bullet.chatColour = EnumChatFormatting.RED; + bullet.setToFire(200); return bullet; } @@ -163,6 +165,7 @@ public class GunPoweredFactory { bullet.firingRate = 10; bullet.modeName = "weapon.elecGun.glass_cannon.ir"; bullet.chatColour = EnumChatFormatting.RED; + bullet.setToFire(100); return bullet; } @@ -191,6 +194,7 @@ public class GunPoweredFactory { bullet.firingRate = 5; bullet.modeName = "weapon.elecGun.glass_cannon.visible"; bullet.chatColour = EnumChatFormatting.GREEN; + bullet.setToFire(100); return bullet; } @@ -219,6 +223,7 @@ public class GunPoweredFactory { bullet.firingRate = 3; bullet.modeName = "weapon.elecGun.glass_cannon.uv"; bullet.chatColour = EnumChatFormatting.AQUA; + bullet.setToFire(100); return bullet; } @@ -247,6 +252,7 @@ public class GunPoweredFactory { bullet.firingRate = 2; bullet.modeName = "weapon.elecGun.glass_cannon.xray"; bullet.chatColour = EnumChatFormatting.BLUE; + bullet.setToFire(40); return bullet; } @@ -275,6 +281,7 @@ public class GunPoweredFactory { bullet.firingRate = 1; bullet.modeName = "weapon.elecGun.glass_cannon.gamma"; bullet.chatColour = EnumChatFormatting.LIGHT_PURPLE; + bullet.setToFire(40); return bullet; } diff --git a/src/main/java/com/hbm/render/util/RenderInfoSystem.java b/src/main/java/com/hbm/render/util/RenderInfoSystem.java index 64864d24a..da618d194 100644 --- a/src/main/java/com/hbm/render/util/RenderInfoSystem.java +++ b/src/main/java/com/hbm/render/util/RenderInfoSystem.java @@ -50,10 +50,9 @@ public class RenderInfoSystem { if(event.type != ElementType.CROSSHAIRS) return; - if(this.messages.isEmpty()) { + if(this.messages.isEmpty()) return; - } - + Minecraft mc = Minecraft.getMinecraft(); ScaledResolution resolution = event.resolution;