mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #1347 from MellowArpeggiation/benelli
Benelli animations (and drum model)
This commit is contained in:
commit
816c918000
@ -63,6 +63,7 @@ public class GunConfiguration implements Cloneable {
|
||||
public int emptyReloadAdditionalDuration;
|
||||
//sound path to the reload sound
|
||||
public String reloadSound = "";
|
||||
public String reloadSoundEmpty = null;
|
||||
//whether the reload sound should be played at the beginning or at the end of the reload
|
||||
public boolean reloadSoundEnd = true;
|
||||
public String equipSound = "";
|
||||
@ -114,6 +115,7 @@ public class GunConfiguration implements Cloneable {
|
||||
public static final String RSOUND_REVOLVER = "hbm:weapon.revolverReload";
|
||||
public static final String RSOUND_RIFLE = "";
|
||||
public static final String RSOUND_MAG = "hbm:weapon.magReload";
|
||||
public static final String RSOUND_MAG_BOLT = "hbm:weapon.magReloadBolt";
|
||||
public static final String RSOUND_SHOTGUN = "hbm:weapon.shotgunReload";
|
||||
public static final String RSOUND_LAUNCHER = "hbm:weapon.rpgReload";
|
||||
public static final String RSOUND_GRENADE = "hbm:weapon.hkReload";
|
||||
|
||||
@ -226,32 +226,6 @@ public class Gun12GaugeFactory {
|
||||
config.firingSound = "hbm:weapon.deagleShoot";
|
||||
config.firingPitch = 0.75F;
|
||||
config.reloadType = 2;
|
||||
config.reloadSoundEnd = true;
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframePosition(6.25, 0.25, 2.5, 55)
|
||||
.addKeyframePosition(0, 0, 0, 55)
|
||||
)
|
||||
.addBus("EJECT", new BusAnimationSequence()
|
||||
.addKeyframePosition(0, 0, 0, 25)
|
||||
.addKeyframePosition(25, 0, 0, 100)
|
||||
)
|
||||
);
|
||||
|
||||
config.animations.put(AnimType.RELOAD, new BusAnimation()
|
||||
.addBus("RELOAD", new BusAnimationSequence()
|
||||
.addKeyframePosition(60, 0, -10, 400)
|
||||
.addKeyframePosition(60, 125, -10, 200)
|
||||
.addKeyframePosition(60, 125, -10, 300)
|
||||
.addKeyframePosition(0, 0, 0, 300)
|
||||
)
|
||||
.addBus("PUMP", new BusAnimationSequence()
|
||||
.addKeyframePosition(0, 0, 0, 900)
|
||||
.addKeyframePosition(10, 0, 0, 200)
|
||||
.addKeyframePosition(0, 0, 0, 1)
|
||||
)
|
||||
);
|
||||
|
||||
config.name = "benelli";
|
||||
config.manufacturer = EnumGunManufacturer.BENELLI;
|
||||
@ -269,10 +243,19 @@ public class Gun12GaugeFactory {
|
||||
|
||||
config.reloadType = 1;
|
||||
config.ammoCap = 24;
|
||||
config.reloadDuration = 20;
|
||||
config.reloadDuration = 21;
|
||||
config.emptyReloadAdditionalDuration = 15;
|
||||
config.reloadSound = GunConfiguration.RSOUND_MAG;
|
||||
config.reloadSoundEnd = true;
|
||||
config.reloadSoundEmpty = GunConfiguration.RSOUND_MAG_BOLT;
|
||||
config.reloadSoundEnd = false;
|
||||
config.name += "Drum";
|
||||
|
||||
config.loadAnimations = i -> {
|
||||
config.animations.put(AnimType.CYCLE, ResourceManager.benelli_anim.get("Fire"));
|
||||
config.animations.put(AnimType.RELOAD, ResourceManager.benelli_anim.get("Reload"));
|
||||
config.animations.put(AnimType.RELOAD_EMPTY, ResourceManager.benelli_anim.get("ReloadEmpty"));
|
||||
};
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
@ -364,6 +364,8 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
setIsReloading(stack, false);
|
||||
return;
|
||||
}
|
||||
|
||||
String reloadSound = mainConfig.reloadSoundEmpty != null && getMag(stack) == 0 ? mainConfig.reloadSoundEmpty : mainConfig.reloadSound;
|
||||
|
||||
ammo.stacksize = toConsume;
|
||||
setMag(stack, getMag(stack) + toAdd);
|
||||
@ -375,11 +377,11 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
AnimType animType = availableFills <= 1 ? AnimType.RELOAD_END : AnimType.RELOAD_CYCLE;
|
||||
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(animType.ordinal()), (EntityPlayerMP) player);
|
||||
if (availableFills > 1 && !mainConfig.reloadSoundEnd)
|
||||
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
|
||||
world.playSoundAtEntity(player, reloadSound, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(hasLoaded && mainConfig.reloadSoundEnd)
|
||||
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
|
||||
world.playSoundAtEntity(player, reloadSound, 1.0F, 1.0F);
|
||||
|
||||
if(mainConfig.ejector != null && mainConfig.ejector.getAfterReload())
|
||||
queueCasing(player, mainConfig.ejector, prevCfg, stack);
|
||||
@ -418,8 +420,10 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEqu
|
||||
if(getIsReloading(stack))
|
||||
return;
|
||||
|
||||
if(!mainConfig.reloadSoundEnd)
|
||||
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
|
||||
if(!mainConfig.reloadSoundEnd) {
|
||||
String reloadSound = mainConfig.reloadSoundEmpty != null && getMag(stack) == 0 ? mainConfig.reloadSoundEmpty : mainConfig.reloadSound;
|
||||
world.playSoundAtEntity(player, reloadSound, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(!world.isRemote) {
|
||||
AnimType reloadType = getMag(stack) == 0 ? AnimType.RELOAD_EMPTY : AnimType.RELOAD;
|
||||
|
||||
@ -852,6 +852,7 @@ public class ResourceManager {
|
||||
public static final HashMap<String, BusAnimation> ks23_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/ks23.json"));
|
||||
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 IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
|
||||
|
||||
|
||||
@ -33,14 +33,8 @@ public class ItemRenderBenelli implements IItemRenderer
|
||||
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
|
||||
}
|
||||
|
||||
static final String body = "Body.001_Cube.001";
|
||||
static final String frontGrip = "Pump_Cylinder.003";
|
||||
static final String slide = "Cylinder";
|
||||
static final String barrelAndTube = "Body_Cube.002";
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
int magSize = ItemGunBase.getMag(item);
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@ -50,9 +44,6 @@ public class ItemRenderBenelli implements IItemRenderer
|
||||
final float scale1 = 0.2F;
|
||||
final double scale2 = 0.065D;
|
||||
final double scale3 = 0.52D;
|
||||
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
|
||||
double[] feedNew = HbmAnimations.getRelevantTransformation("PUMP");
|
||||
|
||||
switch (type) {
|
||||
case EQUIPPED_FIRST_PERSON:// In hand from POV
|
||||
@ -63,31 +54,43 @@ public class ItemRenderBenelli implements IItemRenderer
|
||||
GL11.glTranslatef(-1.007F, 0F, -2.5F);
|
||||
}
|
||||
else {
|
||||
GL11.glRotatef(30.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, -1F, -2.5F);
|
||||
GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(0.0F, -0.5F, -2.5F);
|
||||
}
|
||||
|
||||
GL11.glScalef(scale1, scale1, scale1);
|
||||
// Move on recoil
|
||||
GL11.glTranslated(0, recoil[1], recoil[2]);
|
||||
GL11.glRotated(recoil[0], 1, 0, 0);
|
||||
// Move up for reload
|
||||
|
||||
HbmAnimations.applyRelevantTransformation("Body");
|
||||
ResourceManager.benelli.renderPart("Body");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
ResourceManager.benelli.renderAll();
|
||||
// Pump new round if empty
|
||||
if (magSize == 0)
|
||||
GL11.glTranslated(feedNew[0], feedNew[1], feedNew[2]);
|
||||
ResourceManager.benelli.renderPart(slide);
|
||||
|
||||
HbmAnimations.applyRelevantTransformation("Bolt");
|
||||
ResourceManager.benelli.renderPart("Bolt");
|
||||
|
||||
GL11.glPopMatrix();
|
||||
// Eject spent shell
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
HbmAnimations.applyRelevantTransformation("Drum");
|
||||
ResourceManager.benelli.renderPart("Drum");
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
HbmAnimations.applyRelevantTransformation("Shell");
|
||||
ResourceManager.benelli.renderPart("Shell");
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
break;
|
||||
case EQUIPPED:// In hand from other's POV
|
||||
GL11.glRotatef(15F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(-170, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-15F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.4F, 0.05F, -0.5F);
|
||||
GL11.glRotated(recoil[0], 1, 0, 0);
|
||||
GL11.glScaled(scale2 - scale2 * 2, scale2, scale2);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -171,6 +171,7 @@
|
||||
"weapon.revolverReload": {"category": "player", "sounds": [{"name": "weapon/revolverReload", "stream": false}]},
|
||||
"weapon.shotgunReload": {"category": "player", "sounds": ["weapon/shotgunReload1", "weapon/shotgunReload2", "weapon/shotgunReload3"]},
|
||||
"weapon.magReload": {"category": "player", "sounds": [{"name": "weapon/magReload", "stream": false}]},
|
||||
"weapon.magReloadBolt": {"category": "player", "sounds": [{"name": "weapon/magReloadBolt", "stream": false}]},
|
||||
"weapon.rpgReload": {"category": "player", "sounds": [{"name": "weapon/rpgReload", "stream": false}]},
|
||||
"weapon.boat": {"category": "player", "sounds": [{"name": "weapon/boat", "stream": false}]},
|
||||
"weapon.hkShoot": {"category": "player", "sounds": [{"name": "weapon/hkShoot", "stream": false}]},
|
||||
|
||||
BIN
src/main/resources/assets/hbm/sounds/weapon/magReloadBolt.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/weapon/magReloadBolt.ogg
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user