mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #1361 from MellowArpeggiation/congo
Congo weapon animations
This commit is contained in:
commit
3e2bf3df76
@ -55,6 +55,7 @@ public class GunConfiguration implements Cloneable {
|
||||
public int firingDuration;
|
||||
//sound path to the shooting sound
|
||||
public String firingSound = "";
|
||||
public String firingSoundEmpty = null;
|
||||
public float firingVolume = 1.0F;
|
||||
public float firingPitch = 1.0F;
|
||||
//how long the reload animation will play
|
||||
|
||||
@ -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;
|
||||
@ -31,7 +33,7 @@ public class GunGrenadeFactory {
|
||||
static {
|
||||
EJECTOR_LAUNCHER = new CasingEjector().setAngleRange(0.02F, 0.03F).setAfterReload();
|
||||
EJECTOR_CONGOLAKE = new CasingEjector().setMotion(0.3, 0.1, 0).setAngleRange(0.02F, 0.03F).setDelay(15);
|
||||
CASING40MM = new SpentCasing(CasingType.STRAIGHT).setScale(4F, 4F, 3F).setBounceMotion(0.02F, 0.03F).setColor(0x777777).setupSmoke(1F, 0.5D, 60, 40);
|
||||
CASING40MM = new SpentCasing(CasingType.STRAIGHT).setScale(4F, 4F, 3F).setBounceMotion(0.02F, 0.03F).setColor(SpentCasing.COLOR_CASE_40MM, 0x4B5443).setupSmoke(1F, 0.5D, 60, 40);
|
||||
}
|
||||
|
||||
public static GunConfiguration getHK69Config() {
|
||||
@ -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,18 @@ 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.CYCLE_EMPTY, ResourceManager.congolake_anim.get("FireEmpty"));
|
||||
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;
|
||||
}
|
||||
|
||||
@ -193,7 +207,7 @@ public class GunGrenadeFactory {
|
||||
bullet.explosive = 7.5F;
|
||||
bullet.jolt = 6.5D;
|
||||
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMIF");
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMIF").setColor(SpentCasing.COLOR_CASE_40MM, 0x1C1C1C);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -210,7 +224,7 @@ public class GunGrenadeFactory {
|
||||
bullet.explosive = 10.0F;
|
||||
bullet.trail = 3;
|
||||
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMCon");
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMCon").setColor(SpentCasing.COLOR_CASE_40MM, 0x3D5E1D);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -224,7 +238,7 @@ public class GunGrenadeFactory {
|
||||
bullet.explosive = 1.5F;
|
||||
bullet.trail = 5;
|
||||
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMFin");
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMFin").setColor(SpentCasing.COLOR_CASE_40MM, 0x007FDB);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -241,7 +255,7 @@ public class GunGrenadeFactory {
|
||||
BulletConfigFactory.nuclearExplosion(bulletnt, x, y, z, ExplosionNukeSmall.PARAMS_TOTS);
|
||||
};
|
||||
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMNuke");
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMNuke").setColor(SpentCasing.COLOR_CASE_40MM, 0xE2C000);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -257,7 +271,7 @@ public class GunGrenadeFactory {
|
||||
bullet.trail = 5;
|
||||
bullet.vPFX = "bluedust";
|
||||
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMTrac").setColor(0xEEEEEE);
|
||||
bullet.spentCasing = CASING40MM.clone().register("40MMTrac").setColor(0xEEEEEE, 0x0075CA);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -241,9 +241,6 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
for(int i = 0; i < bullets; i++) {
|
||||
spawnProjectile(world, player, stack, BulletConfigSyncingUtil.getKey(config));
|
||||
}
|
||||
|
||||
if(player instanceof EntityPlayerMP)
|
||||
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player);
|
||||
|
||||
useUpAmmo(player, stack, true);
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
@ -251,8 +248,15 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
int wear = (int) Math.ceil(config.wear / (1F + EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack)));
|
||||
setItemWear(stack, getItemWear(stack) + wear);
|
||||
}
|
||||
|
||||
if(player instanceof EntityPlayerMP) {
|
||||
AnimType animType = getMag(stack) == 0 ? AnimType.CYCLE_EMPTY : AnimType.CYCLE;
|
||||
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(animType.ordinal()), (EntityPlayerMP) player);
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, mainConfig.firingSound, mainConfig.firingVolume, mainConfig.firingPitch);
|
||||
String firingSound = mainConfig.firingSound;
|
||||
if (getMag(stack) == 0 && mainConfig.firingSoundEmpty != null) firingSound = mainConfig.firingSoundEmpty;
|
||||
world.playSoundAtEntity(player, firingSound, mainConfig.firingVolume, mainConfig.firingPitch);
|
||||
|
||||
if(mainConfig.ejector != null && !mainConfig.ejector.getAfterReload())
|
||||
queueCasing(player, mainConfig.ejector, config, stack);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -414,13 +414,16 @@ public class ModEventHandlerRenderer {
|
||||
private static int fogZ;
|
||||
private static Vec3 fogRGBMultiplier;
|
||||
private static boolean doesBiomeApply = false;
|
||||
private static long fogTimer = 0;
|
||||
|
||||
/** Same procedure as getting the blended sky color but for fog */
|
||||
public static Vec3 getFogBlendColor(World world, int playerX, int playerZ, float red, float green, float blue, double partialTicks) {
|
||||
|
||||
if(playerX == fogX && playerZ == fogZ && fogInit) return fogRGBMultiplier;
|
||||
|
||||
long millis = System.currentTimeMillis() - fogTimer;
|
||||
if(playerX == fogX && playerZ == fogZ && fogInit && millis < 3000) return fogRGBMultiplier;
|
||||
|
||||
fogInit = true;
|
||||
fogTimer = System.currentTimeMillis();
|
||||
GameSettings settings = Minecraft.getMinecraft().gameSettings;
|
||||
int[] ranges = ForgeModContainer.blendRanges;
|
||||
int distance = 0;
|
||||
|
||||
@ -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"));
|
||||
|
||||
|
||||
@ -67,8 +67,8 @@ public class GunAnimationPacket implements IMessage {
|
||||
animation = base.getAnimation(stack, AnimType.RELOAD);
|
||||
}
|
||||
|
||||
// Fallback to regular CYCLE if no ALT_CYCLE exists
|
||||
if(animation == null && type == AnimType.ALT_CYCLE) {
|
||||
// Fallback to regular CYCLE if no ALT_CYCLE (or CYCLE_EMPTY) exists
|
||||
if(animation == null && (type == AnimType.ALT_CYCLE || type == AnimType.CYCLE_EMPTY)) {
|
||||
animation = base.getAnimation(stack, AnimType.CYCLE);
|
||||
}
|
||||
|
||||
|
||||
@ -15,8 +15,9 @@ public class SpentCasing implements Cloneable {
|
||||
public static final int COLOR_CASE_16INCH = 0xD89128;
|
||||
public static final int COLOR_CASE_16INCH_PHOS = 0xC8C8C8;
|
||||
public static final int COLOR_CASE_16INCH_NUKE = 0x495443;
|
||||
public static final int COLOR_CASE_40MM = 0x515151;
|
||||
|
||||
public static final HashMap<String, SpentCasing> casingMap = new HashMap();
|
||||
public static final HashMap<String, SpentCasing> casingMap = new HashMap<String, SpentCasing>();
|
||||
|
||||
public enum CasingType {
|
||||
STRAIGHT("Straight"),
|
||||
|
||||
@ -23,6 +23,7 @@ public class HbmAnimations {
|
||||
RELOAD_CYCLE, //animation that plays for every individual round (for shotguns and similar single round loading weapons)
|
||||
RELOAD_END, //animation for transitioning from our RELOAD_CYCLE to idle
|
||||
CYCLE, //animation for every firing cycle
|
||||
CYCLE_EMPTY, //animation for the final shot in the magazine
|
||||
ALT_CYCLE, //animation for alt fire cycles
|
||||
SPINUP, //animation for actionstart
|
||||
SPINDOWN, //animation for actionend
|
||||
|
||||
@ -1,8 +1,14 @@
|
||||
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.particle.SpentCasing;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -34,8 +40,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 +55,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[] { SpentCasing.COLOR_CASE_40MM };
|
||||
|
||||
Color shellColor = new Color(colors[0]);
|
||||
GL11.glColor3f(shellColor.getRed() / 255F, shellColor.getGreen() / 255F, shellColor.getBlue() / 255F);
|
||||
ResourceManager.congolake.renderPart("Shell");
|
||||
|
||||
Color shellForeColor = new Color(colors.length > 1 ? colors[1] : 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 +154,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
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user