big pew pew

This commit is contained in:
Boblet 2023-03-21 16:18:15 +01:00
parent 22e96fefd4
commit 11125a50e0
17 changed files with 23785 additions and 172 deletions

View File

@ -14,6 +14,7 @@ import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo50BMG;
import com.hbm.items.ItemAmmoEnums.AmmoLunaticSniper;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.RefStrings;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
@ -34,6 +35,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
public class Gun50BMGFactory {
@ -77,7 +79,7 @@ public class Gun50BMGFactory {
bullet.ammo = new ComparableStack(ModItems.ammo_luna_sniper.stackFromEnum(AmmoLunaticSniper.INCENDIARY));
bullet.ammo.meta = 1;
bullet.incendiary = 50;
bullet.incendiary = 10;
bullet.spentCasing = CASINGLUNA.clone().register("LunaInc");
@ -172,6 +174,49 @@ public class Gun50BMGFactory {
return config;
}
public static final ResourceLocation scope_luna = new ResourceLocation(RefStrings.MODID, "textures/misc/scope_luna.png");
public static GunConfiguration getLunaticMarksman() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 15;
config.reloadDuration = 15;
config.firingMode = GunConfiguration.FIRE_MANUAL;
config.roundsPerCycle = 1;
config.firingSound = "hbm:weapon.heavyShootPB3";
config.firingPitch = 0.75F;
config.ammoCap = 4;
config.reloadType = GunConfiguration.RELOAD_SINGLE;
config.hasSights = true;
config.zoomFOV = 0.2F; //x5 magnification
config.scopeTexture = scope_luna;
config.allowsInfinity = true;
config.crosshair = Crosshair.L_CLASSIC;
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
config.reloadSoundEnd = true;
config.durability = 500_000;
config.name = "lunaSniper";
config.manufacturer = EnumGunManufacturer.LUNA;
config.comment.add("\"You do not spark joy\"");
config.config = new ArrayList();
config.config.add(BulletConfigSyncingUtil.ROUND_LUNA_SNIPER_SABOT);
config.config.add(BulletConfigSyncingUtil.ROUND_LUNA_SNIPER_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.ROUND_LUNA_SNIPER_EXPLOSIVE);
config.animations.put(AnimType.CYCLE,
new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence()
.addKeyframe(new BusAnimationKeyframe(-0.45, 0.15, 0, 40)) // Moves back and raise slightly
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))) // Then forward again
.addBus("EJECT", new BusAnimationSequence().addKeyframe(new BusAnimationKeyframe(0, 0, 0, 30)) // Wait
.addKeyframe(new BusAnimationKeyframe(50, 0, 0, 120)))); // Fly // out
config.ejector = EJECTOR_SNIPER;
return config;
}
static float inaccuracy = 2.5F;
public static BulletConfiguration get50BMGConfig() {

View File

@ -1493,221 +1493,54 @@ public class ModItems {
public static Item ammo_cell;
/*public static Item ammo_12gauge;
public static Item ammo_12gauge_incendiary;
public static Item ammo_12gauge_shrapnel;
public static Item ammo_12gauge_du;
public static Item ammo_12gauge_sleek;
public static Item ammo_12gauge_marauder;
public static Item ammo_20gauge;
public static Item ammo_20gauge_slug;
public static Item ammo_20gauge_flechette;
public static Item ammo_20gauge_incendiary;
public static Item ammo_20gauge_shrapnel;
public static Item ammo_20gauge_explosive;
public static Item ammo_20gauge_caustic;
public static Item ammo_20gauge_shock;
public static Item ammo_20gauge_wither;
public static Item ammo_20gauge_sleek;
public static Item ammo_4gauge;
public static Item ammo_4gauge_slug;
public static Item ammo_4gauge_flechette;
public static Item ammo_4gauge_flechette_phosphorus;
public static Item ammo_4gauge_explosive;
public static Item ammo_4gauge_semtex;
public static Item ammo_4gauge_balefire;
public static Item ammo_4gauge_kampf;
public static Item ammo_4gauge_canister;
public static Item ammo_4gauge_claw;
public static Item ammo_4gauge_vampire;
public static Item ammo_4gauge_void;
public static Item ammo_4gauge_titan;
public static Item ammo_4gauge_sleek;
public static Item ammo_357_desh;
public static Item ammo_44;
public static Item ammo_44_ap;
public static Item ammo_44_du;
public static Item ammo_44_phosphorus;
public static Item ammo_44_star;
public static Item ammo_44_chlorophyte;
public static Item ammo_44_pip;
public static Item ammo_44_bj;
public static Item ammo_44_silver;
public static Item ammo_44_rocket;
public static Item ammo_5mm;
public static Item ammo_5mm_explosive;
public static Item ammo_5mm_du;
public static Item ammo_5mm_star;
public static Item ammo_5mm_chlorophyte;
public static Item ammo_9mm;
public static Item ammo_9mm_ap;
public static Item ammo_9mm_du;
public static Item ammo_9mm_chlorophyte;
public static Item ammo_9mm_rocket;
public static Item ammo_556;
public static Item ammo_566_gold;
public static Item ammo_556_phosphorus;
public static Item ammo_556_ap;
public static Item ammo_556_du;
public static Item ammo_556_star;
public static Item ammo_556_chlorophyte;
public static Item ammo_556_sleek;
public static Item ammo_556_tracer;
public static Item ammo_556_flechette;
public static Item ammo_556_flechette_incendiary;
public static Item ammo_556_flechette_phosphorus;
public static Item ammo_556_flechette_du;
public static Item ammo_556_flechette_chlorophyte;
public static Item ammo_556_flechette_sleek;
public static Item ammo_556_k;
public static Item ammo_22lr;
public static Item ammo_22lr_ap;
public static Item ammo_22lr_chlorophyte;
public static Item ammo_50ae;
public static Item ammo_50ae_ap;
public static Item ammo_50ae_du;
public static Item ammo_50ae_star;
public static Item ammo_50ae_chlorophyte;
public static Item ammo_50bmg;
public static Item ammo_50bmg_incendiary;
public static Item ammo_50bmg_phosphorus;
public static Item ammo_50bmg_explosive;
public static Item ammo_50bmg_ap;
public static Item ammo_50bmg_du;
public static Item ammo_50bmg_star;
public static Item ammo_50bmg_chlorophyte;
public static Item ammo_50bmg_flechette;
public static Item ammo_50bmg_flechette_am;
public static Item ammo_50bmg_flechette_po;
public static Item ammo_50bmg_sleek;
public static Item ammo_75bolt;
public static Item ammo_75bolt_incendiary;
public static Item ammo_75bolt_he;*/
public static Item ammo_folly;
public static Item ammo_folly_nuclear;
public static Item ammo_folly_du;
/*public static Item ammo_rocket;
public static Item ammo_rocket_he;
public static Item ammo_rocket_incendiary;
public static Item ammo_rocket_phosphorus;
public static Item ammo_rocket_shrapnel;
public static Item ammo_rocket_emp;
public static Item ammo_rocket_glare;
public static Item ammo_rocket_toxic;
public static Item ammo_rocket_canister;
public static Item ammo_rocket_sleek;
public static Item ammo_rocket_nuclear;
public static Item ammo_rocket_rpc;
public static Item ammo_rocket_digamma;
public static Item ammo_grenade;
public static Item ammo_grenade_he;
public static Item ammo_grenade_incendiary;
public static Item ammo_grenade_phosphorus;
public static Item ammo_grenade_toxic;
public static Item ammo_grenade_concussion;
public static Item ammo_grenade_finned;
public static Item ammo_grenade_sleek;
public static Item ammo_grenade_nuclear;
public static Item ammo_grenade_tracer;
public static Item ammo_grenade_kampf;
public static Item ammo_shell;
public static Item ammo_shell_explosive;
public static Item ammo_shell_apfsds_t;
public static Item ammo_shell_apfsds_du;
public static Item ammo_shell_w9;*/
public static Item ammo_dgk;
public static Item ammo_arty;
public static Item ammo_himars;
/*public static Item ammo_nuke;
public static Item ammo_nuke_low;
public static Item ammo_nuke_high;
public static Item ammo_nuke_tots;
public static Item ammo_nuke_safe;
public static Item ammo_nuke_pumpkin;
public static Item ammo_nuke_barrel;
public static Item ammo_mirv;
public static Item ammo_mirv_low;
public static Item ammo_mirv_high;
public static Item ammo_mirv_safe;
public static Item ammo_mirv_special;
public static Item ammo_fuel;
public static Item ammo_fuel_napalm;
public static Item ammo_fuel_phosphorus;
public static Item ammo_fuel_vaporizer;
public static Item ammo_fuel_gas;
public static Item ammo_fireext;
public static Item ammo_fireext_foam;
public static Item ammo_fireext_sand;
public static Item ammo_cell;
public static Item ammo_dart;
public static Item ammo_dart_nuclear;
public static Item ammo_dart_nerf;
public static Item ammo_stinger_rocket;
public static Item ammo_stinger_rocket_he;
public static Item ammo_stinger_rocket_incendiary;
public static Item ammo_stinger_rocket_nuclear;
public static Item ammo_stinger_rocket_bones;*/
public static Item gun_rpg;
//public static Item gun_rpg_ammo;
public static Item gun_karl;
public static Item gun_panzerschreck;
public static Item gun_quadro;
public static Item gun_hk69;
public static Item gun_stinger;
public static Item gun_skystinger;
//public static Item gun_stinger_ammo;
public static Item gun_revolver;
public static Item gun_revolver_saturnite;
//public static Item gun_revolver_ammo;
//public static Item gun_revolver_iron_ammo;
public static Item gun_revolver_gold;
//public static Item gun_revolver_gold_ammo;
//public static Item gun_revolver_lead_ammo;
public static Item gun_revolver_schrabidium;
//public static Item gun_revolver_schrabidium_ammo;
public static Item gun_revolver_cursed;
//public static Item gun_revolver_cursed_ammo;
public static Item gun_revolver_nightmare;
//public static Item gun_revolver_nightmare_ammo;
public static Item gun_revolver_nightmare2;
//public static Item gun_revolver_nightmare2_ammo;
public static Item gun_revolver_pip;
//public static Item gun_revolver_pip_ammo;
public static Item gun_revolver_nopip;
public static Item gun_revolver_blackjack;
public static Item gun_revolver_silver;
public static Item gun_revolver_red;
//public static Item gun_revolver_nopip_ammo;
public static Item gun_bio_revolver;
public static Item gun_deagle;
public static Item gun_flechette;
public static Item gun_ar15;
public static Item gun_calamity;
//public static Item gun_calamity_ammo;
public static Item gun_minigun;
public static Item gun_avenger;
public static Item gun_lacunae;
//public static Item gun_lacunae_ammo;
public static Item gun_folly;
public static Item gun_fatman;
public static Item gun_proto;
//public static Item gun_fatman_ammo;
public static Item gun_mirv;
//public static Item gun_mirv_ammo;
public static Item gun_bf;
public static Item gun_bf_ammo;
public static Item gun_chemthrower;
public static Item gun_mp40;
//public static Item gun_mp40_ammo;
public static Item gun_thompson;
public static Item gun_uzi;
public static Item gun_uzi_silencer;
public static Item gun_uzi_saturnite;
public static Item gun_uzi_saturnite_silencer;
//public static Item gun_uzi_ammo;
public static Item gun_uboinik;
//public static Item gun_uboinik_ammo;
public static Item gun_spas12;
public static Item gun_supershotgun;
public static Item gun_ks23;
@ -1715,11 +1548,9 @@ public class ModItems {
public static Item gun_lever_action;
public static Item gun_lever_action_dark;
public static Item gun_lever_action_sonata;
//public static Item gun_lever_action_ammo;
public static Item gun_bolt_action;
public static Item gun_bolt_action_green;
public static Item gun_bolt_action_saturnite;
//public static Item gun_bolt_action_ammo;
public static Item gun_mymy;
public static Item gun_b92;
public static Item gun_b92_ammo;
@ -1765,11 +1596,12 @@ public class ModItems {
public static Item gun_detonator;
public static Item gun_glass_cannon;
public static Item gun_m2;
public static Item gun_lunatic_marksman;
// We'll figure this part out later
//public static Item gun_llr, gun_mlr, gun_hlr, gun_twr, gun_lunatic, gun_lunatic_shotty, gun_lunatic_marksman;
//public static Item gun_llr, gun_mlr, gun_hlr, gun_twr, gun_lunatic, gun_lunatic_shotty;
//public static Item gun_uac_pistol, gun_uac_dmr, gun_uac_carbine, gun_uac_lmg;
//public static Item gun_m2, gun_benelli, gun_benelli_mod, gun_g36, spear_bishamonten, pagoda;
//public static Item gun_benelli, gun_benelli_mod, gun_g36, spear_bishamonten, pagoda;
public static Item crucible;
@ -4379,6 +4211,7 @@ public class ModItems {
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");
gun_m2 = new ItemGunBase(Gun50BMGFactory.getM2Config()).setFull3D().setUnlocalizedName("gun_m2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter");
gun_lunatic_marksman = new ItemGunBase(Gun50BMGFactory.getLunaticMarksman()).setFull3D().setUnlocalizedName("gun_lunatic_marksman").setCreativeTab(MainRegistry.weaponTab);
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");
@ -7167,6 +7000,7 @@ public class ModItems {
GameRegistry.registerItem(gun_detonator, gun_detonator.getUnlocalizedName());
GameRegistry.registerItem(crucible, crucible.getUnlocalizedName());
GameRegistry.registerItem(gun_glass_cannon, gun_glass_cannon.getUnlocalizedName());
GameRegistry.registerItem(gun_lunatic_marksman, gun_lunatic_marksman.getUnlocalizedName());
//Ammo
/*GameRegistry.registerItem(gun_revolver_iron_ammo, gun_revolver_iron_ammo.getUnlocalizedName());

View File

@ -498,6 +498,7 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_blackjack, new ItemRenderWeaponNovac());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_silver, new ItemRenderWeaponNovac());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_revolver_red, new ItemRenderWeaponNovac());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_lunatic_marksman, new ItemRenderLunaticSniper());
//multitool
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool());

View File

@ -703,6 +703,7 @@ public class ResourceManager {
public static final IModelCustom novac = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/novac.obj"));
public static final IModelCustom novac_scoped = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/novac_scoped.obj"));
public static final IModelCustom m2 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/m2_browning.obj")).asDisplayList(); //large fella should be a display list
public static final IModelCustom lunatic_sniper = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lunatic_sniper.obj")).asDisplayList();
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
@ -788,6 +789,7 @@ public class ResourceManager {
public static final ResourceLocation lent_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lent_gun.png");
public static final ResourceLocation red_key_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/red_key.png");
public static final ResourceLocation m2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/m2_browning.png");
public static final ResourceLocation lunatic_sniper_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lunatic_sniper.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -0,0 +1,134 @@
package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
public class ItemRenderLunaticSniper implements IItemRenderer {
public ItemRenderLunaticSniper() {
}
@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_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION);
}
static final String slide = "Slide_Cube.020_Cube.007";
static final String everythingElse = "Full_Cylinder.007";
static final String spentShell = "Spent_Casing_Casing";
static final String fullRound = "Full_Round_Bullet";
static final float scale1 = 0.2F;
static final float scale2 = 0.15F;
static final float scale3 = 0.3F;
static final float scale4 = 0.7F;
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GL11.glPushMatrix();
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
// double[] eject = HbmAnimations.getRelevantTransformation("EJECT");
double[] tilt = HbmAnimations.getRelevantTransformation("TILT");
// double[] insert = HbmAnimations.getRelevantTransformation("INSERT_ROUND");
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.lunatic_sniper_tex);
GL11.glShadeModel(GL11.GL_SMOOTH);
switch (type) {
case EQUIPPED_FIRST_PERSON:// In hand from POV
if(Minecraft.getMinecraft().thePlayer.isSneaking()) {
GL11.glPopMatrix();
return;
}
GL11.glRotatef(90F, 1F, 0F, 0F);
GL11.glRotatef(-58.5F, 0F, 1F, 0F);
GL11.glRotatef(90F, 0F, 0F, 1F);
GL11.glTranslatef(-0.5F, -0.15F, 0F);
GL11.glScalef(scale1, scale1, scale1);
/// Begin animations ///
// Move on recoil
GL11.glTranslated(0, 0, recoil[1] * 10);
GL11.glRotated(recoil[0] * 10, 0, 0, 1);
// Move on reload
GL11.glPushMatrix();
GL11.glRotated(tilt[0] * 2, 0, 0, 1);
GL11.glRotated(-tilt[1] * 2, 0, 1, 0);
GL11.glTranslated(0, 0, -tilt[1] / 8);
ResourceManager.lunatic_sniper.renderPart(everythingElse);
GL11.glPopMatrix();
// Release slide
GL11.glPushMatrix();
GL11.glRotated(tilt[0] * 2, 0, 0, 1);
GL11.glRotated(-tilt[1] * 2, 0, 1, 0);
GL11.glTranslated(0, 0, -tilt[2] * 15);
ResourceManager.lunatic_sniper.renderPart(slide);
GL11.glPopMatrix();
// Drop in new round
GL11.glPushMatrix();
GL11.glRotated(tilt[0], 0, 0, 1);
GL11.glTranslated(0, tilt[1], tilt[2]);
ResourceManager.lunatic_sniper.renderPart(fullRound);
GL11.glPopMatrix();
// Eject casing
GL11.glPushMatrix();
GL11.glTranslated(0, 2, 0);//FIXME Where on earth is it?!
// ResourceManager.lunatic_sniper.renderPart(spentShell);
GL11.glPopMatrix();
break;
case EQUIPPED:// In hand from other's POV
GL11.glRotatef(90F, 1F, 0F, 0F);
GL11.glRotatef(-50F, 0F, 1F, 0F);
GL11.glRotatef(90F, 0F, 0F, 1F);
GL11.glTranslatef(0F, -0.25F, -0.76F);
GL11.glScalef(scale2 - scale2 * 2, scale2, scale2);
GL11.glPushMatrix();
// GL11.glTranslated(eject[0] / 2, 0, -5);
// ResourceManager.lunatic_sniper.renderPart(spentShell);
GL11.glPopMatrix();
break;
case ENTITY:// Dropped item
GL11.glScalef(scale3, scale3, scale3);
break;
case INVENTORY:
GL11.glTranslatef(10F, 11.5F, 0F);
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-135F, 1.0F, 0.0F, 0.0F);
GL11.glScalef(scale4, scale4, scale4);
break;
default:
break;
}
if(type != ItemRenderType.EQUIPPED_FIRST_PERSON) {
ResourceManager.lunatic_sniper.renderAllExcept(fullRound, spentShell);
}
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B