I realized this, I made some changes .. looks the new code:
package java.game.parts.engines.mazdana8c;
import java.util.*;
import java.util.resource.*;
import java.game.*;
import java.game.parts.*;
import java.game.parts.enginepart.*;
import java.game.parts.enginepart.block.block_inline.*;
import java.game.parts.enginepart.slidingenginepart.reciprocatingenginepart.*;
import java.game.cars.*;
public class mazdana8c extends Block_Inline_OHC
{
public mazdana8c( int id )
{
super( id );
name = "mazdana8c";
description = "mazdana8c teste";
value = tHUF2USD(120);
brand_new_prestige_value = 38.32;
setMaxWear(kmToMaxWear(420000.0));
bore = 89.0;
cylinder_length_from_top = 133.43;
crank_center_to_cylinder_top = 280.60;
crankshaft_slot_ID = 40;
transmission_slot_ID = 1;
crankshaft_bearing_slot_ID = 97;
oil_pan_slot_ID = 37;
cylinder_head_slot_ID = 47;
rpm_idle = 900.0;
time_spark_min = sparkAngleTo4cycleTime(330.0);
time_spark_inc = sparkAngleTo4cycleTime(335.0)-time_spark_min;
time_spark_RPM0 = 3250;
time_spark_RPM1 = 5750;
RPM_limit = 11000;
cylinders = 4;
check4warnings();
}
public void updatevariables()
{
super.updatevariables();
getTurboType();
// includes code by NightRiderBR //
// ALL SOUNDS BY ELECTRONIC ARTS, SIMBIN, OR INVICTUS GAMES //
if (the_car)
{
SfxTable tab;
if (tab = the_car.getSfxTable(0))
{
tab.clear();
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000000A0r), 900.0, 500.0, 1800.0, 0.22, 0.22);
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000000A2r), 2000.0, 1000.0, 3000.0, 0.22, 0.32);
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000000A4r), 3000.0, 2000.0, 5500.0, 0.32, 0.42);
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000000A9r), 5500.0, 3500.0,18000.0, 0.42, 0.50);
}
if (tab = the_car.getSfxTable(1))
{
tab.clear();
if (dynodata.P_turbo_max > 0.0)
{
if (dynodata.P_turbo_waste >= 0.75)
{
if (this.turbotype == 2)
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000001AEr), 8000.0, 6000.0, 12000.0, (1.25*dynodata.P_turbo_waste), (1.25*dynodata.P_turbo_waste));
else
if (this.turbotype == 4)
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000001AFr), 7000.0, 5000.0, 12000.0, (1.5*dynodata.P_turbo_waste), (1.5*dynodata.P_turbo_waste));
}
}
if (dynodata.mixture_ratio <= 11.5 )
{
if (dynodata.mixture_ratio <= 9.5 )
{
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000001B2r), 5500.0, 4500.0, 12000.0, 0.80, 1.20);
}
else
{
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000001B1r), 5500.0, 4500.0, 12000.0, 0.80, 1.20);
}
}
}
if (tab = the_car.getSfxTable(2))
{
tab.clear();
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000000ABr), 900.0, 150.0, 1350.0, 2.0, 2.0);
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000000ACr), 4500.0, 1000.0, 2300.0, 0.5, 0.5);
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000000AEr), 6000.0, 1600.0, 3500.0, 1.0, 1.0);
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000000B1r), 6000.0, 2500.0,18000.0, 1.0, 1.0);
if (dynodata.P_turbo_waste >= 0.5)
{
if (this.turbotype == 1)
{
tab.addItem(new ResourceRef(parts.engines.General_Motors_L44:0x000001B3r), 5000.0, 800.0, 12000.0, 1.00, 1.00);
}
}
the_car.setSfxExhaustMinVol(0.8);
}
}
}
public String isDynoable()
{
Part p;
p = partOnSlot( 14 );
if (!p)
return "the engine is missing the alternator.";
return super.isDynoable();
}
}