Below is the first part of randomfail(). It seems to me that variable "season" cannot modify the rate of failure. It's supposed to double the probability for desert and winter maps. But "enginerandom" is always determined when "season" = 0; the value of 500 (for desert/winter) is applied AFTERWARD, where it has no role to play. And even then, each system is tested against a particular value, which intrinsically has the same probability of matching, which here is 1 in 1,000.
private void randomfail()
{
Random random = new Random();
int randomvalue = random.nextInt(1000);
int enginenum = random.nextInt(3);
int enginenumlog = enginenum + 1;
float f = World.Rnd().nextFloat();
float season = 0.0F;
float enginerandom = (float)randomvalue - season; //(0 to 1000) - 0, or 0 to 1000; (0 to 1000) - 500, or 500 to -500
if(World.cur().camouflage == 2 || World.cur().camouflage == 1) //desert or winter
season = 500F;
else
season = 0.0F;
if(enginerandom == 10F)
{
((FlightModelMain) (super.FM)).EI.engines[0].setEngineStops(this);
super.playSound("weapon.MGunMk108s", true);
}
Not tested, but something like this (which can use cleaning up for elegance!) would double the chance of failure for desert and winter maps, where the probability becomes 1 in 500 versus 1 in 1,000 for all other maps:
private void randomfail()
{
Random random = new Random();
int randomvalue;
if(World.cur().camouflage == 2 || World.cur().camouflage == 1)
{
randomvalue = random.nextInt(500);
float enginerandom = (float)randomvalue;
}
else
{
randomvalue = random.nextInt(1000);
float enginerandom = (float)randomvalue;
}
int enginenum = random.nextInt(3);
int enginenumlog = enginenum + 1;
float f = World.Rnd().nextFloat();
if(enginerandom == 10F)
{
((FlightModelMain) (super.FM)).EI.engines[0].setEngineStops(this);
super.playSound("weapon.MGunMk108s", true);
}