From 5a0d93da949bb98689ba6705d1fce07f5a7af994 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 14 Sep 2014 14:02:16 +0000 Subject: [PATCH] Feature improvement: - If MILITIA_USE_SECTOR_EQUIPMENT is TRUE and you assign a merc to the 'MOVE ITEM' assignment, you can select wether gear that the militia can use should be ignored. - To prevent confusion, 'MOVE ITEM' has been renamed 'GETITEM'. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7517 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameVersion.cpp | 18 +-- Strategic/Assignments.cpp | 205 ++++++++++++--------------- Strategic/Strategic Town Loyalty.cpp | 15 +- Tactical/DynamicDialogue.cpp | 6 + Tactical/Items.cpp | 22 ++- Tactical/Items.h | 3 + Tactical/Soldier Control.h | 2 +- Utils/_ChineseText.cpp | 8 +- Utils/_DutchText.cpp | 10 +- Utils/_EnglishText.cpp | 62 +++++++- Utils/_ItalianText.cpp | 10 +- Utils/_PolishText.cpp | 10 +- 12 files changed, 211 insertions(+), 160 deletions(-) diff --git a/GameVersion.cpp b/GameVersion.cpp index 6b938394..17dc34ad 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -15,9 +15,9 @@ #ifdef JA2EDITOR #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7514 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7517 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7514 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7517 (Development Build)" }; #endif // ------------------------------ @@ -27,11 +27,11 @@ //DEBUG BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7514 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7517 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7514 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7517 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7514 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7517 (Development Build)" }; #endif #elif defined CRIPPLED_VERSION @@ -46,16 +46,16 @@ //RELEASE BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7514 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7517 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7514 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7517 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Release v1.13.7514 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.7517 (Development Build)" }; #endif #endif -CHAR8 czVersionNumber[16] = { "Build 14.09.13" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 14.09.14" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 0fcefed1..306c0801 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -133,16 +133,8 @@ enum{ }; enum{ - MOVEITEM_MENU_1 = 0, - MOVEITEM_MENU_2, - MOVEITEM_MENU_3, - MOVEITEM_MENU_4, - MOVEITEM_MENU_5, - MOVEITEM_MENU_6, - MOVEITEM_MENU_7, - MOVEITEM_MENU_8, - MOVEITEM_MENU_9, - MOVEITEM_MENU_10, + MOVEITEM_MAX_SECTORS = 10, + MOVEITEM_MAX_SECTORS_WITH_MODIFIER = 2 * MOVEITEM_MAX_SECTORS, MOVEITEM_MENU_CANCEL, }; @@ -232,8 +224,7 @@ MOUSE_REGION gRepairMenuRegion[ 20 ]; MOUSE_REGION gMoveItem[ 20 ]; MOUSE_REGION gDisease[DISEASE_MENU_CANCEL + 1]; -#define MOVEITEM_MAX_SECTORS 10 -UINT8 usMoveItemSectors[MOVEITEM_MAX_SECTORS]; +UINT8 usMoveItemSectors[MOVEITEM_MAX_SECTORS_WITH_MODIFIER]; // mouse region for vehicle menu MOUSE_REGION gVehicleMenuRegion[ 20 ]; @@ -7279,7 +7270,7 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) return; // we loop over all mercs with this assignment in this sector, and then do a separate loop over each target sector - std::map sectormercmap; // this map uses the sectors we take stuff from as keys and the number of mercs as elements + std::map > sectormercmap; // this map uses the sectors we take stuff from as keys and the number of mercs as elements // we need a gridno to which we drop stuff INT32 sDropOffGridNo = gMapInformation.sCenterGridNo; @@ -7298,11 +7289,26 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) { // which sector do we want to move stuff to? UINT8 targetsector = pSoldier->usItemMoveSectorID; + + if ( sectormercmap.find( targetsector ) != sectormercmap.end() ) + { + sectormercmap[targetsector].first++; - if ( sectormercmap[targetsector] ) - sectormercmap[targetsector]++; + // it is possible that this guy only moves stuff that is not reserved for the militia + if ( pSoldier->usSoldierFlagMask & SOLDIER_MOVEITEM_RESTRICTED ) + sectormercmap[targetsector].second++; + } else - sectormercmap[targetsector] = 1; + { + std::pair pair; + pair.first = 1; + + // it is possible that this guy only moves stuff that is not reserved for the militia + if ( pSoldier->usSoldierFlagMask & SOLDIER_MOVEITEM_RESTRICTED ) + pair.second = 1; + + sectormercmap[targetsector] = pair; + } if ( pSoldier->sGridNo != NOWHERE ) sDropOffGridNo = pSoldier->sGridNo; @@ -7320,10 +7326,11 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) std::vector pWorldItem_Target;//dnl ch75 271013 // now loop over all sectors from which we take stuff, and move the equipment - std::map::iterator itend = sectormercmap.end(); - for (std::map::iterator it = sectormercmap.begin(); it != itend; ++it) + std::map >::iterator itend = sectormercmap.end( ); + for ( std::map >::iterator it = sectormercmap.begin( ); it != itend; ++it ) { UINT8 sector = (*it).first; + std::pair pair = (*it).second; INT16 targetX = SECTORX(sector); INT16 targetY = SECTORY(sector); @@ -7340,8 +7347,12 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) continue; // each soldier can carry 40 items or 40 kg, and needs 10 minutes (two way walk) per sector distance, thereby 6 / distance runs possible per hour - UINT16 maxitems = 40 * (*it).second * 6 / distance; - UINT16 maxweight = 400 * (*it).second * 6 / distance; + UINT16 maxitems = 40 * pair.first * 6 / distance; + UINT16 maxweight = 400 * pair.first * 6 / distance; + + // we have to differentiate between items that the militia might use and all other items, as there is an option to only move non-militia gear + UINT16 maxitems_militiagear = 40 * (pair.first - pair.second) * 6 / distance; + UINT16 maxweight_militiagear = 400 * (pair.first - pair.second) * 6 / distance; // open the inventory of the sector we are taking stuff from SECTORINFO *pSectorInfo_Target = &( SectorInfo[ SECTOR(targetX, targetY) ] ); @@ -7375,6 +7386,8 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) // move items from Target to Here UINT16 moveditems = 0; UINT32 movedweight = 0; + UINT16 moveditems_militiagear = 0; + UINT32 movedweight_militiagear = 0; OBJECTTYPE* pObjectToMove = new OBJECTTYPE[uiTotalNumberOfRealItems_Target]; UINT8 moveobjectcounter = 0; @@ -7389,6 +7402,19 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) if ( pObj != NULL && pObj->exists() ) // ... if pointer is not obviously useless ... { + // can this object can be used by militia? + if ( ObjectIsMilitiaRelevant( pObj ) ) + { + // if we can still move militia gear, do so. Otherwise ignore this object. + if ( moveditems_militiagear < maxitems_militiagear && movedweight_militiagear < maxweight_militiagear ) + { + moveditems_militiagear += pObj->ubNumberOfObjects; + movedweight_militiagear += CalculateObjectWeight( pObj ); + } + else + continue; + } + moveditems += pObj->ubNumberOfObjects; movedweight += CalculateObjectWeight(pObj); @@ -7476,8 +7502,8 @@ void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ ) } // award a bit of experience to the movers - UINT16 itemsperperson = moveditems / (*it).second; - UINT16 weightperperson = movedweight / (*it).second; + UINT16 itemsperperson = moveditems / pair.first; + UINT16 weightperperson = movedweight / pair.first; for ( uiCnt = firstid, pSoldier = MercPtrs[ uiCnt ]; uiCnt <= lastid; ++uiCnt, ++pSoldier) { if( pSoldier->bActive && ( pSoldier->sSectorX == sMapX ) && ( pSoldier->sSectorY == sMapY ) && ( pSoldier->bSectorZ == bZ) && pSoldier->flags.fMercAsleep == FALSE ) @@ -21018,7 +21044,7 @@ BOOLEAN DisplayMoveItemsMenu( SOLDIERTYPE *pSoldier ) SetCurrentBox(ghMoveItemBox); // delete old sectors - for (UINT8 i = 0; i < MOVEITEM_MAX_SECTORS; ++i) + for ( UINT8 i = 0; i < MOVEITEM_MAX_SECTORS_WITH_MODIFIER; ++i ) { usMoveItemSectors[i] = 0; } @@ -21049,8 +21075,19 @@ BOOLEAN DisplayMoveItemsMenu( SOLDIERTYPE *pSoldier ) AddMonoString( (UINT32 *)&hStringHandle, wSectorName ); + if ( gGameExternalOptions.fMilitiaUseSectorInventory ) + { + usMoveItemSectors[iCount + 10] = (UINT8)X; + + // Set string for generic button + CHAR16 bla[64]; + swprintf( bla, L"%s - No militia gear", wSectorName ); + + AddMonoString( (UINT32 *)&hStringHandle, bla ); + } + ++iCount; - if ( iCount >= MOVEITEM_MAX_SECTORS ) + if ( iCount >= MOVEITEM_MENU_CANCEL ) break; } } @@ -21076,64 +21113,7 @@ BOOLEAN DisplayMoveItemsMenu( SOLDIERTYPE *pSoldier ) void HandleShadingOfLinesForMoveItemMenu( void ) { - SOLDIERTYPE *pSoldier = NULL; - INT32 iVehicleIndex = 0; - INT32 iCount = 0; - - if( ( fShowMoveItemMenu == FALSE ) || ( ghMoveItemBox == -1 ) ) - { - return; - } - - pSoldier = GetSelectedAssignSoldier( FALSE ); - - // PLEASE NOTE: make sure any changes you do here are reflected in all 3 routines which must remain in synch: - // CreateDestroyMouseRegionForMoveItemMenu(), DisplayRepairMenu(), and HandleShadingOfLinesForMoveItemMenu(). - - // we now have to show every sector of the town we are in - INT8 bTownId = GetTownIdForSector( pSoldier->sSectorX, pSoldier->sSectorY ); - - // only in towns - if ( bTownId != BLANK_SECTOR && pSoldier->bSectorZ == 0 ) - { - for(UINT i = 0; i < MOVEITEM_MAX_SECTORS; ++i) - { - UINT8 sector = usMoveItemSectors[i]; - - if ( sector > 0 ) - { - INT16 sectorX = SECTORX(sector); - INT16 sectorY = SECTORY(sector); - - UINT32 uiTotalNumberOfRealItems = 0; - GetNumberOfWorldItemsFromTempItemFile( sectorX, sectorY, 0, &( uiTotalNumberOfRealItems ), FALSE ); - - if ( uiTotalNumberOfRealItems > 0 ) - { - // unshade vehicle line - UnShadeStringInBox( ghMoveItemBox, iCount ); - } - else - { - // shade vehicle line - ShadeStringInBox( ghMoveItemBox, iCount ); - } - } - } - } - - if ( 1 ) - { - // unshade items line - UnShadeStringInBox( ghMoveItemBox, iCount ); - } - else - { - // shade items line - ShadeStringInBox( ghMoveItemBox, iCount ); - } - - ++iCount; + // we only select those sectors from which we can take anything anyway - so nothing to be done here } @@ -21190,22 +21170,23 @@ void CreateDestroyMouseRegionForMoveItemMenu( void ) // only in towns if ( bTownId != BLANK_SECTOR && pSoldier->bSectorZ == 0 ) { - for(UINT i = 0; i < MOVEITEM_MAX_SECTORS; ++i) + for ( UINT i = 0; i < MOVEITEM_MAX_SECTORS_WITH_MODIFIER; ++i ) { UINT8 sector = usMoveItemSectors[i]; if ( sector > 0 ) { // add mouse region for each line of text..and set user data - MSYS_DefineRegion( &gMoveItem[ iCount ], ( INT16 )( iBoxXPosition ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * iCount ), ( INT16 )( iBoxXPosition + iBoxWidth ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * ( iCount + 1 ) ), MSYS_PRIORITY_HIGHEST - 4 , - MSYS_NO_CURSOR, MoveItemMenuMvtCallback, MoveItemMenuBtnCallback ); + MSYS_DefineRegion( &gMoveItem[ iCount ], + ( INT16 )( iBoxXPosition ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * iCount ), ( INT16 )( iBoxXPosition + iBoxWidth ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * ( iCount + 1 ) ), + MSYS_PRIORITY_HIGHEST - 4 , MSYS_NO_CURSOR, MoveItemMenuMvtCallback, MoveItemMenuBtnCallback ); - MSYS_SetRegionUserData( &gMoveItem[ iCount ], 0, iCount ); - // 2nd user data is the vehicle index, which can easily be different from the region index! - MSYS_SetRegionUserData( &gMoveItem[ iCount ], 1, iCount ); - iCount++; + // first data is for entry in usMoveItemSectors, second is for regiondate number + MSYS_SetRegionUserData( &gMoveItem[iCount], 0, i ); + MSYS_SetRegionUserData( &gMoveItem[iCount], 1, iCount ); + ++iCount; - if ( iCount >= MOVEITEM_MAX_SECTORS ) + if ( iCount >= MOVEITEM_MENU_CANCEL ) break; } } @@ -21215,9 +21196,8 @@ void CreateDestroyMouseRegionForMoveItemMenu( void ) MSYS_DefineRegion( &gMoveItem[ iCount ], ( INT16 )( iBoxXPosition ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * iCount ), ( INT16 )( iBoxXPosition + iBoxWidth ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * ( iCount + 1 ) ), MSYS_PRIORITY_HIGHEST - 4 , MSYS_NO_CURSOR, MoveItemMenuMvtCallback, MoveItemMenuBtnCallback ); - MSYS_SetRegionUserData( &gMoveItem[ iCount ], 0, iCount ); - MSYS_SetRegionUserData( &gMoveItem[ iCount ], 1, MOVEITEM_MENU_CANCEL ); - + MSYS_SetRegionUserData( &gMoveItem[iCount], 0, MOVEITEM_MENU_CANCEL ); + MSYS_SetRegionUserData( &gMoveItem[iCount], 1, iCount ); PauseGame( ); @@ -21231,7 +21211,7 @@ void CreateDestroyMouseRegionForMoveItemMenu( void ) fCreated = FALSE; // remove these regions - for( uiCounter = 0; uiCounter < GetNumberOfLinesOfTextInBox( ghMoveItemBox ); uiCounter++ ) + for( uiCounter = 0; uiCounter < GetNumberOfLinesOfTextInBox( ghMoveItemBox ); ++uiCounter ) { MSYS_RemoveRegion( &gMoveItem[ uiCounter ] ); } @@ -21254,10 +21234,6 @@ void CreateDestroyMouseRegionForMoveItemMenu( void ) void MoveItemMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) { - // btn callback handler for assignment region - SOLDIERTYPE *pSoldier = NULL; - INT32 iWhat; - INT32 iValue = MSYS_GetRegionUserData( pRegion, 0 ); // ignore clicks on disabled lines @@ -21265,15 +21241,12 @@ void MoveItemMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) { return; } - - // WHAT is being repaired is stored in the second user data argument - iWhat = MSYS_GetRegionUserData( pRegion, 1 ); - - pSoldier = GetSelectedAssignSoldier( FALSE ); + + SOLDIERTYPE* pSoldier = GetSelectedAssignSoldier( FALSE ); if ( pSoldier && pSoldier->bActive && ( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP ) ) { - if( iWhat < MOVEITEM_MENU_CANCEL ) + if ( iValue < MOVEITEM_MENU_CANCEL ) { pSoldier->bOldAssignment = pSoldier->bAssignment; @@ -21292,8 +21265,19 @@ void MoveItemMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) ChangeSoldiersAssignment( pSoldier, MOVE_EQUIPMENT ); - if ( iWhat < MOVEITEM_MAX_SECTORS ) - pSoldier->usItemMoveSectorID = usMoveItemSectors[iWhat]; + // depending on exact setting, add or remove the flag that controls wether we ignore stuff the militia might use + if ( iValue < MOVEITEM_MAX_SECTORS ) + { + pSoldier->usItemMoveSectorID = usMoveItemSectors[iValue]; + + pSoldier->usSoldierFlagMask &= ~SOLDIER_MOVEITEM_RESTRICTED; + } + else if ( iValue < MOVEITEM_MAX_SECTORS_WITH_MODIFIER ) + { + pSoldier->usItemMoveSectorID = usMoveItemSectors[iValue]; + + pSoldier->usSoldierFlagMask |= SOLDIER_MOVEITEM_RESTRICTED; + } // assign to a movement group AssignMercToAMovementGroup( pSoldier ); @@ -21321,23 +21305,18 @@ void MoveItemMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) void MoveItemMenuMvtCallback(MOUSE_REGION * pRegion, INT32 iReason ) { // mvt callback handler for assignment region - INT32 iValue = MSYS_GetRegionUserData( pRegion, 0 ); + INT32 iValue = MSYS_GetRegionUserData( pRegion, 1 ); if (iReason & MSYS_CALLBACK_REASON_GAIN_MOUSE ) { if( iValue < MOVEITEM_MENU_CANCEL ) { - if( GetBoxShadeFlag( ghMoveItemBox, iValue ) == FALSE ) + if( !GetBoxShadeFlag( ghMoveItemBox, iValue ) ) { // highlight choice HighLightBoxLine( ghMoveItemBox, iValue ); } } - else - { - // highlight cancel line - HighLightBoxLine( ghMoveItemBox, GetNumberOfLinesOfTextInBox( ghMoveItemBox ) - 1 ); - } } else if (iReason & MSYS_CALLBACK_REASON_LOST_MOUSE ) { diff --git a/Strategic/Strategic Town Loyalty.cpp b/Strategic/Strategic Town Loyalty.cpp index 3eb45cb3..ec3846fc 100644 --- a/Strategic/Strategic Town Loyalty.cpp +++ b/Strategic/Strategic Town Loyalty.cpp @@ -2058,20 +2058,11 @@ void HandleLoyaltyImplicationsOfMercRetreat( INT8 bRetreatCode, INT16 sSectorX, // if not worse than 2:1 odds, then penalize morale // SANDRO - Set the odds based on difficulty level - UINT8 DiffLevel; - if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY ) - DiffLevel = 1; - else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM ) - DiffLevel = 2; - else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD ) - DiffLevel = 3; - else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE ) - DiffLevel = 4; - else - DiffLevel = 1; + UINT8 DiffLevel = gGameOptions.ubDifficultyLevel; + if ( DiffLevel > DIF_LEVEL_INSANE ) + DiffLevel = 1; if ( gTacticalStatus.fEnemyInSector && ( (PlayerStrength() * (2 + DiffLevel)) >= EnemyStrength() ) ) - //if ( gTacticalStatus.fEnemyInSector && ( (PlayerStrength() * (2 + gGameOptions.ubDifficultyLevel)) >= EnemyStrength() ) ) { HandleMoraleEvent( NULL, MORALE_RAN_AWAY, sSectorX, sSectorY, (INT8)sSectorZ ); } diff --git a/Tactical/DynamicDialogue.cpp b/Tactical/DynamicDialogue.cpp index f8e94e67..34ddcb16 100644 --- a/Tactical/DynamicDialogue.cpp +++ b/Tactical/DynamicDialogue.cpp @@ -2069,12 +2069,18 @@ void HandleDynamicOpinionChange( SOLDIERTYPE* pSoldier, UINT8 usEvent, BOOLEAN f if ( !pTeamSoldier->iTotalContractLength || (pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC && pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__MERC && pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__NPC_WITH_UNEXTENDABLE_CONTRACT) ) continue; + // A gets offended of B if + // mean wage(B) >= ( WAGE_ACCEPTANCE_FACTOR * level(B) / level(A) ) * mean wage(A) + // which equals + // mean wage(B) / level(B) >= WAGE_ACCEPTANCE_FACTOR * mean wage(A) / level(A) + // their wage UINT32 theirmeanwage = gMercProfiles[pTeamSoldier->ubProfile].uiTotalCostToDate / pTeamSoldier->iTotalContractLength; // adjust this for experience levels FLOAT explevelfactor = gGameExternalOptions.fDynamicWageFactor * pTeamSoldier->stats.bExpLevel / explevel; + // abort if their mean wage isn't that high if ( theirmeanwage < explevelfactor * meanwage ) continue; } diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 3a040dcc..176caf31 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -15409,4 +15409,24 @@ void AttachDefaultAttachments(OBJECTTYPE *pObj, BOOLEAN fAllDefaultAttachments)/ pObj->AttachObject(NULL, &defaultAttachment, FALSE); } } -} \ No newline at end of file +} + +// Flugente: is this object useable by militia? +BOOLEAN ObjectIsMilitiaRelevant( OBJECTTYPE *pObj ) +{ + if ( !pObj ) + return FALSE; + + if ( gGameExternalOptions.fMilitiaUseSectorInventory ) + { + if ( Item[pObj->usItem].usItemClass & IC_ARMOUR && gGameExternalOptions.fMilitiaUseSectorInventory_Armour ) return TRUE; + if ( Item[pObj->usItem].usItemClass & IC_FACE && gGameExternalOptions.fMilitiaUseSectorInventory_Face ) return TRUE; + if ( Item[pObj->usItem].usItemClass & (IC_BLADE | IC_PUNCH) && gGameExternalOptions.fMilitiaUseSectorInventory_Melee ) return TRUE; + if ( Item[pObj->usItem].usItemClass & IC_GRENADE && gGameExternalOptions.fMilitiaUseSectorInventory_Grenade ) return TRUE; + if ( Item[pObj->usItem].usItemClass & (IC_GUN | IC_AMMO) && gGameExternalOptions.fMilitiaUseSectorInventory_Gun ) return TRUE; + if ( Item[pObj->usItem].usItemClass & IC_LAUNCHER && gGameExternalOptions.fMilitiaUseSectorInventory_Launcher ) return TRUE; + if ( Item[pObj->usItem].usItemClass & IC_AMMO && gGameExternalOptions.fMilitiaUseSectorInventory_Ammo ) return TRUE; + } + + return FALSE; +} diff --git a/Tactical/Items.h b/Tactical/Items.h index 4b401c12..dd7f938b 100644 --- a/Tactical/Items.h +++ b/Tactical/Items.h @@ -540,6 +540,9 @@ UINT8 GetInventorySleepModifier( SOLDIERTYPE *pSoldier ); void AttachDefaultAttachments(OBJECTTYPE *pObj, BOOLEAN fAllDefaultAttachments=TRUE);//dnl ch75 261013 +// Flugente: is this object useable by militia? +BOOLEAN ObjectIsMilitiaRelevant( OBJECTTYPE *pObj ); + #endif diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index 826e0762..17b12aee 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -393,7 +393,7 @@ enum #define SOLDIER_VIP 0x10000000 //268435456 // soldier is a VIP - the player will likely try to assassinate him #define SOLDIER_BODYGUARD 0x20000000 //536870912 // soldier is a bodyguard for a VIP/* #define SOLDIER_COVERT_TEMPORARY_OVERT 0x40000000 //1073741824 // we are covert, but just performed a obviously suspicious task. For a short time, we can be uncovered more easily -//#define WH40K_SOLDIER_KILLTHISTURN 0x80000000 //2147483648 // Soldier is on a kill streak*/ +#define SOLDIER_MOVEITEM_RESTRICTED 0x80000000 //2147483648 // when moving item, this soldier will not pick up equipment the militia might use // ---------------------------------------------------------------- // ------------------- more flags for soldiers -------------------- diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index 74594273..4baa0b7f 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -1847,7 +1847,7 @@ STR16 pAssignmentStrings[] = L"游击队", //L"M.Militia", //training moving militia units //ham3.6 L"教练", // training a teammate L"学员", // being trained by someone else - L"搬运物品", // move items + L"Get Item", // get items // TODO.Translate L"兼职", // L"Staff", // operating a strategic facility //ham3.6 L"用餐", // eating at a facility (cantina etc.) L"休息", //L"Rest",// Resting at a facility //ham3.6 @@ -1945,7 +1945,7 @@ STR16 pPersonnelAssignmentStrings[] = L"训练游击队", L"教练", L"学员", - L"搬运物品", // move items + L"Get Item", // get items // TODO.Translate L"兼职", L"用餐", // eating at a facility (cantina etc.) L"休养", @@ -2003,7 +2003,7 @@ STR16 pLongAssignmentStrings[] = L"训练游击队", //L"Train Mobiles", L"训练队友", L"学员", - L"搬运物品", // move items + L"Get Item", // get items // TODO.Translate L"兼职", //L"Staff Facility", L"休养", //L"Rest at Facility", L"审讯俘虏", // L"Interrogate prisoners", @@ -2140,7 +2140,7 @@ STR16 pAssignMenuStrings[] = L"无线电扫描", // Flugente: the merc is scanning for patrols in neighbouring sectors L"告发", // anv: snitch actions L"训练", - L"搬运物品", // move items + L"Get Item", // get items // TODO.Translate L"设施", // L"Facility", // the merc is using/staffing a facility //ham3.6 L"取消", }; diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index a48af7e6..65487b48 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -1844,7 +1844,7 @@ STR16 pAssignmentStrings[] = L"M.Militia", //training moving militia units // TODO.Translate L"Trainer", // training a teammate L"Student", // being trained by someone else - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Staff", // operating a strategic facility // TODO.Translate L"Eat", // eating at a facility (cantina etc.) // TODO.Translate L"Rest", // Resting at a facility // TODO.Translate @@ -1942,7 +1942,7 @@ STR16 pPersonnelAssignmentStrings[] = L"Training Mobile Militia", // TODO.Translate L"Trainer", // training a teammate L"Student", // being trained by someone else - L"Move item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Facility Staff", // TODO.Translate L"Eat", // eating at a facility (cantina etc.) // TODO.Translate L"Resting at Facility", // TODO.Translate @@ -2000,7 +2000,7 @@ STR16 pLongAssignmentStrings[] = L"Train Mobiles", // TODO.Translate L"Trainer", // training a teammate L"Student", // being trained by someone else - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Staff Facility", // TODO.Translate L"Rest at Facility", // TODO.Translate L"Interrogate prisoners", // Flugente: interrogate prisoners TODO.Translate @@ -2137,7 +2137,7 @@ STR16 pAssignMenuStrings[] = L"Radio Scan", // Flugente: the merc is scanning for patrols in neighbouring sectors L"Snitch", // TODO.Translate // anv: snitch actions L"Train", // the merc is training - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Facility", // the merc is using/staffing a facility // TODO.Translate L"Stop", // cancel this menu }; @@ -3690,7 +3690,7 @@ STR16 pMapScreenInvenButtonHelpText[] = L"|L|e|f|t |C|l|i|c|k: Toggle Kits\n|R|i|g|h|t |C|l|i|c|k: Show only Kits", // HEADROCK HAM 5: Filter Button // 16 - 20 L"|L|e|f|t |C|l|i|c|k: Toggle Misc. Items\n|R|i|g|h|t |C|l|i|c|k: Show only Misc. Items", // HEADROCK HAM 5: Filter Button - L"Toggle Move Item Display", // Flugente: move item display // TODO.Translate + L"Toggle Get Item Display", // Flugente: move item display // TODO.Translate }; STR16 pMapScreenBottomFastHelp[] = diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index aa35c429..8d1787a4 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -1848,7 +1848,7 @@ STR16 pAssignmentStrings[] = L"M.Militia", //training moving militia units L"Trainer", // training a teammate L"Student", // being trained by someone else - L"MoveItem", // move items + L"GetItem", // move items L"Staff", // operating a strategic facility L"Eat", // eating at a facility (cantina etc.) L"Rest", // Resting at a facility @@ -1946,7 +1946,7 @@ STR16 pPersonnelAssignmentStrings[] = L"Training Mobile Militia", // Missing L"Trainer", L"Student", - L"Move item", // move items + L"Get item", // move items L"Facility Staff", // Missing L"Eat", // eating at a facility (cantina etc.) L"Resting at Facility", // Missing @@ -2004,7 +2004,7 @@ STR16 pLongAssignmentStrings[] = L"Train Mobiles", // Missing L"Train Teammate", L"Student", - L"Move Item", // move items + L"Get Item", // move items L"Staff Facility", // Missing L"Rest at Facility", // Missing L"Interrogate prisoners", // Flugente: interrogate prisoners @@ -2141,7 +2141,7 @@ STR16 pAssignMenuStrings[] = L"Radio Scan", // Flugente: the merc is scanning for patrols in neighbouring sectors L"Snitch", // anv: snitch actions L"Train", // the merc is training - L"Move Item", // move items + L"Get Item", // move items L"Facility", // the merc is using/staffing a facility L"Cancel", // cancel this menu }; @@ -3689,7 +3689,7 @@ STR16 pMapScreenInvenButtonHelpText[] = L"|L|e|f|t |C|l|i|c|k: Toggle Kits\n|R|i|g|h|t |C|l|i|c|k: Show only Kits", // HEADROCK HAM 5: Filter Button // 16 - 20 L"|L|e|f|t |C|l|i|c|k: Toggle Misc. Items\n|R|i|g|h|t |C|l|i|c|k: Show only Misc. Items", // HEADROCK HAM 5: Filter Button - L"Toggle Move Item Display", // Flugente: move item display + L"Toggle Get Item Display", // Flugente: move item display }; STR16 pMapScreenBottomFastHelp[] = @@ -8764,6 +8764,32 @@ STR16 szCampaignStatsOperationPrefix[] = L"Steadfast %s", // 100 + L"Narcoleptic %s", + L"Bleached %s", + L"Nail-biting %s", + L"Smite the %s", + + L"Bloodthirsty %s", + L"Obese %s", + L"Scheming %s", + L"Tree-Humping %s", + + L"Cheaply made %s", + L"Sanctified %s", + L"Falsely accused %s", + L"%s to the rescue", + + L"Crab-people vs. %s", + L"%s in Space!!!", + L"%s vs. Godzilla", + L"Untamed %s", + + L"Durable %s", + L"Brazen %s", + L"Greedy %s", + L"Midnight %s", + + // 120 }; STR16 szCampaignStatsOperationSuffix[] = @@ -8898,6 +8924,32 @@ STR16 szCampaignStatsOperationSuffix[] = L"Mutual Fund", // 100 + L"Uniform", + L"Saber", + L"Snow Leopard", + L"Panther", + + L"Centaur", + L"Scorpion", + L"Serpent", + L"Black Widow", + + L"Tarantula", + L"Vulture", + L"Heretic", + L"Zombie", + + L"Role-Model", + L"Hellhound", + L"Mongoose", + L"Nurse", + + L"Nun", + L"", + L"", + L"", + + // 120 }; STR16 szMercCompareWebSite[] = diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index e2a34f07..6ac7c97d 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -1840,7 +1840,7 @@ STR16 pAssignmentStrings[] = L"M.Militia", //training moving militia units // TODO.Translate L"Istrutt.", // training a teammate L"Studente", // being trained by someone else - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Staff", // operating a strategic facility // TODO.Translate L"Eat", // eating at a facility (cantina etc.) // TODO.Translate L"Rest", // Resting at a facility // TODO.Translate @@ -1938,7 +1938,7 @@ STR16 pPersonnelAssignmentStrings[] = L"Training Mobile Militia", // TODO.Translate L"Allenatore", L"Studente", - L"Move item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Facility Staff", // TODO.Translate L"Eat", // eating at a facility (cantina etc.) // TODO.Translate L"Resting at Facility", // TODO.Translate @@ -1996,7 +1996,7 @@ STR16 pLongAssignmentStrings[] = L"Train Mobiles", // TODO.Translate L"Allena squadra", L"Studente", - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Staff Facility", // TODO.Translate L"Rest at Facility", // TODO.Translate L"Interrogate prisoners", // Flugente: interrogate prisoners TODO.Translate @@ -2133,7 +2133,7 @@ STR16 pAssignMenuStrings[] = L"Radio Scan", // Flugente: the merc is scanning for patrols in neighbouring sectors L"Snitch", // TODO.Translate // anv: snitch actions L"Si esercita", // the merc is training - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Facility", // the merc is using/staffing a facility // TODO.Translate L"Annulla", // cancel this menu }; @@ -3686,7 +3686,7 @@ STR16 pMapScreenInvenButtonHelpText[] = L"|L|e|f|t |C|l|i|c|k: Toggle Kits\n|R|i|g|h|t |C|l|i|c|k: Show only Kits", // HEADROCK HAM 5: Filter Button // 16 - 20 L"|L|e|f|t |C|l|i|c|k: Toggle Misc. Items\n|R|i|g|h|t |C|l|i|c|k: Show only Misc. Items", // HEADROCK HAM 5: Filter Button - L"Toggle Move Item Display", // Flugente: move item display // TODO.Translate + L"Toggle Get Item Display", // Flugente: move item display // TODO.Translate }; STR16 pMapScreenBottomFastHelp[] = diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 14bc8f03..57a7c409 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -1856,7 +1856,7 @@ STR16 pAssignmentStrings[] = L"R.Samoobr.", //training moving militia units L"Instruk.", // training a teammate L"Uczeń", // being trained by someone else - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Staff", // operating a strategic facility // TODO.Translate L"Eat", // eating at a facility (cantina etc.) // TODO.Translate L"Rest", // Resting at a facility // TODO.Translate @@ -1954,7 +1954,7 @@ STR16 pPersonnelAssignmentStrings[] = L"Training Mobile Militia", // TODO.Translate L"Instruktor", L"Uczeń", - L"Move item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Facility Staff", // TODO.Translate L"Eat", // eating at a facility (cantina etc.) // TODO.Translate L"Resting at Facility", // TODO.Translate @@ -2012,7 +2012,7 @@ STR16 pLongAssignmentStrings[] = L"Train Mobiles", // TODO.Translate L"Trenuj oddział", L"Uczeń", - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Staff Facility", // TODO.Translate L"Rest at Facility", // TODO.Translate L"Interrogate prisoners", // Flugente: interrogate prisoners TODO.Translate @@ -2149,7 +2149,7 @@ STR16 pAssignMenuStrings[] = L"Nasłuch", // Flugente: the merc is scanning for patrols in neighbouring sectors L"Kapuś", // anv: snitch actions L"Szkolenie", // the merc is training - L"Move Item", // move items // TODO.Translate + L"Get Item", // get items // TODO.Translate L"Facility", // the merc is using/staffing a facility // TODO.Translate L"Anuluj", // cancel this menu }; @@ -3699,7 +3699,7 @@ STR16 pMapScreenInvenButtonHelpText[] = L"|L|e|f|t |C|l|i|c|k: Toggle Kits\n|R|i|g|h|t |C|l|i|c|k: Show only Kits", // HEADROCK HAM 5: Filter Button // 16 - 20 L"|L|e|f|t |C|l|i|c|k: Toggle Misc. Items\n|R|i|g|h|t |C|l|i|c|k: Show only Misc. Items", // HEADROCK HAM 5: Filter Button - L"Toggle Move Item Display", // Flugente: move item display // TODO.Translate + L"Toggle Get Item Display", // Flugente: move item display // TODO.Translate }; STR16 pMapScreenBottomFastHelp[] =