mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
one shotgun, two shotgun
This commit is contained in:
parent
805c06c802
commit
be1b1c1df0
@ -4,6 +4,13 @@ import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.BlockMutatorFire;
|
||||
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth;
|
||||
import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
|
||||
@ -45,18 +52,25 @@ public class EntityBombletZeta extends EntityThrowable {
|
||||
{
|
||||
if(!this.worldObj.isRemote)
|
||||
{
|
||||
if(type == 0) {
|
||||
ExplosionLarge.explode(worldObj, this.posX + 0.5F, this.posY + 0.5F, this.posZ + 0.5F, 5.0F, true, false, false, this);
|
||||
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "hbm:entity.bombDet", 25.0F, 0.8F + rand.nextFloat() * 0.4F);
|
||||
if(type == 0) {
|
||||
ExplosionVNT vnt = new ExplosionVNT(worldObj, this.posX + 0.5F, this.posY + 1.5F, this.posZ + 0.5F, 4F);
|
||||
vnt.setBlockAllocator(new BlockAllocatorStandard());
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard());
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 100));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectWeapon(15, 3.5F, 1.25F));
|
||||
vnt.explode();
|
||||
}
|
||||
if(type == 1) {
|
||||
ExplosionLarge.explode(worldObj, this.posX + 0.5F, this.posY + 0.5F, this.posZ + 0.5F, 2.5F, false, false, false, this);
|
||||
ExplosionChaos.burn(worldObj, (int)posX, (int)posY, (int)posZ, 9);
|
||||
ExplosionChaos.flameDeath(worldObj, (int)posX, (int)posY, (int)posZ, 14);
|
||||
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "hbm:entity.bombDet", 25.0F, 1.0F);
|
||||
|
||||
for(int i = 0; i < 5; i++)
|
||||
ExplosionLarge.spawnBurst(worldObj, this.posX + 0.5F, this.posY + 1.0F, this.posZ + 0.5F, rand.nextInt(10) + 15, rand.nextFloat() * 2 + 2);
|
||||
|
||||
ExplosionVNT vnt = new ExplosionVNT(worldObj, this.posX + 0.5F, this.posY + 1.5F, this.posZ + 0.5F, 4F);
|
||||
vnt.setBlockAllocator(new BlockAllocatorStandard());
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard().withBlockEffect(new BlockMutatorFire()));
|
||||
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 100));
|
||||
vnt.setPlayerProcessor(new PlayerProcessorStandard());
|
||||
vnt.setSFX(new ExplosionEffectWeapon(15, 5F, 1.75F));
|
||||
vnt.explode();
|
||||
|
||||
}
|
||||
if(type == 2) {
|
||||
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);
|
||||
|
||||
@ -22,7 +22,6 @@ public class ExplosionEffectWeapon implements IExplosionSFX {
|
||||
public void doEffect(ExplosionVNT explosion, World world, double x, double y, double z, float size) {
|
||||
if(world.isRemote) return;
|
||||
|
||||
world.playSoundEffect(x, y, z, "random.explode", 4.0F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.9F);
|
||||
ExplosionSmallCreator.composeEffect(world, x, y, z, cloudCount, cloudScale, cloudSpeedMult);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1624,6 +1624,7 @@ public class ModItems {
|
||||
public static Item gun_henry;
|
||||
public static Item gun_greasegun;
|
||||
public static Item gun_maresleg;
|
||||
public static Item gun_maresleg_akimbo;
|
||||
public static Item gun_flaregun;
|
||||
public static Item gun_heavy_revolver;
|
||||
public static Item gun_carbine;
|
||||
@ -7012,6 +7013,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_henry, gun_henry.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_greasegun, gun_greasegun.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_maresleg, gun_maresleg.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_maresleg_akimbo, gun_maresleg_akimbo.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_flaregun, gun_flaregun.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_heavy_revolver, gun_heavy_revolver.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_carbine, gun_carbine.getUnlocalizedName());
|
||||
|
||||
@ -27,6 +27,7 @@ public class GunFactoryClient {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_henry, new ItemRenderHenry());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_greasegun, new ItemRenderGreasegun());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_maresleg, new ItemRenderMaresleg());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_maresleg_akimbo, new ItemRenderMareslegAkimbo());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flaregun, new ItemRenderFlaregun());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_heavy_revolver, new ItemRenderHeavyRevolver());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_carbine, new ItemRenderCarbine());
|
||||
@ -93,5 +94,7 @@ public class GunFactoryClient {
|
||||
|
||||
((ItemGunBaseNT) ModItems.gun_light_revolver_dani).getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_light_revolver_dani).getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo).getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo).getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,6 +243,42 @@ public class Orchestras {
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_MARESLEG_AKIMBO = (stack, ctx) -> {
|
||||
EntityPlayer player = ctx.player;
|
||||
if(player.worldObj.isRemote) return;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
|
||||
|
||||
if(type == AnimType.RELOAD) {
|
||||
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.8F);
|
||||
if(timer == 16) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.shotgunReload", 1F, 1F);
|
||||
}
|
||||
if(type == AnimType.RELOAD_CYCLE) {
|
||||
if(timer == 0) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.shotgunReload", 1F, 1F);
|
||||
}
|
||||
if(type == AnimType.RELOAD_END) {
|
||||
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.7F);
|
||||
}
|
||||
if(type == AnimType.JAMMED) {
|
||||
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverCock", 1F, 0.7F);
|
||||
if(timer == 17) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
|
||||
if(timer == 29) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
|
||||
}
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 14) {
|
||||
int offset = ctx.configIndex == 0 ? -1 : 1;
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack);
|
||||
if(casing != null) CasingCreator.composeEffect(player.worldObj, player, 0.3125, -0.125, aiming ? -0.125 * offset : -0.375D * offset, 0, -0.08, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
if(timer == 2) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.dryFireClick", 1F, 1F);
|
||||
if(timer == 8) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.leverCock", 1F, 0.8F);
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_FLAREGUN = (stack, ctx) -> {
|
||||
EntityPlayer player = ctx.player;
|
||||
if(player.worldObj.isRemote) return;
|
||||
@ -580,5 +616,9 @@ public class Orchestras {
|
||||
if(player.worldObj.isRemote) return;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
|
||||
if(type == AnimType.RELOAD) {
|
||||
if(timer == 30) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.insertCanister", 1F, 1F);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -49,6 +49,26 @@ public class XFactory12ga {
|
||||
.setupStandardConfiguration()
|
||||
.anim(LAMBDA_MARESLEG_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG)
|
||||
).setUnlocalizedName("gun_maresleg").setTextureName(RefStrings.MODID + ":gun_darter");
|
||||
ModItems.gun_maresleg_akimbo = new ItemGunBaseNT(
|
||||
new GunConfig().dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 6).addConfigs(g12_bp, g12_bp_magnum, g12_bp_slug, g12))
|
||||
.offset(0.75, -0.0625, 0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
|
||||
.anim(LAMBDA_MARESLEG_SHORT_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG_AKIMBO),
|
||||
new GunConfig().dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(1, 6).addConfigs(g12_bp, g12_bp_magnum, g12_bp_slug, g12))
|
||||
.offset(0.75, -0.0625, -0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
|
||||
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
|
||||
.anim(LAMBDA_MARESLEG_SHORT_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG_AKIMBO)
|
||||
).setUnlocalizedName("gun_maresleg_akimbo").setTextureName(RefStrings.MODID + ":gun_darter");
|
||||
|
||||
ModItems.gun_liberator = new ItemGunBaseNT(new GunConfig()
|
||||
.dura(200).draw(20).inspect(21).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
@ -145,6 +165,29 @@ public class XFactory12ga {
|
||||
return null;
|
||||
};
|
||||
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MARESLEG_SHORT_ANIMS = (stack, type) -> {
|
||||
switch(type) {
|
||||
case EQUIP: return new BusAnimation()
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 250, IType.SIN_DOWN));
|
||||
case CYCLE: return new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, 0, 50).addPos(0, 0, -1, 50).addPos(0, 0, 0, 250))
|
||||
.addBus("SIGHT", new BusAnimationSequence().addPos(35, 0, 0, 100, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
|
||||
.addBus("LEVER", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(-85, 0, 0, 200).addPos(0, 0, 0, 200))
|
||||
.addBus("HAMMER", new BusAnimationSequence().addPos(30, 0, 0, 50).addPos(30, 0, 0, 550).addPos(0, 0, 0, 200))
|
||||
.addBus("FLIP", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(360, 0, 0, 400));
|
||||
case CYCLE_DRY: return new BusAnimation()
|
||||
.addBus("LEVER", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(-90, 0, 0, 200).addPos(0, 0, 0, 200))
|
||||
.addBus("HAMMER", new BusAnimationSequence().addPos(30, 0, 0, 50).addPos(30, 0, 0, 550).addPos(0, 0, 0, 200))
|
||||
.addBus("FLIP", new BusAnimationSequence().addPos(0, 0, 0, 600).addPos(360, 0, 0, 400));
|
||||
case JAMMED: return new BusAnimation()
|
||||
.addBus("LIFT", new BusAnimationSequence().addPos(30, 0, 0, 0).addPos(30, 0, 0, 250).addPos(0, 0, 0, 400, IType.SIN_FULL))
|
||||
.addBus("LEVER", new BusAnimationSequence().addPos(-85, 0, 0, 0).addPos(-15, 0, 0, 200).addPos(-15, 0, 0, 650).addPos(-85, 0, 0, 200).addPos(-15, 0, 0, 200).addPos(-15, 0, 0, 200).addPos(-85, 0, 0, 200).addPos(0, 0, 0, 200))
|
||||
.addBus("FLAG", new BusAnimationSequence().addPos(1, 1, 1, 0));
|
||||
}
|
||||
|
||||
return LAMBDA_MARESLEG_ANIMS.apply(stack, type);
|
||||
};
|
||||
|
||||
/** This fucking sucks */
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_LIBERATOR_ANIMS = (stack, type) -> {
|
||||
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack);
|
||||
|
||||
@ -15,6 +15,8 @@ import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
|
||||
import com.hbm.lib.RefStrings;
|
||||
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 net.minecraft.item.ItemStack;
|
||||
@ -45,9 +47,9 @@ public class XFactoryRocket {
|
||||
.setOnImpact(LAMBDA_STANDARD_EXPLODE_HEAT).setOnEntityHit(null).setOnRicochet(null).setOnUpdate(LAMBDA_STANDARD_ACCELERATE);
|
||||
|
||||
ModItems.gun_panzerschreck = new ItemGunBaseNT(new GunConfig()
|
||||
.dura(300).draw(7).inspect(39).crosshair(Crosshair.L_CIRCUMFLEX)
|
||||
.dura(300).draw(7).inspect(40).crosshair(Crosshair.L_CIRCUMFLEX)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(15F).delay(20).reload(28).jam(33).sound("hbm:weapon.hkShoot", 1.0F, 1.0F)
|
||||
.dmg(25F).delay(5).reload(50).jam(40).sound("hbm:weapon.rpgShoot", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 1).addConfigs(rocket_rpzb_he, rocket_rpzb_heat))
|
||||
.offset(1, -0.0625 * 1.5, -0.1875D)
|
||||
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
@ -56,7 +58,20 @@ public class XFactoryRocket {
|
||||
).setUnlocalizedName("gun_panzerschreck").setTextureName(RefStrings.MODID + ":gun_darter");
|
||||
}
|
||||
|
||||
public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_PANZERSCHRECK_ANIMS = (stack, type) -> {
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_PANZERSCHRECK_ANIMS = (stack, type) -> {
|
||||
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack) <= 0;
|
||||
switch(type) {
|
||||
case EQUIP: return new BusAnimation()
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(60, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||
case RELOAD: return new BusAnimation()
|
||||
.addBus("RELOAD", new BusAnimationSequence().addPos(90, 0, 0, 750, IType.SIN_FULL).addPos(90, 0, 0, 1000).addPos(0, 0, 0, 750, IType.SIN_FULL))
|
||||
.addBus("ROCKET", new BusAnimationSequence().addPos(0, -3, -6, 0).addPos(0, -3, -6, 750).addPos(0, 0, -6.5, 500, IType.SIN_DOWN).addPos(0, 0, 0, 350, IType.SIN_UP));
|
||||
case JAMMED: empty = false;
|
||||
case INSPECT:
|
||||
return new BusAnimation()
|
||||
.addBus("RELOAD", new BusAnimationSequence().addPos(90, 0, 0, 750, IType.SIN_FULL).addPos(90, 0, 0, 500).addPos(0, 0, 0, 750, IType.SIN_FULL))
|
||||
.addBus("ROCKET", new BusAnimationSequence().addPos(0, empty ? -3 : 0, 0, 0));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
@ -134,7 +134,8 @@ public class ModEventHandlerRenderer {
|
||||
|
||||
if(akimbo) {
|
||||
ModelBiped biped = renderer.modelBipedMain;
|
||||
biped.bipedLeftArm.rotateAngleY = 0.1F + biped.bipedHead.rotateAngleY;
|
||||
renderer.modelArmorChestplate.bipedLeftArm.rotateAngleY = renderer.modelArmor.bipedLeftArm.rotateAngleY = biped.bipedLeftArm.rotateAngleY =
|
||||
0.1F + biped.bipedHead.rotateAngleY;
|
||||
if(!isManly) {
|
||||
AbstractClientPlayer acp = (AbstractClientPlayer) player;
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(acp.getLocationSkin());
|
||||
@ -180,11 +181,22 @@ public class ModEventHandlerRenderer {
|
||||
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
RenderPlayer renderer = event.renderer;
|
||||
ItemStack held = player.getHeldItem();
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemGunBaseNT) {
|
||||
if(held != null && player.getHeldItem().getItem() instanceof ItemGunBaseNT) {
|
||||
renderer.modelBipedMain.aimedBow = true;
|
||||
renderer.modelArmor.aimedBow = true;
|
||||
renderer.modelArmorChestplate.aimedBow = true;
|
||||
|
||||
//technically not necessary but it probably fixes some issues with mods that implement their armor weirdly
|
||||
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(held, IItemRenderer.ItemRenderType.EQUIPPED);
|
||||
if(customRenderer instanceof ItemRenderWeaponBase) {
|
||||
ItemRenderWeaponBase renderGun = (ItemRenderWeaponBase) customRenderer;
|
||||
if(renderGun.isAkimbo()) {
|
||||
ModelBiped biped = renderer.modelBipedMain;
|
||||
renderer.modelArmorChestplate.bipedLeftArm.rotateAngleY = renderer.modelArmor.bipedLeftArm.rotateAngleY = biped.bipedLeftArm.rotateAngleY = 0.1F + biped.bipedHead.rotateAngleY;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,17 +7,21 @@ import com.hbm.particle.ParticleExplosionSmall;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.particle.EntityBlockDustFX;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ExplosionSmallCreator implements IParticleCreator {
|
||||
|
||||
public static final double speedOfSound = (17.15D) * 0.5;
|
||||
|
||||
public static void composeEffect(World world, double x, double y, double z, int cloudCount, float cloudScale, float cloudSpeedMult) {
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
@ -26,7 +30,7 @@ public class ExplosionSmallCreator implements IParticleCreator {
|
||||
data.setFloat("cloudScale", cloudScale);
|
||||
data.setFloat("cloudSpeedMult", cloudSpeedMult);
|
||||
data.setInteger("debris", 15);
|
||||
IParticleCreator.sendPacket(world, x, y, z, 150, data);
|
||||
IParticleCreator.sendPacket(world, x, y, z, 200, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -37,6 +41,15 @@ public class ExplosionSmallCreator implements IParticleCreator {
|
||||
float cloudSpeedMult = data.getFloat("cloudSpeedMult");
|
||||
int debris = data.getInteger("debris");
|
||||
|
||||
float dist = (float) player.getDistance(x, y, z);
|
||||
float soundRange = 200F;
|
||||
|
||||
if(dist <= soundRange) {
|
||||
String sound = dist <= soundRange * 0.4 ? "hbm:weapon.explosionSmallNear" : "hbm:weapon.explosionSmallFar";
|
||||
PositionedSoundRecord positionedsoundrecord = new PositionedSoundRecord(new ResourceLocation(sound), 100F, 0.9F + rand.nextFloat() * 0.2F, (float) x, (float) y, (float) z);
|
||||
Minecraft.getMinecraft().getSoundHandler().playDelayedSound(positionedsoundrecord, (int) (dist / speedOfSound));
|
||||
}
|
||||
|
||||
for(int i = 0; i < cloudCount; i++) {
|
||||
ParticleExplosionSmall particle = new ParticleExplosionSmall(world, x, y, z, cloudScale, cloudSpeedMult);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
|
||||
|
||||
@ -0,0 +1,178 @@
|
||||
package com.hbm.render.item.weapon.sedna;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemRenderMareslegAkimbo extends ItemRenderWeaponBase {
|
||||
|
||||
@Override public boolean isAkimbo() { return true; }
|
||||
|
||||
@Override
|
||||
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.5F; }
|
||||
|
||||
@Override
|
||||
public void setupFirstPerson(ItemStack stack) {
|
||||
GL11.glTranslated(0, 0, 0.875);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFirstPerson(ItemStack stack) {
|
||||
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
|
||||
float offset = 0.8F;
|
||||
|
||||
for(int i = -1; i <= 1; i += 2) {
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.maresleg_tex);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
int index = i == -1 ? 0 : 1;
|
||||
|
||||
standardAimingTransform(stack, -1.5F * offset * i, -1F * offset, 2F * offset, 0, -3.875 / 8D, 1);
|
||||
|
||||
double scale = 0.375D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP", index);
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL", index);
|
||||
double[] lever = HbmAnimations.getRelevantTransformation("LEVER", index);
|
||||
double[] turn = HbmAnimations.getRelevantTransformation("TURN", index);
|
||||
double[] flip = HbmAnimations.getRelevantTransformation("FLIP", index);
|
||||
double[] lift = HbmAnimations.getRelevantTransformation("LIFT", index);
|
||||
double[] shell = HbmAnimations.getRelevantTransformation("SHELL", index);
|
||||
double[] flag = HbmAnimations.getRelevantTransformation("FLAG", index);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
GL11.glTranslated(recoil[0] * 2, recoil[1], recoil[2]);
|
||||
GL11.glRotated(recoil[2] * 5, 1, 0, 0);
|
||||
GL11.glRotated(turn[2], 0, 0, 1);
|
||||
|
||||
GL11.glTranslated(0, 0, -4);
|
||||
GL11.glRotated(lift[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 0, 4);
|
||||
|
||||
GL11.glTranslated(0, 0, -4);
|
||||
GL11.glRotated(equip[0], -1, 0, 0);
|
||||
GL11.glTranslated(0, 0, 4);
|
||||
|
||||
GL11.glTranslated(0, 0, -2);
|
||||
GL11.glRotated(flip[0], -1, 0, 0);
|
||||
GL11.glTranslated(0, 0, 2);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1, 3.75);
|
||||
GL11.glRotated(turn[2], 0, 0, -1);
|
||||
GL11.glRotated(flip[0], 1, 0, 0);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
this.renderSmokeNodes(gun.getConfig(stack, index).smokeNodes, 0.25D);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
ResourceManager.maresleg.renderPart("Gun");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0.125, -2.875);
|
||||
GL11.glRotated(lever[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, -0.125, 2.875);
|
||||
ResourceManager.maresleg.renderPart("Lever");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(shell[0], shell[1] - 0.75, shell[2]);
|
||||
ResourceManager.maresleg.renderPart("Shell");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(flag[0] != 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
ResourceManager.maresleg.renderPart("Shell");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1, 3.75);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
|
||||
this.renderMuzzleFlash(gun.lastShot[index], 75, 5);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupThirdPerson(ItemStack stack) {
|
||||
super.setupThirdPerson(stack);
|
||||
double scale = 1.75D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glTranslated(0, 0.25, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupThirdPersonAkimbo(ItemStack stack) {
|
||||
super.setupThirdPersonAkimbo(stack);
|
||||
double scale = 1.75D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glTranslated(0, 0.25, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupInv(ItemStack stack) {
|
||||
GL11.glScaled(1, 1, -1);
|
||||
GL11.glTranslated(8, 8, 0);
|
||||
double scale = 2.5D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInv(ItemStack stack) {
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.maresleg_tex);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(225, 0, 0, 1);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glRotated(45, 0, 1, 0);
|
||||
GL11.glTranslated(-1, 0, 0);
|
||||
ResourceManager.maresleg.renderPart("Gun");
|
||||
ResourceManager.maresleg.renderPart("Lever");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glTranslated(0, 0, 5);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(225, 0, 0, 1);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
GL11.glRotated(-90, 1, 0, 0);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glRotated(-45, 0, 1, 0);
|
||||
GL11.glTranslated(1, 0, 0);
|
||||
ResourceManager.maresleg.renderPart("Gun");
|
||||
ResourceManager.maresleg.renderPart("Lever");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderOther(ItemStack stack, ItemRenderType type) {
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.maresleg_tex);
|
||||
ResourceManager.maresleg.renderPart("Gun");
|
||||
ResourceManager.maresleg.renderPart("Lever");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -30,12 +31,29 @@ public class ItemRenderPanzerschreck extends ItemRenderWeaponBase {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.panzerschreck_tex);
|
||||
double scale = 1.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
|
||||
double[] reload = HbmAnimations.getRelevantTransformation("RELOAD");
|
||||
double[] rocket = HbmAnimations.getRelevantTransformation("ROCKET");
|
||||
|
||||
GL11.glTranslated(0, -1, -1);
|
||||
GL11.glRotated(equip[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 1, 1);
|
||||
|
||||
GL11.glTranslated(0, -4, -3);
|
||||
GL11.glRotated(reload[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 4, 3);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
ResourceManager.panzerschreck.renderPart("Tube");
|
||||
ResourceManager.panzerschreck.renderPart("Shield");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(rocket[0], rocket[1], rocket[2]);
|
||||
ResourceManager.panzerschreck.renderPart("Rocket");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@ -43,7 +61,7 @@ public class ItemRenderPanzerschreck extends ItemRenderWeaponBase {
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
this.renderMuzzleFlash(gun.lastShot[0], 75, 5);
|
||||
this.renderMuzzleFlash(gun.lastShot[0], 150, 7.5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@ import com.hbm.render.loader.ModelRendererObj;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
@ -164,6 +166,15 @@ public class ModelArmorBase extends ModelBiped {
|
||||
rightArm.rotateAngleX += MathHelper.sin(idleCycle * 0.067F) * 0.05F;
|
||||
leftArm.rotateAngleX -= MathHelper.sin(idleCycle * 0.067F) * 0.05F;
|
||||
}
|
||||
|
||||
if(entity instanceof EntityPlayer) {
|
||||
Object o = RenderManager.instance.entityRenderMap.get(EntityPlayer.class);
|
||||
if(o instanceof RenderPlayer) {
|
||||
RenderPlayer render = (RenderPlayer) o;
|
||||
leftArm.copyRotationFrom(render.modelBipedMain.bipedLeftArm);
|
||||
rightArm.copyRotationFrom(render.modelBipedMain.bipedRightArm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void bindTexture(ResourceLocation loc) {
|
||||
|
||||
@ -215,6 +215,8 @@
|
||||
"weapon.nuclearExplosion": {"category": "player", "sounds": [{"name": "weapon/nuclearExplosion", "stream": true}]},
|
||||
"weapon.explosionLargeNear": {"category": "player", "sounds": [{"name": "weapon/explosionLargeNear", "stream": false}]},
|
||||
"weapon.explosionLargeFar": {"category": "player", "sounds": [{"name": "weapon/explosionLargeFar", "stream": false}]},
|
||||
"weapon.explosionSmallNear": {"category": "player", "sounds": ["weapon/explosionSmallNear1", "weapon/explosionSmallNear2", "weapon/explosionSmallNear3"]},
|
||||
"weapon.explosionSmallFar": {"category": "player", "sounds": ["weapon/explosionSmallFar1", "weapon/explosionSmallFar2"]},
|
||||
|
||||
"weapon.dFlash": {"category": "player", "sounds": [{"name": "weapon/dFlash", "stream": false}]},
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Loading…
x
Reference in New Issue
Block a user