cryo cannon

This commit is contained in:
Boblet 2023-07-11 16:06:44 +02:00
parent 18a1b103ba
commit 13c4cdc24d
10 changed files with 170 additions and 2 deletions

View File

@ -167,6 +167,8 @@ public class BulletConfigSyncingUtil {
public static int FLAMER_VAPORIZER = i++;
public static int FLAMER_GAS = i++;
public static int CRYO_NORMAL = i++;
public static int FEXT_NORMAL = i++;
public static int FEXT_FOAM = i++;
public static int FEXT_SAND = i++;
@ -458,6 +460,8 @@ public class BulletConfigSyncingUtil {
configSet.put(FLAMER_VAPORIZER, GunEnergyFactory.getVaporizerConfig());
configSet.put(FLAMER_GAS, GunEnergyFactory.getGasConfig());
configSet.put(CRYO_NORMAL, GunEnergyFactory.getCryoConfig());
configSet.put(FEXT_NORMAL, GunEnergyFactory.getFextConfig());
configSet.put(FEXT_FOAM, GunEnergyFactory.getFextFoamConfig());
configSet.put(FEXT_SAND, GunEnergyFactory.getFextSandConfig());

View File

@ -191,7 +191,7 @@ public class GunEnergyFactory {
config.reloadDuration = 20;
config.firingDuration = 0;
config.ammoCap = 1;
config.durability = 1500;
config.durability = 2_500;
config.reloadType = GunConfiguration.RELOAD_FULL;
config.allowsInfinity = true;
config.crosshair = Crosshair.CIRCLE;
@ -207,6 +207,30 @@ public class GunEnergyFactory {
return config;
}
public static GunConfiguration getCryoCannonConfig() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 1;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_AUTO;
config.firingDuration = 0;
config.ammoCap = 1_000;
config.durability = 10_000;
config.reloadType = GunConfiguration.RELOAD_FULL;
config.allowsInfinity = true;
config.crosshair = Crosshair.L_CIRCLE;
config.name = "Cryo Cannon";
config.manufacturer = EnumGunManufacturer.DRG;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.CRYO_NORMAL);
return config;
}
public static GunConfiguration getVortexConfig() {
@ -698,6 +722,15 @@ public class GunEnergyFactory {
return bullet;
}
public static BulletConfiguration getCryoConfig() {
BulletConfiguration bullet = new BulletConfiguration();
bullet.ammo = new ComparableStack(ModItems.gun_cryolator_ammo);
bullet.ammoCount = 100;
bullet.bulletsMin = 1;
bullet.bulletsMax = 1;
return bullet;
}
public static BulletConfiguration getTurbineConfig() {

View File

@ -1584,6 +1584,7 @@ public class ModItems {
public static Item gun_immolator_ammo;
public static Item gun_flamer;
public static Item gun_cryolator;
public static Item gun_cryocannon;
public static Item gun_cryolator_ammo;
public static Item gun_fireext;
public static Item gun_mp;
@ -4213,6 +4214,7 @@ public class ModItems {
gun_flamer = new ItemGunBase(GunEnergyFactory.getFlamerConfig()).setUnlocalizedName("gun_flamer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_flamer");
gun_cryolator_ammo = new Item().setUnlocalizedName("gun_cryolator_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_cryolator_ammo");
gun_cryolator = new GunCryolator().setUnlocalizedName("gun_cryolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_cryolator");
gun_cryocannon = new ItemCryoCannon(GunEnergyFactory.getCryoCannonConfig()).setUnlocalizedName("gun_cryocannon").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_cryocannon");
gun_fireext = new ItemGunBase(GunEnergyFactory.getExtConfig()).setUnlocalizedName("gun_fireext").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_fireext");
gun_mp = new ItemGunBase(Gun556mmFactory.getEuphieConfig()).setUnlocalizedName("gun_mp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_pm");
gun_bolter = new ItemGunBase(Gun75BoltFactory.getBolterConfig()).setUnlocalizedName("gun_bolter").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bolter");
@ -7030,6 +7032,7 @@ public class ModItems {
GameRegistry.registerItem(gun_immolator, gun_immolator.getUnlocalizedName());
GameRegistry.registerItem(gun_flamer, gun_flamer.getUnlocalizedName());
GameRegistry.registerItem(gun_cryolator, gun_cryolator.getUnlocalizedName());
GameRegistry.registerItem(gun_cryocannon, gun_cryocannon.getUnlocalizedName());
GameRegistry.registerItem(gun_fireext, gun_fireext.getUnlocalizedName());
GameRegistry.registerItem(gun_mp, gun_mp.getUnlocalizedName());
GameRegistry.registerItem(gun_bolter, gun_bolter.getUnlocalizedName());

View File

@ -0,0 +1,30 @@
package com.hbm.items.weapon;
import com.hbm.entity.projectile.EntityChemical;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.packet.GunAnimationPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemCryoCannon extends ItemGunBase {
public ItemCryoCannon(GunConfiguration config) {
super(config);
}
@Override
protected void spawnProjectile(World world, EntityPlayer player, ItemStack stack, int config) {
EntityChemical chem = new EntityChemical(world, player);
chem.setFluid(Fluids.OXYGEN);
world.spawnEntityInWorld(chem);
if(player instanceof EntityPlayerMP) PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player);
}
}

View File

@ -84,7 +84,8 @@ public class ItemGunChemthrower extends ItemGunBase implements IFillableItem {
public boolean canReload(ItemStack stack, World world, EntityPlayer player) {
return false;
}
@Override
protected void spawnProjectile(World world, EntityPlayer player, ItemStack stack, int config) {
//spawn fluid projectile
@ -96,6 +97,7 @@ public class ItemGunChemthrower extends ItemGunBase implements IFillableItem {
if(player instanceof EntityPlayerMP)
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {

View File

@ -523,6 +523,7 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_benelli, new ItemRenderBenelli());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uac_pistol, new ItemRenderUACPistol());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_coilgun, new ItemRenderWeaponCoilgun());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_cryocannon, new ItemRenderWeaponCryoCannon());
//multitool
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_dig, new ItemRenderMultitool());
MinecraftForgeClient.registerItemRenderer(ModItems.multitool_silk, new ItemRenderMultitool());

View File

@ -751,6 +751,7 @@ public class ResourceManager {
public static final IModelCustom tau = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/tau.obj"));
public static final IModelCustom benelli = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/benelli_new.obj")).asDisplayList();
public static final IModelCustom coilgun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/coilgun.obj")).asDisplayList();
public static final IModelCustom cryocannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/cryo_cannon_alt.obj")).asDisplayList();
public static final IModelCustom uac_pistol = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/UAC pistol.obj")).asDisplayList(); //TODO: reduce this fat fuck
public static final IModelCustom lance = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/lance.obj"));
@ -844,6 +845,7 @@ public class ResourceManager {
public static final ResourceLocation tau_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/tau.png");
public static final ResourceLocation benelli_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/benelli_tex.png");
public static final ResourceLocation coilgun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/coilgun.png");
public static final ResourceLocation cryocannon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/cryo_cannon.png");
public static final ResourceLocation uac_pistol_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/pistol_texture.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -0,0 +1,91 @@
package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
public class ItemRenderWeaponCryoCannon implements IItemRenderer {
@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.glEnable(GL11.GL_LIGHTING);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.cryocannon_tex);
switch(type) {
case EQUIPPED_FIRST_PERSON:
double s0 = 0.25D;
GL11.glRotated(25, 0, 0, 1);
GL11.glTranslated(1, 0, -0.3);
GL11.glRotated(80, 0, 1, 0);
GL11.glScaled(s0, s0, s0);
break;
case EQUIPPED:
double scale = 0.5D;
GL11.glScaled(scale, scale, scale);
GL11.glRotatef(15F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(10F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(15F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.75F, -2.5F, 3.5F);
break;
case ENTITY:
double s1 = 0.25D;
GL11.glScaled(s1, s1, s1);
GL11.glTranslated(0, 0, 3);
break;
case INVENTORY:
double s = 2.5D;
GL11.glTranslated(1, 6, 0);
GL11.glRotated(-135, 0, 0, 1);
GL11.glRotated(-90, 0, 1, 0);
GL11.glScaled(s, s, -s);
break;
default: break;
}
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.cryocannon.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -1966,6 +1966,7 @@ item.gun_stinger_ammo.name=Stinger-Rakete (LEGACY)
item.gun_super_shotgun.name=Super Shotgun
item.gun_supershotgun.name=Super Shotgun
item.gun_thompson.name=Thompson Maschinenpistole
item.gun_uac_pistol.name=UAC .45 Pistole
item.gun_uboinik.name=Ubojnik
item.gun_uboinik_ammo.name=12x70 Schrotmunition (LEGACY)
item.gun_uzi.name=IMI Uzi

View File

@ -2660,6 +2660,7 @@ item.gun_super_shotgun.name=Super Shotgun
item.gun_super_shotgun.desc=It's super broken!
item.gun_supershotgun.name=Super Shotgun
item.gun_thompson.name=Thompson Submachine Gun
item.gun_uac_pistol.name=UAC .45 Pistol
item.gun_uboinik.name=Uboinik
item.gun_uboinik_ammo.name=12x70 Buckshot (LEGACY)
item.gun_uzi.name=IMI Uzi