diff --git a/GameSettings.cpp b/GameSettings.cpp index aa9b4d87..5bbcd60e 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1377,12 +1377,11 @@ void LoadGameExternalOptions() // New setting to change stamina gGameExternalOptions.uStaminaHit = iniReader.ReadInteger("Tactical Interface Settings", "STAMINA_HIT", 10000); - // Alternative system for aiming - progressive method depending on marksmash of Merc + // Alternative system for aiming - progressive method depending on marksmanship of Merc gGameExternalOptions.bAltAimEnabled = iniReader.ReadBoolean("Tactical Interface Settings","ALT_AIMING_ENABLED",FALSE); // Use aimed burst gGameExternalOptions.bAimedBurstEnabled = iniReader.ReadBoolean("Tactical Interface Settings","USE_AIMED_BURST",FALSE); - gGameExternalOptions.bAimedBurstAlternateKey = iniReader.ReadBoolean("Tactical Interface Settings","AIMED_BURST_ALTERNATE_KEY",FALSE); // Penalty for aimed burst gGameExternalOptions.uAimedBurstPenalty = iniReader.ReadInteger("Tactical Interface Settings","AIMING_BURST_PENALTY",2, 0, 10); @@ -1408,9 +1407,6 @@ void LoadGameExternalOptions() // , and add special bonuses to explosion gGameExternalOptions.bAllowSpecialExplosiveAttachments = iniReader.ReadBoolean("Tactical Interface Settings","ALLOW_SPECIAL_EXPLOSIVE_ATTACHMENTS",FALSE); - // Automatically take new mine from inventory, use last tripwire network settings - gGameExternalOptions.bImprovedBombPlanting = iniReader.ReadBoolean("Tactical Interface Settings","IMPROVED_BOMB_PLANTING",FALSE); - // Chance to Say Annoying Phrase (you can just turn of it by button in game) gGameExternalOptions.iChanceSayAnnoyingPhrase = iniReader.ReadInteger("Tactical Interface Settings","CHANCE_SAY_ANNOYING_PHRASE",100); diff --git a/GameSettings.h b/GameSettings.h index 60135f4e..27e24bdf 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -794,16 +794,14 @@ typedef struct //enable ext mouse key BOOLEAN bAltAimEnabled; BOOLEAN bAimedBurstEnabled; - BOOLEAN bAimedBurstAlternateKey; // Flugente: some users cannot use the mousewheel and are thus unable to aim auto-only weapons. This solves this by allowing to aim via a key command INT16 uAimedBurstPenalty; BOOLEAN bWeSeeWhatMilitiaSeesAndViceVersa; BOOLEAN bAllowWearSuppressor; BOOLEAN bLazyCivilians; BOOLEAN bNeutralCiviliansAvoidPlayerMines; //sevenfm: Neutral civilians can detect mines with MAPELEMENT_PLAYER_MINE_PRESENT flag set - BOOLEAN bAddSmokeAfterExplosion; - BOOLEAN bAllowExplosiveAttachments; - BOOLEAN bAllowSpecialExplosiveAttachments; - BOOLEAN bImprovedBombPlanting; + BOOLEAN bAddSmokeAfterExplosion; + BOOLEAN bAllowExplosiveAttachments; + BOOLEAN bAllowSpecialExplosiveAttachments; INT16 iChanceSayAnnoyingPhrase; BOOLEAN bNewTacticalAIBehavior; FLOAT uShotHeadPenalty; diff --git a/Standard Gaming Platform/english.h b/Standard Gaming Platform/english.h index 89c99496..9ead3cfe 100644 --- a/Standard Gaming Platform/english.h +++ b/Standard Gaming Platform/english.h @@ -130,4 +130,7 @@ #define ENTER 13 #define SPACE 32 +#define COMMA 188 +#define FULLSTOP 190 + #endif \ No newline at end of file diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 448322a8..b0feb8bf 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -4896,7 +4896,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo ) wcscpy( gzUserDefinedButton[15], L"4-D" ); // sevenfm: if SHIFT is pressed - plant tripwire with last network settings - if( gGameExternalOptions.bImprovedBombPlanting && _KeyDown( SHIFT ) && gubLastTripwire > 0 ) + if( _KeyDown( SHIFT ) && gubLastTripwire > 0 ) BombMessageBoxCallBack(gubLastTripwire); else DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_TRIPWIRE_NETWORK ], GAME_SCREEN, MSG_BOX_FLAG_GENERIC_SIXTEEN_BUTTONS, BombMessageBoxCallBack, NULL ); @@ -6985,8 +6985,7 @@ void ExtendedBoobyTrapMessageBoxCallBack( UINT8 ubExitValue ) void HandleTakeNewBombFromIventory(SOLDIERTYPE* pSoldier, OBJECTTYPE* pObj) { - if(gGameExternalOptions.bImprovedBombPlanting && - !( (gTacticalStatus.uiFlags & TURNBASED ) && (gTacticalStatus.uiFlags & INCOMBAT) ) && + if( !( (gTacticalStatus.uiFlags & TURNBASED ) && (gTacticalStatus.uiFlags & INCOMBAT) ) && !pSoldier->inv[HANDPOS].exists() && _KeyDown( SHIFT )) { pSoldier->TakeNewBombFromIventory(pObj->usItem); diff --git a/Tactical/Interface Control.cpp b/Tactical/Interface Control.cpp index 69d07ca2..08f241a9 100644 --- a/Tactical/Interface Control.cpp +++ b/Tactical/Interface Control.cpp @@ -714,14 +714,6 @@ void RenderTopmostTacticalInterface( ) RenderAccumulatedBurstLocations( ); - // HEADROCK HAM 4: The NCTH indicator is now drawn to the FRAMEBUFFER instead of the MOUSEBUFFER. This is - // due to size constraints related to drawing directly on the cursor. This indicator follows the mouse, and - // is a mouse-cursor in everything but name. See the function itself for more details. - if (UsingNewCTHSystem() == true && gfUICtHBar) - { - DrawCTHIndicator(); - } - // Loop through all mercs and make go for ( cnt = 0; cnt < guiNumMercSlots; cnt++ ) { @@ -752,6 +744,14 @@ void RenderTopmostTacticalInterface( ) DrawSelectedUIAboveGuy((UINT16)gsSelectedGuy ); } + // HEADROCK HAM 4: The NCTH indicator is now drawn to the FRAMEBUFFER instead of the MOUSEBUFFER. This is + // due to size constraints related to drawing directly on the cursor. This indicator follows the mouse, and + // is a mouse-cursor in everything but name. See the function itself for more details. + if (UsingNewCTHSystem() == true && gfUICtHBar) + { + DrawCTHIndicator(); + } + // FOR THE MOST PART, DISABLE INTERFACE STUFF WHEN IT'S ENEMY'S TURN if ( gTacticalStatus.ubCurrentTeam == gbPlayerNum ) { diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index be85849d..127ccdd2 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -3869,18 +3869,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) } else { - // Flugente: alternate for people without mousewheel who want to aim auto-only weapons - if ( gGameExternalOptions.bAimedBurstEnabled && gGameExternalOptions.bAimedBurstAlternateKey && gCurrentUIMode == CONFIRM_ACTION_MODE ) - { - SOLDIERTYPE * pSoldier; - - if ( GetSoldier( &pSoldier, gusSelectedSoldier ) ) - { - HandleWheelAdjustCursor( pSoldier, usMapPos, 1,brstmode ); - } - } // nothing in hand and the Options Screen button for whichever panel we're in must be enabled - else if ( ( gpItemPointer == NULL ) && !gfDisableTacticalPanelButtons && + if ( ( gpItemPointer == NULL ) && !gfDisableTacticalPanelButtons && ( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ OPTIONS_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) ) { if( !fDisableMapInterfaceDueToBattle ) @@ -4224,8 +4214,43 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) //else if( gusSelectedSoldier != NOBODY ) break; + case 'z': + if( fCtrl && fAlt ) + { + if ( INFORMATION_CHEAT_LEVEL( ) ) + { + ToggleZBuffer(); + } + } + else if ( fAlt ) + { + HandleTBToggleStealthAll(); + } + else if ( fCtrl ) + { + // used for "lock" / "unlock" the mouse cursor in windowed mode + } + else + { + HandleTBToggleStealth(); + } + break; + + case ',': + // Flugente: alternate for people without mousewheel to aim auto-only weapons + if ( gGameExternalOptions.bAimedBurstEnabled && gCurrentUIMode == CONFIRM_ACTION_MODE ) + { + SOLDIERTYPE * pSoldier; + + if ( GetSoldier( &pSoldier, gusSelectedSoldier ) ) + { + HandleRightClickAdjustCursor( pSoldier, usMapPos ); + } + } + break; + // added by Flugente - case '.': + case '.': if ( fCtrl && fAlt ) //jikuja: Create item by reusing old entered number { if ( CHEATER_CHEAT_LEVEL( ) ) @@ -4257,28 +4282,6 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) break; - case 'z': - if( fCtrl && fAlt ) - { - if ( INFORMATION_CHEAT_LEVEL( ) ) - { - ToggleZBuffer(); - } - } - else if ( fAlt ) - { - HandleTBToggleStealthAll(); - } - else if ( fCtrl ) - { - // used for "lock" / "unlock" the mouse cursor in windowed mode - } - else - { - HandleTBToggleStealth(); - } - break; - case '-': case '_': //if the display cover or line of sight is being displayed @@ -6580,7 +6583,7 @@ void QueryTBWheel( UINT32 *puiNewEvent ) if ( GetSoldier( &pSoldier, gusSelectedSoldier ) ) { if( gGameExternalOptions.bAimedBurstEnabled ) - HandleWheelAdjustCursor( pSoldier, usMapPos, -gViewportRegion.WheelState,brstmode ); + HandleWheelAdjustCursor( pSoldier, usMapPos, -gViewportRegion.WheelState, brstmode ); else HandleWheelAdjustCursorWOAB( pSoldier, usMapPos, -gViewportRegion.WheelState); } diff --git a/Tactical/UI Cursors.cpp b/Tactical/UI Cursors.cpp index e6899445..28640d55 100644 --- a/Tactical/UI Cursors.cpp +++ b/Tactical/UI Cursors.cpp @@ -2416,65 +2416,132 @@ void HandleRightClickAdjustCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos ) case TARGETCURS: // CHECK IF GUY HAS IN HAND A WEAPON - if ( pSoldier->bDoBurst && !pSoldier->bDoAutofire) + if ( pSoldier->bDoBurst && !pSoldier->bDoAutofire && !gGameExternalOptions.bAimedBurstEnabled) { - // Do nothing! + // Do nothing for aimed burst deactivated // pSoldier->aiData.bShownAimTime = REFINE_AIM_BURST; } else if(pSoldier->bDoAutofire) { - INT16 sCurAPCosts; - UINT16 usShotsLeft = pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft; - if (pSoldier->IsValidSecondHandBurst()) + // aiming in auto mode using hotkey for mousewheel not working + if( gfKeyState[ COMMA ] && gGameExternalOptions.bAimedBurstEnabled ) { - usShotsLeft = min( (pSoldier->inv[ SECONDHANDPOS ][0]->data.gun.ubGunShotsLeft), usShotsLeft ); - } + sGridNo = usMapPos; + bTargetLevel = (INT8)gsInterfaceLevel; - if(pSoldier->flags.autofireLastStep) - { - pSoldier->bDoAutofire = 1; //reset the bullet counter - pSoldier->flags.autofireLastStep = FALSE; - return; - } - - - if(usShotsLeft > pSoldier->bDoAutofire ) - { - //Calculate how many bullets we need to fire to add at least one more AP - sAPCosts = sCurAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime); - while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts <= sCurAPCosts && usShotsLeft > pSoldier->bDoAutofire) //Increment the bullet count until we run out of APs or we spend the whole AP + // Look for a target here... + if ( gfUIFullTargetFound ) { - pSoldier->bDoAutofire++; - sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime); + // Get target soldier, if one exists + pTSoldier = MercPtrs[ gusUIFullTargetID ]; + sGridNo = pTSoldier->sGridNo; + bTargetLevel = pSoldier->pathing.bLevel; + + if ( !HandleCheckForBadChangeToGetThrough( pSoldier, pTSoldier, sGridNo , bTargetLevel ) ) + { + return; + } } - //we've stepped over the border and used up one more ap, now let's make sure that it is spent to maximize the bullets + bFutureAim = (INT8)( pSoldier->aiData.bShownAimTime + 1 ); - sCurAPCosts = sAPCosts; - - do + if ( bFutureAim <= maxAimLevels ) { - pSoldier->bDoAutofire++; - sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime); - } - while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && usShotsLeft >= pSoldier->bDoAutofire); - pSoldier->bDoAutofire--; + sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, (INT8)(bFutureAim ) ); - sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime); - - if(!EnoughPoints( pSoldier, sAPCosts, 0, FALSE )) //We've not enough points to fire those bullets - { - pSoldier->flags.autofireLastStep = TRUE; - pSoldier->bDoAutofire--; + // Determine if we can afford! + if ( EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) ) + { + pSoldier->aiData.bShownAimTime+= 1; + if ( pSoldier->aiData.bShownAimTime > maxAimLevels ) + { + pSoldier->aiData.bShownAimTime = maxAimLevels; + } + } + // Else - goto first level! + else + { + if ( !gfDisplayFullCountRing ) + { + gfDisplayFullCountRing = TRUE; + } + else + { + pSoldier->aiData.bShownAimTime = REFINE_AIM_1; + gfDisplayFullCountRing = FALSE; + } + } } else - pSoldier->flags.autofireLastStep = FALSE; //both last step conditions are false + { + if ( !gfDisplayFullCountRing ) + { + gfDisplayFullCountRing = TRUE; + } + else + { + pSoldier->aiData.bShownAimTime = REFINE_AIM_1; + gfDisplayFullCountRing = FALSE; + } + } } + // adjust number of bullets in auto mode else { - pSoldier->flags.autofireLastStep = TRUE; + INT16 sCurAPCosts; + UINT16 usShotsLeft = pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft; + if (pSoldier->IsValidSecondHandBurst()) + { + usShotsLeft = min( (pSoldier->inv[ SECONDHANDPOS ][0]->data.gun.ubGunShotsLeft), usShotsLeft ); + } + + if(pSoldier->flags.autofireLastStep) + { + pSoldier->bDoAutofire = 1; //reset the bullet counter + pSoldier->flags.autofireLastStep = FALSE; + return; + } + + + if(usShotsLeft > pSoldier->bDoAutofire ) + { + //Calculate how many bullets we need to fire to add at least one more AP + sAPCosts = sCurAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime); + while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts <= sCurAPCosts && usShotsLeft > pSoldier->bDoAutofire) //Increment the bullet count until we run out of APs or we spend the whole AP + { + pSoldier->bDoAutofire++; + sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime); + } + + //we've stepped over the border and used up one more ap, now let's make sure that it is spent to maximize the bullets + + sCurAPCosts = sAPCosts; + + do + { + pSoldier->bDoAutofire++; + sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime); + } + while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && usShotsLeft >= pSoldier->bDoAutofire); + pSoldier->bDoAutofire--; + + sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime); + + if(!EnoughPoints( pSoldier, sAPCosts, 0, FALSE )) //We've not enough points to fire those bullets + { + pSoldier->flags.autofireLastStep = TRUE; + pSoldier->bDoAutofire--; + } + else + pSoldier->flags.autofireLastStep = FALSE; //both last step conditions are false + } + else + { + pSoldier->flags.autofireLastStep = TRUE; + } } } + // single fire mode else { sGridNo = usMapPos; @@ -3672,7 +3739,8 @@ void HandleWheelAdjustCursorWOAB( SOLDIERTYPE *pSoldier, INT32 sMapPos, INT32 sD case PUNCHCURS: bFutureAim = (INT8)( pSoldier->aiData.bShownAimTime + (sDelta*REFINE_PUNCH_2) ); -if(bFutureAim<0) return; + if(bFutureAim<0) + return; if ( bFutureAim <= REFINE_PUNCH_2 ) { sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, (INT8)(bFutureAim / 2) ); @@ -3698,7 +3766,8 @@ if(bFutureAim<0) return; case KNIFECURS: bFutureAim = (INT8)( pSoldier->aiData.bShownAimTime + (sDelta*REFINE_KNIFE_2) ); -if(bFutureAim<0) return; + if(bFutureAim<0) + return; if ( bFutureAim <= REFINE_KNIFE_2 ) { sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, (INT8)(bFutureAim / 2) );