diff --git a/src/main/java/com/hbm/entity/EntityMappings.java b/src/main/java/com/hbm/entity/EntityMappings.java index d231fa8b6..fd59a34b9 100644 --- a/src/main/java/com/hbm/entity/EntityMappings.java +++ b/src/main/java/com/hbm/entity/EntityMappings.java @@ -246,6 +246,7 @@ public class EntityMappings { addMob(EntityGlyphidBombardier.class, "entity_glyphid_bombardier", 0xDDD919, 0xDBB79D); addMob(EntityGlyphidBlaster.class, "entity_glyphid_blaster", 0xD83737, 0xDBB79D); addMob(EntityGlyphidScout.class, "entity_glyphid_scout", 0x273038, 0xB9E36B); + addMob(EntityGlyphidNuclear.class, "entity_glyphid_nuclear", 0x267F00, 0xA0A0A0); addSpawn(EntityCreeperPhosgene.class, 5, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray()); addSpawn(EntityCreeperVolatile.class, 10, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray()); diff --git a/src/main/java/com/hbm/entity/mob/EntityGlyphid.java b/src/main/java/com/hbm/entity/mob/EntityGlyphid.java index bc570fe02..ab3e9ac51 100644 --- a/src/main/java/com/hbm/entity/mob/EntityGlyphid.java +++ b/src/main/java/com/hbm/entity/mob/EntityGlyphid.java @@ -9,14 +9,6 @@ import com.hbm.main.ResourceManager; import net.minecraft.entity.Entity; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIAttackOnCollide; -import net.minecraft.entity.ai.EntityAIHurtByTarget; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; -import net.minecraft.entity.ai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -28,14 +20,14 @@ public class EntityGlyphid extends EntityMob { public EntityGlyphid(World world) { super(world); - this.tasks.addTask(0, new EntityAISwimming(this)); + /*this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));*/ this.setSize(1.75F, 1F); } @@ -64,9 +56,28 @@ public class EntityGlyphid extends EntityMob { @Override protected Entity findPlayerToAttack() { - EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); + EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 128.0D); return entityplayer != null && this.canEntityBeSeen(entityplayer) ? entityplayer : null; } + + @Override + protected void updateEntityActionState() { + super.updateEntityActionState(); + + if(this.entityToAttack != null) { + this.setPathToEntity(this.worldObj.getPathEntityToEntity(this, this.entityToAttack, 128F, true, false, false, true)); + } + } + + @Override + protected boolean canDespawn() { + return entityToAttack == null; + } + + @Override + public int getMaxSafePointTries() { + return 10; + } @Override public boolean attackEntityFrom(DamageSource source, float amount) { diff --git a/src/main/java/com/hbm/entity/mob/EntityGlyphidNuclear.java b/src/main/java/com/hbm/entity/mob/EntityGlyphidNuclear.java new file mode 100644 index 000000000..8c6590203 --- /dev/null +++ b/src/main/java/com/hbm/entity/mob/EntityGlyphidNuclear.java @@ -0,0 +1,100 @@ +package com.hbm.entity.mob; + +import com.hbm.blocks.ModBlocks; +import com.hbm.explosion.vanillant.ExplosionVNT; +import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard; +import com.hbm.explosion.vanillant.standard.BlockMutatorDebris; +import com.hbm.explosion.vanillant.standard.BlockProcessorStandard; +import com.hbm.explosion.vanillant.standard.EntityProcessorStandard; +import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard; +import com.hbm.main.MainRegistry; +import com.hbm.main.ResourceManager; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class EntityGlyphidNuclear extends EntityGlyphid { + + public int deathTicks; + + public EntityGlyphidNuclear(World world) { + super(world); + this.setSize(2.5F, 1.75F); + this.isImmuneToFire = true; + } + + @Override + public ResourceLocation getSkin() { + return ResourceManager.glyphid_nuclear_tex; + } + + @Override + public double getScale() { + return 2D; + } + + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.8D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50D); + } + + @Override + public int getArmorBreakChance(float amount) { + return amount < 25 ? 100 : amount > 1000 ? 1 : 10; + } + + @Override + public float calculateDamage(float amount) { + + byte armor = this.dataWatcher.getWatchableObjectByte(17); + int divisor = 1; + + for(int i = 0; i < 5; i++) { + if((armor & (1 << i)) > 0) { + divisor += 5; + } + } + + amount /= divisor; + + return amount; + } + + @Override + public float getDamageThreshold() { + return 10F; + } + + @Override + protected void onDeathUpdate() { + ++this.deathTicks; + + if(this.deathTicks == 100) { + + ExplosionVNT vnt = new ExplosionVNT(worldObj, posX, posY, posZ, 25, this); + vnt.setBlockAllocator(new BlockAllocatorStandard(24)); + vnt.setBlockProcessor(new BlockProcessorStandard().withBlockEffect(new BlockMutatorDebris(ModBlocks.volcanic_lava_block, 0)).setNoDrop()); + vnt.setEntityProcessor(new EntityProcessorStandard().withRangeMod(1.5F)); + vnt.setPlayerProcessor(new PlayerProcessorStandard()); + vnt.explode(); + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "muke"); + // if the FX type is "muke", apply random BF effect + if(MainRegistry.polaroidID == 11 || rand.nextInt(100) == 0) { + data.setBoolean("balefire", true); + } + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY + 0.5, posZ), new TargetPoint(dimension, posX, posY, posZ, 250)); + + this.setDead(); + } + } +} diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 8f491ea8d..26133ebac 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -730,6 +730,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerEntityRenderingHandler(EntityGlyphidBombardier.class, new RenderGlyphid()); RenderingRegistry.registerEntityRenderingHandler(EntityGlyphidBlaster.class, new RenderGlyphid()); RenderingRegistry.registerEntityRenderingHandler(EntityGlyphidScout.class, new RenderGlyphid()); + RenderingRegistry.registerEntityRenderingHandler(EntityGlyphidNuclear.class, new RenderGlyphidNuclear()); //"particles" RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.smoke1, ModItems.smoke2, ModItems.smoke3, ModItems.smoke4, ModItems.smoke5, ModItems.smoke6, ModItems.smoke7, ModItems.smoke8 })); RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new MultiCloudRenderer(new Item[] { ModItems.b_smoke1, ModItems.b_smoke2, ModItems.b_smoke3, ModItems.b_smoke4, ModItems.b_smoke5, ModItems.b_smoke6, ModItems.b_smoke7, ModItems.b_smoke8 })); diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 1f9716a94..4820c556d 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -666,6 +666,7 @@ public class ResourceManager { public static final ResourceLocation glyphid_bombardier_tex = new ResourceLocation(RefStrings.MODID, "textures/entity/glyphid_bombardier.png"); public static final ResourceLocation glyphid_blaster_tex = new ResourceLocation(RefStrings.MODID, "textures/entity/glyphid_blaster.png"); public static final ResourceLocation glyphid_scout_tex = new ResourceLocation(RefStrings.MODID, "textures/entity/glyphid_scout.png"); + public static final ResourceLocation glyphid_nuclear_tex = new ResourceLocation(RefStrings.MODID, "textures/entity/glyphid_nuclear.png"); //ZIRNOX public static final ResourceLocation zirnox_tex = new ResourceLocation(RefStrings.MODID, "textures/models/zirnox.png"); diff --git a/src/main/java/com/hbm/render/entity/mob/RenderGlyphidNuclear.java b/src/main/java/com/hbm/render/entity/mob/RenderGlyphidNuclear.java new file mode 100644 index 000000000..5c91e44a1 --- /dev/null +++ b/src/main/java/com/hbm/render/entity/mob/RenderGlyphidNuclear.java @@ -0,0 +1,236 @@ +package com.hbm.render.entity.mob; + +import org.lwjgl.opengl.GL11; + +import com.hbm.entity.mob.EntityGlyphid; +import com.hbm.entity.mob.EntityGlyphidNuclear; +import com.hbm.main.ResourceManager; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderGlyphidNuclear extends RenderLiving { + + public RenderGlyphidNuclear() { + super(new ModelGlyphid(), 1.0F); + this.shadowOpaque = 0.0F; + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) { + EntityGlyphid glyphid = (EntityGlyphid) entity; + return glyphid.getSkin(); + } + + @Override + protected void preRenderCallback(EntityLivingBase entity, float interp) { + this.preRenderCallback((EntityGlyphidNuclear) entity, interp); + } + + protected void preRenderCallback(EntityGlyphidNuclear entity, float interp) { + float swell = (float) (entity.deathTicks + interp) / 95F; + float flash = 1.0F + MathHelper.sin(swell * 100.0F) * swell * 0.01F; + + if(swell < 0.0F) { + swell = 0.0F; + } + + if(swell > 1.0F) { + swell = 1.0F; + } + + swell *= swell; + swell *= swell; + + float scaleHorizontal = (1.0F + swell * 0.4F) * flash; + float scaleVertical = (1.0F + swell * 0.1F) / flash; + GL11.glScalef(scaleHorizontal, scaleVertical, scaleHorizontal); + } + + @Override + protected int getColorMultiplier(EntityLivingBase entity, float lightBrightness, float interp) { + return this.getColorMultiplier((EntityGlyphidNuclear) entity, lightBrightness, interp); + } + + protected int getColorMultiplier(EntityGlyphidNuclear entity, float lightBrightness, float interp) { + float swell = (float) (entity.deathTicks + interp) / 20F; + + + + + int a = (int) (swell * 0.2F * 255.0F); + + if((int) (swell * 10.0F) % 4 < 2) + return a *= 0.75; + + if(a < 0) { + a = 0; + } + + if(a > 255) { + a = 255; + } + + short r = 255; + short g = 255; + short b = 255; + return a << 24 | r << 16 | g << 8 | b; + } + + public static class ModelGlyphid extends ModelBase { + + double bite = 0; + + @Override + public void setLivingAnimations(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float interp) { + bite = entity.getSwingProgress(interp); + } + + @Override + public void render(Entity entity, float limbSwing, float limbSwingAmount, float rotationYaw, float rotationHeadYaw, float rotationPitch, float scale) { + GL11.glPushMatrix(); + + GL11.glRotatef(180, 1, 0, 0); + GL11.glTranslatef(0, -1.5F, 0); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + + double s = ((EntityGlyphid) entity).getScale(); + GL11.glScaled(s, s, s); + + EntityLivingBase living = (EntityLivingBase) entity; + byte armor = living.getDataWatcher().getWatchableObjectByte(17); + + double walkCycle = limbSwing; + + double speed = 100000D; + double chewing = 200000D; + double cy0 = Math.sin(walkCycle % (Math.PI * 2)); + double cy1 = Math.sin(walkCycle % (Math.PI * 2) - Math.PI * 0.5); + double cy2 = Math.sin(walkCycle % (Math.PI * 2) - Math.PI); + double cy3 = Math.sin(walkCycle % (Math.PI * 2) - Math.PI * 0.75); + + double bite = MathHelper.clamp_double(Math.sin(this.bite * Math.PI * 2 - Math.PI * 0.5), 0, 1) * 20; + double headTilt = Math.sin(this.bite * Math.PI) * 30; + + ResourceManager.glyphid.renderPart("Body"); + if((armor & (1 << 0)) > 0) ResourceManager.glyphid.renderPart("ArmorFront"); + if((armor & (1 << 1)) > 0) ResourceManager.glyphid.renderPart("ArmorLeft"); + if((armor & (1 << 2)) > 0) ResourceManager.glyphid.renderPart("ArmorRight"); + + /// LEFT ARM /// + GL11.glPushMatrix(); + GL11.glTranslated(0.25, 0.625, 0.0625); + GL11.glRotated(10, 0, 1, 0); + GL11.glRotated(35 + cy1 * 20, 1, 0, 0); + GL11.glTranslated(-0.25, -0.625, -0.0625); + ResourceManager.glyphid.renderPart("ArmLeftUpper"); + GL11.glTranslated(0.25, 0.625, 0.4375); + GL11.glRotated(-75 - cy1 * 20 + cy0 * 20, 1, 0, 0); + GL11.glTranslated(-0.25, -0.625, -0.4375); + ResourceManager.glyphid.renderPart("ArmLeftMid"); + GL11.glTranslated(0.25, 0.625, 0.9375); + GL11.glRotated(90 - cy0 * 45, 1, 0, 0); + GL11.glTranslated(-0.25, -0.625, -0.9375); + ResourceManager.glyphid.renderPart("ArmLeftLower"); + if((armor & (1 << 3)) > 0) ResourceManager.glyphid.renderPart("ArmLeftArmor"); + GL11.glPopMatrix(); + + /// RIGHT ARM /// + GL11.glPushMatrix(); + GL11.glTranslated(-0.25, 0.625, 0.0625); + GL11.glRotated(-10, 0, 1, 0); + GL11.glRotated(35 + cy2 * 20, 1, 0, 0); + GL11.glTranslated(0.25, -0.625, -0.0625); + ResourceManager.glyphid.renderPart("ArmRightUpper"); + GL11.glTranslated(-0.25, 0.625, 0.4375); + GL11.glRotated(-75 - cy2 * 20 + cy3 * 20, 1, 0, 0); + GL11.glTranslated(0.25, -0.625, -0.4375); + ResourceManager.glyphid.renderPart("ArmRightMid"); + GL11.glTranslated(-0.25, 0.625, 0.9375); + GL11.glRotated(90 - cy3 * 45, 1, 0, 0); + GL11.glTranslated(0.25, -0.625, -0.9375); + ResourceManager.glyphid.renderPart("ArmRightLower"); + if((armor & (1 << 4)) > 0) ResourceManager.glyphid.renderPart("ArmRightArmor"); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + + GL11.glTranslated(0, 0.5, 0.25); + GL11.glRotated(headTilt, 0, 0, 1); + GL11.glTranslated(0, -0.5, -0.25); + + GL11.glPushMatrix(); + GL11.glTranslated(0, 0.5, 0.25); + GL11.glRotated(-bite, 1, 0, 0); + GL11.glTranslated(0, -0.5, -0.25); + ResourceManager.glyphid.renderPart("JawTop"); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslated(0, 0.5, 0.25); + GL11.glRotated(bite, 0, 1, 0); + GL11.glRotated(bite, 1, 0, 0); + GL11.glTranslated(0, -0.5, -0.25); + ResourceManager.glyphid.renderPart("JawLeft"); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslated(0, 0.5, 0.25); + GL11.glRotated(-bite, 0, 1, 0); + GL11.glRotated(bite, 1, 0, 0); + GL11.glTranslated(0, -0.5, -0.25); + ResourceManager.glyphid.renderPart("JawRight"); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + + double steppy = 15; + double bend = 60; + + for(int i = 0; i < 3; i++) { + + double c0 = cy0 * (i == 1 ? -1 : 1); + double c1 = cy1 * (i == 1 ? -1 : 1); + + GL11.glPushMatrix(); + GL11.glTranslated(0, 0.25, 0); + GL11.glRotated(i * 30 - 15 + c0 * 7.5, 0, 1, 0); + GL11.glRotated(steppy + c1 * steppy, 0, 0, 1); + GL11.glTranslated(0, -0.25, 0); + ResourceManager.glyphid.renderPart("LegLeftUpper"); + GL11.glTranslated(0.5625, 0.25, 0); + GL11.glRotated(-bend - c1 * steppy, 0, 0, 1); + GL11.glTranslated(-0.5625, -0.25, 0); + ResourceManager.glyphid.renderPart("LegLeftLower"); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslated(0, 0.25, 0); + GL11.glRotated(i * 30 - 45 + c0 * 7.5, 0, 1, 0); + GL11.glRotated(-steppy + c1 * steppy, 0, 0, 1); + GL11.glTranslated(0, -0.25, 0); + ResourceManager.glyphid.renderPart("LegRightUpper"); + GL11.glTranslated(-0.5625, 0.25, 0); + GL11.glRotated(bend - c1 * steppy, 0, 0, 1); + GL11.glTranslated(0.5625, -0.25, 0); + ResourceManager.glyphid.renderPart("LegRightLower"); + GL11.glPopMatrix(); + } + + + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glTranslated(0, 1, 0); + GL11.glRotated(90, 1, 0, 0); + Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.mini_nuke_tex); + ResourceManager.projectiles.renderPart("MiniNuke"); + GL11.glShadeModel(GL11.GL_FLAT); + + GL11.glPopMatrix(); + } + } +} diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 0058e4be6..5e2693e41 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -507,8 +507,12 @@ entity.entity_elder_one.name=Quackos der Älteste entity.entity_fucc_a_ducc.name=Ente entity.entity_glyphid.name=Glyphid entity.entity_glyphid_behemoth.name=Glyphid-Behemoth +entity.entity_glyphid_blaster.name=Glyphid-Blaster +entity.entity_glyphid_bombardier.name=Glyphid-Bombardierer entity.entity_glyphid_brawler.name=Glyphid-Schläger entity.entity_glyphid_brenda.name=Brenda +entity.entity_glyphid_nuclear.name=Der dicke Johnson +entity.entity_glyphid_scout.name=Glyphid-Späher entity.entity_ntm_fbi.name=FBI Agent entity.entity_ntm_radiation_blaze.name=Kernschmelze-Elementar entity.hbm.entity_ntm_ufo.name=Marsianisches Invasionsschiff diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 9c60416ef..846ac5558 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -953,8 +953,12 @@ entity.entity_elder_one.name=Quackos The Elder One entity.entity_fucc_a_ducc.name=Duck entity.entity_glyphid.name=Glyphid entity.entity_glyphid_behemoth.name=Glyphid Behemoth +entity.entity_glyphid_blaster.name=Glyphid Blaster +entity.entity_glyphid_bombardier.name=Glyphid Bombardier entity.entity_glyphid_brawler.name=Glyphid Brawler entity.entity_glyphid_brenda.name=Brenda +entity.entity_glyphid_nuclear.name=Big Man Johnson +entity.entity_glyphid_scout.name=Glyphid Scout entity.entity_ntm_fbi.name=FBI Agent entity.entity_ntm_radiation_blaze.name=Meltdown Elemental entity.hbm.entity_ntm_ufo.name=Martian Invasion Ship diff --git a/src/main/resources/assets/hbm/textures/entity/glyphid_nuclear.png b/src/main/resources/assets/hbm/textures/entity/glyphid_nuclear.png new file mode 100644 index 000000000..af7c50fbc Binary files /dev/null and b/src/main/resources/assets/hbm/textures/entity/glyphid_nuclear.png differ