Звичайна людина на Землі
Регистрация: 06.11.2011
Адрес: Україна, м.Київ, Печерський район, вул. Кіквідзе
Сообщений: 8,085
|
Или же такая конструкция:
PHP код:
// Source File Name: RocketX7homing_Langstrecken.java
package com.maddox.il2.objects.weapons;
import com.maddox.JGP.*;
import com.maddox.JGP.Point3d;
import com.maddox.JGP.Vector3d;
import com.maddox.il2.ai.World;
import com.maddox.il2.ai.*;
import com.maddox.il2.ai.air.*;
import com.maddox.il2.engine.*;
import com.maddox.il2.fm.FlightModel;
import com.maddox.il2.fm.RealFlightModel;
import com.maddox.il2.game.Main3D;
import com.maddox.il2.game.Selector;
import com.maddox.il2.objects.air.Aircraft;
import com.maddox.il2.objects.air.TypeX4Carrier;
import com.maddox.rts.*;
// Referenced classes of package com.maddox.il2.objects.weapons:
// RocketX4_F
public class RocketX7homing_Langstrecken extends RocketX4_F
{
public boolean interpolateStep()
{
float f = Time.tickLenFs();
float f1 = (float)getSpeed((Vector3d)null);
f1 += (320F - f1) * 0.1F * f;
pos.getAbs(p, or);
v.set(1.0D, 0.0D, 0.0D);
or.transform(v);
v.scale(f1);
setSpeed(v);
p.x += v.x * (double)f;
p.y += v.y * (double)f;
p.z += v.z * (double)f;
if(isNet() && isNetMirror())
{
pos.setAbs(p, or);
return false;
}
if(Time.current() > tStart + 350L)
if(victim == null || !Actor.isValid(victim))
{
victim = NearestTargets.getEnemy(0, -1, p, 10000D, getOwner().getArmy());
} else
{
victim.pos.getAbs(pT);
pT.sub(p);
or.transformInv(pT);
if(pT.x > 0.0D)
{
if(pT.y > 0.10000000000000001D)
deltaAzimuth = -1F;
if(pT.y < -0.10000000000000001D)
deltaAzimuth = 1.0F;
if(pT.z < -0.10000000000000001D)
deltaTangage = -1F;
if(pT.z > 0.10000000000000001D)
deltaTangage = 1.0F;
or.increment(45F * f * deltaAzimuth, 45F * f * deltaTangage, 720F * f);
deltaAzimuth = deltaTangage = 0.0F;
} else
{
victim = null;
}
}
pos.setAbs(p, or);
return false;
}
public RocketX7homing_Langstrecken()
{
evasive = false;
victim = null;
fm = null;
tStart = 0L;
deltaAzimuth = 0.0F;
deltaTangage = 0.0F;
victim = null;
}
public RocketX7homing_Langstrecken(Actor actor, NetChannel netchannel, int i, Point3d point3d, Orient orient, float f)
{
evasive = false;
victim = null;
fm = null;
tStart = 0L;
net = new RocketX4_F.Mirror(this, netchannel, i);
pos.setAbs(point3d, orient);
pos.reset();
pos.setBase(actor, (Hook)null, true);
doStart(-1F);
v.set(1.0D, 0.0D, 0.0D);
orient.transform(v);
v.scale(f);
setSpeed(v);
collide(false);
}
public void start(float f, int i)
{
Actor actor = pos.base();
if(isValid(actor) && (actor instanceof Aircraft))
{
if(actor.isNetMirror())
{
destroy();
return;
}
net = new RocketX4_F.Master(this);
}
doStart(f);
}
private void doStart(float f)
{
super.start(-1F, 0);
fm = ((Aircraft)getOwner()).FM;
tStart = Time.current();
if(Config.isUSE_RENDER())
flame.drawing(true);
pos.getAbs(p, or);
or.setYPR(or.getYaw(), or.getPitch(), 0.0F);
pos.setAbs(p, or);
if(isNet() && isNetMirror())
return;
if(Config.isUSE_RENDER())
{
breakSounds();
Eff3DActor.setIntesity(super.smoke, 0.0F);
Eff3DActor.setIntesity(super.sprite, 0.0F);
super.flame.drawing(false);
super.light.light.setEmit(0.0F, 0.0F);
}
}
protected void doExplosion(Actor actor, String s)
{
super.pos.getTime(Time.current(), p);
MsgExplosion.send(actor, s, p, getOwner(), 45F, 1.0F, 1, 400F);
super.doExplosion(actor, s);
}
protected void doExplosionAir()
{
super.pos.getTime(Time.current(), p);
MsgExplosion.send((Actor)null, (String)null, p, getOwner(), 45F, 1.0F, 1, 400F);
super.doExplosionAir();
}
static java.lang.Class _mthclass$(java.lang.String s)
{
java.lang.Class class1;
try
{
class1 = java.lang.Class.forName(s);
}
catch(java.lang.ClassNotFoundException classnotfoundexception)
{
throw new NoClassDefFoundError(classnotfoundexception.getMessage());
}
return class1;
}
private FlightModel fm;
private static Orient or = new Orient();
private static Point3d p = new Point3d();
private static Point3d pT = new Point3d();
private static Vector3d v = new Vector3d();
private long tStart;
private float deltaAzimuth;
private float deltaTangage;
private float deltaX;
private Actor victim;
private boolean evasive;
private static AirGroup airgroup = null;
private static Pilot pilot = null;
static
{
Class class1 = com.maddox.il2.objects.weapons.RocketX7homing_Langstrecken.class;
Property.set(class1, "timeLife", 400F);
Property.set(class1, "timeFire", 200F);
Property.set(class1, "radius", 58F);
Property.set(class1, "force", 15712F);
Property.set(class1, "power", 17.5F);
Property.set(class1, "powerType", 1);
Property.set(class1, "kalibr", 0.22F);
Property.set(class1, "massa", 90F);
Property.set(class1, "massaEnd", 67.5F);
Spawn.add(class1, new RocketX4_F.SPAWN());
}
}
Последний раз редактировалось Vasya; 28.11.2015 в 08:20.
|