finishing touches on the portable mass extinction machine
@ -10,6 +10,7 @@ import com.hbm.items.weapon.sedna.hud.HUDComponentAmmoCounter;
|
||||
import com.hbm.items.weapon.sedna.hud.HUDComponentDurabilityBar;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.tileentity.RenderArcFurnace;
|
||||
import com.hbm.render.util.BeamPronter;
|
||||
import com.hbm.render.util.BeamPronter.EnumBeamType;
|
||||
import com.hbm.render.util.BeamPronter.EnumWaveType;
|
||||
@ -124,6 +125,7 @@ public class LegoClient {
|
||||
|
||||
if(bullet.ticksExisted < 2) return;
|
||||
|
||||
RenderArcFurnace.fullbright(true);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
@ -170,6 +172,7 @@ public class LegoClient {
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
RenderArcFurnace.fullbright(false);
|
||||
}
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_GRENADE = (bullet, interp) -> {
|
||||
@ -231,7 +234,8 @@ public class LegoClient {
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LIGHTNING = (bullet, interp) -> {
|
||||
|
||||
|
||||
RenderArcFurnace.fullbright(true);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180 - bullet.rotationYaw, 0, 1F, 0);
|
||||
GL11.glRotatef(-bullet.rotationPitch - 90, 1F, 0, 0);
|
||||
@ -245,10 +249,12 @@ public class LegoClient {
|
||||
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorOuter, colorOuter, bullet.ticksExisted, (int)(bullet.beamLength / 2 + 1), (float)scale * 7F, 2, 0.0625F);
|
||||
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorOuter, colorOuter, bullet.ticksExisted / 2, (int)(bullet.beamLength / 2 + 1), (float)scale * 7F, 2, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
RenderArcFurnace.fullbright(false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_TAU = (bullet, interp) -> {
|
||||
|
||||
RenderArcFurnace.fullbright(true);
|
||||
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@ -269,10 +275,12 @@ public class LegoClient {
|
||||
renderBulletStandard(Tessellator.instance, 0xFFBF00, 0xFFFFFF, bullet.beamLength, true);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
RenderArcFurnace.fullbright(false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_TAU_CHARGE = (bullet, interp) -> {
|
||||
|
||||
RenderArcFurnace.fullbright(true);
|
||||
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@ -293,6 +301,7 @@ public class LegoClient {
|
||||
renderBulletStandard(Tessellator.instance, 0xFFF0A0, 0xFFFFFF, bullet.beamLength, true);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
RenderArcFurnace.fullbright(false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_NUKE = (bullet, interp) -> {
|
||||
|
||||
@ -979,4 +979,15 @@ public class Orchestras {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_FATMAN = (stack, ctx) -> {
|
||||
EntityLivingBase entity = ctx.entity;
|
||||
if(entity.worldObj.isRemote) return;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
|
||||
if(type == AnimType.RELOAD) {
|
||||
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.fatmanFull", 1F, 1F);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -57,12 +57,13 @@ public class XFactoryAccelerator {
|
||||
}
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_PRIMARY_RELEASE = (stack, ctx) -> {
|
||||
if(ctx.getPlayer() == null) return;
|
||||
if(ctx.getPlayer() == null || ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) != AnimType.CYCLE) return;
|
||||
ctx.getPlayer().worldObj.playSoundEffect(ctx.getPlayer().posX, ctx.getPlayer().posY, ctx.getPlayer().posZ, "hbm:weapon.fire.tauRelease", 1F, 1F);
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_SECONDARY_PRESS = (stack, ctx) -> {
|
||||
if(ctx.getPlayer() == null) return;
|
||||
if(ctx.config.getReceivers(stack)[0].getMagazine(stack).getAmount(stack, ctx.inventory) <= 0) return;
|
||||
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.SPINUP, ctx.configIndex);
|
||||
tauChargeMag.getMagType(stack); //caches the last loaded ammo
|
||||
};
|
||||
@ -71,7 +72,7 @@ public class XFactoryAccelerator {
|
||||
if(ctx.getPlayer() == null) return;
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
|
||||
if(timer >= 10) {
|
||||
if(timer >= 10 && ItemGunBaseNT.getLastAnim(stack, ctx.configIndex) == AnimType.SPINUP) {
|
||||
ItemGunBaseNT.playAnimation(ctx.getPlayer(), stack, AnimType.ALT_CYCLE, ctx.configIndex);
|
||||
int unitsUsed = 1 + Math.min(12, timer / 10);
|
||||
|
||||
|
||||
@ -1,7 +1,17 @@
|
||||
package com.hbm.items.weapon.sedna.factory;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
@ -11,12 +21,19 @@ import com.hbm.items.weapon.sedna.Receiver;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class XFactoryCatapult {
|
||||
|
||||
@ -24,21 +41,76 @@ public class XFactoryCatapult {
|
||||
public static BulletConfig nuke_demo;
|
||||
public static BulletConfig nuke_high;
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_NUKE_STANDARD = (bullet, mop) -> {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3) return;
|
||||
if(bullet.isDead) return;
|
||||
bullet.setDead();
|
||||
|
||||
ExplosionVNT vnt = new ExplosionVNT(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 10);
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(2, bullet.damage).withRangeMod(1.5F));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.explode();
|
||||
|
||||
incrementRad(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
|
||||
spawnMush(bullet, mop);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_NUKE_DEMO = (bullet, mop) -> {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3) return;
|
||||
if(bullet.isDead) return;
|
||||
bullet.setDead();
|
||||
|
||||
ExplosionVNT vnt = new ExplosionVNT(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 10);
|
||||
vnt.setBlockAllocator(new BlockAllocatorStandard(64));
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard());
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(2, bullet.damage).withRangeMod(1.5F));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.explode();
|
||||
|
||||
incrementRad(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
|
||||
spawnMush(bullet, mop);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_NUKE_HIGH = (bullet, mop) -> {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3) return;
|
||||
if(bullet.isDead) return;
|
||||
bullet.setDead();
|
||||
bullet.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(bullet.worldObj, 35, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord));
|
||||
spawnMush(bullet, mop);
|
||||
};
|
||||
|
||||
public static void incrementRad(World world, double posX, double posY, double posZ) {
|
||||
for(int i = -2; i <= 2; i++) { for(int j = -2; j <= 2; j++) {
|
||||
if(Math.abs(i) + Math.abs(j) < 4) {
|
||||
ChunkRadiationManager.proxy.incrementRad(world, (int) Math.floor(posX + i * 16), (int) Math.floor(posY), (int) Math.floor(posZ + j * 16), 50 / (Math.abs(i) + Math.abs(j) + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnMush(EntityBulletBaseMK4 bullet, MovingObjectPosition mop) {
|
||||
bullet.worldObj.playSoundEffect(mop.hitVec.xCoord, mop.hitVec.yCoord + 0.5, mop.hitVec.zCoord, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "muke");
|
||||
data.setBoolean("balefire", MainRegistry.polaroidID == 11 || bullet.worldObj.rand.nextInt(100) == 0);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, mop.hitVec.xCoord, mop.hitVec.yCoord + 0.5, mop.hitVec.zCoord), new TargetPoint(bullet.dimension, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 250));
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
|
||||
nuke_standard = new BulletConfig().setItem(EnumAmmo.NUKE_STANDARD).setVel(3F).setGrav(0.025F);
|
||||
nuke_demo = new BulletConfig().setItem(EnumAmmo.NUKE_DEMO).setVel(3F).setGrav(0.025F);
|
||||
nuke_high = new BulletConfig().setItem(EnumAmmo.NUKE_HIGH).setVel(3F).setGrav(0.025F);
|
||||
nuke_standard = new BulletConfig().setItem(EnumAmmo.NUKE_STANDARD).setLife(300).setVel(3F).setGrav(0.025F).setOnImpact(LAMBDA_NUKE_STANDARD);
|
||||
nuke_demo = new BulletConfig().setItem(EnumAmmo.NUKE_DEMO).setLife(300).setVel(3F).setGrav(0.025F).setOnImpact(LAMBDA_NUKE_DEMO);
|
||||
nuke_high = new BulletConfig().setItem(EnumAmmo.NUKE_HIGH).setLife(300).setVel(3F).setGrav(0.025F).setOnImpact(LAMBDA_NUKE_HIGH);
|
||||
|
||||
ModItems.gun_fatman = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(300).draw(7).inspect(40).crosshair(Crosshair.L_CIRCUMFLEX)
|
||||
.dura(300).draw(20).inspect(30).crosshair(Crosshair.L_CIRCUMFLEX)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(25F).delay(5).reload(50).jam(40).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
|
||||
.dmg(25F).delay(10).reload(57).jam(40).sound("hbm:weapon.fire.fatman", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 1).addConfigs(nuke_standard, nuke_demo, nuke_high))
|
||||
.offset(1, -0.0625 * 1.5, -0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.setupStandardConfiguration()
|
||||
.anim(LAMBDA_FATMAN_ANIMS).orchestra(Orchestras.ORCHESTRA_PANERSCHRECK)
|
||||
.anim(LAMBDA_FATMAN_ANIMS).orchestra(Orchestras.ORCHESTRA_FATMAN)
|
||||
).setUnlocalizedName("gun_fatman");
|
||||
}
|
||||
|
||||
@ -46,16 +118,24 @@ public class XFactoryCatapult {
|
||||
switch(type) {
|
||||
case EQUIP: return new BusAnimation()
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 1000, IType.SIN_DOWN));
|
||||
case CYCLE:
|
||||
Random rand = MainRegistry.proxy.me().getRNG();
|
||||
return new BusAnimation()
|
||||
.addBus("GAUGE", new BusAnimationSequence().addPos(0, 0, 135 + rand.nextInt(136), 100, IType.SIN_DOWN).addPos(0, 0, 0, 500, IType.SIN_DOWN))
|
||||
.addBus("PISTON", new BusAnimationSequence().addPos(0, 0, 3, 100, IType.SIN_UP))
|
||||
.addBus("NUKE", new BusAnimationSequence().addPos(0, 0, 3, 100, IType.SIN_UP).addPos(0, 0, 0, 0));
|
||||
case RELOAD: return new BusAnimation()
|
||||
.addBus("BARREL", new BusAnimationSequence().addPos(0, 0, 1.5, 150).addPos(0, 0, 1.5, 2100).addPos(0, 0, 0, 150))
|
||||
.addBus("OPEN", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(90, 0, 0, 500, IType.SIN_FULL).addPos(90, 0, 0, 1000).addPos(0, 0, 0, 500, IType.SIN_FULL))
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 2250).addPos(-1, 0, 0, 150, IType.SIN_DOWN).addPos(0, 0, 0, 150, IType.SIN_UP))
|
||||
.addBus("MISSILE", new BusAnimationSequence().addPos(-10, 0, 0, 0).addPos(-10, 0, 0, 750).addPos(3, 0, 2, 0).addPos(0, 0, -6, 350, IType.SIN_FULL).addPos(0, 0, 0, 350, IType.SIN_UP));
|
||||
case JAMMED:
|
||||
.addBus("LID", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -45, 250, IType.SIN_UP).addPos(0, 0, -45, 1200).addPos(0, 0, 0, 250, IType.SIN_UP))
|
||||
.addBus("HANDLE", new BusAnimationSequence().addPos(0, 0, -2, 500, IType.SIN_FULL).addPos(0, 0, -2, 1700).addPos(0, 0, 0, 750, IType.SIN_FULL))
|
||||
.addBus("NUKE", new BusAnimationSequence().addPos(5, -4, 3, 0).addPos(5, -4, 3, 750).addPos(2, 0.5, 3, 500, IType.SIN_UP).addPos(1, 0.5, 3, 100).addPos(0, 0, 3, 100).addPos(0, 0, 3, 750).addPos(0, 0, 0, 750, IType.SIN_FULL))
|
||||
.addBus("PISTON", new BusAnimationSequence().addPos(0, 0, 3, 0).addPos(0, 0, 3, 2200).addPos(0, 0, 0, 750, IType.SIN_FULL))
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(5, 0, 0, 500, IType.SIN_FULL).addPos(0, 0, 0, 500, IType.SIN_FULL).addPos(0, 0, 0, 450).addPos(3, 0, 0, 100, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL).addPos(0, 0, 0, 500).addPos(-10, 0, 0, 375, IType.SIN_DOWN).addPos(0, 0, 0, 375, IType.SIN_UP));
|
||||
case JAMMED: return new BusAnimation()
|
||||
.addBus("HANDLE", new BusAnimationSequence().addPos(0, 0, 0, 750).addPos(0, 0, -2, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL).addPos(0, 0, -2, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL))
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(-15, 0, 0, 250, IType.SIN_FULL).addPos(-15, 0, 0, 1000).addPos(0, 0, 0, 250, IType.SIN_FULL));
|
||||
case INSPECT: return new BusAnimation()
|
||||
.addBus("BARREL", new BusAnimationSequence().addPos(0, 0, 1.5, 150).addPos(0, 0, 1.5, 1350).addPos(0, 0, 0, 150))
|
||||
.addBus("OPEN", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(90, 0, 0, 500, IType.SIN_FULL).addPos(90, 0, 0, 250).addPos(0, 0, 0, 500, IType.SIN_FULL))
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(0, 0, 0, 1500).addPos(-1, 0, 0, 150, IType.SIN_DOWN).addPos(0, 0, 0, 150, IType.SIN_UP));
|
||||
.addBus("HANDLE", new BusAnimationSequence().addPos(0, 0, 0, 250).addPos(0, 0, -2, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL).addPos(0, 0, -2, 250, IType.SIN_FULL).addPos(0, 0, 0, 250, IType.SIN_FULL))
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-15, 0, 0, 250, IType.SIN_FULL).addPos(-15, 0, 0, 1000).addPos(0, 0, 0, 250, IType.SIN_FULL));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
@ -54,27 +54,29 @@ public class ParticleMukeCloud extends EntityFX {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public void onUpdate() {
|
||||
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
public void onUpdate() {
|
||||
|
||||
this.noClip = this.particleAge <= 2;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge - 2) {
|
||||
this.setDead();
|
||||
}
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= friction;
|
||||
this.motionY *= friction;
|
||||
this.motionZ *= friction;
|
||||
if(this.particleAge++ >= this.particleMaxAge - 2) {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if (this.onGround) {
|
||||
this.motionX *= 0.7D;
|
||||
this.motionZ *= 0.7D;
|
||||
}
|
||||
}
|
||||
this.motionY -= 0.04D * (double) this.particleGravity;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= friction;
|
||||
this.motionY *= friction;
|
||||
this.motionZ *= friction;
|
||||
|
||||
if(this.onGround) {
|
||||
this.motionX *= 0.7D;
|
||||
this.motionZ *= 0.7D;
|
||||
}
|
||||
}
|
||||
|
||||
public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) {
|
||||
|
||||
|
||||
@ -7,7 +7,6 @@ import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemRenderFatMan extends ItemRenderWeaponBase {
|
||||
@ -31,13 +30,18 @@ public class ItemRenderFatMan extends ItemRenderWeaponBase {
|
||||
public void renderFirstPerson(ItemStack stack) {
|
||||
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.fatman_tex);
|
||||
double scale = 0.5D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
boolean isLoaded = gun.getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, null) > 0;
|
||||
|
||||
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
|
||||
double[] open = HbmAnimations.getRelevantTransformation("OPEN");
|
||||
double[] lid = HbmAnimations.getRelevantTransformation("LID");
|
||||
double[] nuke = HbmAnimations.getRelevantTransformation("NUKE");
|
||||
double[] piston = HbmAnimations.getRelevantTransformation("PISTON");
|
||||
double[] handle = HbmAnimations.getRelevantTransformation("HANDLE");
|
||||
double[] gauge = HbmAnimations.getRelevantTransformation("GAUGE");
|
||||
|
||||
GL11.glTranslated(0, 1, -2);
|
||||
GL11.glRotated(equip[0], 1, 0, 0);
|
||||
@ -46,18 +50,35 @@ public class ItemRenderFatMan extends ItemRenderWeaponBase {
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
ResourceManager.fatman.renderPart("Launcher");
|
||||
ResourceManager.fatman.renderPart("Handle");
|
||||
ResourceManager.fatman.renderPart("Gauge");
|
||||
ResourceManager.fatman.renderPart("Lid");
|
||||
|
||||
if(gun.getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, null) > 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, handle[2]);
|
||||
ResourceManager.fatman.renderPart("Handle");
|
||||
|
||||
GL11.glTranslated(0.4375, -0.875, 0);
|
||||
GL11.glRotated(gauge[2], 0, 0, 1);
|
||||
GL11.glTranslated(-0.4375, 0.875, 0);
|
||||
ResourceManager.fatman.renderPart("Gauge");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.25, 0.125, 0);
|
||||
GL11.glRotated(lid[2], 0, 0, 1);
|
||||
GL11.glTranslated(-0.25, -0.125, 0);
|
||||
ResourceManager.fatman.renderPart("Lid");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, piston[2]);
|
||||
if(!isLoaded && piston[2] == 0) GL11.glTranslated(0, 0, 3);
|
||||
ResourceManager.fatman.renderPart("Piston");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(isLoaded || nuke[0] != 0 || nuke[1] != 0 || nuke[2] != 0) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.fatman_mininuke_tex);
|
||||
ResourceManager.fatman.renderPart("Piston");
|
||||
ResourceManager.fatman.renderPart("MiniNuke");
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, 3);
|
||||
ResourceManager.fatman.renderPart("Piston");
|
||||
GL11.glTranslated(nuke[0], nuke[1], nuke[2]);
|
||||
ResourceManager.fatman.renderPart("MiniNuke");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@ -232,6 +232,9 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
|
||||
}
|
||||
|
||||
public void setupInv(ItemStack stack) {
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
GL11.glScaled(1, 1, -1);
|
||||
GL11.glTranslated(8, 8, 0);
|
||||
GL11.glRotated(225, 0, 0, 1);
|
||||
|
||||
@ -224,13 +224,14 @@
|
||||
"weapon.switchmode1": {"category": "player", "sounds": [{"name": "weapon/switchmode1", "stream": false}]},
|
||||
"weapon.switchmode2": {"category": "player", "sounds": [{"name": "weapon/switchmode2", "stream": false}]},
|
||||
|
||||
"weapon.fire.blackPowder": {"category": "player", "sounds": [{"name": "weapon/fire/blackPowder", "stream": false}]},
|
||||
"weapon.fire.flameLoop": {"category": "player", "sounds": [{"name": "weapon/fire/flameLoop", "stream": false}]},
|
||||
"weapon.fire.lockon": {"category": "player", "sounds": [{"name": "weapon/fire/lockon", "stream": false}]},
|
||||
"weapon.fire.shredderCycle": {"category": "player", "sounds": [{"name": "weapon/fire/shredderCycle", "stream": false}]},
|
||||
"weapon.fire.tau": {"category": "player", "sounds": [{"name": "weapon/fire/tau", "stream": false}]},
|
||||
"weapon.fire.tauLoop": {"category": "player", "sounds": [{"name": "weapon/fire/tauLoop", "stream": false}]},
|
||||
"weapon.fire.blackPowder": {"category": "player", "sounds": ["weapon/fire/blackPowder"]},
|
||||
"weapon.fire.flameLoop": {"category": "player", "sounds": ["weapon/fire/flameLoop"]},
|
||||
"weapon.fire.lockon": {"category": "player", "sounds": ["weapon/fire/lockon"]},
|
||||
"weapon.fire.shredderCycle": {"category": "player", "sounds": ["weapon/fire/shredderCycle"]},
|
||||
"weapon.fire.tau": {"category": "player", "sounds": ["weapon/fire/tau"]},
|
||||
"weapon.fire.tauLoop": {"category": "player", "sounds": ["weapon/fire/tauLoop"]},
|
||||
"weapon.fire.tauRelease": {"category": "player", "sounds": ["weapon/fire/tauRelease1", "weapon/fire/tauRelease2", "weapon/fire/tauRelease3"]},
|
||||
"weapon.fire.fatman": {"category": "player", "sounds": ["weapon/fire/fatman"]},
|
||||
|
||||
"weapon.reload.boltClose": {"category": "player", "sounds": ["weapon/reload/boltClose"]},
|
||||
"weapon.reload.boltOpen": {"category": "player", "sounds": ["weapon/reload/boltOpen"]},
|
||||
@ -256,6 +257,7 @@
|
||||
"weapon.reload.shotgunReload": {"category": "player", "sounds": ["weapon/reload/shotgunReload1", "weapon/reload/shotgunReload2", "weapon/reload/shotgunReload3"]},
|
||||
"weapon.reload.tubeFwoomp": {"category": "player", "sounds": ["weapon/reload/tubeFwoomp"]},
|
||||
"weapon.reload.impact": {"category": "player", "sounds": ["weapon/reload/impact1", "weapon/reload/impact2", "weapon/reload/impact3"]},
|
||||
"weapon.reload.fatmanFull": {"category": "player", "sounds": ["weapon/reload/fatmanFull"]},
|
||||
|
||||
"turret.chekhov_fire": {"category": "block", "sounds": [{"name": "turret/chekhov_fire", "stream": false}]},
|
||||
"turret.jeremy_fire": {"category": "block", "sounds": ["turret/jeremy_fire1", "turret/jeremy_fire2", "turret/jeremy_fire3", "turret/jeremy_fire4", "turret/jeremy_fire5"]},
|
||||
|
||||
BIN
src/main/resources/assets/hbm/sounds/weapon/fire/fatman.ogg
Normal file
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 393 B |
|
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 369 B After Width: | Height: | Size: 392 B |