mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
spent casings for turrets, finished 12ga percussive caps
This commit is contained in:
parent
5075f28bc2
commit
00e8675a15
@ -251,6 +251,10 @@ public class EntityBulletBase extends Entity implements IProjectile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(config.maxAge == 0) {
|
if(config.maxAge == 0) {
|
||||||
|
|
||||||
|
if(this.config.bUpdate != null)
|
||||||
|
this.config.bUpdate.behaveUpdate(this);
|
||||||
|
|
||||||
this.setDead();
|
this.setDead();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import com.hbm.handler.BulletConfiguration;
|
|||||||
import com.hbm.handler.CasingEjector;
|
import com.hbm.handler.CasingEjector;
|
||||||
import com.hbm.handler.GunConfiguration;
|
import com.hbm.handler.GunConfiguration;
|
||||||
import com.hbm.interfaces.IBulletHurtBehavior;
|
import com.hbm.interfaces.IBulletHurtBehavior;
|
||||||
|
import com.hbm.interfaces.IBulletUpdateBehavior;
|
||||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
import com.hbm.items.ItemAmmoEnums.Ammo12Gauge;
|
import com.hbm.items.ItemAmmoEnums.Ammo12Gauge;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
@ -110,14 +111,7 @@ public class Gun12GaugeFactory {
|
|||||||
config.firingSound = "hbm:weapon.shotgunPump";
|
config.firingSound = "hbm:weapon.shotgunPump";
|
||||||
config.reloadType = GunConfiguration.RELOAD_SINGLE;
|
config.reloadType = GunConfiguration.RELOAD_SINGLE;
|
||||||
|
|
||||||
|
config.config = HbmCollection.twelveGauge;
|
||||||
config.config = new ArrayList<Integer>();
|
|
||||||
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
|
|
||||||
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
|
|
||||||
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
|
|
||||||
config.config.add(BulletConfigSyncingUtil.G12_DU);
|
|
||||||
config.config.add(BulletConfigSyncingUtil.G12_AM);
|
|
||||||
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
|
|
||||||
|
|
||||||
config.ejector = EJECTOR_SPAS_ALT;
|
config.ejector = EJECTOR_SPAS_ALT;
|
||||||
|
|
||||||
@ -305,43 +299,50 @@ public class Gun12GaugeFactory {
|
|||||||
|
|
||||||
public static BulletConfiguration get12GaugePercussionConfig() {
|
public static BulletConfiguration get12GaugePercussionConfig() {
|
||||||
|
|
||||||
BulletConfiguration bullet = new BulletConfiguration();
|
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||||
|
|
||||||
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.PERCUSSION));
|
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.PERCUSSION));
|
||||||
|
bullet.velocity = 2F;
|
||||||
bullet.spread = 0F;
|
bullet.spread = 0F;
|
||||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaPerc").setColor(0x9E1616, SpentCasing.COLOR_CASE_12GA);
|
bullet.wear = 10;
|
||||||
|
bullet.dmgMin = 30F;
|
||||||
|
bullet.dmgMax = 30F;
|
||||||
bullet.maxAge = 0;
|
bullet.maxAge = 0;
|
||||||
|
|
||||||
|
bullet.spentCasing = CASING12GAUGE.clone().register("12GaPerc").setColor(0x9E1616, SpentCasing.COLOR_CASE_12GA);
|
||||||
|
|
||||||
bullet.bUpdate = (entityBullet) -> {
|
bullet.bUpdate = new IBulletUpdateBehavior() {
|
||||||
|
|
||||||
if(!entityBullet.worldObj.isRemote) {
|
@Override
|
||||||
|
public void behaveUpdate(EntityBulletBase bullet) {
|
||||||
|
|
||||||
Vec3 vec = Vec3.createVectorHelper(entityBullet.motionX, entityBullet.motionY, entityBullet.motionZ);
|
if(!bullet.worldObj.isRemote) {
|
||||||
double radius = vec.lengthVector();
|
|
||||||
double x = entityBullet.posX + vec.xCoord;
|
Vec3 vec = Vec3.createVectorHelper(bullet.motionX, bullet.motionY, bullet.motionZ);
|
||||||
double y = entityBullet.posY + vec.yCoord;
|
double radius = 4;
|
||||||
double z = entityBullet.posZ + vec.zCoord;
|
double x = bullet.posX + vec.xCoord;
|
||||||
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x, y, z).expand(radius, radius, radius);
|
double y = bullet.posY + vec.yCoord;
|
||||||
List<Entity> list = entityBullet.worldObj.getEntitiesWithinAABBExcludingEntity(entityBullet.shooter, aabb);
|
double z = bullet.posZ + vec.zCoord;
|
||||||
|
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x, y, z).expand(radius, radius, radius);
|
||||||
for(Entity e : list) {
|
List<Entity> list = bullet.worldObj.getEntitiesWithinAABBExcludingEntity(bullet.shooter, aabb);
|
||||||
DamageSource source = entityBullet.shooter instanceof EntityPlayer ? DamageSource.causePlayerDamage((EntityPlayer) entityBullet.shooter) : DamageSource.magic;
|
|
||||||
e.attackEntityFrom(source, 30F);
|
for(Entity e : list) {
|
||||||
|
DamageSource source = bullet.shooter instanceof EntityPlayer ? DamageSource.causePlayerDamage((EntityPlayer) bullet.shooter) : DamageSource.magic;
|
||||||
|
e.attackEntityFrom(source, 30F);
|
||||||
|
}
|
||||||
|
|
||||||
|
NBTTagCompound data = new NBTTagCompound();
|
||||||
|
data.setString("type", "plasmablast");
|
||||||
|
data.setFloat("r", 0.75F);
|
||||||
|
data.setFloat("g", 0.75F);
|
||||||
|
data.setFloat("b", 0.75F);
|
||||||
|
data.setFloat("pitch", (float) -bullet.rotationPitch + 90);
|
||||||
|
data.setFloat("yaw", (float) bullet.rotationYaw);
|
||||||
|
data.setFloat("scale", 2F);
|
||||||
|
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(bullet.dimension, x, y, z, 100));
|
||||||
|
|
||||||
|
bullet.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
|
||||||
data.setString("type", "plasmablast");
|
|
||||||
data.setFloat("r", 0.75F);
|
|
||||||
data.setFloat("g", 0.75F);
|
|
||||||
data.setFloat("b", 0.75F);
|
|
||||||
data.setFloat("pitch", (float) Math.toDegrees(entityBullet.rotationPitch));
|
|
||||||
data.setFloat("yaw", (float) Math.toDegrees(entityBullet.rotationYaw));
|
|
||||||
data.setFloat("scale", 2F);
|
|
||||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z),
|
|
||||||
new TargetPoint(entityBullet.dimension, x, y, z, 100));
|
|
||||||
|
|
||||||
entityBullet.setDead();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ public class Gun5mmFactory {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
EJECTOR_MINIGUN = new CasingEjector().setMotion(-0.4, 0.1, 0).setOffset(-0.35, -0.2, 0.35).setAngleRange(0.01F, 0.03F).setAmount(5);
|
EJECTOR_MINIGUN = new CasingEjector().setMotion(-0.4, 0.1, 0).setOffset(-0.35, -0.2, 0.35).setAngleRange(0.01F, 0.03F).setAmount(5);
|
||||||
CASING5MM = new SpentCasing(CasingType.STRAIGHT).setScale(1F).setBounceMotion(0.05F, 0.02F).setColor(SpentCasing.COLOR_CASE_BRASS);
|
CASING5MM = new SpentCasing(CasingType.STRAIGHT).setScale(1.25F).setBounceMotion(0.05F, 0.02F).setColor(SpentCasing.COLOR_CASE_BRASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GunConfiguration getMinigunConfig() {
|
public static GunConfiguration getMinigunConfig() {
|
||||||
|
|||||||
@ -6,8 +6,16 @@ import com.hbm.interfaces.IBulletImpactBehavior;
|
|||||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
import com.hbm.items.ItemAmmoEnums.Ammo240Shell;
|
import com.hbm.items.ItemAmmoEnums.Ammo240Shell;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.particle.SpentCasing;
|
||||||
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
|
||||||
public class GunCannonFactory {
|
public class GunCannonFactory {
|
||||||
|
|
||||||
|
protected static SpentCasing CASINNG240MM;
|
||||||
|
|
||||||
|
static {
|
||||||
|
CASINNG240MM = new SpentCasing(CasingType.BOTTLENECK).setScale(7.5F).setBounceMotion(0.02F, 0.05F).setColor(SpentCasing.COLOR_CASE_BRASS);
|
||||||
|
}
|
||||||
|
|
||||||
public static BulletConfiguration getShellConfig() {
|
public static BulletConfiguration getShellConfig() {
|
||||||
|
|
||||||
@ -19,6 +27,8 @@ public class GunCannonFactory {
|
|||||||
bullet.explosive = 4F;
|
bullet.explosive = 4F;
|
||||||
bullet.blockDamage = false;
|
bullet.blockDamage = false;
|
||||||
|
|
||||||
|
bullet.spentCasing = CASINNG240MM.register("240MM"); //same instance everywhere, only register once
|
||||||
|
|
||||||
return bullet;
|
return bullet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,6 +42,8 @@ public class GunCannonFactory {
|
|||||||
bullet.explosive = 4F;
|
bullet.explosive = 4F;
|
||||||
bullet.blockDamage = true;
|
bullet.blockDamage = true;
|
||||||
|
|
||||||
|
bullet.spentCasing = CASINNG240MM;
|
||||||
|
|
||||||
return bullet;
|
return bullet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,6 +57,8 @@ public class GunCannonFactory {
|
|||||||
bullet.doesPenetrate = true;
|
bullet.doesPenetrate = true;
|
||||||
bullet.style = BulletConfiguration.STYLE_APDS;
|
bullet.style = BulletConfiguration.STYLE_APDS;
|
||||||
|
|
||||||
|
bullet.spentCasing = CASINNG240MM;
|
||||||
|
|
||||||
return bullet;
|
return bullet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +72,8 @@ public class GunCannonFactory {
|
|||||||
bullet.doesPenetrate = true;
|
bullet.doesPenetrate = true;
|
||||||
bullet.style = BulletConfiguration.STYLE_APDS;
|
bullet.style = BulletConfiguration.STYLE_APDS;
|
||||||
|
|
||||||
|
bullet.spentCasing = CASINNG240MM;
|
||||||
|
|
||||||
return bullet;
|
return bullet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +93,8 @@ public class GunCannonFactory {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bullet.spentCasing = CASINNG240MM;
|
||||||
|
|
||||||
return bullet;
|
return bullet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,13 +3,22 @@ package com.hbm.handler.guncfg;
|
|||||||
import com.hbm.handler.BulletConfiguration;
|
import com.hbm.handler.BulletConfiguration;
|
||||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.particle.SpentCasing;
|
||||||
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
|
|
||||||
public class GunDGKFactory {
|
public class GunDGKFactory {
|
||||||
|
|
||||||
|
public static final SpentCasing CASINGDGK;
|
||||||
|
|
||||||
|
static {
|
||||||
|
CASINGDGK = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F).setBounceMotion(0.05F, 0.02F).setColor(SpentCasing.COLOR_CASE_BRASS).setMaxAge(60); //3 instead of 12 seconds
|
||||||
|
}
|
||||||
|
|
||||||
public static BulletConfiguration getDGKConfig() {
|
public static BulletConfiguration getDGKConfig() {
|
||||||
|
|
||||||
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||||
bullet.ammo = new ComparableStack(ModItems.ammo_dgk);
|
bullet.ammo = new ComparableStack(ModItems.ammo_dgk);
|
||||||
|
bullet.spentCasing = CASINGDGK.register("DGK");
|
||||||
return bullet;
|
return bullet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4432,7 +4432,7 @@ public class ModItems {
|
|||||||
ammo_folly = new ItemCustomLore().setUnlocalizedName("ammo_folly");
|
ammo_folly = new ItemCustomLore().setUnlocalizedName("ammo_folly");
|
||||||
ammo_folly_nuclear = new ItemCustomLore().setUnlocalizedName("ammo_folly_nuclear");
|
ammo_folly_nuclear = new ItemCustomLore().setUnlocalizedName("ammo_folly_nuclear");
|
||||||
ammo_folly_du = new ItemCustomLore().setUnlocalizedName("ammo_folly_du");
|
ammo_folly_du = new ItemCustomLore().setUnlocalizedName("ammo_folly_du");
|
||||||
ammo_dgk = new ItemCustomLore().setUnlocalizedName("ammo_dgk");
|
//ammo_dgk = new ItemCustomLore().setUnlocalizedName("ammo_dgk");
|
||||||
ammo_arty = new ItemAmmoArty().setUnlocalizedName("ammo_arty");
|
ammo_arty = new ItemAmmoArty().setUnlocalizedName("ammo_arty");
|
||||||
ammo_himars = new ItemAmmoHIMARS().setUnlocalizedName("ammo_himars");
|
ammo_himars = new ItemAmmoHIMARS().setUnlocalizedName("ammo_himars");
|
||||||
/*ammo_nuke = new ItemAmmo().setUnlocalizedName("ammo_nuke");
|
/*ammo_nuke = new ItemAmmo().setUnlocalizedName("ammo_nuke");
|
||||||
|
|||||||
@ -20,6 +20,8 @@ import com.hbm.lib.RefStrings;
|
|||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
import com.hbm.particle.SpentCasing;
|
||||||
|
import com.hbm.particle.SpentCasing.CasingType;
|
||||||
import com.hbm.potion.HbmPotion;
|
import com.hbm.potion.HbmPotion;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
@ -171,14 +173,16 @@ public class ItemAmmoArty extends Item {
|
|||||||
return "item." + itemTypes[Math.abs(stack.getItemDamage()) % itemTypes.length].name;
|
return "item." + itemTypes[Math.abs(stack.getItemDamage()) % itemTypes.length].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static SpentCasing SIXTEEN_INCH_CASE = new SpentCasing(CasingType.STRAIGHT).setScale(15F, 15F, 10F);
|
||||||
|
|
||||||
public abstract class ArtilleryShell {
|
public abstract class ArtilleryShell {
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
|
public SpentCasing casing;
|
||||||
|
|
||||||
public ArtilleryShell() { }
|
public ArtilleryShell(String name, int casingColor) {
|
||||||
|
|
||||||
public ArtilleryShell(String name) {
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
this.casing = SIXTEEN_INCH_CASE.clone().register(name).setColor(casingColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop);
|
public abstract void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop);
|
||||||
@ -231,12 +235,12 @@ public class ItemAmmoArty extends Item {
|
|||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
/* STANDARD SHELLS */
|
/* STANDARD SHELLS */
|
||||||
this.itemTypes[NORMAL] = new ArtilleryShell("ammo_arty") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); }};
|
this.itemTypes[NORMAL] = new ArtilleryShell("ammo_arty", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); }};
|
||||||
this.itemTypes[CLASSIC] = new ArtilleryShell("ammo_arty_classic") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 5F, false); }};
|
this.itemTypes[CLASSIC] = new ArtilleryShell("ammo_arty_classic", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 5F, false); }};
|
||||||
this.itemTypes[EXPLOSIVE] = new ArtilleryShell("ammo_arty_he") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 3F, true); }};
|
this.itemTypes[EXPLOSIVE] = new ArtilleryShell("ammo_arty_he", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 3F, true); }};
|
||||||
|
|
||||||
/* MINI NUKE */
|
/* MINI NUKE */
|
||||||
this.itemTypes[MINI_NUKE] = new ArtilleryShell("ammo_arty_mini_nuke") {
|
this.itemTypes[MINI_NUKE] = new ArtilleryShell("ammo_arty_mini_nuke", SpentCasing.COLOR_CASE_16INCH_NUKE) {
|
||||||
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
||||||
shell.killAndClear();
|
shell.killAndClear();
|
||||||
Vec3 vec = Vec3.createVectorHelper(shell.motionX, shell.motionY, shell.motionZ).normalize();
|
Vec3 vec = Vec3.createVectorHelper(shell.motionX, shell.motionY, shell.motionZ).normalize();
|
||||||
@ -245,7 +249,7 @@ public class ItemAmmoArty extends Item {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* FULL NUKE */
|
/* FULL NUKE */
|
||||||
this.itemTypes[NUKE] = new ArtilleryShell("ammo_arty_nuke") {
|
this.itemTypes[NUKE] = new ArtilleryShell("ammo_arty_nuke", SpentCasing.COLOR_CASE_16INCH_NUKE) {
|
||||||
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
||||||
shell.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(shell.worldObj, BombConfig.missileRadius, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord));
|
shell.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(shell.worldObj, BombConfig.missileRadius, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord));
|
||||||
EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(shell.worldObj, 1000, BombConfig.missileRadius * 0.005F);
|
EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(shell.worldObj, 1000, BombConfig.missileRadius * 0.005F);
|
||||||
@ -258,7 +262,7 @@ public class ItemAmmoArty extends Item {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* PHOSPHORUS */
|
/* PHOSPHORUS */
|
||||||
this.itemTypes[PHOSPHORUS] = new ArtilleryShell("ammo_arty_phosphorus") {
|
this.itemTypes[PHOSPHORUS] = new ArtilleryShell("ammo_arty_phosphorus", SpentCasing.COLOR_CASE_16INCH_PHOS) {
|
||||||
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
||||||
standardExplosion(shell, mop, 10F, 3F, false);
|
standardExplosion(shell, mop, 10F, 3F, false);
|
||||||
shell.worldObj.playSoundEffect(shell.posX, shell.posY, shell.posZ, "hbm:weapon.explosionMedium", 20.0F, 0.9F + shell.worldObj.rand.nextFloat() * 0.2F);
|
shell.worldObj.playSoundEffect(shell.posX, shell.posY, shell.posZ, "hbm:weapon.explosionMedium", 20.0F, 0.9F + shell.worldObj.rand.nextFloat() * 0.2F);
|
||||||
@ -287,7 +291,7 @@ public class ItemAmmoArty extends Item {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* THIS DOOFUS */
|
/* THIS DOOFUS */
|
||||||
this.itemTypes[CARGO] = new ArtilleryShell("ammo_arty_cargo") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
this.itemTypes[CARGO] = new ArtilleryShell("ammo_arty_cargo", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
|
||||||
if(mop.typeOfHit == MovingObjectType.BLOCK) {
|
if(mop.typeOfHit == MovingObjectType.BLOCK) {
|
||||||
shell.setPosition(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
|
shell.setPosition(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
|
||||||
shell.getStuck(mop.blockX, mop.blockY, mop.blockZ);
|
shell.getStuck(mop.blockX, mop.blockY, mop.blockZ);
|
||||||
@ -295,11 +299,11 @@ public class ItemAmmoArty extends Item {
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
/* CLUSTER SHELLS */
|
/* CLUSTER SHELLS */
|
||||||
this.itemTypes[PHOSPHORUS_MULTI] = new ArtilleryShell("ammo_arty_phosphorus_multi") {
|
this.itemTypes[PHOSPHORUS_MULTI] = new ArtilleryShell("ammo_arty_phosphorus_multi", SpentCasing.COLOR_CASE_16INCH_PHOS) {
|
||||||
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.this.itemTypes[PHOSPHORUS].onImpact(shell, mop); }
|
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.this.itemTypes[PHOSPHORUS].onImpact(shell, mop); }
|
||||||
public void onUpdate(EntityArtilleryShell shell) { standardCluster(shell, PHOSPHORUS, 10, 300, 5); }
|
public void onUpdate(EntityArtilleryShell shell) { standardCluster(shell, PHOSPHORUS, 10, 300, 5); }
|
||||||
};
|
};
|
||||||
this.itemTypes[MINI_NUKE_MULTI] = new ArtilleryShell("ammo_arty_mini_nuke_multi") {
|
this.itemTypes[MINI_NUKE_MULTI] = new ArtilleryShell("ammo_arty_mini_nuke_multi", SpentCasing.COLOR_CASE_16INCH_NUKE) {
|
||||||
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.this.itemTypes[MINI_NUKE].onImpact(shell, mop); }
|
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.this.itemTypes[MINI_NUKE].onImpact(shell, mop); }
|
||||||
public void onUpdate(EntityArtilleryShell shell) { standardCluster(shell, MINI_NUKE, 5, 300, 5); }
|
public void onUpdate(EntityArtilleryShell shell) { standardCluster(shell, MINI_NUKE, 5, 300, 5); }
|
||||||
};
|
};
|
||||||
|
|||||||
@ -25,8 +25,8 @@ import net.minecraft.util.Vec3;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class ParticleSpentCasing extends EntityFX
|
public class ParticleSpentCasing extends EntityFX {
|
||||||
{
|
|
||||||
public static final Random rand = new Random();
|
public static final Random rand = new Random();
|
||||||
private static float dScale = 0.05F, smokeJitter = 0.025F, smokeAccel = 0.5F;
|
private static float dScale = 0.05F, smokeJitter = 0.025F, smokeAccel = 0.5F;
|
||||||
private static byte maxSmokeGen = 60, maxSmokeLife = 120;
|
private static byte maxSmokeGen = 60, maxSmokeLife = 120;
|
||||||
@ -49,7 +49,7 @@ public class ParticleSpentCasing extends EntityFX
|
|||||||
this.momentumYaw = momentumYaw;
|
this.momentumYaw = momentumYaw;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
|
|
||||||
particleMaxAge = 240;
|
particleMaxAge = config.getMaxAge();
|
||||||
smoke = rand.nextFloat() < config.getSmokeChance();
|
smoke = rand.nextFloat() < config.getSmokeChance();
|
||||||
|
|
||||||
motionX = mx;
|
motionX = mx;
|
||||||
|
|||||||
@ -12,6 +12,9 @@ public class SpentCasing implements Cloneable {
|
|||||||
public static final int COLOR_CASE_12GA = 0x757575;
|
public static final int COLOR_CASE_12GA = 0x757575;
|
||||||
public static final int COLOR_CASE_4GA = 0xD8D8D8;
|
public static final int COLOR_CASE_4GA = 0xD8D8D8;
|
||||||
public static final int COLOR_CASE_44 = 0x3E3E3E;
|
public static final int COLOR_CASE_44 = 0x3E3E3E;
|
||||||
|
public static final int COLOR_CASE_16INCH = 0xD89128;
|
||||||
|
public static final int COLOR_CASE_16INCH_PHOS = 0xC8C8C8;
|
||||||
|
public static final int COLOR_CASE_16INCH_NUKE = 0x495443;
|
||||||
|
|
||||||
public static final HashMap<String, SpentCasing> casingMap = new HashMap();
|
public static final HashMap<String, SpentCasing> casingMap = new HashMap();
|
||||||
|
|
||||||
@ -38,6 +41,7 @@ public class SpentCasing implements Cloneable {
|
|||||||
private float smokeChance;
|
private float smokeChance;
|
||||||
private float bounceYaw = 0F;
|
private float bounceYaw = 0F;
|
||||||
private float bouncePitch = 0F;
|
private float bouncePitch = 0F;
|
||||||
|
private int maxAge = 240;
|
||||||
|
|
||||||
public SpentCasing(CasingType type) {
|
public SpentCasing(CasingType type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@ -89,6 +93,11 @@ public class SpentCasing implements Cloneable {
|
|||||||
this.bouncePitch = pitch;
|
this.bouncePitch = pitch;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SpentCasing setMaxAge(int age) {
|
||||||
|
this.maxAge = age;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() { return this.registryName; }
|
public String getName() { return this.registryName; }
|
||||||
public float getScaleX() { return this.scaleX; }
|
public float getScaleX() { return this.scaleX; }
|
||||||
@ -100,6 +109,7 @@ public class SpentCasing implements Cloneable {
|
|||||||
public float getSmokeChance() { return this.smokeChance; }
|
public float getSmokeChance() { return this.smokeChance; }
|
||||||
public float getBounceYaw() { return this.bounceYaw; }
|
public float getBounceYaw() { return this.bounceYaw; }
|
||||||
public float getBouncePitch() { return this.bouncePitch; }
|
public float getBouncePitch() { return this.bouncePitch; }
|
||||||
|
public int getMaxAge() { return this.maxAge; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SpentCasing clone() {
|
public SpentCasing clone() {
|
||||||
|
|||||||
@ -5,9 +5,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
import com.hbm.entity.projectile.EntityArtilleryShell;
|
import com.hbm.entity.projectile.EntityArtilleryShell;
|
||||||
|
import com.hbm.handler.CasingEjector;
|
||||||
import com.hbm.inventory.container.ContainerTurretBase;
|
import com.hbm.inventory.container.ContainerTurretBase;
|
||||||
import com.hbm.inventory.gui.GUITurretArty;
|
import com.hbm.inventory.gui.GUITurretArty;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.weapon.ItemAmmoArty;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
@ -210,6 +212,13 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
|
|||||||
proj.setWhistle(true);
|
proj.setWhistle(true);
|
||||||
|
|
||||||
worldObj.spawnEntityInWorld(proj);
|
worldObj.spawnEntityInWorld(proj);
|
||||||
|
|
||||||
|
casingDelay = this.casingDelay();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int casingDelay() {
|
||||||
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateConnections() {
|
protected void updateConnections() {
|
||||||
@ -333,6 +342,12 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
|
|||||||
|
|
||||||
this.didJustShoot = false;
|
this.didJustShoot = false;
|
||||||
|
|
||||||
|
if(casingDelay > 0) {
|
||||||
|
casingDelay--;
|
||||||
|
} else {
|
||||||
|
spawnCasing();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
|
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
|
||||||
@ -364,6 +379,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
|
|||||||
ItemStack conf = this.getShellLoaded();
|
ItemStack conf = this.getShellLoaded();
|
||||||
|
|
||||||
if(conf != null) {
|
if(conf != null) {
|
||||||
|
cachedCasingConfig = ItemAmmoArty.itemTypes[conf.getItemDamage()].casing;
|
||||||
this.spawnShell(conf);
|
this.spawnShell(conf);
|
||||||
this.conusmeAmmo(ModItems.ammo_arty);
|
this.conusmeAmmo(ModItems.ammo_arty);
|
||||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.jeremy_fire", 25.0F, 1.0F);
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.jeremy_fire", 25.0F, 1.0F);
|
||||||
@ -388,6 +404,18 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static CasingEjector ejector = new CasingEjector().setMotion(0, 1.2, 0.5).setAngleRange(0.1F, 0.1F);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CasingEjector getEjector() {
|
||||||
|
return ejector;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Vec3 getCasingSpawnPos() {
|
||||||
|
return this.getTurretPos();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleButtonPacket(int value, int meta) {
|
public void handleButtonPacket(int value, int meta) {
|
||||||
if(meta == 5) {
|
if(meta == 5) {
|
||||||
|
|||||||
@ -12,16 +12,20 @@ import com.hbm.entity.missile.EntitySiegeDropship;
|
|||||||
import com.hbm.entity.projectile.EntityBulletBase;
|
import com.hbm.entity.projectile.EntityBulletBase;
|
||||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||||
import com.hbm.handler.BulletConfiguration;
|
import com.hbm.handler.BulletConfiguration;
|
||||||
|
import com.hbm.handler.CasingEjector;
|
||||||
import com.hbm.interfaces.IControlReceiver;
|
import com.hbm.interfaces.IControlReceiver;
|
||||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.machine.ItemTurretBiometry;
|
import com.hbm.items.machine.ItemTurretBiometry;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
|
import com.hbm.packet.PacketDispatcher;
|
||||||
import com.hbm.particle.SpentCasing;
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.tileentity.TileEntityMachineBase;
|
import com.hbm.tileentity.TileEntityMachineBase;
|
||||||
|
|
||||||
import api.hbm.energy.IEnergyUser;
|
import api.hbm.energy.IEnergyUser;
|
||||||
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@ -216,6 +220,14 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
|||||||
NBTTagCompound data = this.writePacket();
|
NBTTagCompound data = this.writePacket();
|
||||||
this.networkPack(data, 250);
|
this.networkPack(data, 250);
|
||||||
|
|
||||||
|
if(usesCasings() && this.casingDelay() > 0) {
|
||||||
|
if(casingDelay > 0) {
|
||||||
|
casingDelay--;
|
||||||
|
} else {
|
||||||
|
spawnCasing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
|
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
|
||||||
@ -230,14 +242,6 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
|||||||
else
|
else
|
||||||
this.lastRotationYaw -= Math.PI * 2;
|
this.lastRotationYaw -= Math.PI * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(usesCasings() && this.casingDelay() > 0) {
|
|
||||||
if(casingDelay > 0) {
|
|
||||||
casingDelay--;
|
|
||||||
} else {
|
|
||||||
spawnCasing();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,10 +357,11 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
|||||||
worldObj.spawnEntityInWorld(proj);
|
worldObj.spawnEntityInWorld(proj);
|
||||||
|
|
||||||
if(usesCasings()) {
|
if(usesCasings()) {
|
||||||
if(this.casingDelay() == 0)
|
if(this.casingDelay() == 0) {
|
||||||
spawnCasing();
|
spawnCasing();
|
||||||
else
|
} else {
|
||||||
casingDelay = this.casingDelay();
|
casingDelay = this.casingDelay();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -846,20 +851,25 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
|||||||
return this.getTurretPos();
|
return this.getTurretPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected CasingEjector getEjector() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
protected void spawnCasing() {
|
protected void spawnCasing() {
|
||||||
|
|
||||||
if(cachedCasingConfig == null) return;
|
if(cachedCasingConfig == null) return;
|
||||||
|
CasingEjector ej = getEjector();
|
||||||
|
|
||||||
Vec3 spawn = this.getCasingSpawnPos();
|
Vec3 spawn = this.getCasingSpawnPos();
|
||||||
final NBTTagCompound data = new NBTTagCompound();
|
NBTTagCompound data = new NBTTagCompound();
|
||||||
data.setString("type", "casing");
|
data.setString("type", "casing");
|
||||||
data.setDouble("posX", spawn.xCoord);
|
|
||||||
data.setDouble("posY", spawn.yCoord);
|
|
||||||
data.setDouble("posZ", spawn.zCoord);
|
|
||||||
data.setFloat("pitch", (float) rotationPitch);
|
data.setFloat("pitch", (float) rotationPitch);
|
||||||
data.setFloat("yaw", (float) rotationYaw);
|
data.setFloat("yaw", (float) rotationYaw);
|
||||||
data.setBoolean("crouched", false);
|
data.setBoolean("crouched", false);
|
||||||
data.setString("name", cachedCasingConfig.getName());
|
data.setString("name", cachedCasingConfig.getName());
|
||||||
MainRegistry.proxy.effectNT(data);
|
if(ej != null) data.setInteger("ej", ej.getId());
|
||||||
|
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, spawn.xCoord, spawn.yCoord, spawn.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||||
|
|
||||||
|
cachedCasingConfig = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||||
import com.hbm.handler.BulletConfiguration;
|
import com.hbm.handler.BulletConfiguration;
|
||||||
|
import com.hbm.handler.CasingEjector;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
|
||||||
@ -73,6 +74,7 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT {
|
|||||||
BulletConfiguration conf = this.getFirstConfigLoaded();
|
BulletConfiguration conf = this.getFirstConfigLoaded();
|
||||||
|
|
||||||
if(conf != null) {
|
if(conf != null) {
|
||||||
|
this.cachedCasingConfig = conf.spentCasing;
|
||||||
this.spawnBullet(conf);
|
this.spawnBullet(conf);
|
||||||
this.conusmeAmmo(conf.ammo);
|
this.conusmeAmmo(conf.ammo);
|
||||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.chekhov_fire", 2.0F, 1.0F);
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.chekhov_fire", 2.0F, 1.0F);
|
||||||
@ -91,6 +93,24 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Vec3 getCasingSpawnPos() {
|
||||||
|
|
||||||
|
Vec3 pos = this.getTurretPos();
|
||||||
|
Vec3 vec = Vec3.createVectorHelper(-1.125, 0.125, 0.25);
|
||||||
|
vec.rotateAroundZ((float) -this.rotationPitch);
|
||||||
|
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
|
||||||
|
|
||||||
|
return Vec3.createVectorHelper(pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static CasingEjector ejector = new CasingEjector().setMotion(-0.8, 0.8, 0).setAngleRange(0.1F, 0.1F);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CasingEjector getEjector() {
|
||||||
|
return ejector;
|
||||||
|
}
|
||||||
|
|
||||||
public int getDelay() {
|
public int getDelay() {
|
||||||
return 2;
|
return 2;
|
||||||
@ -139,7 +159,11 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void manualSetup() {
|
public void manualSetup() {
|
||||||
|
|
||||||
manual = true;
|
manual = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean usesCasings() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||||
|
import com.hbm.handler.CasingEjector;
|
||||||
|
|
||||||
public class TileEntityTurretFriendly extends TileEntityTurretChekhov {
|
public class TileEntityTurretFriendly extends TileEntityTurretChekhov {
|
||||||
|
|
||||||
@ -31,4 +32,11 @@ public class TileEntityTurretFriendly extends TileEntityTurretChekhov {
|
|||||||
public int getDelay() {
|
public int getDelay() {
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static CasingEjector ejector = new CasingEjector().setMotion(-0.3, 0.6, 0).setAngleRange(0.02F, 0.05F);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CasingEjector getEjector() {
|
||||||
|
return ejector;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,9 +6,12 @@ import java.util.List;
|
|||||||
import com.hbm.config.WeaponConfig;
|
import com.hbm.config.WeaponConfig;
|
||||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||||
import com.hbm.handler.BulletConfiguration;
|
import com.hbm.handler.BulletConfiguration;
|
||||||
|
import com.hbm.handler.CasingEjector;
|
||||||
|
import com.hbm.handler.guncfg.GunDGKFactory;
|
||||||
import com.hbm.lib.ModDamageSource;
|
import com.hbm.lib.ModDamageSource;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
import com.hbm.particle.SpentCasing;
|
||||||
import com.hbm.util.EntityDamageUtil;
|
import com.hbm.util.EntityDamageUtil;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
@ -126,9 +129,16 @@ public class TileEntityTurretHoward extends TileEntityTurretBaseNT {
|
|||||||
|
|
||||||
if(loaded > 0 && this.tPos != null) {
|
if(loaded > 0 && this.tPos != null) {
|
||||||
|
|
||||||
|
SpentCasing cfg = GunDGKFactory.CASINGDGK;
|
||||||
|
|
||||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 0.9F + worldObj.rand.nextFloat() * 0.3F);
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 0.9F + worldObj.rand.nextFloat() * 0.3F);
|
||||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 1F + worldObj.rand.nextFloat() * 0.3F);
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 1F + worldObj.rand.nextFloat() * 0.3F);
|
||||||
|
|
||||||
|
for(int i = 0; i < 2; i++) {
|
||||||
|
this.cachedCasingConfig = cfg;
|
||||||
|
this.spawnCasing();
|
||||||
|
}
|
||||||
|
|
||||||
if(timer % 2 == 0) {
|
if(timer % 2 == 0) {
|
||||||
loaded--;
|
loaded--;
|
||||||
|
|
||||||
@ -174,4 +184,27 @@ public class TileEntityTurretHoward extends TileEntityTurretBaseNT {
|
|||||||
super.writeToNBT(nbt);
|
super.writeToNBT(nbt);
|
||||||
nbt.setInteger("loaded", loaded);
|
nbt.setInteger("loaded", loaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Vec3 getCasingSpawnPos() {
|
||||||
|
|
||||||
|
Vec3 pos = this.getTurretPos();
|
||||||
|
Vec3 vec = Vec3.createVectorHelper(-0.875, 0.2, -0.125);
|
||||||
|
vec.rotateAroundZ((float) -this.rotationPitch);
|
||||||
|
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
|
||||||
|
|
||||||
|
return Vec3.createVectorHelper(pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static CasingEjector ejector = new CasingEjector().setAngleRange(0.01F, 0.01F).setMotion(0, 0, -0.1);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CasingEjector getEjector() {
|
||||||
|
return ejector.setMotion(0.4, 0, 0).setAngleRange(0.02F, 0.03F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean usesCasings() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.hbm.tileentity.turret;
|
package com.hbm.tileentity.turret;
|
||||||
|
|
||||||
import com.hbm.config.WeaponConfig;
|
import com.hbm.config.WeaponConfig;
|
||||||
|
import com.hbm.handler.guncfg.GunDGKFactory;
|
||||||
import com.hbm.lib.ModDamageSource;
|
import com.hbm.lib.ModDamageSource;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
@ -70,6 +71,9 @@ public class TileEntityTurretHowardDamaged extends TileEntityTurretHoward {
|
|||||||
|
|
||||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 0.7F + worldObj.rand.nextFloat() * 0.3F);
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 0.7F + worldObj.rand.nextFloat() * 0.3F);
|
||||||
|
|
||||||
|
this.cachedCasingConfig = GunDGKFactory.CASINGDGK;
|
||||||
|
this.spawnCasing();
|
||||||
|
|
||||||
if(worldObj.rand.nextInt(100) + 1 <= WeaponConfig.ciwsHitrate * 0.5)
|
if(worldObj.rand.nextInt(100) + 1 <= WeaponConfig.ciwsHitrate * 0.5)
|
||||||
EntityDamageUtil.attackEntityFromIgnoreIFrame(this.target, ModDamageSource.shrapnel, 2F + worldObj.rand.nextInt(2));
|
EntityDamageUtil.attackEntityFromIgnoreIFrame(this.target, ModDamageSource.shrapnel, 2F + worldObj.rand.nextInt(2));
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||||
import com.hbm.handler.BulletConfiguration;
|
import com.hbm.handler.BulletConfiguration;
|
||||||
|
import com.hbm.handler.CasingEjector;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
|
||||||
@ -84,6 +85,7 @@ public class TileEntityTurretJeremy extends TileEntityTurretBaseNT {
|
|||||||
BulletConfiguration conf = this.getFirstConfigLoaded();
|
BulletConfiguration conf = this.getFirstConfigLoaded();
|
||||||
|
|
||||||
if(conf != null) {
|
if(conf != null) {
|
||||||
|
this.cachedCasingConfig = conf.spentCasing;
|
||||||
this.spawnBullet(conf);
|
this.spawnBullet(conf);
|
||||||
this.conusmeAmmo(conf.ammo);
|
this.conusmeAmmo(conf.ammo);
|
||||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.jeremy_fire", 4.0F, 1.0F);
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.jeremy_fire", 4.0F, 1.0F);
|
||||||
@ -103,4 +105,32 @@ public class TileEntityTurretJeremy extends TileEntityTurretBaseNT {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Vec3 getCasingSpawnPos() {
|
||||||
|
|
||||||
|
Vec3 pos = this.getTurretPos();
|
||||||
|
Vec3 vec = Vec3.createVectorHelper(-2, 0, 0);
|
||||||
|
vec.rotateAroundZ((float) -this.rotationPitch);
|
||||||
|
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
|
||||||
|
|
||||||
|
return Vec3.createVectorHelper(pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static CasingEjector ejector = new CasingEjector().setAngleRange(0.01F, 0.01F).setMotion(0, 0, -0.1);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CasingEjector getEjector() {
|
||||||
|
return ejector;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean usesCasings() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int casingDelay() {
|
||||||
|
return 22;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||||
import com.hbm.handler.BulletConfiguration;
|
import com.hbm.handler.BulletConfiguration;
|
||||||
|
import com.hbm.handler.CasingEjector;
|
||||||
import com.hbm.inventory.container.ContainerTurretBase;
|
import com.hbm.inventory.container.ContainerTurretBase;
|
||||||
import com.hbm.inventory.gui.GUITurretSentry;
|
import com.hbm.inventory.gui.GUITurretSentry;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
@ -164,6 +165,7 @@ public class TileEntityTurretSentry extends TileEntityTurretBaseNT implements IG
|
|||||||
BulletConfiguration conf = this.getFirstConfigLoaded();
|
BulletConfiguration conf = this.getFirstConfigLoaded();
|
||||||
|
|
||||||
if(conf != null) {
|
if(conf != null) {
|
||||||
|
this.cachedCasingConfig = conf.spentCasing;
|
||||||
this.spawnBullet(conf);
|
this.spawnBullet(conf);
|
||||||
this.conusmeAmmo(conf.ammo);
|
this.conusmeAmmo(conf.ammo);
|
||||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.sentry_fire", 2.0F, 1.0F);
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.sentry_fire", 2.0F, 1.0F);
|
||||||
@ -192,6 +194,29 @@ public class TileEntityTurretSentry extends TileEntityTurretBaseNT implements IG
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Vec3 getCasingSpawnPos() {
|
||||||
|
|
||||||
|
Vec3 pos = this.getTurretPos();
|
||||||
|
Vec3 vec = Vec3.createVectorHelper(0, 0.25,-0.125);
|
||||||
|
vec.rotateAroundZ((float) -this.rotationPitch);
|
||||||
|
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
|
||||||
|
|
||||||
|
return Vec3.createVectorHelper(pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static CasingEjector ejector = new CasingEjector().setMotion(-0.3, 0.6, 0).setAngleRange(0.01F, 0.01F);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CasingEjector getEjector() {
|
||||||
|
return ejector.setMotion(0.3, 0.6, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean usesCasings() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void seekNewTarget() {
|
protected void seekNewTarget() {
|
||||||
|
|||||||
@ -789,6 +789,7 @@ item.ammo_12gauge.name=Kaliber 12 Schrot
|
|||||||
item.ammo_12gauge_du.name=Kaliber 12 Schrot (Uranbeschichtung)
|
item.ammo_12gauge_du.name=Kaliber 12 Schrot (Uranbeschichtung)
|
||||||
item.ammo_12gauge_incendiary.name=Kaliber 12 Schrot (Brand)
|
item.ammo_12gauge_incendiary.name=Kaliber 12 Schrot (Brand)
|
||||||
item.ammo_12gauge_marauder.name=Kaliber 12 Taktische Anti-Marauder Schrotpatrone
|
item.ammo_12gauge_marauder.name=Kaliber 12 Taktische Anti-Marauder Schrotpatrone
|
||||||
|
item.ammo_12gauge_percussion.name=Kaliber 12 Sprengkapsel
|
||||||
item.ammo_12gauge_shrapnel.name=Kaliber 12 Schrot (Schrapnell)
|
item.ammo_12gauge_shrapnel.name=Kaliber 12 Schrot (Schrapnell)
|
||||||
item.ammo_12gauge_sleek.name=Kaliber 12 Schrot (IF-F&E)
|
item.ammo_12gauge_sleek.name=Kaliber 12 Schrot (IF-F&E)
|
||||||
item.ammo_20gauge.name=Kaliber 20 Schrot
|
item.ammo_20gauge.name=Kaliber 20 Schrot
|
||||||
|
|||||||
@ -1391,6 +1391,7 @@ item.ammo_12gauge.name=12 Gauge Buckshot
|
|||||||
item.ammo_12gauge_du.name=12 Gauge Buckshot (Uranium Coated)
|
item.ammo_12gauge_du.name=12 Gauge Buckshot (Uranium Coated)
|
||||||
item.ammo_12gauge_incendiary.name=12 Gauge Buckshot (Incendiary)
|
item.ammo_12gauge_incendiary.name=12 Gauge Buckshot (Incendiary)
|
||||||
item.ammo_12gauge_marauder.name=12 Gauge Tactical Anti-Marauder Shell
|
item.ammo_12gauge_marauder.name=12 Gauge Tactical Anti-Marauder Shell
|
||||||
|
item.ammo_12gauge_percussion.name=12 Gauge Percussion Cap
|
||||||
item.ammo_12gauge_shrapnel.name=12 Gauge Buckshot (Shrapnel)
|
item.ammo_12gauge_shrapnel.name=12 Gauge Buckshot (Shrapnel)
|
||||||
item.ammo_12gauge_sleek.name=12 Gauge Buckshot (IF-R&D)
|
item.ammo_12gauge_sleek.name=12 Gauge Buckshot (IF-R&D)
|
||||||
item.ammo_20gauge.name=20 Gauge Buckshot
|
item.ammo_20gauge.name=20 Gauge Buckshot
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Loading…
x
Reference in New Issue
Block a user