diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index bb4af955..de2eae30 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -4845,16 +4845,29 @@ void StartTacticalFunctionSelectionMessageBox( SOLDIERTYPE * pSoldier, INT32 sGr wcscpy( gzUserDefinedButton[0], TacticalStr[ FILL_CANTEEN_STR ] ); wcscpy( gzUserDefinedButton[1], TacticalStr[ CLEAN_ONE_GUN_STR ] ); wcscpy( gzUserDefinedButton[2], TacticalStr[ CLEAN_ALL_GUNS_STR ] ); - wcscpy( gzUserDefinedButton[3], TacticalStr[ TAKE_OFF_CLOTHES_STR ] ); - wcscpy( gzUserDefinedButton[4], TacticalStr[ MILITIA_DROP_EQ_STR ] ); + + if ( gpTempSoldier->bSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER) ) + wcscpy( gzUserDefinedButton[3], TacticalStr[ TAKE_OFF_DISGUISE_STR ] ); + else + wcscpy( gzUserDefinedButton[3], TacticalStr[ TAKE_OFF_CLOTHES_STR ] ); + + if ( gGameExternalOptions.fMilitiaUseSectorInventory ) + { + wcscpy( gzUserDefinedButton[4], TacticalStr[ MILITIA_DROP_EQ_STR ] ); + wcscpy( gzUserDefinedButton[5], TacticalStr[ MILITIA_PICK_UP_EQ_STR ] ); + } + else + { + wcscpy( gzUserDefinedButton[4], TacticalStr[ UNUSED_STR ] ); + wcscpy( gzUserDefinedButton[5], TacticalStr[ UNUSED_STR ] ); + } // if disguised, allow testing our disguise if ( gpTempSoldier->bSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER) ) - wcscpy( gzUserDefinedButton[5], TacticalStr[ SPY_SELFTEST_STR ] ); + wcscpy( gzUserDefinedButton[6], TacticalStr[ SPY_SELFTEST_STR ] ); else - wcscpy( gzUserDefinedButton[5], TacticalStr[ UNUSED_STR ] ); + wcscpy( gzUserDefinedButton[6], TacticalStr[ UNUSED_STR ] ); - wcscpy( gzUserDefinedButton[6], TacticalStr[ UNUSED_STR ] ); wcscpy( gzUserDefinedButton[7], TacticalStr[ UNUSED_STR ] ); DoMessageBox( MSG_BOX_BASIC_MEDIUM_BUTTONS, TacticalStr[ FUNCTION_SELECTION_STR ], GAME_SCREEN, MSG_BOX_FLAG_GENERIC_EIGHT_BUTTONS, TacticalFunctionSelectionMessageBoxCallBack, NULL ); } @@ -5029,9 +5042,15 @@ void TacticalFunctionSelectionMessageBoxCallBack( UINT8 ubExitValue ) break; case 5: // militia drops all gear taken from sector inventory - TeamDropAll( MILITIA_TEAM ); + if ( gGameExternalOptions.fMilitiaUseSectorInventory ) + TeamDropAll( MILITIA_TEAM ); break; case 6: + // militia takes gear from sector inventory + if ( gGameExternalOptions.fMilitiaUseSectorInventory ) + TeamRestock( MILITIA_TEAM ); + break; + case 7: // test our disguise if ( gpTempSoldier->bSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER) ) gpTempSoldier->SpySelfTest(); diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 3ee44d18..ae2a2d19 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -109,6 +109,7 @@ #include "Militia Control.h" #include "Lua Interpreter.h" #include "bullets.h" +#include "Inventory Choosing.h" // added by Flugente for TakeMilitiaEquipmentfromSector() #endif #include "connect.h" @@ -10131,13 +10132,12 @@ void TeamDropAll(UINT8 bTeam, BOOLEAN fForce) // not if this team is hostile to us if ( gTacticalStatus.Team[ gbPlayerNum ].bSide != gTacticalStatus.Team[ bTeam ].bSide ) return; - - SOLDIERTYPE *pSoldier; - + #ifdef JA2BETAVERSION ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Team %d drops all items for inspection!", bTeam ); #endif + SOLDIERTYPE *pSoldier; UINT32 uiCnt = 0; UINT32 firstid = gTacticalStatus.Team[ bTeam ].bFirstID; UINT32 lastid = gTacticalStatus.Team[ bTeam ].bLastID; @@ -10151,6 +10151,48 @@ void TeamDropAll(UINT8 bTeam, BOOLEAN fForce) } } +void TeamRestock(UINT8 bTeam) +{ + if ( bTeam > PLAYER_PLAN ) + return; + + // not if there is a battle going on + if ( (gTacticalStatus.uiFlags & INCOMBAT ) ) + return; + + // not if this team is hostile to us + if ( gTacticalStatus.Team[ gbPlayerNum ].bSide != gTacticalStatus.Team[ bTeam ].bSide ) + return; + +#ifdef JA2BETAVERSION + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Team %d restocks gear from sector inventory!", bTeam ); +#endif + + SOLDIERTYPE *pSoldier; + UINT32 uiCnt = 0; + UINT32 firstid = gTacticalStatus.Team[ bTeam ].bFirstID; + UINT32 lastid = gTacticalStatus.Team[ bTeam ].bLastID; + for ( uiCnt = firstid, pSoldier = MercPtrs[ uiCnt ]; uiCnt <= lastid; ++uiCnt, ++pSoldier) + { + if( pSoldier->bActive && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) ) + { + // the function fills a createstruct, so create one + SOLDIERCREATE_STRUCT createstruct; + + // we first have to copy over all our currently equipped items, otherwise we might overwrite them later + createstruct.Inv = pSoldier->inv; + + TakeMilitiaEquipmentfromSector(pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ, &createstruct, pSoldier->ubSoldierClass); + + // replace our inventory with the new one + pSoldier->inv = createstruct.Inv; + + // we took new gear, so we can drop it again + pSoldier->bSoldierFlagMask &= ~SOLDIER_EQUIPMENT_DROPPED; + } + } +} + // are we allowed to steal access this guy's inventory? BOOLEAN AllowedToStealFromTeamMate( UINT8 ubID, UINT8 ubTargetID ) { diff --git a/Tactical/Overhead.h b/Tactical/Overhead.h index 211e598c..bceab9ca 100644 --- a/Tactical/Overhead.h +++ b/Tactical/Overhead.h @@ -355,9 +355,13 @@ extern UINT8 NumEnemyInSector(); extern UINT8 NumZombiesInSector(); #endif -void HandleSurrenderOffer( SOLDIERTYPE* pSoldier ); // Flugente: offer the enemy the chance to surrender +// Flugente: offer the enemy the chance to surrender +void HandleSurrenderOffer( SOLDIERTYPE* pSoldier ); + +// Flugente: order a team to drop gear, or pick it up // setting fForce to TRUE allows dropping of gear in combat (used in auto-resolve instances) void TeamDropAll(UINT8 bTeam, BOOLEAN fForce = FALSE); +void TeamRestock(UINT8 bTeam); // are we allowed to steal access this guy's inventory? BOOLEAN AllowedToStealFromTeamMate( UINT8 aAccessorID, UINT8 aTargetID ); diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 09d496ed..584d958c 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -15903,6 +15903,13 @@ void SOLDIERTYPE::DropSectorEquipment() OBJECTTYPE* pObj = NULL; UINT8 size = this->inv.size(); + INT32 sPutGridNo = this->sGridNo; + if ( sPutGridNo == NOWHERE ) + sPutGridNo = RandomGridNo(); + + if ( Water( sPutGridNo) ) + sPutGridNo = gMapInformation.sCenterGridNo; + if ( ( this->sSectorX == gWorldSectorX ) && ( this->sSectorY == gWorldSectorY ) && ( this->bSectorZ == gbWorldSectorZ) ) { for ( UINT8 cnt = 0; cnt < size; ++cnt ) @@ -15920,10 +15927,6 @@ void SOLDIERTYPE::DropSectorEquipment() if ( !gGameExternalOptions.fMilitiaUseSectorInventory_Ammo && Item[ pObj->usItem ].usItemClass & IC_GUN ) (*pObj)[0]->data.gun.ubGunShotsLeft = 0; - INT32 sPutGridNo = this->sGridNo; - if ( sPutGridNo == NOWHERE ) - sPutGridNo = RandomGridNo(); - AddItemToPool( sPutGridNo, pObj, 1 , this->pathing.bLevel, (WOLRD_ITEM_FIND_SWEETSPOT_FROM_GRIDNO|WORLD_ITEM_REACHABLE), -1 ); DeleteObj( &(this->inv[cnt]) ); } diff --git a/Utils/Text.h b/Utils/Text.h index 7118ead1..edf2e6c7 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -957,12 +957,20 @@ enum CLEAN_ONE_GUN_STR, CLEAN_ALL_GUNS_STR, TAKE_OFF_CLOTHES_STR, + TAKE_OFF_DISGUISE_STR, + MILITIA_DROP_EQ_STR, + MILITIA_PICK_UP_EQ_STR, + SPY_SELFTEST_STR, + UNUSED_STR, + CORPSE_SELECTION_STR, DECAPITATE_STR, GUT_STR, TAKE_CLOTHES_STR, TAKE_BODY_STR, + WEAPON_CLEANING_STR, + PRISONER_NO_PRISONS_STR, PRISONER_DECIDE_STR, PRISONER_LETGO_STR, @@ -970,9 +978,6 @@ enum PRISONER_DEMAND_SURRENDER_STR, PRISONER_OFFER_SURRENDER_STR, PRISONER_TALK_STR, - MILITIA_DROP_EQ_STR, - SPY_SELFTEST_STR, - UNUSED_STR, TEXT_NUM_TACTICAL_STR }; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index e1aae69a..8e53f3b2 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -2937,6 +2937,11 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"清理枪支污垢(佣兵)", L"清理所有枪支污垢(小队)", L"脱掉衣服", + L"Lose disguise", + L"民兵检查", //L"Militia inspection", + L"Militia restock", + L"测试伪装", //L"Test disguise", + L"unused", // added by Flugente: decide what to do with the corpses L"你想要对尸体做什么?", @@ -2956,9 +2961,6 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"劝说敌人投降", L"劝降", //L"Offer surrender", L"交谈", - L"民兵检查", //L"Militia inspection", - L"测试伪装", //L"Test disguise", - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface. diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 97676921..ec0aa17f 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -2929,12 +2929,17 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", - // added by Flugente: selection of a function to call in tactical // TODO.Translate + // added by Flugente: selection of a function to call in tactical L"What do you want to do?", L"Fill canteens", - L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Merc)", L"Clean guns (Team)", L"Take off clothes", + L"Lose disguise", + L"Militia inspection", + L"Militia restock", + L"Test disguise", + L"unused", // added by Flugente: decide what to do with the corpses L"What do you want to do with the body?", @@ -2948,15 +2953,12 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: decide what to do with prisoners L"You have no prison for these prisoners, you have to let them go", - L"Where do you want to send the prisoners?",//TODO.Translate + L"Where do you want to send the prisoners?", L"Let them go", L"What do you want to do?", L"Demand surrender", L"Offer surrender", L"Talk", - L"Militia inspection",//TODO.Translate - L"Test disguise", // TODO.Translate - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface. diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 90065e6b..06c56a5f 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -2937,6 +2937,11 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Clean guns (Merc)", L"Clean guns (Team)", L"Take off clothes", + L"Lose disguise", + L"Militia inspection", + L"Militia restock", + L"Test disguise", + L"unused", // added by Flugente: decide what to do with the corpses L"What do you want to do with the body?", @@ -2956,9 +2961,6 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Demand surrender", L"Offer surrender", L"Talk", - L"Militia inspection", - L"Test disguise", - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface. diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index e337d670..b31a0c90 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -2936,12 +2936,17 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", - // added by Flugente: selection of a function to call in tactical // TODO.Translate + // added by Flugente: selection of a function to call in tactical L"What do you want to do?", L"Fill canteens", - L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Merc)", L"Clean guns (Team)", L"Take off clothes", + L"Lose disguise", + L"Militia inspection", + L"Militia restock", + L"Test disguise", + L"unused", // added by Flugente: decide what to do with the corpses L"What do you want to do with the body?", @@ -2955,15 +2960,12 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: decide what to do with prisoners L"You have no prison for these prisoners, you have to let them go", - L"Where do you want to send the prisoners?",//TODO.Translate + L"Where do you want to send the prisoners?", L"Let them go", L"What do you want to do?", L"Demand surrender", L"Offer surrender", L"Talk", - L"Militia inspection",//TODO.Translate - L"Test disguise", // TODO.Translate - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface. diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index e1a4fa3e..bb3eb368 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -2936,9 +2936,14 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: selection of a function to call in tactical L"Was möchten Sie tun?", L"Feldflasche auffüllen", - L"Clean guns (Merc)",//TODO.Translate - L"Clean guns (Team)", + L"Waffen reinigen (Merc)", + L"Waffen reinigen (Team)", L"Kleidung ausziehen", + L"Verkleidung loswerden", + L"Miliz inspizieren", + L"Miliz ausrüsten", + L"Verkleidung testen", + L"unused", // added by Flugente: decide what to do with the corpses L"Was möchten Sie mit der Leiche tun?", @@ -2958,9 +2963,6 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Kapitulation fordern", L"Kapitulation anbieten", L"Sprechen", - L"Miliz inspizieren", - L"Verkleidung testen", - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface. diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index aaa06fb6..4126b6b3 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -2923,12 +2923,17 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", - // added by Flugente: selection of a function to call in tactical // TODO.Translate + // added by Flugente: selection of a function to call in tactical L"What do you want to do?", L"Fill canteens", - L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Merc)", L"Clean guns (Team)", L"Take off clothes", + L"Lose disguise", + L"Militia inspection", + L"Militia restock", + L"Test disguise", + L"unused", // added by Flugente: decide what to do with the corpses L"What do you want to do with the body?", @@ -2942,15 +2947,12 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: decide what to do with prisoners L"You have no prison for these prisoners, you have to let them go", - L"Where do you want to send the prisoners?",//TODO.Translate + L"Where do you want to send the prisoners?", L"Let them go", L"What do you want to do?", L"Demand surrender", L"Offer surrender", L"Talk", - L"Militia inspection",//TODO.Translate - L"Test disguise", // TODO.Translate - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface. diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index b9fee09b..77ed355b 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -2939,12 +2939,17 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", - // added by Flugente: selection of a function to call in tactical // TODO.Translate + // added by Flugente: selection of a function to call in tactical L"What do you want to do?", L"Fill canteens", - L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Merc)", L"Clean guns (Team)", L"Take off clothes", + L"Lose disguise", + L"Militia inspection", + L"Militia restock", + L"Test disguise", + L"unused", // added by Flugente: decide what to do with the corpses L"What do you want to do with the body?", @@ -2958,15 +2963,12 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: decide what to do with prisoners L"You have no prison for these prisoners, you have to let them go", - L"Where do you want to send the prisoners?",//TODO.Translate + L"Where do you want to send the prisoners?", L"Let them go", L"What do you want to do?", L"Demand surrender", L"Offer surrender", L"Talk", - L"Militia inspection",//TODO.Translate - L"Test disguise", // TODO.Translate - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface. diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index d4379b2b..9ac31976 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -2936,6 +2936,11 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Clean guns (Merc)",//TODO.Translate L"Clean guns (Team)", L"Снять одежду", + L"Lose disguise", + L"Militia inspection", + L"Militia restock", + L"Test disguise", + L"unused", // added by Flugente: decide what to do with the corpses L"Что будем делать с телом?", @@ -2955,9 +2960,6 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Требовать сдаться", L"Предлоить сдаться", L"Переговоры", - L"Militia inspection",//TODO.Translate - L"Test disguise", // TODO.Translate - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface. diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index 67c42907..8b5f23b2 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -2933,12 +2933,17 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = L"Health: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", L"Health: %d/%d\nPoison: %d/%d\nEnergy: %d/%d\nMorale: %s\nWater: %d%s\nFood: %d%s", - // added by Flugente: selection of a function to call in tactical // TODO.Translate + // added by Flugente: selection of a function to call in tactical L"What do you want to do?", L"Fill canteens", - L"Clean guns (Merc)",//TODO.Translate + L"Clean guns (Merc)", L"Clean guns (Team)", L"Take off clothes", + L"Lose disguise", + L"Militia inspection", + L"Militia restock", + L"Test disguise", + L"unused", // added by Flugente: decide what to do with the corpses L"What do you want to do with the body?", @@ -2952,15 +2957,12 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] = // added by Flugente: decide what to do with prisoners L"You have no prison for these prisoners, you have to let them go", - L"Where do you want to send the prisoners?",//TODO.Translate + L"Where do you want to send the prisoners?", L"Let them go", L"What do you want to do?", L"Demand surrender", L"Offer surrender", L"Talk", - L"Militia inspection",//TODO.Translate - L"Test disguise", // TODO.Translate - L"unused", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.