howard dungeon variant

This commit is contained in:
Boblet 2021-08-24 15:14:16 +02:00
parent 0dca95c044
commit 59ccb1ebc2
13 changed files with 4165 additions and 2 deletions

View File

@ -973,6 +973,7 @@ public class ModBlocks {
public static final int guiID_richard = 108;
public static Block turret_howard;
public static final int guiID_howard = 112;
public static Block turret_howard_damaged;
public static Block turret_maxwell;
public static final int guiID_maxwell = 120;
public static Block turret_fritz;
@ -1857,6 +1858,7 @@ public class ModBlocks {
turret_tauon = new TurretTauon(Material.iron).setBlockName("turret_tauon").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_richard = new TurretRichard(Material.iron).setBlockName("turret_richard").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_howard = new TurretHoward(Material.iron).setBlockName("turret_howard").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_howard_damaged = new TurretHowardDamaged(Material.iron).setBlockName("turret_howard_damaged").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_rust");
turret_maxwell = new TurretMaxwell(Material.iron).setBlockName("turret_maxwell").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_fritz = new TurretFritz(Material.iron).setBlockName("turret_fritz").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_brandon = new TurretBrandon(Material.iron).setBlockName("turret_brandon").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
@ -2511,6 +2513,7 @@ public class ModBlocks {
GameRegistry.registerBlock(turret_tauon, turret_tauon.getUnlocalizedName());
GameRegistry.registerBlock(turret_richard, turret_richard.getUnlocalizedName());
GameRegistry.registerBlock(turret_howard, turret_howard.getUnlocalizedName());
GameRegistry.registerBlock(turret_howard_damaged, turret_howard_damaged.getUnlocalizedName());
GameRegistry.registerBlock(turret_maxwell, turret_maxwell.getUnlocalizedName());
GameRegistry.registerBlock(turret_fritz, turret_fritz.getUnlocalizedName());
GameRegistry.registerBlock(turret_brandon, turret_brandon.getUnlocalizedName());

View File

@ -0,0 +1,46 @@
package com.hbm.blocks.turret;
import com.hbm.blocks.BlockDummyable;
import com.hbm.tileentity.turret.TileEntityTurretHowardDamaged;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class TurretHowardDamaged extends BlockDummyable {
public TurretHowardDamaged(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntityTurretHowardDamaged();
return null;
}
@Override
public int[] getDimensions() {
return new int[] { 0, 0, 1, 0, 1, 0 };
}
@Override
public int getOffset() {
return 0;
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
}
}

View File

@ -133,6 +133,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretTauon.class, new RenderTurretTauon());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretRichard.class, new RenderTurretRichard());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretHoward.class, new RenderTurretHoward());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretHowardDamaged.class, new RenderTurretHowardDamaged());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretMaxwell.class, new RenderTurretMaxwell());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretFritz.class, new RenderTurretFritz());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretBrandon.class, new RenderTurretBrandon());

View File

@ -472,6 +472,7 @@ public class MainRegistry {
GameRegistry.registerTileEntity(TileEntityTurretFriendly.class, "tileentity_turret_friendly");
GameRegistry.registerTileEntity(TileEntityTurretRichard.class, "tileentity_turret_richard");
GameRegistry.registerTileEntity(TileEntityTurretHoward.class, "tileentity_turret_howard");
GameRegistry.registerTileEntity(TileEntityTurretHowardDamaged.class, "tileentity_turret_howard_damaged");
GameRegistry.registerTileEntity(TileEntityTurretMaxwell.class, "tileentity_turret_maxwell");
GameRegistry.registerTileEntity(TileEntityTurretFritz.class, "tileentity_turret_fritz");
GameRegistry.registerTileEntity(TileEntityTurretBrandon.class, "tileentity_turret_brandon");

View File

@ -46,6 +46,8 @@ public class ResourceManager {
public static final IModelCustom turret_maxwell = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_microwave.obj"));
public static final IModelCustom turret_fritz = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_fritz.obj"));
public static final IModelCustom turret_brandon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_brandon.obj"));
public static final IModelCustom turret_howard_damaged = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_howard_damaged.obj"));
//Landmines
public static final IModelCustom mine_ap = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/mine_ap.obj"));
@ -297,6 +299,12 @@ public class ResourceManager {
public static final ResourceLocation turret_fritz_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/fritz.png");
public static final ResourceLocation turret_brandon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/brandon.png");
public static final ResourceLocation turret_base_rusted= new ResourceLocation(RefStrings.MODID, "textures/models/turrets/rusted/base.png");
public static final ResourceLocation turret_carriage_ciws_rusted = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/rusted/carriage_ciws.png");
public static final ResourceLocation turret_howard_rusted = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/rusted/howard.png");
public static final ResourceLocation turret_howard_barrels_rusted = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/rusted/howard_barrels.png");
public static final ResourceLocation brandon_explosive = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/brandon_drum.png");
//Landmines

View File

@ -0,0 +1,58 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretHowardDamaged;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
public class RenderTurretHowardDamaged extends RenderTurretBase {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
TileEntityTurretHowardDamaged turret = (TileEntityTurretHowardDamaged)te;
Vec3 pos = turret.getHorizontalOffset();
GL11.glPushMatrix();
GL11.glTranslated(x + pos.xCoord, y, z + pos.zCoord);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.turret_base_rusted);
ResourceManager.turret_chekhov.renderPart("Base");
double yaw = -Math.toDegrees(turret.lastRotationYaw + (turret.rotationYaw - turret.lastRotationYaw) * interp) - 90D;
double pitch = Math.toDegrees(turret.lastRotationPitch + (turret.rotationPitch - turret.lastRotationPitch) * interp);
GL11.glRotated(yaw, 0, 1, 0);
bindTexture(ResourceManager.turret_carriage_ciws_rusted);
ResourceManager.turret_howard_damaged.renderPart("Carriage");
GL11.glTranslated(0, 2.25, 0);
GL11.glRotated(pitch, 0, 0, 1);
GL11.glTranslated(0, -2.25, 0);
bindTexture(ResourceManager.turret_howard_rusted);
ResourceManager.turret_howard_damaged.renderPart("Body");
float rot = turret.lastSpin + (turret.spin - turret.lastSpin) * interp;
bindTexture(ResourceManager.turret_howard_barrels_rusted);
GL11.glPushMatrix();
GL11.glTranslated(0, 2.5, 0);
GL11.glRotated(rot, -1, 0, 0);
GL11.glTranslated(0, -2.5, 0);
ResourceManager.turret_howard_damaged.renderPart("BarrelsTop");
GL11.glPopMatrix();
ResourceManager.turret_howard_damaged.renderPart("BarrelsBottom");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -163,7 +163,7 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
}
}
if(this.isOn && hasPower()) {
if(isOn() && hasPower()) {
if(tPos != null)
this.alignTurret();
@ -181,7 +181,7 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
this.stattrak++;
}
if(this.isOn && hasPower()) {
if(isOn() && hasPower()) {
searchTimer--;
this.setPower(this.getPower() - this.getConsumption());
@ -716,6 +716,10 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
return this.getPower() >= this.getConsumption();
}
public boolean isOn() {
return this.isOn;
}
public void setPower(long i) {
this.power = i;
}

View File

@ -0,0 +1,79 @@
package com.hbm.tileentity.turret;
import com.hbm.config.WeaponConfig;
import com.hbm.lib.ModDamageSource;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.util.EntityDamageUtil;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
public class TileEntityTurretHowardDamaged extends TileEntityTurretHoward {
@Override
public boolean hasPower() { //does not need power
return true;
}
@Override
public boolean isOn() { //is always on
return true;
}
@Override
public double getTurretYawSpeed() {
return 3D;
}
@Override
public double getTurretPitchSpeed() {
return 2D;
}
@Override
public double getDecetorRange() {
return 64D;
}
@Override
public boolean entityAcceptableTarget(Entity e) { //will fire at any living entity
return e instanceof EntityLivingBase;
}
@Override
public void updateFiringTick() {
timer++;
if(this.tPos != null) {
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 0.9F + worldObj.rand.nextFloat() * 0.3F);
if(timer % 4 == 0) {
if(worldObj.rand.nextInt(100) + 1 <= WeaponConfig.ciwsHitrate * 0.5)
EntityDamageUtil.attackEntityFromIgnoreIFrame(this.target, ModDamageSource.shrapnel, 2F + worldObj.rand.nextInt(2));
Vec3 pos = this.getTurretPos();
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
vec.rotateAroundZ((float) -this.rotationPitch);
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
Vec3 hOff = Vec3.createVectorHelper(0, 0.25, 0);
hOff.rotateAroundZ((float) -this.rotationPitch);
hOff.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaExt");
data.setString("mode", "largeexplode");
data.setFloat("size", 1.5F);
data.setByte("count", (byte)1);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord + vec.xCoord + hOff.xCoord, pos.yCoord + vec.yCoord + hOff.yCoord, pos.zCoord + vec.zCoord + hOff.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
}
}
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB