From 501df7103c8b3c16da0f5052d10d8d1b7dc37c0c Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 17 Dec 2012 21:23:36 +0000 Subject: [PATCH] - The facility performance tag now determines the effectiveness of the interrogation assignment (100 = standard). - Canteens can now be refilled even if the food system is off - If you set a handcuff's item to class from MISC (268435456)to KIT (8192), it will be treated as a stack of binders. Repeated use on enemies consumes the item. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5740 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 23 ++++++++++++++++++++--- Tactical/Food.cpp | 9 ++------- Tactical/Soldier Control.cpp | 16 ++++++++++++---- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 07086e8c..6262077e 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -2637,7 +2637,25 @@ UINT32 CalculateInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts ) INT32 threatenvalue = CalcThreateningEffectiveness( pSoldier->ubProfile ) * gMercProfiles[pSoldier->ubProfile].usApproachFactor[2] ; usInterrogationPoints *= threatenvalue; - usInterrogationPoints /= 6500; + + UINT16 performancemodifier = 100; + for (UINT16 cnt = 0; cnt < NUM_FACILITY_TYPES; ++cnt) + { + // Is this facility here? + if (gFacilityLocations[SECTOR( pSoldier->sSectorX, pSoldier->sSectorY )][cnt].fFacilityHere) + { + // we determine wether this is a prison by checking for usPrisonBaseLimit + if (gFacilityTypes[cnt].AssignmentData[FAC_INTERROGATE_PRISONERS].usPrisonBaseLimit > 0) + { + performancemodifier = gFacilityTypes[cnt].AssignmentData[FAC_INTERROGATE_PRISONERS].usPerformance; + break; + } + } + } + + performancemodifier = min(1000, max(10, performancemodifier) ); + + usInterrogationPoints = (usInterrogationPoints * performancemodifier) / (650000); // TODO: adjust for cop background @@ -5548,8 +5566,7 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ ) UINT32 prisonersinterrogated = interrogationpoints / 100; // the part that gets left behind is saved to the map (but not the part that gets lost due to there not being enough prisoners) - interrogationpoints -= prisonersinterrogated * 100; - pSectorInfo->uiInterrogationHundredsLeft = (UINT8)(interrogationpoints); + pSectorInfo->uiInterrogationHundredsLeft = (UINT8)(interrogationpoints - prisonersinterrogated * 100); if ( prisonersinterrogated > numprisoners ) prisonersinterrogated = numprisoners; diff --git a/Tactical/Food.cpp b/Tactical/Food.cpp index 2c1e597b..27facfd7 100644 --- a/Tactical/Food.cpp +++ b/Tactical/Food.cpp @@ -743,12 +743,6 @@ UINT8 GetWaterQuality(INT16 asMapX, INT16 asMapY, INT8 asMapZ) // a function that tries to fill up all canteens in this sector void SectorFillCanteens( void ) { - if ( !gGameOptions.fFoodSystem ) - { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szFoodTextStr[STR_FOOD_ERROR_NO_FOOD_SYSTEM] ); - return; - } - // no functionality if not in tactical or in combat, or nobody is here // can be called from a messagebox, thus the check for MSG_BOX_SCREEN if ( (guiCurrentScreen != GAME_SCREEN && guiCurrentScreen != MSG_BOX_SCREEN) || (gTacticalStatus.uiFlags & INCOMBAT) || gusSelectedSoldier == NOBODY ) @@ -814,7 +808,8 @@ void SectorFillCanteens( void ) // it would be pretty pointless to fill our canteens and then not to drink from them even though we are hungry. If there is an unlimited water source in this sector, drink from our // freshly filled canteens. Thus calling this function repeatedly will cause us to drink till we're full, and restore our canteens to full level - EatFromInventory( pSoldier, TRUE ); + if ( gGameOptions.fFoodSystem ) + EatFromInventory( pSoldier, TRUE ); } } diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 92ce1e87..285a3c49 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -15328,9 +15328,9 @@ UINT32 SOLDIERTYPE::GetSurrenderStrength() // adjust for type of soldier if ( this->ubSoldierClass == SOLDIER_CLASS_ELITE || this->ubSoldierClass == SOLDIER_CLASS_ELITE_MILITIA ) - value *= 1.5; + value *= 1.5f; else if ( this->ubSoldierClass == SOLDIER_CLASS_ADMINISTRATOR || this->ubSoldierClass == SOLDIER_CLASS_GREEN_MILITIA ) - value *= 0.75; + value *= 0.75f; return value; } @@ -16324,8 +16324,16 @@ void SOLDIERTYPE::EVENT_SoldierHandcuffPerson( INT32 sGridNo, UINT8 ubDirection // move handcuffs to his hands if ( HasItemFlag( (&(this->inv[HANDPOS]))->usItem, HANDCUFFS ) ) { - AutoPlaceObject( pSoldier, &(this->inv[HANDPOS]), FALSE ); - DeleteObj( &(this->inv[HANDPOS]) ); + // stack handcuffs (like a stack of binders) simply gets used up a bit + if ( Item[(&(this->inv[HANDPOS]))->usItem].usItemClass == IC_KIT ) + { + UseKitPoints( &(this->inv[HANDPOS]), 10, pSoldier ); + } + else + { + AutoPlaceObject( pSoldier, &(this->inv[HANDPOS]), FALSE ); + DeleteObj( &(this->inv[HANDPOS]) ); + } } // CHANGE DIRECTION AND GOTO ANIMATION NOW