extremely shitty animations

This commit is contained in:
Bob 2024-10-13 17:06:46 +02:00
parent 44b1604992
commit ceb9abbec4
9 changed files with 86 additions and 41 deletions

View File

@ -78,7 +78,7 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_am180) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_liberator) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_congolake) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_flamer) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_flamer) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO_NOCOUNTER);
((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);

View File

@ -21,7 +21,8 @@ public class LegoClient {
public static HUDComponentDurabilityBar HUD_COMPONENT_DURABILITY = new HUDComponentDurabilityBar();
public static HUDComponentDurabilityBar HUD_COMPONENT_DURABILITY_MIRROR = new HUDComponentDurabilityBar(true);
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO = new HUDComponentAmmoCounter(0);
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO_MIRROR = new HUDComponentAmmoCounter(0, true);
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO_MIRROR = new HUDComponentAmmoCounter(0).mirror();
public static HUDComponentAmmoCounter HUD_COMPONENT_AMMO_NOCOUNTER = new HUDComponentAmmoCounter(0).noCounter();
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_STANDARD_BULLET = (bullet, interp) -> {
double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp;

View File

@ -424,6 +424,13 @@ public class Orchestras {
EntityPlayer player = ctx.player;
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 == 15) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.openLatch", 1F, 1F);
if(timer == 35) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.impact", 0.5F, 1F);
if(timer == 60) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.revolverClose", 1F, 0.75F);
if(timer == 70) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.insertCanister", 1F, 1F);
if(timer == 85) player.worldObj.playSoundAtEntity(player, "hbm:weapon.reload.pressureValve", 1F, 1F);
}
};
}

View File

@ -11,30 +11,39 @@ import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.lib.RefStrings;
import com.hbm.particle.helper.FlameCreator;
import com.hbm.main.MainRegistry;
import com.hbm.main.ResourceManager;
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;
import net.minecraft.nbt.NBTTagCompound;
public class XFactoryFlamer {
public static BulletConfig flame_diesel;
public static void init() {
flame_diesel = new BulletConfig().setItem(EnumAmmo.FLAME_DIESEL).setLife(100).setVel(1F).setGrav(0.02D).setReloadCount(200)
flame_diesel = new BulletConfig().setItem(EnumAmmo.FLAME_DIESEL).setLife(100).setVel(1F).setGrav(0.02D).setReloadCount(300)
.setOnUpdate((bullet) -> {
if(!bullet.worldObj.isRemote) FlameCreator.composeEffect(bullet.worldObj, bullet.posX, bullet.posY - 0.25, bullet.posZ);
if(bullet.worldObj.isRemote && MainRegistry.proxy.me().getDistanceToEntity(bullet) < 100) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "flamethrower");
data.setDouble("posX", bullet.posX);
data.setDouble("posY", bullet.posY - 0.125);
data.setDouble("posZ", bullet.posZ);
MainRegistry.proxy.effectNT(data);
}
});
ModItems.gun_flamer = new ItemGunBaseNT(new GunConfig()
.dura(20_000).draw(4).inspect(23).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.dura(20_000).draw(10).inspect(17).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(10F).delay(1).auto(true).reload(55).jam(0)
.mag(new MagazineFullReload(0, 200).addConfigs(flame_diesel))
.offset(0.75, -0.0625, -0.3125D)
.dmg(10F).delay(1).auto(true).reload(90).jam(0)
.mag(new MagazineFullReload(0, 300).addConfigs(flame_diesel))
.offset(0.75, -0.0625, -0.25D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardConfiguration()
.anim(LAMBDA_FLAMER_ANIMS).orchestra(Orchestras.ORCHESTRA_FLAMER)
@ -44,9 +53,10 @@ public class XFactoryFlamer {
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_FLAMER_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
case RELOAD: return new BusAnimation();
case INSPECT: return new BusAnimation();
.addBus("EQUIP", new BusAnimationSequence().addPos(-45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
case RELOAD: return ResourceManager.flamethrower_anim.get("Reload");
case INSPECT: return new BusAnimation()
.addBus("ROTATE", new BusAnimationSequence().addPos(0, 0, 45, 250, IType.SIN_FULL).addPos(0, 0, 45, 350).addPos(0, 0, -15, 150, IType.SIN_FULL).addPos(0, 0, 0, 100, IType.SIN_FULL));
case JAMMED: return new BusAnimation();
}

View File

@ -5,6 +5,7 @@ import org.lwjgl.opengl.GL12;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
@ -12,27 +13,35 @@ import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
public class HUDComponentAmmoCounter implements IHUDComponent {
private static final ResourceLocation misc = new ResourceLocation(RefStrings.MODID + ":textures/misc/overlay_misc.png");
protected static final RenderItem itemRenderer = RenderItem.getInstance();
protected int receiver;
protected boolean mirrored;
protected boolean noCounter;
public HUDComponentAmmoCounter(int receiver) {
this(receiver, false);
this.receiver = receiver;
}
public HUDComponentAmmoCounter(int receiver, boolean mirror) {
this.receiver = receiver;
this.mirrored = mirror;
public HUDComponentAmmoCounter mirror() {
this.mirrored = true;
return this;
}
public HUDComponentAmmoCounter noCounter() {
this.noCounter = true;
return this;
}
@Override
public int getComponentHeight(EntityPlayer player, ItemStack stack){
return 22;
return 24;
}
@Override
@ -41,12 +50,12 @@ public class HUDComponentAmmoCounter implements IHUDComponent {
ScaledResolution resolution = event.resolution;
Minecraft mc = Minecraft.getMinecraft();
int pX = resolution.getScaledWidth() / 2 + (mirrored ? -(62 + 36 + 52) : (62 + 36));
int pZ = resolution.getScaledHeight() - bottomOffset - 21;
int pX = resolution.getScaledWidth() / 2 + (mirrored ? -(62 + 36 + 52) : (62 + 36)) + (noCounter ? 14 : 0);
int pZ = resolution.getScaledHeight() - bottomOffset - 23;
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
IMagazine mag = gun.getConfig(stack, gunIndex).getReceivers(stack)[this.receiver].getMagazine(stack);
mc.fontRenderer.drawString(mag.reportAmmoStateForHUD(stack), pX + 17, pZ + 6, 0xFFFFFF);
if(!noCounter) mc.fontRenderer.drawString(mag.reportAmmoStateForHUD(stack), pX + 17, pZ + 6, 0xFFFFFF);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
@ -55,5 +64,6 @@ public class HUDComponentAmmoCounter implements IHUDComponent {
RenderHelper.disableStandardItemLighting();
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
mc.renderEngine.bindTexture(misc);
}
}

View File

@ -868,6 +868,7 @@ public class ResourceManager {
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 HashMap<String, BusAnimation> flamethrower_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/flamethrower.json"));
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));

View File

@ -34,16 +34,31 @@ public class ItemRenderFlamer extends ItemRenderWeaponBase {
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] rotate = HbmAnimations.getRelevantTransformation("ROTATE");
GL11.glTranslated(0, -1, -3);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 1, 3);
GL11.glTranslated(0, 2, -6);
GL11.glRotated(-equip[0], 1, 0, 0);
GL11.glTranslated(0, -2, 6);
GL11.glTranslated(0, 1, 0);
GL11.glRotated(rotate[2], 0, 0, 1);
GL11.glTranslated(0, -1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.flamethrower.renderPart("Gun");
ResourceManager.flamethrower.renderPart("Tank");
GL11.glPushMatrix();
HbmAnimations.applyRelevantTransformation("Gun");
ResourceManager.flamethrower.renderPart("Gun");
GL11.glPopMatrix();
GL11.glPushMatrix();
HbmAnimations.applyRelevantTransformation("Tank");
ResourceManager.flamethrower.renderPart("Tank");
GL11.glPopMatrix();
GL11.glPushMatrix();
HbmAnimations.applyRelevantTransformation("Gauge");
GL11.glTranslated(1.25, 1.25, 0);
IMagazine mag = gun.getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack);
GL11.glRotated(-135 + (mag.getAmount(stack) * 270D / mag.getCapacity(stack)), 0, 0, 1);

File diff suppressed because one or more lines are too long

View File

@ -76,46 +76,46 @@ v -0.250000 -1.566988 -6.750000
vt 0.346821 0.604839
vt 0.369942 0.580645
vt 0.369942 0.612903
vt 0.393064 0.741935
vt 0.390173 0.741935
vt 0.369942 0.709677
vt 0.393064 0.709677
vt 0.390173 0.709677
vt 0.624277 0.709677
vt 0.624277 0.741935
vt 0.369942 0.645161
vt 0.346821 0.620968
vt 0.393064 0.774194
vt 0.390173 0.774194
vt 0.369942 0.806452
vt 0.369942 0.774194
vt 0.624277 0.677419
vt 0.367052 0.935484
vt 0.369942 0.935484
vt 0.346821 0.911290
vt 0.369942 0.903226
vt 0.369942 0.741935
vt 0.393064 0.677419
vt 0.390173 0.677419
vt 0.624277 0.645161
vt 0.346821 0.895161
vt 0.369942 0.870968
vt 0.369942 0.677419
vt 0.393064 0.645161
vt 0.390173 0.645161
vt 0.624277 0.612903
vt 0.346821 0.862903
vt 0.369942 0.838710
vt 0.393064 0.612903
vt 0.390173 0.612903
vt 0.624277 0.580645
vt 0.346821 0.814516
vt 0.393064 0.580645
vt 0.390173 0.580645
vt 0.369942 0.548387
vt 0.393064 0.548387
vt 0.390173 0.548387
vt 0.624277 0.548387
vt 0.346821 0.782258
vt 0.393064 0.903226
vt 0.393064 0.870968
vt 0.393064 0.935484
vt 0.390173 0.903226
vt 0.390173 0.870968
vt 0.390173 0.935484
vt 0.624277 0.903226
vt 0.624277 0.935484
vt 0.346821 0.750000
vt 0.393064 0.838710
vt 0.393064 0.806452
vt 0.390173 0.838710
vt 0.390173 0.806452
vt 0.624277 0.870968
vt 0.346821 0.733871
vt 0.624277 0.838710