Here's the new method for generating the napalm effects that I've added to Explosions.class:
public static void generateNapalm(Actor actor, Point3d point3d)
{
if (Config.isUSE_RENDER())
{
Loc loc = new Loc(point3d);
o.set(0.0F, 90.0F, 0.0F);
loc.set(point3d, o);
Vector3d vector3d = new Vector3d();
float sizeScale = TrueRandom.nextFloat(0.75F, 1.0F);
Eff3DActor.New(loc, sizeScale, "3DO/Effects/Fireworks/Napalm_Burn.eff", -1F);
Eff3DActor.New(loc, sizeScale, "3DO/Effects/Fireworks/Napalm_Smoke.eff", -1F);
float tim = TrueRandom.nextFloat(45F, 120F);
if (World.Sun().ToSun.z < 0.0F)
{
float scaleLight = MiscEffects.cvt(World.Sun().ToSun.z, -0.25F, 0.0F, 1.0F, 0.5F);
Eff3DActor eff3dactor = Eff3DActor.New(loc, 1.0F, "Effects/Explodes/Cannon/Object/light.eff", 8F);
eff3dactor.postDestroy(Time.current() + 8000L);
LightPointActor lightpointactor = new LightPointActor(new LightPointWorld(), new Point3d());
lightpointactor.light.setColor(1.0F, 0.6F, 0.2F);
lightpointactor.light.setEmit(0.33F * scaleLight, 300F * scaleLight);
eff3dactor.draw.lightMap().put("light", lightpointactor);
}
if (TrueRandom.nextFloat() < 0.33F)
{
int i_1 = TrueRandom.nextInt(3, 6);
for (int i = 0; i < i_1; i++)
{
vector3d.set(TrueRandom.nextDouble(-22D, 22D), TrueRandom.nextDouble(-22D, 22D), TrueRandom.nextDouble(24D, 7D));
BallisticProjectile ballisticprojectile = new BallisticProjectile(point3d, vector3d, TrueRandom.nextFloat(3F, 5F));
Eff3DActor.New(ballisticprojectile, null, null, 1.0F, "3DO/Effects/Fireworks/Napalm.eff", -1F);
Eff3DActor.New(ballisticprojectile, null, null, 1.0F, "3DO/Effects/Fireworks/Napalm_Smokes.eff", -1F);
}
Eff3DActor.New(loc, 1.0F, "3DO/Effects/Fireworks/Napalm_Persistent_Smoke.eff", tim);
}
int i_3 = TrueRandom.nextInt(2, 5);
for (int i_2 = 0; i_2 < i_3; i_2++)
{
Point3d point3d_3 = new Point3d(point3d);
float d = (float)World.Rnd().nextGaussian() * 10F;
if (Math.abs(d) > 20F)
d /= 2F;
point3d_3.x += d;
d = (float)World.Rnd().nextGaussian() * 10F;
if (Math.abs(d) > 20F)
d /= 2F;
point3d_3.y += d;
World.cur();
point3d_3.z = World.land().HQ(point3d_3.x, point3d_3.y);
Loc loc_3 = new Loc(point3d_3);
o.set(0.0F, 90.0F, 0.0F);
loc_3.set(point3d_3, o);
Eff3DActor.New(loc_3, TrueRandom.nextFloat(0.5F, 0.9F), "Effects/Explodes/Objects/House/FuelSmall/Boiling2.eff", tim * TrueRandom.nextFloat(0.6F, 1.0F));
}
}
}
The foregoing new method is called by method generate() in the same Explosions.class. I've created the code below, inside existing method generate(), so as to differentiate reliably between the three basic types of NAPALM (incendiary, really) ordnance; napalm, phosphorous and other incendiaries. Note the total of six NEW methods (of which generateNapalm is one) created so as to generate properly unique effects for the ordnance. The initial check for "i == 2" denotes the weapons of type 'NAPALM' (incediaries). "f" is the power value in the weapon's class, and "f1" is the radius for the explosive effect. I've expanded upon the scheme already in use, which principally differentiates between the three incendiary types by the radius (f1) value. It's not particularly elegant, and there's limited room to get clever. But I've adhered to the basic framework and it works well enough now.
if (i == 2)
{
if (f == 0.0F && f1 == 0.0F)
{
generateIncendiaryBomblet(actor, point3d);
return;
}
if (f1 > 0.0F && f1 < 3.0F)
{
if (f < 1.0F) //f = power
{
generateWPBurstSmall(actor, point3d);
f = 4.0F;
}
else //if (f >= 1.0F)
{
generateWPBurstLarge(actor, point3d);
f = 15.0F;
}
}
if (f1 >= 3.0F && f1 < 50F)
{
if (f < 4.0F)
{
generateIncendiarySmall(actor, point3d);
f = 0.5F;
}
else //if (f >= 4.0F)
{
generateIncendiaryLarge(actor, point3d);
f = 4.0F;
}
}
if (f1 >= 50.0F)
{
generateNapalm(actor, point3d);
return;
}
}
For comparison, here's the stock treatment of the preceding. It is much simpler, using one basic "Termit1" effect (randomly selected from two variations), and if the radius value is >= 3 some 36 ballistic particles are created and which emit the "PhosfourousFire" effect. Extremely limited.
if(i == 2)
{
if(f1 < 3F)
{
switch(World.rnd().nextInt(1, 2))
{
case 1: // '\001'
Eff3DActor.New(actor, null, rel, 1.0F, "3DO/Effects/Fireworks/Termit1W.eff", 10F);
break;
case 2: // '\002'
Eff3DActor.New(actor, null, rel, 1.0F, "3DO/Effects/Fireworks/Termit1SM.eff", -1F);
break;
}
} else
{
Vector3d vector3d = new Vector3d();
for(int j = 0; j < 36; j++)
{
vector3d.set(World.rnd().nextDouble(-20D, 20D), World.rnd().nextDouble(-20D, 20D), World.rnd().nextDouble(3D, 20D));
float f2 = World.rnd().nextFloat(3F, 15F);
BallisticProjectile ballisticprojectile = new BallisticProjectile(point3d, vector3d, f2);
Eff3DActor.New(ballisticprojectile, null, null, 1.0F, "3DO/Effects/Fireworks/PhosfourousFire.eff", f2);
}
}
return;
}