Цитата:
Сообщение от Vasya
Если я завтра буду не на работе - то расширенный код для повреждения мотора в основной класс Якам допишу.
|
Тут:
-
http://forum.aviaskins.com/showpost....postcount=6629 -
внутри архива есть хеш AAF46F6E19676E80 - это YAK.class.
В нём переписал повреждения мотора и пропеллера. За основу брал повреждения Мессера.
Вот то что получилось:
Код:
if(s.startsWith("xxeng1"))
{
Aircraft.debugprintln(this, "*** Engine Module: Hit..");
if(s.endsWith("prop"))
{
if(getEnergyPastArmor(0.1F, shot) > 0.0F && World.Rnd().nextFloat() < 0.8F)
if(World.Rnd().nextFloat() < 0.5F)
{
((FlightModelMain) (super.FM)).AS.setEngineSpecificDamage(shot.initiator, 0, 3);
Aircraft.debugprintln(this, "*** Engine Module: Prop Governor Hit, Disabled..");
} else
{
((FlightModelMain) (super.FM)).AS.setEngineSpecificDamage(shot.initiator, 0, 4);
Aircraft.debugprintln(this, "*** Engine Module: Prop Governor Hit, Damaged..");
}
}
if((s.endsWith("cyl1") || s.endsWith("cyl2")) && getEnergyPastArmor(World.Rnd().nextFloat(0.5F, 2.542F), shot) > 0.0F && World.Rnd().nextFloat() < FM.EI.engines[0].getCylindersRatio() * 1.72F)
{
FM.EI.engines[0].setCyliderKnockOut(shot.initiator, World.Rnd().nextInt(1, (int)(shot.power / 6000F)));
debugprintln(this, "*** Engine Cylinders Hit, " + FM.EI.engines[0].getCylindersOperable() + "/" + FM.EI.engines[0].getCylinders() + " Left..");
if(World.Rnd().nextFloat() < 0.01F)
{
FM.EI.engines[0].setEngineStuck(shot.initiator);
debugprintln(this, "*** Engine Cylinder Case Broken - Engine Stuck..");
}
if(World.Rnd().nextFloat() < shot.power / 24000F)
{
FM.AS.hitEngine(shot.initiator, 0, 3);
debugprintln(this, "*** Engine Cylinders Hit - Engine Fires..");
}
getEnergyPastArmor(World.Rnd().nextFloat(3F, 25F), shot);
}
if(s.endsWith("case"))
{
if(getEnergyPastArmor(4.1F, shot) > 0.0F)
{
if(World.Rnd().nextFloat() < shot.power / 175000F)
{
FM.AS.setEngineStuck(shot.initiator, 0);
debugprintln(this, "*** Engine Crank Case Hit - Engine Stucks..");
}
if(World.Rnd().nextFloat() < shot.power / 50000F)
{
FM.AS.hitEngine(shot.initiator, 0, 2);
debugprintln(this, "*** Engine Crank Case Hit - Engine Damaged..");
}
if(World.Rnd().nextFloat() < shot.power / 28000F)
{
FM.EI.engines[0].setCyliderKnockOut(shot.initiator, 1);
debugprintln(this, "*** Engine Crank Case Hit - Cylinder Feed Out, " + FM.EI.engines[0].getCylindersOperable() + "/" + FM.EI.engines[0].getCylinders() + " Left..");
}
if(World.Rnd().nextFloat() < shot.power / 175000F)
{
((FlightModelMain) (super.FM)).AS.setEngineStuck(shot.initiator, 0);
Aircraft.debugprintln(this, "*** Engine Module: Bullet Jams Crank Ball Bearing..");
}
if(World.Rnd().nextFloat() < shot.power / 50000F)
{
((FlightModelMain) (super.FM)).AS.hitEngine(shot.initiator, 0, 2);
Aircraft.debugprintln(this, "*** Engine Module: Crank Case Hit, Readyness Reduced to " + ((FlightModelMain) (super.FM)).EI.engines[0].getReadyness() + "..");
}
((FlightModelMain) (super.FM)).EI.engines[0].setReadyness(shot.initiator, ((FlightModelMain) (super.FM)).EI.engines[0].getReadyness() - World.Rnd().nextFloat(0.0F, shot.power / 48000F));
Aircraft.debugprintln(this, "*** Engine Module: Crank Case Hit, Readyness Reduced to " + ((FlightModelMain) (super.FM)).EI.engines[0].getReadyness() + "..");
}
getEnergyPastArmor(22.5F, shot);
} else
if(s.endsWith("supc") && getEnergyPastArmor(0.05F, shot) > 0.0F && World.Rnd().nextFloat() < 0.89F)
{
FM.EI.engines[0].setKillCompressor(shot.initiator);
debugprintln(this, "*** Engine Supercharger Out..");
}
if(s.endsWith("eqpt") && getEnergyPastArmor(World.Rnd().nextFloat(0.001F, 0.2F), shot) > 0.0F && World.Rnd().nextFloat() < 0.89F)
{
if(World.Rnd().nextFloat() < 0.11F)
{
FM.EI.engines[0].setMagnetoKnockOut(shot.initiator, World.Rnd().nextInt(0, 1));
debugprintln(this, "*** Engine Magneto Out..");
}
if(World.Rnd().nextFloat() < 0.11F)
{
FM.EI.engines[0].setKillCompressor(shot.initiator);
debugprintln(this, "*** Engine Compressor Feed Out..");
}
}
return;
}
Не утверждаю что это ПРАВИЛЬНО. Нужно тестить, подставлять под обстрел и смотреть как работает написанный код.
Некоторые места чуть усилены., повреждения прописаны в последовательности как я ВИЖУ.
Моментами есть дубляж функций - как бы сохраняеться выбор для движка Ила что ломать в моторе при попаданиях в оный.
Повреждения пропеллера взяты от БФ-109 полностью.