mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
solinium bomb fix, sauerbraten shotgun
This commit is contained in:
parent
fe84f5cb25
commit
b187b76add
2691
src/main/java/assets/hbm/models/weapons/sauergun.obj
Normal file
2691
src/main/java/assets/hbm/models/weapons/sauergun.obj
Normal file
File diff suppressed because it is too large
Load Diff
@ -134,6 +134,7 @@
|
||||
"weapon.quadroReload": {"category": "player", "sounds": [{"name": "weapon/quadroReload", "stream": false}]},
|
||||
"weapon.fstbmbStart": {"category": "player", "sounds": [{"name": "weapon/fstbmbStart", "stream": false}]},
|
||||
"weapon.fstbmbPing": {"category": "player", "sounds": [{"name": "weapon/fstbmbPing", "stream": false}]},
|
||||
"weapon.sauergun": {"category": "player", "sounds": ["weapon/sauergun1", "weapon/sauergun2", "weapon/sauergun3"]},
|
||||
|
||||
"weapon.reloadTurret": {"category": "player", "sounds": [{"name": "weapon/reloadTurret", "stream": false}]},
|
||||
"weapon.switchmode1": {"category": "player", "sounds": [{"name": "weapon/switchmode1", "stream": false}]},
|
||||
|
||||
BIN
src/main/java/assets/hbm/sounds/weapon/sauergun1.ogg
Normal file
BIN
src/main/java/assets/hbm/sounds/weapon/sauergun1.ogg
Normal file
Binary file not shown.
BIN
src/main/java/assets/hbm/sounds/weapon/sauergun2.ogg
Normal file
BIN
src/main/java/assets/hbm/sounds/weapon/sauergun2.ogg
Normal file
Binary file not shown.
BIN
src/main/java/assets/hbm/sounds/weapon/sauergun3.ogg
Normal file
BIN
src/main/java/assets/hbm/sounds/weapon/sauergun3.ogg
Normal file
Binary file not shown.
BIN
src/main/java/assets/hbm/textures/models/weapons/sauergun.png
Normal file
BIN
src/main/java/assets/hbm/textures/models/weapons/sauergun.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 945 B |
@ -4,15 +4,18 @@ import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.hbm.entity.effect.EntityFalloutRain;
|
||||
import com.hbm.explosion.ExplosionFleija;
|
||||
import com.hbm.explosion.ExplosionHurtUtil;
|
||||
import com.hbm.explosion.ExplosionNukeAdvanced;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.explosion.ExplosionSolinium;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Spaghetti("why???")
|
||||
public class EntityNukeExplosionMK3 extends Entity {
|
||||
|
||||
public int age = 0;
|
||||
@ -155,7 +158,13 @@ public class EntityNukeExplosionMK3 extends Entity {
|
||||
if(!flag)
|
||||
{
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F);
|
||||
ExplosionNukeGeneric.dealDamage(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, this.destructionRange * 2);
|
||||
|
||||
if(waste || extType != 1) {
|
||||
ExplosionNukeGeneric.dealDamage(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, this.destructionRange * 2);
|
||||
} else {
|
||||
ExplosionHurtUtil.doRadiation(worldObj, posX, posY, posZ, 15000, 250000, this.destructionRange);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!did2 && waste) {
|
||||
EntityFalloutRain fallout = new EntityFalloutRain(this.worldObj, (int)(this.destructionRange * 1.8) * 10);
|
||||
|
||||
44
src/main/java/com/hbm/explosion/ExplosionHurtUtil.java
Normal file
44
src/main/java/com/hbm/explosion/ExplosionHurtUtil.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.explosion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ExplosionHurtUtil {
|
||||
|
||||
/**
|
||||
* Adds radiation to entities in an AoE
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param outer The least amount of radiation received on the very edge of the AoE
|
||||
* @param inner The greatest amount of radiation received on the very center of the AoE
|
||||
* @param radius
|
||||
*/
|
||||
public static void doRadiation(World world, double x, double y, double z, float outer, float inner, double radius) {
|
||||
|
||||
List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x - radius, y - radius, z - radius, x + radius, y + radius, z + radius));
|
||||
|
||||
for(EntityLivingBase entity : entities) {
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(x - entity.posX, y - entity.posY, z - entity.posZ);
|
||||
|
||||
double dist = vec.lengthVector();
|
||||
|
||||
if(dist > radius)
|
||||
continue;
|
||||
|
||||
double interpolation = 1 - (dist / radius);
|
||||
float rad = (float) (outer + (inner - outer) * interpolation);
|
||||
|
||||
Library.applyRadData(entity, rad);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,6 +6,10 @@ import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
public class Gun4GaugeFactory {
|
||||
@ -50,6 +54,54 @@ public class Gun4GaugeFactory {
|
||||
return config;
|
||||
}
|
||||
|
||||
public static GunConfiguration getSauerConfig() {
|
||||
|
||||
GunConfiguration config = getShotgunConfig();
|
||||
|
||||
config.rateOfFire = 20;
|
||||
config.ammoCap = 0;
|
||||
config.reloadType = GunConfiguration.RELOAD_NONE;
|
||||
config.firingMode = GunConfiguration.FIRE_AUTO;
|
||||
config.durability = 3000;
|
||||
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
|
||||
config.firingSound = "hbm:weapon.sauergun";
|
||||
config.firingPitch = 1.0F;
|
||||
|
||||
config.name = "Sauer Shotgun";
|
||||
config.manufacturer = "Cube 2: Sauerbraten";
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("SAUER_RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0.5, 0, 0, 50))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 50))
|
||||
)
|
||||
.addBus("SAUER_TILT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0.0, 0, 0, 200)) // do nothing for 200ms
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 30, 150)) //tilt forward
|
||||
.addKeyframe(new BusAnimationKeyframe(45, 0, 30, 150)) //tilt sideways
|
||||
.addKeyframe(new BusAnimationKeyframe(45, 0, 30, 200)) //do nothing for 200ms (eject)
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 30, 150)) //restore sideways
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 150)) //restore forward
|
||||
)
|
||||
.addBus("SAUER_COCK", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500)) //do nothing for 500ms
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 100)) //pull back lever for 100ms
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 100)) //release lever for 100ms
|
||||
)
|
||||
.addBus("SAUER_SHELL_EJECT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500)) //do nothing for 500ms
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 500)) //FLING!
|
||||
)
|
||||
);
|
||||
|
||||
config.config = new ArrayList<Integer>();
|
||||
config.config.add(BulletConfigSyncingUtil.G4_NORMAL);
|
||||
config.config.add(BulletConfigSyncingUtil.G4_SLUG);
|
||||
config.config.add(BulletConfigSyncingUtil.G4_EXPLOSIVE);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
public static BulletConfiguration get4GaugeConfig() {
|
||||
|
||||
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
|
||||
|
||||
@ -1264,6 +1264,7 @@ public class ModItems {
|
||||
public static Item gun_uboinik_ammo;
|
||||
public static Item gun_supershotgun;
|
||||
public static Item gun_ks23;
|
||||
public static Item gun_sauer;
|
||||
public static Item gun_lever_action;
|
||||
public static Item gun_lever_action_dark;
|
||||
public static Item gun_lever_action_sonata;
|
||||
@ -3077,6 +3078,7 @@ public class ModItems {
|
||||
gun_uboinik = new ItemGunBase(Gun12GaugeFactory.getUboinikConfig()).setUnlocalizedName("gun_uboinik").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||
gun_supershotgun = new ItemGunShotty(Gun12GaugeFactory.getShottyConfig()).setUnlocalizedName("gun_supershotgun").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||
gun_ks23 = new ItemGunBase(Gun4GaugeFactory.getKS23Config()).setUnlocalizedName("gun_ks23").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||
gun_sauer = new ItemGunBase(Gun4GaugeFactory.getSauerConfig()).setUnlocalizedName("gun_sauer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||
gun_lever_action_ammo = new Item().setUnlocalizedName("gun_lever_action_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_lever_action_ammo");
|
||||
gun_lever_action = new ItemGunBase(Gun20GaugeFactory.getMareConfig()).setUnlocalizedName("gun_lever_action").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_lever_action");
|
||||
gun_lever_action_dark = new ItemGunBase(Gun20GaugeFactory.getMareDarkConfig()).setUnlocalizedName("gun_lever_action_dark").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_lever_action_dark");
|
||||
@ -5066,6 +5068,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_uboinik, gun_uboinik.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_supershotgun, gun_supershotgun.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_ks23, gun_ks23.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_sauer, gun_sauer.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_lever_action, gun_lever_action.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_lever_action_dark, gun_lever_action_dark.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_lever_action_sonata, gun_lever_action_sonata.getUnlocalizedName());
|
||||
|
||||
@ -165,6 +165,7 @@ public class ClientProxy extends ServerProxy
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer, new ItemRenderWeaponObj());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flechette, new ItemRenderWeaponObj());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_quadro, new ItemRenderWeaponQuadro());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_sauer, new ItemRenderWeaponSauer());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBombMulti.class, new RenderBombMulti());
|
||||
|
||||
|
||||
@ -344,6 +344,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom flamer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flamer.obj"));
|
||||
public static final IModelCustom flechette = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flechette.obj"));
|
||||
public static final IModelCustom quadro = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/quadro.obj"));
|
||||
public static final IModelCustom sauergun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/sauergun.obj"));
|
||||
|
||||
public static final IModelCustom grenade_frag = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/grenade_frag.obj"));
|
||||
|
||||
@ -374,6 +375,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation flechette_stock = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flechette_stock.png");
|
||||
public static final ResourceLocation quadro_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/quadro.png");
|
||||
public static final ResourceLocation quadro_rocket_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/quadro_rocket.png");
|
||||
public static final ResourceLocation sauergun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/sauergun.png");
|
||||
|
||||
public static final ResourceLocation grenade_mk2 = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/grenade_mk2.png");
|
||||
|
||||
|
||||
137
src/main/java/com/hbm/render/item/ItemRenderWeaponSauer.java
Normal file
137
src/main/java/com/hbm/render/item/ItemRenderWeaponSauer.java
Normal file
@ -0,0 +1,137 @@
|
||||
package com.hbm.render.item;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class ItemRenderWeaponSauer implements IItemRenderer {
|
||||
|
||||
public ItemRenderWeaponSauer() { }
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch(type) {
|
||||
case EQUIPPED:
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
case ENTITY:
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
|
||||
return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.sauergun_tex);
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
switch(type) {
|
||||
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("SAUER_RECOIL");
|
||||
double[] tilt = HbmAnimations.getRelevantTransformation("SAUER_TILT");
|
||||
double[] cock = HbmAnimations.getRelevantTransformation("SAUER_COCK");
|
||||
double[] eject = HbmAnimations.getRelevantTransformation("SAUER_SHELL_EJECT");
|
||||
|
||||
double s0 = 0.5D;
|
||||
GL11.glScaled(s0, s0, s0);
|
||||
|
||||
GL11.glTranslatef(0.0F, -0.5F, 0.0F);
|
||||
GL11.glRotatef(-100F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(20F, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
if(recoil != null)
|
||||
GL11.glTranslated(0, 0, recoil[0]);
|
||||
|
||||
if(player.isSneaking()) {
|
||||
GL11.glRotatef(-3F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(2F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(3F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslatef(-2.0F, 0.5F, 0.3F);
|
||||
}
|
||||
|
||||
if(tilt != null) {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glRotated(tilt[2] * -0.5, 1, 0, 0);
|
||||
GL11.glTranslated(0, 5, 0);
|
||||
GL11.glRotated(tilt[0], 0, 0, 1);
|
||||
|
||||
GL11.glTranslated(0, 0, cock[0]);
|
||||
ResourceManager.sauergun.renderPart("Lever");
|
||||
GL11.glTranslated(0, 0, -cock[0]);
|
||||
|
||||
GL11.glTranslated(eject[2] * 10, -eject[2], 0);
|
||||
GL11.glRotated(eject[2] * 90, -1, 0, 0);
|
||||
ResourceManager.sauergun.renderPart("Shell");
|
||||
GL11.glRotated(eject[2] * 90, 1, 0, 0);
|
||||
GL11.glTranslated(-eject[2] * 10, eject[2], 0);
|
||||
|
||||
} else {
|
||||
|
||||
ResourceManager.sauergun.renderPart("Lever");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
|
||||
double scale = 0.5D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotatef(20F, 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(-1F, -0.3F, 0.0F);
|
||||
ResourceManager.sauergun.renderPart("Lever");
|
||||
break;
|
||||
|
||||
case ENTITY:
|
||||
|
||||
double s1 = 0.5D;
|
||||
GL11.glTranslatef(0.0F, 0.0F, 1.0F);
|
||||
GL11.glScaled(s1, s1, s1);
|
||||
ResourceManager.sauergun.renderPart("Lever");
|
||||
break;
|
||||
|
||||
case INVENTORY:
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
double s = 2.25D;
|
||||
GL11.glScaled(s, s, -s);
|
||||
GL11.glTranslatef(4.0F, 4.5F, 0.0F);
|
||||
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(45F, 1.0F, 0.0F, 0.0F);
|
||||
ResourceManager.sauergun.renderPart("Lever");
|
||||
|
||||
break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
ResourceManager.sauergun.renderPart("Gun");
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user