variable contamination range for MK4 explosion

This commit is contained in:
Boblet 2020-08-07 10:45:42 +02:00
parent 7af43a14fa
commit e035b20dd3
2 changed files with 20 additions and 7 deletions

View File

@ -179,8 +179,9 @@ public class NukeCustom extends BlockContainer implements IBomb {
hydro += nuke / 2 + tnt / 4;
hydro = Math.min(hydro, 350);
dirty *= 0.25F;
worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int)hydro, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5));
worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int)hydro, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).moreFallout((int)dirty));
worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, hydro));
/// NUCLEAR ///
@ -189,7 +190,7 @@ public class NukeCustom extends BlockContainer implements IBomb {
nuke += tnt / 2;
nuke = Math.min(nuke, 200);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int)nuke, xCoord + 0.5, yCoord + 5, zCoord + 0.5));
worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int)nuke, xCoord + 0.5, yCoord + 5, zCoord + 0.5).moreFallout((int)dirty));
worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(worldObj, xCoord + 0.5, yCoord + 5, zCoord + 0.5, nuke));
/// NON-NUCLEAR ///

View File

@ -23,6 +23,7 @@ public class EntityNukeExplosionMK4 extends Entity {
public int length;
public boolean fallout = true;
private int falloutAdd = 0;
ExplosionNukeRay explosion;
@ -92,7 +93,7 @@ public class EntityNukeExplosionMK4 extends Entity {
fallout.posX = this.posX;
fallout.posY = this.posY;
fallout.posZ = this.posZ;
fallout.setScale((int)(this.length * 1.8) * MainRegistry.falloutRange / 100);
fallout.setScale((int)(this.length * 1.8 + falloutAdd) * MainRegistry.falloutRange / 100);
this.worldObj.spawnEntityInWorld(fallout);
@ -108,14 +109,20 @@ public class EntityNukeExplosionMK4 extends Entity {
}
@Override
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
protected void readEntityFromNBT(NBTTagCompound nbt) {
/*strength = nbt.getInteger("strength");
count = nbt.getInteger("count");
speed = nbt.getInteger("speed");
length = nbt.getInteger("length");
fallout = nbt.getBoolean("fallout");
falloutAdd = nbt.getInteger("falloutAdd");*/
//TODO: implement NBT functionality for MK4 explosion logic
}
@Override
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
}
protected void writeEntityToNBT(NBTTagCompound nbt) { }
public static EntityNukeExplosionMK4 statFac(World world, int r, double x, double y, double z) {
@ -168,5 +175,10 @@ public class EntityNukeExplosionMK4 extends Entity {
mk4.fallout = false;
return mk4;
}
public EntityNukeExplosionMK4 moreFallout(int fallout) {
falloutAdd = fallout;
return this;
}
}