mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
too late to turn tail, too good to fail
This commit is contained in:
parent
f49b832c96
commit
7695c189ea
@ -5,6 +5,8 @@ import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.TrackerUtil;
|
||||
import com.hbm.util.Vec3NT;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.EntityTrackerEntry;
|
||||
@ -29,6 +31,7 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
|
||||
super(world);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
public EntityBulletBaseMK4(EntityLivingBase entity, BulletConfig config, float baseDamage, float gunSpread, double sideOffset, double heightOffset, double frontOffset) {
|
||||
@ -181,4 +184,6 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
|
||||
@Override public boolean doesPenetrate() { return this.config.doesPenetrate; }
|
||||
@Override public boolean isSpectral() { return this.config.isSpectral; }
|
||||
@Override public int selfDamageDelay() { return this.config.selfDamageDelay; }
|
||||
|
||||
@Override @SideOnly(Side.CLIENT) public boolean canRenderOnFire() { return false; }
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
|
||||
this.ignoreFrustumCheck = true;
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
public EntityLivingBase getThrower() { return this.thrower; }
|
||||
@ -198,4 +199,6 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
|
||||
this.rotationYaw = buf.readFloat();
|
||||
this.rotationPitch = buf.readFloat();
|
||||
}
|
||||
|
||||
@Override @SideOnly(Side.CLIENT) public boolean canRenderOnFire() { return false; }
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.interfaces.ICustomDamageHandler;
|
||||
import com.hbm.explosion.vanillant.interfaces.IEntityProcessor;
|
||||
@ -96,9 +97,11 @@ public class EntityProcessorCross implements IEntityProcessor {
|
||||
if(!damageMap.containsKey(entity) || damageMap.get(entity) < dmg) damageMap.put(entity, dmg);
|
||||
double enchKnockback = EnchantmentProtection.func_92092_a(entity, knockback);
|
||||
|
||||
entity.motionX += deltaX * enchKnockback;
|
||||
entity.motionY += deltaY * enchKnockback;
|
||||
entity.motionZ += deltaZ * enchKnockback;
|
||||
if(!(entity instanceof EntityBulletBaseMK4)) {
|
||||
entity.motionX += deltaX * enchKnockback;
|
||||
entity.motionY += deltaY * enchKnockback;
|
||||
entity.motionZ += deltaZ * enchKnockback;
|
||||
}
|
||||
|
||||
if(entity instanceof EntityPlayer) {
|
||||
affectedPlayers.put((EntityPlayer) entity, Vec3.createVectorHelper(deltaX * knockback, deltaY * knockback, deltaZ * knockback));
|
||||
|
||||
@ -66,6 +66,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
|
||||
public static final String KEY_ANIMTIMER = "animtimer_";
|
||||
public static final String KEY_LOCKONTARGET = "lockontarget";
|
||||
public static final String KEY_LOCKEDON = "lockedon";
|
||||
public static final String KEY_CANCELRELOAD = "cancel";
|
||||
|
||||
public static ConcurrentHashMap<EntityLivingBase, AudioWrapper> loopedSounds = new ConcurrentHashMap();
|
||||
|
||||
@ -285,6 +286,9 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
|
||||
public static void setTertiary(ItemStack stack, int index, boolean value) { setValueBool(stack, KEY_TERTIARY + index, value); }
|
||||
public static boolean getReloadKey(ItemStack stack, int index) { return getValueBool(stack, KEY_RELOAD + index); }
|
||||
public static void setReloadKey(ItemStack stack, int index, boolean value) { setValueBool(stack, KEY_RELOAD + index, value); }
|
||||
// RELOAD CANCEL //
|
||||
public static boolean getReloadCancel(ItemStack stack) { return getValueBool(stack, KEY_CANCELRELOAD); }
|
||||
public static void setReloadCancel(ItemStack stack, boolean value) { setValueBool(stack, KEY_CANCELRELOAD, value); }
|
||||
|
||||
|
||||
/// UTIL ///
|
||||
|
||||
@ -16,6 +16,7 @@ import static com.hbm.items.weapon.sedna.factory.XFactoryBlackPowder.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactoryCatapult.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactoryEnergy.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactoryFolly.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactoryTurret.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactoryRocket.*;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
@ -170,6 +171,8 @@ public class GunFactoryClient {
|
||||
folly_sm.setRendererBeam(LegoClient.RENDER_FOLLY);
|
||||
folly_nuke.setRenderer(LegoClient.RENDER_BIG_NUKE);
|
||||
|
||||
setRendererBulk(LegoClient.RENDER_GRENADE, shell_normal, shell_explosive, shell_ap, shell_du, shell_w9); //TODO: change the sabots
|
||||
|
||||
//HUDS
|
||||
((ItemGunBaseNT) ModItems.gun_debug) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_pepperbox) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
|
||||
@ -63,9 +63,10 @@ public class GunStateDecider {
|
||||
IMagazine mag = rec.getMagazine(stack);
|
||||
|
||||
mag.reloadAction(stack, ctx.inventory);
|
||||
boolean cancel = ItemGunBaseNT.getReloadCancel(stack);
|
||||
|
||||
//if after reloading the gun can still reload, assume a tube mag and resume reloading
|
||||
if(mag.canReload(stack, ctx.inventory)) {
|
||||
if(!cancel && mag.canReload(stack, ctx.inventory)) {
|
||||
ItemGunBaseNT.setState(stack, gunIndex, GunState.RELOADING);
|
||||
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getReloadCycleDuration(stack));
|
||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_CYCLE, gunIndex);
|
||||
@ -82,6 +83,8 @@ public class GunStateDecider {
|
||||
ItemGunBaseNT.setTimer(stack, gunIndex, duration);
|
||||
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_END, gunIndex);
|
||||
}
|
||||
|
||||
ItemGunBaseNT.setReloadCancel(stack, false);
|
||||
}
|
||||
|
||||
mag.setAmountAfterReload(stack, mag.getAmount(stack, ctx.inventory));
|
||||
|
||||
@ -107,6 +107,10 @@ public class Lego {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(state == GunState.RELOADING) {
|
||||
ItemGunBaseNT.setReloadCancel(stack, true);
|
||||
}
|
||||
}
|
||||
|
||||
/** If IDLE, switch mode between 0 and 1. */
|
||||
|
||||
@ -180,6 +180,9 @@ public class XFactory12ga {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(state == GunState.RELOADING) {
|
||||
ItemGunBaseNT.setReloadCancel(stack, true);
|
||||
}
|
||||
};
|
||||
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MARESLEG_ANIMS = (stack, type) -> {
|
||||
|
||||
@ -74,6 +74,8 @@ public class XFactory40mm {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && mop.entityHit instanceof EntityLivingBase) {
|
||||
EntityLivingBase living = (EntityLivingBase) mop.entityHit;
|
||||
EntityDamageUtil.attackEntityFromNT(living, bullet.config.getDamage(bullet, bullet.getThrower(), DamageClass.EXPLOSIVE), bullet.damage * 3F, true, true, 0.5F, 3F, 0.15F);
|
||||
} else if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
|
||||
mop.entityHit.attackEntityFrom(bullet.config.getDamage(bullet, bullet.getThrower(), DamageClass.EXPLOSIVE), bullet.damage * 3F);
|
||||
}
|
||||
};
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_STANDARD_EXPLODE_DEMO = (bullet, mop) -> {
|
||||
|
||||
@ -133,8 +133,8 @@ public class XFactoryCatapult {
|
||||
nuke_standard = new BulletConfig().setItem(EnumAmmo.NUKE_STANDARD).setLife(300).setVel(3F).setGrav(0.025F).setOnImpact(LAMBDA_NUKE_STANDARD);
|
||||
nuke_demo = new BulletConfig().setItem(EnumAmmo.NUKE_DEMO).setLife(300).setVel(3F).setGrav(0.025F).setOnImpact(LAMBDA_NUKE_DEMO);
|
||||
nuke_high = new BulletConfig().setItem(EnumAmmo.NUKE_HIGH).setLife(300).setVel(3F).setGrav(0.025F).setOnImpact(LAMBDA_NUKE_HIGH);
|
||||
nuke_tots = new BulletConfig().setItem(EnumAmmo.NUKE_TOTS).setProjectiles(8).setLife(300).setVel(3F).setGrav(0.025F).setSpread(0.1F).setOnImpact(LAMBDA_NUKE_TINYTOT);
|
||||
nuke_hive = new BulletConfig().setItem(EnumAmmo.NUKE_HIVE).setProjectiles(12).setLife(300).setVel(1F).setGrav(0.025F).setSpread(0.15F).setDamage(0.5F).setOnImpact(LAMBDA_NUKE_HIVE);
|
||||
nuke_tots = new BulletConfig().setItem(EnumAmmo.NUKE_TOTS).setProjectiles(8).setLife(300).setVel(3F).setGrav(0.025F).setSpread(0.1F).setDamage(0.35F).setOnImpact(LAMBDA_NUKE_TINYTOT);
|
||||
nuke_hive = new BulletConfig().setItem(EnumAmmo.NUKE_HIVE).setProjectiles(12).setLife(300).setVel(1F).setGrav(0.025F).setSpread(0.15F).setDamage(0.25F).setOnImpact(LAMBDA_NUKE_HIVE);
|
||||
|
||||
ModItems.gun_fatman = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
|
||||
.dura(300).draw(20).inspect(30).crosshair(Crosshair.L_CIRCUMFLEX).hideCrosshair(false)
|
||||
|
||||
@ -89,6 +89,8 @@ public class XFactoryRocket {
|
||||
if(mop.typeOfHit == mop.typeOfHit.ENTITY && mop.entityHit instanceof EntityLivingBase) {
|
||||
EntityLivingBase living = (EntityLivingBase) mop.entityHit;
|
||||
EntityDamageUtil.attackEntityFromNT(living, bullet.config.getDamage(bullet, bullet.getThrower(), DamageClass.EXPLOSIVE), bullet.damage * 3F, true, true, 0.5F, 5F, 0.2F);
|
||||
} else if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
|
||||
mop.entityHit.attackEntityFrom(bullet.config.getDamage(bullet, bullet.getThrower(), DamageClass.EXPLOSIVE), bullet.damage * 3F);
|
||||
}
|
||||
};
|
||||
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_STANDARD_EXPLODE_DEMO = (bullet, mop) -> {
|
||||
|
||||
@ -12,6 +12,8 @@ import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class XFactoryTurret {
|
||||
|
||||
public static BulletConfig dgk_normal;
|
||||
@ -24,12 +26,12 @@ public class XFactoryTurret {
|
||||
public static BulletConfig shell_w9;
|
||||
|
||||
public static void init() {
|
||||
dgk_normal = new BulletConfig();
|
||||
dgk_normal = new BulletConfig().setItem(new ItemStack(ModItems.ammo_dgk));
|
||||
|
||||
shell_normal = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.STOCK)).setDamage(1F).setCasing(CASINNG240MM).setOnImpact((bullet, mop) -> {
|
||||
shell_normal = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.STOCK)).setDamage(1F).setCasing(CASINNG240MM.clone().register("240standard")).setOnImpact((bullet, mop) -> {
|
||||
Lego.standardExplode(bullet, mop, 10F); bullet.setDead();
|
||||
});
|
||||
shell_explosive = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.EXPLOSIVE)).setDamage(1.5F).setCasing(CASINNG240MM).setOnImpact((bullet, mop) -> {
|
||||
shell_explosive = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.EXPLOSIVE)).setDamage(1.5F).setCasing(CASINNG240MM.clone().register("240ext")).setOnImpact((bullet, mop) -> {
|
||||
ExplosionVNT vnt = new ExplosionVNT(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 10F);
|
||||
vnt.setBlockAllocator(new BlockAllocatorStandard());
|
||||
vnt.setBlockProcessor(new BlockProcessorStandard());
|
||||
@ -39,8 +41,8 @@ public class XFactoryTurret {
|
||||
vnt.explode();
|
||||
bullet.setDead();
|
||||
});
|
||||
shell_ap = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.APFSDS_T)).setDamage(2F).setDoesPenetrate(true).setCasing(CASINNG240MM);
|
||||
shell_du = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.APFSDS_DU)).setDamage(2.5F).setDoesPenetrate(true).setDamageFalloutByPen(false).setCasing(CASINNG240MM);
|
||||
shell_w9 = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.W9)).setDamage(2.5F).setCasing(CASINNG240MM).setOnImpact(XFactoryCatapult.LAMBDA_NUKE_STANDARD);
|
||||
shell_ap = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.APFSDS_T)).setDamage(2F).setDoesPenetrate(true).setCasing(CASINNG240MM.clone().register("240w"));
|
||||
shell_du = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.APFSDS_DU)).setDamage(2.5F).setDoesPenetrate(true).setDamageFalloutByPen(false).setCasing(CASINNG240MM.clone().register("240u"));
|
||||
shell_w9 = new BulletConfig().setItem(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.W9)).setDamage(2.5F).setCasing(CASINNG240MM.clone().register("240n")).setOnImpact(XFactoryCatapult.LAMBDA_NUKE_STANDARD);
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ public class ParticleAshes extends EntityFXRotating {
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tess, float interp, float sX, float sY, float sZ, float dX, float dZ) {
|
||||
|
||||
|
||||
float timeLeft = this.particleMaxAge - (this.particleAge + interp);
|
||||
|
||||
if(timeLeft < 40) {
|
||||
@ -74,11 +74,11 @@ public class ParticleAshes extends EntityFXRotating {
|
||||
Vec3NT vec = new Vec3NT(particleScale, 0, particleScale).rotateAroundYDeg(this.rotationPitch);
|
||||
|
||||
tess.addVertexWithUV(pX + vec.xCoord, pY + 0.05, pZ + vec.zCoord, particleIcon.getMaxU(), particleIcon.getMaxV());
|
||||
vec.rotateAroundYDeg(-90);
|
||||
vec.rotateAroundYDeg(90);
|
||||
tess.addVertexWithUV(pX + vec.xCoord, pY + 0.05, pZ + vec.zCoord, particleIcon.getMaxU(), particleIcon.getMinV());
|
||||
vec.rotateAroundYDeg(-90);
|
||||
vec.rotateAroundYDeg(90);
|
||||
tess.addVertexWithUV(pX + vec.xCoord, pY + 0.05, pZ + vec.zCoord, particleIcon.getMinU(), particleIcon.getMinV());
|
||||
vec.rotateAroundYDeg(-90);
|
||||
vec.rotateAroundYDeg(90);
|
||||
tess.addVertexWithUV(pX + vec.xCoord, pY + 0.05, pZ + vec.zCoord, particleIcon.getMinU(), particleIcon.getMaxV());
|
||||
} else {
|
||||
renderParticleRotated(tess, interp, sX, sY, sZ, dX, dZ, this.particleScale);
|
||||
|
||||
@ -50,7 +50,7 @@ public class RenderInfoSystem {
|
||||
if(event.type != ElementType.CROSSHAIRS)
|
||||
return;
|
||||
|
||||
this.messages.put(-666, new InfoEntry("Super Cancer World preview special edition director's cut and Knuckles", 666_666));
|
||||
this.messages.put(-666, new InfoEntry("Your arteries are bad cable management, rip them out deluxe edition", 666_666));
|
||||
|
||||
if(this.messages.isEmpty())
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user