diff --git a/Strategic/Map Screen Interface Map.cpp b/Strategic/Map Screen Interface Map.cpp index 8d7aa696..e0442156 100644 --- a/Strategic/Map Screen Interface Map.cpp +++ b/Strategic/Map Screen Interface Map.cpp @@ -722,14 +722,10 @@ INT32 GetMapColour( INT16 sX, INT16 sY, UINT8 aType ) return MAP_SHADE_DK_GREEN; else if ( diseaseratio < 0.1f ) return MAP_SHADE_MD_GREEN; - else if ( diseaseratio < 0.2f ) + else if ( diseaseratio < 0.25f ) return MAP_SHADE_LT_GREEN; - else if ( diseaseratio < 0.3f ) - return MAP_SHADE_DK_YELLOW; else if ( diseaseratio < 0.4f ) return MAP_SHADE_MD_YELLOW; - else if ( diseaseratio < 0.5f ) - return MAP_SHADE_LT_YELLOW; else if ( diseaseratio < 0.65f ) return MAP_SHADE_ORANGE; else if ( diseaseratio < 0.8f ) diff --git a/Strategic/Queen Command.cpp b/Strategic/Queen Command.cpp index fd7fd427..5f3c93d2 100644 --- a/Strategic/Queen Command.cpp +++ b/Strategic/Queen Command.cpp @@ -2659,8 +2659,7 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier ) { return; } - - + // If this is an EPC , just kill them... if ( AM_AN_EPC( pSoldier ) ) { @@ -2677,8 +2676,7 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier ) // ATE: Patch fix If in a vehicle, remove from vehicle... TakeSoldierOutOfVehicle( pSoldier ); - - + // Are there enemies in ALMA? ( I13 ) iNumEnemiesInSector = NumNonPlayerTeamMembersInSector( gModSettings.ubInitialPOWSectorX, gModSettings.ubInitialPOWSectorY, ENEMY_TEAM ); //(13, 9) @@ -2708,74 +2706,54 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier ) RemoveCharacterFromSquads( pSoldier ); WORLDITEM WorldItem; - std::vector pWorldItem(1);//dnl ch75 271013 + std::vector pWorldItem; - // Is this the first one..? - if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTNOTSTARTED ) + if ( gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_ALMA] == QUESTDONE ) { - //-teleport him to NE Alma sector (not Tixa as originally planned) - pSoldier->sSectorX = gModSettings.ubInitialPOWSectorX; //13 - pSoldier->sSectorY = gModSettings.ubInitialPOWSectorY; //9 - pSoldier->bSectorZ = 0; - - // put him on the floor!! - pSoldier->pathing.bLevel = 0; + INT32 itemdropoffgridno = -1; + // Is this the first one..? + if ( gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED ) + { + //-teleport him to NE Alma sector (not Tixa as originally planned) + pSoldier->sSectorX = gModSettings.ubInitialPOWSectorX; //13 + pSoldier->sSectorY = gModSettings.ubInitialPOWSectorY; //9 + pSoldier->bSectorZ = 0; + pSoldier->usStrategicInsertionData = gModSettings.iInitialPOWGridNo[gStrategicStatus.ubNumCapturedForRescue]; + itemdropoffgridno = gModSettings.iInitialPOWItemGridNo[gStrategicStatus.ubNumCapturedForRescue]; + } + else //if ( gubQuest[QUEST_HELD_IN_ALMA] == QUESTDONE ) + { + //-teleport him to N7 + pSoldier->sSectorX = gModSettings.ubMeanwhileInterrogatePOWSectorX; //7 + pSoldier->sSectorY = gModSettings.ubMeanwhileInterrogatePOWSectorY; //14 + pSoldier->bSectorZ = 0; + pSoldier->usStrategicInsertionData = gModSettings.iMeanwhileInterrogatePOWGridNo[gStrategicStatus.ubNumCapturedForRescue]; + itemdropoffgridno = gModSettings.iMeanwhileInterrogatePOWItemGridNo[gStrategicStatus.ubNumCapturedForRescue];; + } + // OK, drop all items! UINT32 invsize = pSoldier->inv.size(); for ( i = 0; i < invsize; ++i ) { - if( pSoldier->inv[ i ].exists() == true ) + if ( pSoldier->inv[i].exists() ) { WorldItem.fExists = TRUE; - WorldItem.sGridNo = gModSettings.iInitialPOWItemGridNo[ gStrategicStatus.ubNumCapturedForRescue ]; + WorldItem.sGridNo = itemdropoffgridno; WorldItem.ubLevel = 0; WorldItem.usFlags = 0; WorldItem.bVisible = FALSE; WorldItem.bRenderZHeightAboveLevel = 0; - pSoldier->inv[ i ].MoveThisObjectTo(WorldItem.object); - //dnl ch75 271013 - pWorldItem[0] = WorldItem; - AddWorldItemsToUnLoadedSector( gModSettings.ubInitialPOWSectorX, gModSettings.ubInitialPOWSectorY, 0, gModSettings.iInitialPOWItemGridNo[ gStrategicStatus.ubNumCapturedForRescue ], 1, pWorldItem, FALSE ); + pSoldier->inv[i].MoveThisObjectTo( WorldItem.object ); + pWorldItem.push_back( WorldItem ); } } - pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; - pSoldier->usStrategicInsertionData = gModSettings.iInitialPOWGridNo[ gStrategicStatus.ubNumCapturedForRescue ]; - - gStrategicStatus.ubNumCapturedForRescue++; - } - else if ( gubQuest[ QUEST_HELD_IN_ALMA ] == QUESTDONE ) - { - //-teleport him to N7 - pSoldier->sSectorX = gModSettings.ubMeanwhileInterrogatePOWSectorX; //7 - pSoldier->sSectorY = gModSettings.ubMeanwhileInterrogatePOWSectorY; //14 - pSoldier->bSectorZ = 0; + AddWorldItemsToUnLoadedSector( pSoldier->sSectorX, pSoldier->sSectorY, 0, itemdropoffgridno, pWorldItem.size(), pWorldItem, FALSE ); // put him on the floor!! pSoldier->pathing.bLevel = 0; - - // OK, drop all items! - UINT32 invsize = pSoldier->inv.size(); - for ( i = 0; i < invsize; ++i ) - { - if( pSoldier->inv[ i ].exists() == true ) - { - WorldItem.fExists = TRUE; - WorldItem.sGridNo = gModSettings.iMeanwhileInterrogatePOWItemGridNo[ gStrategicStatus.ubNumCapturedForRescue ]; - WorldItem.ubLevel = 0; - WorldItem.usFlags = 0; - WorldItem.bVisible = FALSE; - WorldItem.bRenderZHeightAboveLevel = 0; - pSoldier->inv[ i ].MoveThisObjectTo(WorldItem.object); - //dnl ch75 271013 - pWorldItem[0] = WorldItem; - AddWorldItemsToUnLoadedSector( gModSettings.ubMeanwhileInterrogatePOWSectorX, gModSettings.ubMeanwhileInterrogatePOWSectorY, 0, gModSettings.iMeanwhileInterrogatePOWItemGridNo[ gStrategicStatus.ubNumCapturedForRescue ], 1, pWorldItem, FALSE ); - } - } - pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; - pSoldier->usStrategicInsertionData = gModSettings.iMeanwhileInterrogatePOWGridNo[ gStrategicStatus.ubNumCapturedForRescue ]; gStrategicStatus.ubNumCapturedForRescue++; } @@ -2792,12 +2770,9 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier ) //Set his life to 50% + or - 10 HP. INT8 oldlife = pSoldier->stats.bLife; - pSoldier->stats.bLife = pSoldier->stats.bLifeMax / 2; - if ( pSoldier->stats.bLife <= 35 ) - { - pSoldier->stats.bLife = 35; - } - else if ( pSoldier->stats.bLife >= 45 ) + pSoldier->stats.bLife = max(35, pSoldier->stats.bLifeMax / 2); + + if ( pSoldier->stats.bLife >= 45 ) { pSoldier->stats.bLife += (INT8)(10 - Random( 21 ) ); } diff --git a/Strategic/Strategic Town Loyalty.cpp b/Strategic/Strategic Town Loyalty.cpp index f113750f..acf03ccc 100644 --- a/Strategic/Strategic Town Loyalty.cpp +++ b/Strategic/Strategic Town Loyalty.cpp @@ -1116,7 +1116,6 @@ void RemoveRandomItemsInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, // stealing should fail anyway 'cause there shouldn't be a temp file for unvisited sectors, but let's check anyway Assert( GetSectorFlagStatus( sSectorX, sSectorY, ( UINT8 ) sSectorZ, SF_ALREADY_VISITED ) == TRUE ); - // get sector name string GetSectorIDString( sSectorX, sSectorY, ( INT8 ) sSectorZ, wSectorName, TRUE ); @@ -1140,15 +1139,15 @@ void RemoveRandomItemsInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, uiNewTotal = uiNumberOfItems; // set up item list ptrs - for( iCounter = 0; iCounter < uiNumberOfItems ; iCounter++ ) + for( iCounter = 0; iCounter < uiNumberOfItems ; ++iCounter ) { //if the item exists, and is visible and reachable, see if it should be stolen if ( pItemList[ iCounter ].fExists && pItemList[ iCounter ].bVisible == TRUE && pItemList[ iCounter ].usFlags & WORLD_ITEM_REACHABLE ) { - if( Random( 100 ) < ubChance ) + if ( Chance( ubChance ) ) { // remove - uiNewTotal--; + --uiNewTotal; pItemList[ iCounter ].fExists = FALSE; // debug message @@ -1165,12 +1164,12 @@ void RemoveRandomItemsInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, } else // handle a loaded sector { - for( iCounter = 0; iCounter < guiNumWorldItems; iCounter++ ) + for( iCounter = 0; iCounter < guiNumWorldItems; ++iCounter ) { // note, can't do reachable test here because we'd have to do a path call... if ( gWorldItems[ iCounter ].fExists && gWorldItems[ iCounter ].bVisible == TRUE ) { - if( Random( 100 ) < ubChance ) + if ( Chance( ubChance ) ) { RemoveItemFromPool( gWorldItems[ iCounter ].sGridNo , iCounter, gWorldItems[ iCounter ].ubLevel ); // debug message @@ -1179,11 +1178,8 @@ void RemoveRandomItemsInSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, } } } - - return; } - /* ARM: Civilian theft of items was removed void HandleTheftByCiviliansInSector( INT16 sX, INT16 sY, INT32 iLoyalty ) { @@ -1231,15 +1227,11 @@ void HandleTownTheft( void ) HandleTheftByCiviliansInSector( ( INT16 )( pTownLocationsList[ iCounter ] % MAP_WORLD_X ), ( INT16 )( pTownLocationsList[ iCounter ] / MAP_WORLD_X ), gTownLoyalty[ ubTown ].ubRating ); } - iCounter++; + ++iCounter; } - - return; } */ - - void BuildListOfTownSectors( void ) { INT32 iCounterX = 0, iCounterY = 0, iCounter = 0;