BombClusterInc_No16
I managed to get it into working stage.
1. By adding a correct missing spawner into Mesh and
2. change part of Java to sth. like in working AN/M Clusters. Since i.e. 4lbs Inc Mk.IV is practically AN-M50
// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov Date: 26.08.2022 11:03:28
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: fullnames
// Source File Name: BombClusterInc_No16.java
package com.maddox.il2.objects.weapons;
import com.maddox.JGP.Point3d;
import com.maddox.JGP.Tuple3d;
import com.maddox.JGP.Vector3d;
import com.maddox.il2.ai.DifficultySettings;
import com.maddox.il2.ai.RangeRandom;
import com.maddox.il2.ai.World;
import com.maddox.il2.engine.Actor;
import com.maddox.il2.engine.ActorMesh;
import com.maddox.il2.engine.ActorPos;
import com.maddox.il2.engine.Config;
import com.maddox.il2.engine.Eff3DActor;
import com.maddox.il2.engine.Hook;
import com.maddox.il2.engine.Loc;
import com.maddox.il2.engine.Orient;
import com.maddox.rts.Property;
import com.maddox.rts.Time;
import com.maddox.sound.AudioStream;
import com.maddox.sound.SoundFX;
import com.maddox.sound.SoundPreset;
// Referenced classes of package com.maddox.il2.objects.weapons:
// Bomb, , Fuze
public class BombClusterInc_No16 extends com.maddox.il2.objects.weapons.Bomb
{
public BombClusterInc_No16()
{
}
public void start()
{
super.start();
charge = 0;
setStartDelayedExplosion(true);
if(super.fuze == null)
t1 = com.maddox.rts.Time.current() + 1000L;
else
if(super.delayExplosion == 0.0F)
t1 = com.maddox.rts.Time.current() + 200L;
else
t1 = com.maddox.rts.Time.current() + (long)(1000F * super.delayExplosion);
}
public void interpolateTick()
{
super.interpolateTick();
if(t1 < com.maddox.rts.Time.current())
doFireContaineds();
}
public void msgCollision(com.maddox.il2.engine.Actor actor, java.lang.String s, java.lang.String s1)
{
super.msgCollision(actor, s, s1);
if(isArmed())
doFireContaineds();
else
destroy();
}
private void ExplodeCharge(com.maddox.JGP.Point3d point3d)
{
if(!com.maddox.il2.engine.Config.isUSE_RENDER())
{
return;
} else
{
o.set(0.0F, 0.0F, 0.0F);
l.set(point3d, o);
java.lang.String s = "effects/Explodes/Air/Zenitka/US_Frag/";
FragChargeSound(point3d);
float f = -1F;
com.maddox.il2.engine.Eff3DActor.New(l, 1.0F, s + "Sparks.eff", f);
com.maddox.il2.engine.Eff3DActor.New(l, 1.0F, s + "SparksP.eff", f);
return;
}
}
private void FragChargeSound(com.maddox.JGP.Point3d point3d)
{
com.maddox.sound.SoundPreset soundpreset = new SoundPreset("explode.bullet");
com.maddox.sound.SoundFX soundfx = new SoundFX(soundpreset);
soundfx.setPosition(point3d);
soundfx.setUsrFlag(1);
soundfx.play();
}
private void doFireContaineds()
{
charge++;
if(charge < 2)
{
com.maddox.il2.engine.Actor actor = getOwner();
if(!com.maddox.il2.engine.Actor.isValid(actor))
return;
com.maddox.JGP.Point3d point3d = new Point3d();
com.maddox.il2.engine.Orient orient = new Orient();
com.maddox.JGP.Vector3d vector3d = new Vector3d();
com.maddox.JGP.Vector3d vector3d1 = new Vector3d();
com.maddox.il2.engine.Loc loc = new Loc();
com.maddox.il2.engine.Loc loc1 = new Loc(0.0D, 0.0D, 0.0D, 0.0F, 0.0F, 0.0F);
super.pos.getCurrent(loc);
findHook("_Spawn0" + charge).computePos(this, loc, loc1);
getSpeed(vector3d1);
for(int i = 0; i < 235; i++)
{
loc1.get(point3d, orient);
orient.increment(com.maddox.il2.ai.World.Rnd().nextFloat(-90F, 90F), com.maddox.il2.ai.World.Rnd().nextFloat(45F, 135F), com.maddox.il2.ai.World.Rnd().nextFloat(0.0F, 0.0F));
vector3d.set(1.0D, 0.0D, 0.0D);
orient.transform(vector3d);
vector3d.scale(com.maddox.il2.ai.World.Rnd().nextDouble(0.001D, 5.0000000000000027D));
vector3d.add(vector3d1);
com.maddox.il2.objects.weapons.Bomb4lbInc_AN_M50 Bomb4lbInc_AN_M50 = new Bomb4lbInc_AN_M50();
((com.maddox.il2.engine.Actor) (Bomb4lbInc_AN_M50)).pos.setUpdateEnable(true);
((com.maddox.il2.engine.Actor) (Bomb4lbInc_AN_M50)).pos.setAbs(point3d, orient);
((com.maddox.il2.engine.Actor) (Bomb4lbInc_AN_M50)).pos.reset();
Bomb4lbInc_AN_M50.start();
Bomb4lbInc_AN_M50.setOwner(actor, false, false, false);
Bomb4lbInc_AN_M50.setSpeed(vector3d);
if(com.maddox.il2.ai.World.cur().diffCur.BombFuzes)
try
{
Bomb4lbInc_AN_M50.setFuse((com.maddox.il2.objects.weapons.Fuze)com.maddox.il2.objects.weapons.Fuze_instant.class.newInstance());
}
catch(java.lang.InstantiationException instantiationexception)
{
instantiationexception.printStackTrace();
}
catch(java.lang.IllegalAccessException illegalaccessexception)
{
illegalaccessexception.printStackTrace();
}
setMesh("3DO/Arms/ClusterInc_No16_MkII/Open2/mono.sim");
drawing(true);
}
}
}
private long t1;
private int charge;
private static com.maddox.il2.engine.Loc l = new Loc();
private static com.maddox.il2.engine.Orient o = new Orient();
private float ttcurTM;
static
{
java.lang.Class class1 = com.maddox.il2.objects.weapons.BombClusterInc_No16.class;
com.maddox.rts.Property.set(class1, "mesh", "3DO/Arms/ClusterInc_No16_MkII/mono.sim");
com.maddox.rts.Property.set(class1, "power", 0.0F);
com.maddox.rts.Property.set(class1, "powerType", 0);
com.maddox.rts.Property.set(class1, "kalibr", 0.45F);
com.maddox.rts.Property.set(class1, "massa", 424F);
com.maddox.rts.Property.set(class1, "sound", "weapon.bomb_std");
com.maddox.rts.Property.set(class1, "fuze", ((java.lang.Object) (new java.lang.Object[] {
com.maddox.il2.objects.weapons.Fuze_fragBundle.class
})));
}
}
AN/M with M-50 inlets, it is perfect for our Game.