Вот так пока сделал:
Код:
if(s.startsWith("xxeng1"))
{
if(s.endsWith("prop") && getEnergyPastArmor(World.Rnd().nextFloat(0.0F, 0.5F), shot) > 0.0F)
{
FM.EI.engines[0].setKillPropAngleDevice(shot.initiator);
Aircraft.debugprintln(this, "*** Engine Prop Governor Failed..");
}
if(s.endsWith("gear") && getEnergyPastArmor(World.Rnd().nextFloat(0.0F, 1.1F), shot) > 0.0F)
{
FM.EI.engines[0].setKillPropAngleDeviceSpeeds(shot.initiator);
Aircraft.debugprintln(this, "*** Engine Prop Governor Damaged..");
}
if(s.endsWith("case"))
{
if(getEnergyPastArmor(World.Rnd().nextFloat(0.0F, 6.8F), shot) > 0.0F)
{
if(World.Rnd().nextFloat() < shot.power / 200000F)
{
FM.AS.setEngineStuck(shot.initiator, 0);
Aircraft.debugprintln(this, "*** Engine Crank Case Hit - Engine Stucks..");
}
if(World.Rnd().nextFloat() < shot.power / 50000F)
{
FM.AS.hitEngine(shot.initiator, 0, 2);
Aircraft.debugprintln(this, "*** Engine Crank Case Hit - Engine Damaged..");
}
if(World.Rnd().nextFloat() < shot.power / 28000F)
{
FM.EI.engines[0].setCyliderKnockOut(shot.initiator, 1);
Aircraft.debugprintln(this, "*** Engine Crank Case Hit - Cylinder Feed Out, " + FM.EI.engines[0].getCylindersOperable() + "/" + FM.EI.engines[0].getCylinders() + " Left..");
}
if(World.Rnd().nextFloat() < 0.08F)
{
FM.EI.engines[0].setEngineStuck(shot.initiator);
Aircraft.debugprintln(this, "*** Engine Crank Case Hit - Ball Bearing Jammed - Engine Stuck..");
}
FM.EI.engines[0].setReadyness(shot.initiator, FM.EI.engines[0].getReadyness() - World.Rnd().nextFloat(0.0F, shot.power / 48000F));
Aircraft.debugprintln(this, "*** Engine Crank Case Hit - Readyness Reduced to " + FM.EI.engines[0].getReadyness() + "..");
}
if(World.Rnd().nextFloat() < 0.01F)
{
FM.EI.engines[0].setEngineStops(shot.initiator);
Aircraft.debugprintln(this, "*** Engine Crank Case Hit - Engine Stalled..");
}
if(World.Rnd().nextFloat() < 0.01F)
{
FM.AS.hitEngine(shot.initiator, 0, 10);
Aircraft.debugprintln(this, "*** Engine Crank Case Hit - Fuel Feed Hit - Engine Flamed..");
}
getEnergyPastArmor(6F, shot);
}
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 / 4800F)));
Aircraft.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);
Aircraft.debugprintln(this, "*** Engine Cylinder Case Broken - Engine Stuck..");
}
if(World.Rnd().nextFloat() < shot.power / 24000F)
{
FM.AS.hitEngine(shot.initiator, 0, 3);
Aircraft.debugprintln(this, "*** Engine Cylinders Hit - Engine Fires..");
}
getEnergyPastArmor(World.Rnd().nextFloat(3F, 46.7F), shot);
}
if(s.startsWith("xxoil1"))
{
if(getEnergyPastArmor(0.1F, shot) > 0.0F && World.Rnd().nextFloat() < 0.25F)
{
FM.AS.hitOil(shot.initiator, 0);
debuggunnery("Engine Module: Oil Radiator Pierced..");
}
getEnergyPastArmor(0.22F, shot);
}