mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
patched up MG42
This commit is contained in:
parent
3b938c5873
commit
8d07e34583
@ -21,6 +21,8 @@ public class EntityGhost extends EntityCreature {
|
||||
this.tasks.addTask(0, new EntityAISwimming(this));
|
||||
this.tasks.addTask(1, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(2, new EntityAILookIdle(this));
|
||||
|
||||
this.renderDistanceWeight *= 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -35,7 +37,7 @@ public class EntityGhost extends EntityCreature {
|
||||
super.onUpdate();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
double despawnRange = 100;
|
||||
double despawnRange = 50;
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(despawnRange, despawnRange, despawnRange));
|
||||
if(!players.isEmpty())
|
||||
this.setDead();
|
||||
|
||||
@ -6,9 +6,11 @@ import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.config.WorldConfig;
|
||||
import com.hbm.entity.mob.EntityFBI;
|
||||
import com.hbm.entity.mob.EntityGhost;
|
||||
import com.hbm.entity.mob.EntityMaskMan;
|
||||
import com.hbm.entity.mob.EntityRADBeast;
|
||||
import com.hbm.entity.projectile.EntityMeteor;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
@ -118,6 +120,23 @@ public class BossSpawnHandler {
|
||||
if(GeneralConfig.enableMeteorStrikes && !world.isRemote) {
|
||||
meteorUpdate(world);
|
||||
}
|
||||
|
||||
if(world.getTotalWorldTime() % 20 == 0) {
|
||||
|
||||
if(world.rand.nextInt(5) == 0 && !world.playerEntities.isEmpty() && world.provider.isSurfaceWorld()) {
|
||||
|
||||
EntityPlayer player = (EntityPlayer) world.playerEntities.get(world.rand.nextInt(world.playerEntities.size()));
|
||||
|
||||
if(HbmLivingProps.getDigamma(player) > 0) {
|
||||
Vec3 vec = Vec3.createVectorHelper(75, 0, 0);
|
||||
vec.rotateAroundY((float)(Math.PI * 2) * world.rand.nextFloat());
|
||||
double spawnX = player.posX + vec.xCoord + world.rand.nextGaussian();
|
||||
double spawnZ = player.posZ + vec.zCoord + world.rand.nextGaussian();
|
||||
double spawnY = world.getHeightValue((int)spawnX, (int)spawnZ);
|
||||
trySpawn(world, (float)spawnX, (float)spawnY, (float)spawnZ, new EntityGhost(world));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void trySpawn(World world, float x, float y, float z, EntityLiving e) {
|
||||
|
||||
@ -12,6 +12,10 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
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;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
@ -29,7 +33,7 @@ public class Gun50BMGFactory {
|
||||
|
||||
GunConfiguration config = new GunConfiguration();
|
||||
|
||||
config.rateOfFire = 6;
|
||||
config.rateOfFire = 1;
|
||||
config.roundsPerCycle = 1;
|
||||
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||
config.firingMode = GunConfiguration.FIRE_AUTO;
|
||||
@ -38,14 +42,28 @@ public class Gun50BMGFactory {
|
||||
config.ammoCap = 50;
|
||||
config.reloadType = GunConfiguration.RELOAD_FULL;
|
||||
config.allowsInfinity = true;
|
||||
config.crosshair = Crosshair.L_BOX;
|
||||
config.durability = 2000;
|
||||
config.crosshair = Crosshair.NONE;
|
||||
config.durability = 15 * 50 * 10; //15 * capacity * default wear
|
||||
config.reloadSound = GunConfiguration.RSOUND_MAG;
|
||||
config.firingSound = "hbm:weapon.calShoot";
|
||||
config.reloadSoundEnd = false;
|
||||
|
||||
config.name = "Maxim gun";
|
||||
config.manufacturer = "Hiram Maxim";
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
)
|
||||
);
|
||||
|
||||
config.animations.put(AnimType.RELOAD, new BusAnimation()
|
||||
.addBus("MAG", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, -1, 0, 500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))
|
||||
)
|
||||
);
|
||||
|
||||
config.name = "Universal-Maschinengewehr Modell 42 - .50 Mod";
|
||||
config.manufacturer = "Wilhelm-Gustloff-Werke";
|
||||
|
||||
config.config = new ArrayList<Integer>();
|
||||
config.config.add(BulletConfigSyncingUtil.BMG50_NORMAL);
|
||||
|
||||
@ -470,6 +470,7 @@ public class MainRegistry {
|
||||
EntityRegistry.registerModEntity(EntityMissileVolcano.class, "entity_missile_volcano", 159, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityMissileShuttle.class, "entity_missile_shuttle", 160, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityZirnoxDebris.class, "entity_zirnox_debris", 161, this, 1000, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityGhost.class, "entity_ntm_ghost", 162, this, 1000, 1, true);
|
||||
|
||||
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
|
||||
EntityRegistry.registerGlobalEntityID(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x813b9b, 0xd71fdd);
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package com.hbm.render.entity.mob;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.mob.EntityGhost;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.model.ModelSiegeZombie;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderBiped;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
@ -28,4 +31,14 @@ public class RenderGhost extends RenderBiped {
|
||||
protected ResourceLocation getEntityTexture(EntityGhost entity) {
|
||||
return new ResourceLocation(RefStrings.MODID + ":textures/entity/ghost.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,12 +3,11 @@ package com.hbm.render.item.weapon;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
|
||||
|
||||
public class ItemRenderWeaponFFMG42 implements IItemRenderer {
|
||||
|
||||
@ -38,8 +37,10 @@ public class ItemRenderWeaponFFMG42 implements IItemRenderer {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.mg42_tex);
|
||||
boolean renderMag = true;
|
||||
|
||||
switch(type) {
|
||||
|
||||
@ -51,6 +52,21 @@ public class ItemRenderWeaponFFMG42 implements IItemRenderer {
|
||||
GL11.glTranslated(-0.125, 0, 0);
|
||||
GL11.glScaled(s0, s0, s0);
|
||||
|
||||
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
|
||||
GL11.glTranslated(recoil[0] * 0.25, 0, 0);
|
||||
|
||||
double[] reload = HbmAnimations.getRelevantTransformation("MAG");
|
||||
GL11.glRotated(reload[1] * 15, 1, 0, 0);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glRotated(reload[1] * -45, 1, 0, 0);
|
||||
GL11.glTranslated(0, reload[1] * 0.25, -reload[1]);
|
||||
ResourceManager.mg42.renderPart("Mag");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderMag = false;
|
||||
|
||||
break;
|
||||
|
||||
case EQUIPPED:
|
||||
@ -86,8 +102,9 @@ public class ItemRenderWeaponFFMG42 implements IItemRenderer {
|
||||
default: break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.mg42.renderAll();
|
||||
ResourceManager.mg42.renderPart("Gun");
|
||||
if(renderMag) ResourceManager.mg42.renderPart("Mag");
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@ -1354,7 +1354,7 @@ item.gun_bolt_action_green.name=Dream-Repetiergewehr (Grün)
|
||||
item.gun_bolt_action_saturnite.name=Saturnitbüchse
|
||||
item.gun_bolter.name=Boltergewehr
|
||||
item.gun_bolter_digamma.name=Digammagewehr
|
||||
item.gun_calamity.name=Calamity
|
||||
item.gun_calamity.name=Knochensäge
|
||||
item.gun_calamity_ammo.name=.50 BMG Patrone (LEGACY)
|
||||
item.gun_calamity_dual.name=Sattelkanone
|
||||
item.gun_cryolator.name=Der Cryolator
|
||||
|
||||
@ -1429,7 +1429,7 @@ item.gun_bolt_action_green.name=Dream Bolt-Action Rifle (Green)
|
||||
item.gun_bolt_action_saturnite.name=Saturnite Rifle
|
||||
item.gun_bolter.name=Bolter
|
||||
item.gun_bolter_digamma.name=Digamma Gun
|
||||
item.gun_calamity.name=Calamity
|
||||
item.gun_calamity.name=Buzzsaw
|
||||
item.gun_calamity_ammo.name=.50 BMG Round (LEGACY)
|
||||
item.gun_calamity_dual.name=Saddle Gun
|
||||
item.gun_cryolator.name=The Cryolator
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/entity/ghost.png
Normal file
BIN
src/main/resources/assets/hbm/textures/entity/ghost.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Loading…
x
Reference in New Issue
Block a user