From e3dd57759c476c7e5c51cccd3dea3c35261ee04a Mon Sep 17 00:00:00 2001 From: 70000hp <105080577+70000hp@users.noreply.github.com> Date: Mon, 28 Aug 2023 18:19:02 -0400 Subject: [PATCH] Finishing the Moritas + spas alt fire anim --- .../hbm/handler/guncfg/Gun12GaugeFactory.java | 16 +++++++++++ .../hbm/handler/guncfg/Gun22LRFactory.java | 4 +-- .../hbm/handler/guncfg/Gun556mmFactory.java | 27 +++++++++++++++++-- src/main/java/com/hbm/items/ModItems.java | 2 +- .../item/weapon/ItemRenderWeaponMorita.java | 3 ++- src/main/resources/assets/hbm/lang/en_US.lang | 1 + 6 files changed, 47 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java index 424deacfc2..2f397f941b 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun12GaugeFactory.java @@ -124,6 +124,22 @@ public static GunConfiguration getSpas12Config() { .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200)) ) ); + + config.animations.put(AnimType.ALT_CYCLE, new BusAnimation() + .addBus("SPAS_RECOIL_TRANSLATE", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(0, 0, -2, 100)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200)) + ) + .addBus("SPAS_RECOIL_ROT", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(-1, 0, 1, 100)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200)) + ) + .addBus("SPAS_PUMP", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 450)) + .addKeyframe(new BusAnimationKeyframe(0, 0, -1.8, 200)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200)) + ) + ); config.ejector = EJECTOR_SPAS; diff --git a/src/main/java/com/hbm/handler/guncfg/Gun22LRFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun22LRFactory.java index cc129d2606..f8c9d1fd65 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun22LRFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun22LRFactory.java @@ -87,8 +87,8 @@ public static BulletConfiguration get22LRSatConfig() { bullet.ammo = new ComparableStack(ModItems.ammo_22lr.stackFromEnum(Ammo22LR.STOCK)); bullet.spread *= inaccuracy; - bullet.dmgMin = 18; - bullet.dmgMax = 26; + bullet.dmgMin = 12; + bullet.dmgMax = 16; bullet.dmgFire = true; bullet.wear = 5; bullet.spentCasing = CASING22LR.clone().register("22LRStock"); diff --git a/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java b/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java index a58511a965..ecb9deb3bb 100644 --- a/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/Gun556mmFactory.java @@ -187,7 +187,7 @@ public static GunConfiguration getMoritaConfig() { ) ); - config.name = "morita"; + config.name = "Morita Assault Rifle"; config.manufacturer = EnumGunManufacturer.MORITA; config.comment.add("Smells like crayons."); @@ -222,7 +222,7 @@ public static GunConfiguration getMUnderbarrelConfig(){ return config; } - public static GunConfiguration getMoritaCarbineConfig() { + public static GunConfiguration getMoritaCarbineBurstConfig() { GunConfiguration config = getMoritaConfig(); config.rateOfFire = 4; @@ -231,10 +231,33 @@ public static GunConfiguration getMoritaCarbineConfig() { config.partialFire = true; config.durability = 8000; config.reloadDuration = 15; + config.comment.clear(); + config.name = "Morita Carbine Rifle"; config.comment.add("COME ON YOU APES, YOU WANNA LIVE FOREVER??"); + config.comment.add("Main fire for full auto, alt fire for 3 round bursts"); + config.animations.put(AnimType.ALT_CYCLE, new BusAnimation() + .addBus("RECOIL", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(0.5, 0, 0, 25)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75)) + ) + ); + return config; + } + public static GunConfiguration getMoritaCarbineAutoConfig() { + + GunConfiguration config = getMoritaCarbineBurstConfig(); + + config.rateOfFire = 2; + config.roundsPerCycle = 1; + config.gunMode = GunConfiguration.MODE_NORMAL; + config.firingMode = GunConfiguration.FIRE_AUTO; + config.firingSound = "hbm:weapon.moritaShoot"; + config.firingDuration = 0; + return config; } + private static float inaccuracy = 2.5F; public static BulletConfiguration get556Config() { diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 551d61cf0b..bffb76e95b 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -4243,7 +4243,7 @@ public static void initializeItem() gun_uac_pistol = new ItemGunBase(Gun45ACPFactory.getUACPistolConfig()).setFull3D().setUnlocalizedName("gun_uac_pistol").setCreativeTab(MainRegistry.weaponTab); gun_morita = new ItemGunBase(Gun556mmFactory.getMoritaConfig(), Gun556mmFactory.getMUnderbarrelConfig()).setUnlocalizedName("gun_morita").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_morita"); - gun_morita_carbine = new ItemGunBase(Gun556mmFactory.getMoritaCarbineConfig()).setUnlocalizedName("gun_morita_carbine").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_morita"); + gun_morita_carbine = new ItemGunBase(Gun556mmFactory.getMoritaCarbineAutoConfig(), Gun556mmFactory.getMoritaCarbineBurstConfig()).setUnlocalizedName("gun_morita_carbine").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_morita"); 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"); diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponMorita.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponMorita.java index ba3317c901..2b47058527 100644 --- a/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponMorita.java +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponMorita.java @@ -123,7 +123,8 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data) { GL11.glEnable(GL11.GL_LIGHTING); - double s = 1.7D; + double s = item.isItemEqual(new ItemStack(ModItems.gun_morita)) ? 1.45D : 1.7D; + GL11.glTranslated(6, 10, 0); GL11.glRotated(90, 0, 1, 0); GL11.glRotated(135, 1, 0, 0); diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 82f460ab34..2e97b236ca 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -1109,6 +1109,7 @@ gun.make.MANN=Open Mann Co. gun.make.MAXIM=Hiram Maxim gun.make.METRO=Metro Gunsmiths gun.make.MWT=MWT Prototype Labs +gun.make.MORITA=Morita Company gun.make.NAWS=Kayarm Industries gun.make.ERFURT=Erfurter Maschinenfabrik Geipel gun.make.NONE=-