reworked prisoner info chance, PRISONER_INFO_DETECT_CHANCE is obsolete

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5927 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-03-17 00:33:40 +00:00
parent 923664ca40
commit e5f8799d07
3 changed files with 29 additions and 38 deletions
+3 -4
View File
@@ -1581,12 +1581,11 @@ void LoadGameExternalOptions()
gGameExternalOptions.fSurrenderMultiplier = iniReader.ReadFloat("Strategic Gameplay Settings", "SURRENDER_MULTIPLIER", 5.0f, 2.0f, 10.0f); gGameExternalOptions.fSurrenderMultiplier = iniReader.ReadFloat("Strategic Gameplay Settings", "SURRENDER_MULTIPLIER", 5.0f, 2.0f, 10.0f);
gGameExternalOptions.fPlayerCanAsktoSurrender = iniReader.ReadBoolean("Strategic Gameplay Settings","PLAYER_CAN_ASK_TO_SURRENDER", TRUE); gGameExternalOptions.fPlayerCanAsktoSurrender = iniReader.ReadBoolean("Strategic Gameplay Settings","PLAYER_CAN_ASK_TO_SURRENDER", TRUE);
gGameExternalOptions.ubPrisonerReturntoQueenChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_RETURN_TO_ARMY_CHANCE", 50, 0, 100); gGameExternalOptions.ubPrisonerReturntoQueenChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_RETURN_TO_ARMY_CHANCE", 50, 0, 100);
gGameExternalOptions.ubPrisonerProcessDefectChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_DEFECT_CHANCE", 10, 0, 100); gGameExternalOptions.ubPrisonerProcessDefectChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_DEFECT_CHANCE", 25, 0, 100);
gGameExternalOptions.ubPrisonerProcessInfoBaseChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_BASECHANCE", 10, 0, 100); gGameExternalOptions.ubPrisonerProcessInfoBaseChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_BASECHANCE", 25, 0, 100);
gGameExternalOptions.ubPrisonerProcessInfoDetectChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_DETECT_CHANCE", 5, 0, 100);
gGameExternalOptions.ubPrisonerProcessInfoNumberChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_NUMBER_CHANCE", 30, 0, 100); gGameExternalOptions.ubPrisonerProcessInfoNumberChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_NUMBER_CHANCE", 30, 0, 100);
gGameExternalOptions.ubPrisonerProcessInfoDirectionChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_DIRECTION_CHANCE", 40, 0, 100); gGameExternalOptions.ubPrisonerProcessInfoDirectionChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_INFO_DIRECTION_CHANCE", 40, 0, 100);
gGameExternalOptions.ubPrisonerProcessRansomBaseChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_RANSOM_CHANCE", 10, 0, 100); gGameExternalOptions.ubPrisonerProcessRansomBaseChance = iniReader.ReadInteger("Strategic Gameplay Settings","PRISONER_RANSOM_CHANCE", 25, 0, 100);
// CHRISL: Determine how Skyrider should handle landing in enemy occupied sectors // CHRISL: Determine how Skyrider should handle landing in enemy occupied sectors
gGameExternalOptions.ubSkyriderHotLZ = iniReader.ReadInteger("Strategic Gameplay Settings", "ALLOW_SKYRIDER_HOT_LZ", 0); gGameExternalOptions.ubSkyriderHotLZ = iniReader.ReadInteger("Strategic Gameplay Settings", "ALLOW_SKYRIDER_HOT_LZ", 0);
-1
View File
@@ -1196,7 +1196,6 @@ typedef struct
UINT8 ubPrisonerReturntoQueenChance; UINT8 ubPrisonerReturntoQueenChance;
UINT8 ubPrisonerProcessDefectChance; UINT8 ubPrisonerProcessDefectChance;
UINT8 ubPrisonerProcessInfoBaseChance; UINT8 ubPrisonerProcessInfoBaseChance;
UINT8 ubPrisonerProcessInfoDetectChance;
UINT8 ubPrisonerProcessInfoNumberChance; UINT8 ubPrisonerProcessInfoNumberChance;
UINT8 ubPrisonerProcessInfoDirectionChance; UINT8 ubPrisonerProcessInfoDirectionChance;
UINT8 ubPrisonerProcessRansomBaseChance; UINT8 ubPrisonerProcessRansomBaseChance;
+28 -35
View File
@@ -5608,45 +5608,38 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
else if ( result < gGameExternalOptions.ubPrisonerProcessDefectChance + gGameExternalOptions.ubPrisonerProcessInfoBaseChance ) else if ( result < gGameExternalOptions.ubPrisonerProcessDefectChance + gGameExternalOptions.ubPrisonerProcessInfoBaseChance )
{ {
BOOLEAN found = FALSE; BOOLEAN found = FALSE;
// run through sectors and handle each type in sector UINT8 maxtries = 20;
for(INT16 sX = 1; sX < MAP_WORLD_X - 1; ++sX ) for(UINT8 infotry = 0; infotry < maxtries; ++infotry)
{ {
if ( found ) UINT8 usX = 1 + Random( MAP_WORLD_X - 2 );
break; UINT8 usY = 1 + Random( MAP_WORLD_Y - 2 );
for(INT16 sY = 1; sY < MAP_WORLD_X - 1; ++sY ) // there need to be mobile enemies here - that the queen has troops in towns we do not own is hardly worthy information, and empty sectors aren't interesting
if ( NumMobileEnemiesInSector( usX, usY ) == 0 )
continue;
// not if we already know about this sector
if ( SectorInfo[ SECTOR( usX, usY ) ].uiFlags & SF_ASSIGN_NOTICED_ENEMIES_HERE )
continue;
// enemy patrol detected
SectorInfo[ SECTOR( usX, usY ) ].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_HERE;
if ( Chance(gGameExternalOptions.ubPrisonerProcessInfoNumberChance) )
{ {
UINT32 result = Random(100); // we also learned the number of enemies
if ( result < gGameExternalOptions.ubPrisonerProcessInfoDetectChance ) SectorInfo[ SECTOR( usX, usY ) ].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER;
{
// there need to be mobile enemies here - that the queen has troops in towns we do not own is hardly worthy information
if ( NumMobileEnemiesInSector( sX, sY ) == 0 )
continue;
// not if we already know about this sector
if ( SectorInfo[ SECTOR( sX, sY ) ].uiFlags & SF_ASSIGN_NOTICED_ENEMIES_HERE )
continue;
// enemy patrol detected
SectorInfo[ SECTOR( sX, sY ) ].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_HERE;
if ( result < gGameExternalOptions.ubPrisonerProcessInfoNumberChance )
{
// we also learned the number of enemies
SectorInfo[ SECTOR( sX, sY ) ].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_NUMBER;
}
if ( result < gGameExternalOptions.ubPrisonerProcessInfoDirectionChance )
{
// we also learned the direction of the patrol
SectorInfo[ SECTOR( sX, sY ) ].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION;
}
++revealedpositions;
found = TRUE;
break;
}
} }
if ( Chance(gGameExternalOptions.ubPrisonerProcessInfoDirectionChance) )
{
// we also learned the direction of the patrol
SectorInfo[ SECTOR( usX, usY ) ].uiFlags |= SF_ASSIGN_NOTICED_ENEMIES_KNOW_DIRECTION;
}
++revealedpositions;
found = TRUE;
break;
} }
} }
// chance prisoner will grant us ransom money // chance prisoner will grant us ransom money