diff --git a/GameSettings.cpp b/GameSettings.cpp index d05e3ffa..0e3b383f 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -434,6 +434,10 @@ void LoadGameExternalOptions() // Soldier tool tips gGameExternalOptions.gfAllowSoldierToolTips = iniReader.ReadBoolean("JA2 Tactical Settings","ALLOW_SOLDIER_TOOL_TIPS",0); + // Unload weapons & remove attachments + gGameExternalOptions.gfShiftFUnloadWeapons = iniReader.ReadBoolean("JA2 Tactical Settings","SHIFT_F_UNLOAD_WEAPONS",1); + gGameExternalOptions.gfShiftFRemoveAttachments = iniReader.ReadBoolean("JA2 Tactical Settings","SHIFT_F_REMOVE_ATTACHMENTS",1); + //################# Rain Settings ################## // Rain settings diff --git a/GameSettings.h b/GameSettings.h index 522021d4..bd522124 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -251,6 +251,9 @@ typedef struct UINT32 ubVisDistDecreasePerRainIntensity; BOOLEAN gfAllowLimitedVision; + BOOLEAN gfShiftFUnloadWeapons; + BOOLEAN gfShiftFRemoveAttachments; + // Rain settings BOOLEAN gfAllowRain; UINT32 gusRainChancePerDay; diff --git a/GameVersion.cpp b/GameVersion.cpp index e796b33b..a3b68463 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,12 +23,12 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - wchar_t zVersionLabel[256] = { L"Release v1.13.839" }; + wchar_t zVersionLabel[256] = { L"Release v1.13.844" }; #endif -INT8 czVersionNumber[16] = { "Build 07.04.07" }; //YY.MM.DD +INT8 czVersionNumber[16] = { "Build 07.04.19" }; //YY.MM.DD wchar_t zTrackingNumber[16] = { L"Z" }; diff --git a/JA2.vcproj b/JA2.vcproj index ca644882..7ea293e5 100644 --- a/JA2.vcproj +++ b/JA2.vcproj @@ -546,7 +546,7 @@ usGunAmmoItem = pAttachment->usItem; + + if ( fValidLaunchable ) + { + pTargetObj->usGunAmmoItem = pAttachment->usItem; + } } } diff --git a/Tactical/Points.cpp b/Tactical/Points.cpp index bd2621be..1a7783ba 100644 --- a/Tactical/Points.cpp +++ b/Tactical/Points.cpp @@ -2167,11 +2167,11 @@ INT16 MinAPsToThrow( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurningCos // Is it the same as he's facing? if ( ubDirection != pSoldier->bDirection ) - { - //Lalien: disabled it again - //AXP 25.03.2007: Reenabled look cost - //iAPCost += GetAPsToLook( pSoldier ); - } + { + //Lalien: disabled it again + //AXP 25.03.2007: Reenabled look cost + //iAPCost += GetAPsToLook( pSoldier ); + } } } else diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 6bdbc6aa..dadcf766 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -227,7 +227,7 @@ UINT8 gubCheatLevel = STARTING_CHEAT_LEVEL; extern void StackObjs( OBJECTTYPE * pSourceObj, OBJECTTYPE * pTargetObj, UINT8 ubNumberToCopy ); extern BOOLEAN CompatibleAmmoForGun( OBJECTTYPE *pTryObject, OBJECTTYPE *pTestObject ); extern void DetermineWhichAssignmentMenusCanBeShown( void ); -extern void DetermineWhichMilitiaControlMenusCanBeShown( void ); //lal +extern void DetermineWhichMilitiaControlMenusCanBeShown( void ); //lalien void GetTBMouseButtonInput( UINT32 *puiNewEvent ) { @@ -2555,6 +2555,65 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) } break; + + + case 'F': + if ( !(gTacticalStatus.fEnemyInSector) ) + { + HandleAllReachAbleItemsInTheSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); + + for ( UINT32 uiLoop = 0; uiLoop < guiNumWorldItems; uiLoop++ ) //for all items in sector + { + if ( (gWorldItems[ uiLoop ].fExists) && (gWorldItems[ uiLoop ].usFlags & WORLD_ITEM_REACHABLE) )//item exists and is reachable + { + if (( Item[ gWorldItems[ uiLoop ].o.usItem ].usItemClass == IC_GUN ) && (gGameExternalOptions.gfShiftFUnloadWeapons == TRUE) )//item is a gun and unloading is allowed + { + //Remove magazine + if ( (gWorldItems[ uiLoop ].o.usGunAmmoItem != NONE) && (gWorldItems[ uiLoop ].o.ubGunShotsLeft > 0) ) + { + OBJECTTYPE newObj; //Create object + CreateItem(gWorldItems[ uiLoop ].o.usGunAmmoItem, 100, &newObj); + newObj.ubShotsLeft[0] = gWorldItems[ uiLoop ].o.ubGunShotsLeft; + gWorldItems[ uiLoop ].o.ubGunShotsLeft = 0; + gWorldItems[ uiLoop ].o.usGunAmmoItem = NONE; + + // put it on the ground + AddItemToPool( gWorldItems[ uiLoop ].sGridNo, &newObj, 1, gWorldItems[ uiLoop ].ubLevel, 0 , -1 ); + } + } + + //remove attachments + if ( gGameExternalOptions.gfShiftFRemoveAttachments == TRUE ) + { + for (int bAttachPos = MAX_ATTACHMENTS-1; bAttachPos >= 0; bAttachPos--) + { + if (gWorldItems[ uiLoop ].o.usAttachItem[ bAttachPos ] != NOTHING) + { + if ( !Item[ gWorldItems[ uiLoop ].o.usAttachItem[ bAttachPos ] ].inseparable ) + { + OBJECTTYPE newObj; + if (RemoveAttachment( &(gWorldItems[ uiLoop ].o), bAttachPos, &newObj )) + { + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[ ATTACHMENT_REMOVED ] ); + } + // put it on the ground + AddItemToPool( gWorldItems[ uiLoop ].sGridNo, &newObj, 1, gWorldItems[ uiLoop ].ubLevel, 0 , -1 ); + } + } + } + } + + + } + } + } + break; + + + + + + case 'D': if ( gGameSettings.fOptions[TOPTION_DROP_ALL] ) { @@ -3277,6 +3336,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) case 'S': if (! ( gTacticalStatus.fEnemyInSector ) ) { + HandleAllReachAbleItemsInTheSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); + for ( UINT32 uiLoop = 0; uiLoop < guiNumWorldItems; uiLoop++ ) { if ( ( gWorldItems[ uiLoop ].fExists) && (gWorldItems[ uiLoop ].usFlags & WORLD_ITEM_REACHABLE) )//item exists and is reachable @@ -3305,6 +3366,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) } } } + + //HandleAllReachAbleItemsInTheSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); } break; diff --git a/Utils/Text Utils.cpp b/Utils/Text Utils.cpp index 1ea888e3..969e76a6 100644 --- a/Utils/Text Utils.cpp +++ b/Utils/Text Utils.cpp @@ -247,8 +247,8 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString ) } #endif - #ifdef POLISH - switch( pNameString[ i ] ) + #ifdef POLISH + switch( pNameString[ i ] ) { case 260: pInfoString[ i ] = 165; break; case 262: pInfoString[ i ] = 198; break; @@ -271,10 +271,10 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString ) case 380: pInfoString[ i ] = 191; break; case 378: pInfoString[ i ] = 376; break; } - #endif + #endif - #ifdef RUSSIAN + #ifdef RUSSIAN if ((unsigned char)Item[ubIndex].szItemDesc [j] == 208) //d0 { // This character determines the special character @@ -372,8 +372,7 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString ) // } //} #endif - - } + } else { pInfoString[i] ='\0'; diff --git a/Utils/Text.h b/Utils/Text.h index d665a478..302d1bd8 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -549,6 +549,7 @@ enum DOOR_IS_BUSY, VEHICLE_VITAL_STATS_POPUPTEXT, NO_LOS_TO_TALK_TARGET, + ATTACHMENT_REMOVED, }; enum{ diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 994f2e61..17e8d2a4 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -1406,6 +1406,7 @@ wchar_t TacticalStr[][ MED_STRING_LENGTH ] = L"Iemand anders probeert deze deur te gebruiken.", // L"Somebody else is trying to use this door.", L"Gezondheid: %d/%d\nBrandstof: %d/%d", //L"Health: %d/%d\nFuel: %d/%d", L"%s kan %s niet zien.", // Cannot see person trying to talk to + L"Attachment removed", }; //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 e5d312f1..5b8f6d7a 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -1406,7 +1406,8 @@ wchar_t TacticalStr[][ MED_STRING_LENGTH ] = L"Lock destroyed", L"Somebody else is trying to use this door.", L"Health: %d/%d\nFuel: %d/%d", - L"%s cannot see %s.", // Cannot see person trying to talk to + L"%s cannot see %s.", // Cannot see person trying to talk to + L"Attachment removed", }; //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 46ca860c..4aa68a54 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -1395,7 +1395,8 @@ wchar_t TacticalStr[][ MED_STRING_LENGTH ] = L"Verrou détruit", L"Quelqu'un d'autre veut essayer sur cette porte.", L"Etat : %d/%d\nCarburant : %d/%d", -L"%s ne peut pas voir %s.", // Cannot see person trying to talk to + L"%s ne peut pas voir %s.", // Cannot see person trying to talk to + L"Attachment removed", }; //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 297dfe56..f795fd3d 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -1370,6 +1370,7 @@ wchar_t TacticalStr[][ MED_STRING_LENGTH ] = L"Noch jemand an der Tür.", L"Gesundh.: %d/%d\nTank: %d/%d", L"%s kann %s nicht sehen.", // Cannot see person trying to talk to + L"Attachment removed", }; //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 8b3859da..1fe9e89b 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -1389,7 +1389,8 @@ wchar_t TacticalStr[][ MED_STRING_LENGTH ] = L"Serratura distrutta", L"Qualcun altro sta provando a utilizzare questa porta.", L"Salute: %d/%d\nCarburante: %d/%d", - L"%s non riesce a vedere %s.", // Cannot see person trying to talk to + L"%s non riesce a vedere %s.", // Cannot see person trying to talk to + L"Attachment removed", }; //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 1f033894..8cd3adb1 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -1389,7 +1389,8 @@ wchar_t TacticalStr[][ MED_STRING_LENGTH ] = L"Zamek zosta³ zniszczony", L"Ktoœ inny majstruje przy tych drzwiach.", L"Stan: %d/%d\nPaliwo: %d/%d", - L"%s nie widzi - %s.", // Cannot see person trying to talk to + L"%s nie widzi - %s.", // Cannot see person trying to talk to + L"Attachment removed", }; //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 b12bc14e..45fcf4f9 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -1397,7 +1397,8 @@ wchar_t TacticalStr[][ MED_STRING_LENGTH ] = L"Çàìîê ðàçðóøåí", L"Êòî-òî åùå ïûòàåòñÿ âîñïîëüçîâ.ýòîé äâåðüþ.", L"Çäîðîâüå: %d/%d\nÁåíç: %d/%d", - L"%s íå âèäèò %s.", // Cannot see person trying to talk to + L"%s íå âèäèò %s.", // Cannot see person trying to talk to + L"Attachment removed", }; //Varying helptext explains (for the "Go to Sector/Map" checkbox) what will happen given different circumstances in the "exiting sector" interface.