Add animations to Congo Lake

This commit is contained in:
George Paton 2024-02-25 17:59:07 +11:00
parent 14fb890dd7
commit e88d3aba19
9 changed files with 2898 additions and 2205 deletions

View File

@ -11,10 +11,12 @@ import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.AmmoGrenade;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.main.ResourceManager;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
@ -69,11 +71,11 @@ public class GunGrenadeFactory {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 20;
config.rateOfFire = 24;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_MANUAL;
config.reloadDuration = 20;
config.reloadDuration = 16;
config.firingDuration = 0;
config.ammoCap = 4;
config.reloadType = GunConfiguration.RELOAD_SINGLE;
@ -81,6 +83,7 @@ public class GunGrenadeFactory {
config.crosshair = Crosshair.L_CIRCUMFLEX;
config.firingSound = "hbm:weapon.glShoot";
config.reloadSound = GunConfiguration.RSOUND_GRENADE_NEW;
config.reloadSoundEnd = false;
config.name = "congoLake";
config.manufacturer = EnumGunManufacturer.NAWS;
@ -89,7 +92,17 @@ public class GunGrenadeFactory {
config.durability = 2500;
config.ejector = EJECTOR_CONGOLAKE;
config.reloadAnimationsSequential = true;
config.loadAnimations = i -> {
config.animations.put(AnimType.CYCLE, ResourceManager.congolake_anim.get("Fire"));
config.animations.put(AnimType.RELOAD, ResourceManager.congolake_anim.get("ReloadStart"));
config.animations.put(AnimType.RELOAD_EMPTY, ResourceManager.congolake_anim.get("ReloadEmpty"));
config.animations.put(AnimType.RELOAD_CYCLE, ResourceManager.congolake_anim.get("Reload"));
config.animations.put(AnimType.RELOAD_END, ResourceManager.congolake_anim.get("ReloadEnd"));
};
return config;
}

View File

@ -4166,7 +4166,7 @@ public class ModItems {
gun_panzerschreck = new ItemGunBase(GunRocketFactory.getPanzConfig()).setUnlocalizedName("gun_panzerschreck").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_panzerschreck");
gun_quadro = new ItemGunBase(GunRocketFactory.getQuadroConfig()).setUnlocalizedName("gun_quadro").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_quadro");
gun_hk69 = new ItemGunBase(GunGrenadeFactory.getHK69Config()).setUnlocalizedName("gun_hk69").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_hk69");
gun_congolake = new ItemGunCongo(GunGrenadeFactory.getCongoConfig()).setUnlocalizedName("gun_congolake").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_congolake");
gun_congolake = new ItemGunBase(GunGrenadeFactory.getCongoConfig()).setUnlocalizedName("gun_congolake").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_congolake");
gun_stinger = new ItemGunBase(GunRocketHomingFactory.getStingerConfig()).setUnlocalizedName("gun_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger");
gun_skystinger = new ItemGunBase(GunRocketHomingFactory.getSkyStingerConfig()).setUnlocalizedName("gun_skystinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_skystinger");
gun_revolver = new ItemGunBase(Gun357MagnumFactory.getRevolverConfig()).setUnlocalizedName("gun_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver");

View File

@ -1,36 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.handler.GunConfiguration;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.ItemStack;
public class ItemGunCongo extends ItemGunBase {
public ItemGunCongo(GunConfiguration config) {
super(config);
}
@Override
@SideOnly(Side.CLIENT)
public BusAnimation getAnimation(ItemStack stack, AnimType type) {
if(type == AnimType.CYCLE) {
return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence()
.addKeyframePosition(1, 0, 0, 50)
.addKeyframePosition(0, 0, 0, 100))
.addBus("PUMP", new BusAnimationSequence()
.addKeyframePosition(0, 0, 0, 500)
.addKeyframePosition(1, 0, 0, 100)
.addKeyframePosition(0, 0, 0, 200));
}
return null;
}
}

View File

@ -853,6 +853,7 @@ public class ResourceManager {
public static final HashMap<String, BusAnimation> spas_12_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/spas12.json"));
public static final HashMap<String, BusAnimation> supershotty_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/supershotty.json"));
public static final HashMap<String, BusAnimation> benelli_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/benelli.json"));
public static final HashMap<String, BusAnimation> congolake_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/congolake.json"));
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));

View File

@ -1,7 +1,12 @@
package com.hbm.render.item.weapon;
import java.awt.Color;
import org.lwjgl.opengl.GL11;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.items.weapon.ItemGunBase;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
@ -34,8 +39,7 @@ public class ItemRenderWeaponCongo implements IItemRenderer {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.congolake_tex);
@ -50,17 +54,70 @@ public class ItemRenderWeaponCongo implements IItemRenderer {
GL11.glRotated(90, 0, 1, 0);
GL11.glScaled(s0, s0, s0);
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
GL11.glTranslated(0, 0, -recoil[0]);
GL11.glShadeModel(GL11.GL_SMOOTH);
HbmAnimations.applyRelevantTransformation("Gun");
ResourceManager.congolake.renderPart("Gun");
double[] pump = HbmAnimations.getRelevantTransformation("PUMP");
GL11.glTranslated(0, 0, -pump[0]);
ResourceManager.congolake.renderPart("Pump_Pummp");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
{
HbmAnimations.applyRelevantTransformation("Pump");
ResourceManager.congolake.renderPart("Pump");
}
GL11.glPopMatrix();
GL11.glPushMatrix();
{
HbmAnimations.applyRelevantTransformation("Sight");
ResourceManager.congolake.renderPart("Sight");
}
GL11.glPopMatrix();
GL11.glPushMatrix();
{
HbmAnimations.applyRelevantTransformation("Loop");
ResourceManager.congolake.renderPart("Loop");
}
GL11.glPopMatrix();
GL11.glPushMatrix();
{
HbmAnimations.applyRelevantTransformation("GuardOuter");
ResourceManager.congolake.renderPart("GuardOuter");
GL11.glPushMatrix();
{
HbmAnimations.applyRelevantTransformation("GuardInner");
ResourceManager.congolake.renderPart("GuardInner");
}
GL11.glPopMatrix();
}
GL11.glPopMatrix();
GL11.glPushMatrix();
{
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.casings_tex);
HbmAnimations.applyRelevantTransformation("Shell");
ItemGunBase gun = (ItemGunBase)item.getItem();
BulletConfiguration bullet = BulletConfigSyncingUtil.pullConfig(gun.mainConfig.config.get(ItemGunBase.getMagType(item)));
int[] colors = bullet.spentCasing != null ? bullet.spentCasing.getColors() : new int[] { 0x3E3E3E };
Color shellColor = new Color(colors.length >= 2 ? colors[1] : 0x3E3E3E);
GL11.glColor3f(shellColor.getRed() / 255F, shellColor.getGreen() / 255F, shellColor.getBlue() / 255F);
ResourceManager.congolake.renderPart("Shell");
Color shellForeColor = new Color(colors[0]);
GL11.glColor3f(shellForeColor.getRed() / 255F, shellForeColor.getGreen() / 255F, shellForeColor.getBlue() / 255F);
ResourceManager.congolake.renderPart("ShellFore");
GL11.glColor3f(1F, 1F, 1F);
}
GL11.glPopMatrix();
break;
@ -96,11 +153,11 @@ public class ItemRenderWeaponCongo implements IItemRenderer {
}
if(type != ItemRenderType.EQUIPPED_FIRST_PERSON) {
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.congolake.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff