// int func_SetIniParameterValue(ini_param_index, value); // only a wrapper function for the true handler function
// int func_GetParameterFromIniFile(ini_param_index); // only a wrapper function for the true handler function
int __cdecl func_SetFactorsForResourceMapGeneration()
{
int result;
int v1; // unknown
signed int MinResources;
signed int MaxResources;
int RawResourceMode;
int RawResourceModeCopy;
int FuelResourceMode;
int FuelResourceModeCopy;
int UsedResourceTypes;
int GoldResourceMode;
int GoldResourceModeCopy;
signed int AlienDerelictsMode;
MinResources = 1;
MaxResources = 15;
RawResourceMode = func_GetParameterFromIniFile(77); // raw_resource - default value: 1
if ( (unsigned int)RawResourceMode < 1 )
{
if ( !RawResourceMode ) // raw_resource == 0 (poor)
{
func_SetIniParameterValue(9, 0); // raw_normal_low - default value: 0
func_SetIniParameterValue(10, 3); // raw_normal_high - default value: 5
func_SetIniParameterValue(11, 8); // raw_concentrate_low - default value: 13
func_SetIniParameterValue(12, 12); // raw_concentrate_high - default value: 16
func_SetIniParameterValue(13, 28); // raw_concentrate_seperation - default value: 23
func_SetIniParameterValue(14, 6); // raw_concentrate_diffusion - default value: 6
}
}
else
{
if ( (unsigned int)RawResourceMode <= 1 ) // raw_resource == 1 (medium)
{
func_SetIniParameterValue(9, 0);
func_SetIniParameterValue(10, 5);
func_SetIniParameterValue(11, 13);
func_SetIniParameterValue(12, 16);
func_SetIniParameterValue(13, 23);
func_SetIniParameterValue(14, 5);
}
else
{
if ( RawResourceMode == 2 ) // raw_resource == 2 (rich)
{
func_SetIniParameterValue(9, 1);
func_SetIniParameterValue(10, 5);
func_SetIniParameterValue(11, 16);
func_SetIniParameterValue(12, 16);
func_SetIniParameterValue(13, 19);
func_SetIniParameterValue(14, 4);
}
}
}
RawResourceModeCopy = func_GetParameterFromIniFile(77);
if ( (unsigned int)RawResourceModeCopy < 1 )
{
if ( !RawResourceModeCopy )
{
MinResources += 3;
++MaxResources;
}
}
else
{
if ( (unsigned int)RawResourceModeCopy <= 1 )
{
MinResources += 5;
MaxResources += 2;
}
else
{
if ( RawResourceModeCopy == 2 )
{
MinResources += 6;
MaxResources += 3;
}
}
}
FuelResourceMode = func_GetParameterFromIniFile(78); // fuel_resource - default value: 1
if ( (unsigned int)FuelResourceMode < 1 )
{
if ( !FuelResourceMode ) // fuel_resource == 0 (poor)
{
func_SetIniParameterValue(15, 1); // fuel_normal_low - default value: 2
func_SetIniParameterValue(16, 2); // fuel_normal_high - default value: 3
func_SetIniParameterValue(17, 8); // fuel_concentrate_low - default value: 12
func_SetIniParameterValue(18, 12); // fuel_concentrate_high - default value: 16
func_SetIniParameterValue(19, 29); // fuel_concentrate_seperation - default value: 24
func_SetIniParameterValue(20, 6); // raw_concentrate_diffusion - default value: 5
}
}
else
{
if ( (unsigned int)FuelResourceMode <= 1 ) // fuel_resource == 1 (medium)
{
func_SetIniParameterValue(15, 2);
func_SetIniParameterValue(16, 3);
func_SetIniParameterValue(17, 12);
func_SetIniParameterValue(18, 16);
func_SetIniParameterValue(19, 24);
func_SetIniParameterValue(20, 5);
}
else
{
if ( FuelResourceMode == 2 ) // fuel_resource == 2 (rich)
{
func_SetIniParameterValue(15, 2);
func_SetIniParameterValue(16, 4);
func_SetIniParameterValue(17, 16);
func_SetIniParameterValue(18, 16);
func_SetIniParameterValue(19, 20);
func_SetIniParameterValue(20, 4);
}
}
}
FuelResourceModeCopy = func_GetParameterFromIniFile(78);
if ( (unsigned int)FuelResourceModeCopy < 1 )
{
if ( !FuelResourceModeCopy )
{
MinResources += 2;
++MaxResources;
}
}
else
{
if ( (unsigned int)FuelResourceModeCopy <= 1 )
{
MinResources += 3;
MaxResources += 2;
}
else
{
if ( FuelResourceModeCopy == 2 )
{
MinResources += 4;
MaxResources += 3;
}
}
}
func_GetParameterFromIniFile(77); // raw_resource - default value: 1
UsedResourceTypes = func_GetParameterFromIniFile(78) + v1; // fuel_resource - default value: 1
// NOTE: UsedResourceTypes might be something else... not sure of it.
// NOTE: <- v1 possibly holds the RetVal of the previous function call.
if ( (unsigned int)UsedResourceTypes <= 4 )
{
switch ( UsedResourceTypes )
{
case 0: // mixed_resource_seperation - default value: 40
func_SetIniParameterValue(27, 49);
break;
case 1:
func_SetIniParameterValue(27, 44);
break;
case 2:
func_SetIniParameterValue(27, 40);
break;
case 3:
func_SetIniParameterValue(27, 36);
break;
case 4:
func_SetIniParameterValue(27, 33);
break;
}
}
GoldResourceMode = func_GetParameterFromIniFile(79); // gold_resource - default value: 1
if ( (unsigned int)GoldResourceMode < 1 )
{
if ( !GoldResourceMode ) // gold_resource == 0 (poor)
{
func_SetIniParameterValue(21, 0); // gold_normal_low - default value: 0
func_SetIniParameterValue(22, 0); // gold_normal_high - default value: 0
func_SetIniParameterValue(23, 5); // gold_concentrate_low - default value: 10
func_SetIniParameterValue(24, 9); // gold_concentrate_high - default value: 16
func_SetIniParameterValue(25, 39); // gold_concentrate_seperation - default value: 32
func_SetIniParameterValue(26, 6); // gold_concentrate_diffusion - default value: 5
}
}
else
{
if ( (unsigned int)GoldResourceMode <= 1 ) // gold_resource == 1 (medium)
{
func_SetIniParameterValue(21, 0);
func_SetIniParameterValue(22, 0);
func_SetIniParameterValue(23, 8);
func_SetIniParameterValue(24, 12);
func_SetIniParameterValue(25, 32);
func_SetIniParameterValue(26, 5);
}
else
{
if ( GoldResourceMode == 2 ) // gold_resource == 2 (rich)
{
func_SetIniParameterValue(21, 0);
func_SetIniParameterValue(22, 1);
func_SetIniParameterValue(23, 12);
func_SetIniParameterValue(24, 16);
func_SetIniParameterValue(25, 26);
func_SetIniParameterValue(26, 4);
}
}
}
GoldResourceModeCopy = func_GetParameterFromIniFile(79);
if ( (unsigned int)GoldResourceModeCopy < 1 )
{
!GoldResourceModeCopy;
}
else
{
if ( (unsigned int)GoldResourceModeCopy <= 1 )
{
++MaxResources;
}
else
{
if ( GoldResourceModeCopy == 2 )
{
++MinResources;
MaxResources += 2;
}
}
}
func_SetIniParameterValue(28, (signed __int16)MinResources); // min_resources - default value: 9
func_SetIniParameterValue(29, (signed __int16)MaxResources); // max_resources - default value: 20
result = func_GetParameterFromIniFile(80); // alien_derelicts - default value: 0
AlienDerelictsMode = result;
if ( (unsigned int)AlienDerelictsMode < 1 )
{
if ( !AlienDerelictsMode ) // alien_derelicts == 0 (none)
result = func_SetIniParameterValue(44, 0);
}
else
{
if ( (unsigned int)AlienDerelictsMode <= 1 ) // alien_derelicts == 1 (rare)
{
func_SetIniParameterValue(43, 65); // alien_seperation - default value: 60
result = func_SetIniParameterValue(44, 20); // alien_unit_value - default value: 0
}
else
{
if ( AlienDerelictsMode == 2 ) // alien_derelicts == 2 (common)
{
func_SetIniParameterValue(43, 50);
result = func_SetIniParameterValue(44, 30);
}
}
}
return result;
}