mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Merged from revision: 6792
Fixes (by Buggler) - draw NCTH cursor indicator after health bar indicator due to potential overlap (thanks to Sevenfm) - removed IMPROVED_BOMB_PLANTING option, enabled by default - removed AIMED_BURST_ALTERNATE_KEY option, enabled by default. Alternate Aiming Hotkey reassigned to ',' (comma) for increasing aim - streamlined burst & auto mode right click aim mechanism git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6793 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+1
-5
@@ -1377,12 +1377,11 @@ void LoadGameExternalOptions()
|
|||||||
// New setting to change stamina
|
// New setting to change stamina
|
||||||
gGameExternalOptions.uStaminaHit = iniReader.ReadInteger("Tactical Interface Settings", "STAMINA_HIT", 10000);
|
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);
|
gGameExternalOptions.bAltAimEnabled = iniReader.ReadBoolean("Tactical Interface Settings","ALT_AIMING_ENABLED",FALSE);
|
||||||
|
|
||||||
// Use aimed burst
|
// Use aimed burst
|
||||||
gGameExternalOptions.bAimedBurstEnabled = iniReader.ReadBoolean("Tactical Interface Settings","USE_AIMED_BURST",FALSE);
|
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
|
// Penalty for aimed burst
|
||||||
gGameExternalOptions.uAimedBurstPenalty = iniReader.ReadInteger("Tactical Interface Settings","AIMING_BURST_PENALTY",2, 0, 10);
|
gGameExternalOptions.uAimedBurstPenalty = iniReader.ReadInteger("Tactical Interface Settings","AIMING_BURST_PENALTY",2, 0, 10);
|
||||||
@@ -1408,9 +1407,6 @@ void LoadGameExternalOptions()
|
|||||||
// <GasCan>, <Marbles> and <Alcohol> add special bonuses to explosion
|
// <GasCan>, <Marbles> and <Alcohol> add special bonuses to explosion
|
||||||
gGameExternalOptions.bAllowSpecialExplosiveAttachments = iniReader.ReadBoolean("Tactical Interface Settings","ALLOW_SPECIAL_EXPLOSIVE_ATTACHMENTS",FALSE);
|
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)
|
// 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);
|
gGameExternalOptions.iChanceSayAnnoyingPhrase = iniReader.ReadInteger("Tactical Interface Settings","CHANCE_SAY_ANNOYING_PHRASE",100);
|
||||||
|
|
||||||
|
|||||||
+3
-5
@@ -794,16 +794,14 @@ typedef struct
|
|||||||
//enable ext mouse key
|
//enable ext mouse key
|
||||||
BOOLEAN bAltAimEnabled;
|
BOOLEAN bAltAimEnabled;
|
||||||
BOOLEAN bAimedBurstEnabled;
|
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;
|
INT16 uAimedBurstPenalty;
|
||||||
BOOLEAN bWeSeeWhatMilitiaSeesAndViceVersa;
|
BOOLEAN bWeSeeWhatMilitiaSeesAndViceVersa;
|
||||||
BOOLEAN bAllowWearSuppressor;
|
BOOLEAN bAllowWearSuppressor;
|
||||||
BOOLEAN bLazyCivilians;
|
BOOLEAN bLazyCivilians;
|
||||||
BOOLEAN bNeutralCiviliansAvoidPlayerMines; //sevenfm: Neutral civilians can detect mines with MAPELEMENT_PLAYER_MINE_PRESENT flag set
|
BOOLEAN bNeutralCiviliansAvoidPlayerMines; //sevenfm: Neutral civilians can detect mines with MAPELEMENT_PLAYER_MINE_PRESENT flag set
|
||||||
BOOLEAN bAddSmokeAfterExplosion;
|
BOOLEAN bAddSmokeAfterExplosion;
|
||||||
BOOLEAN bAllowExplosiveAttachments;
|
BOOLEAN bAllowExplosiveAttachments;
|
||||||
BOOLEAN bAllowSpecialExplosiveAttachments;
|
BOOLEAN bAllowSpecialExplosiveAttachments;
|
||||||
BOOLEAN bImprovedBombPlanting;
|
|
||||||
INT16 iChanceSayAnnoyingPhrase;
|
INT16 iChanceSayAnnoyingPhrase;
|
||||||
BOOLEAN bNewTacticalAIBehavior;
|
BOOLEAN bNewTacticalAIBehavior;
|
||||||
FLOAT uShotHeadPenalty;
|
FLOAT uShotHeadPenalty;
|
||||||
|
|||||||
@@ -130,4 +130,7 @@
|
|||||||
#define ENTER 13
|
#define ENTER 13
|
||||||
#define SPACE 32
|
#define SPACE 32
|
||||||
|
|
||||||
|
#define COMMA 188
|
||||||
|
#define FULLSTOP 190
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -4896,7 +4896,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
|
|||||||
wcscpy( gzUserDefinedButton[15], L"4-D" );
|
wcscpy( gzUserDefinedButton[15], L"4-D" );
|
||||||
|
|
||||||
// sevenfm: if SHIFT is pressed - plant tripwire with last network settings
|
// 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);
|
BombMessageBoxCallBack(gubLastTripwire);
|
||||||
else
|
else
|
||||||
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_TRIPWIRE_NETWORK ], GAME_SCREEN, MSG_BOX_FLAG_GENERIC_SIXTEEN_BUTTONS, BombMessageBoxCallBack, NULL );
|
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)
|
void HandleTakeNewBombFromIventory(SOLDIERTYPE* pSoldier, OBJECTTYPE* pObj)
|
||||||
{
|
{
|
||||||
if(gGameExternalOptions.bImprovedBombPlanting &&
|
if( !( (gTacticalStatus.uiFlags & TURNBASED ) && (gTacticalStatus.uiFlags & INCOMBAT) ) &&
|
||||||
!( (gTacticalStatus.uiFlags & TURNBASED ) && (gTacticalStatus.uiFlags & INCOMBAT) ) &&
|
|
||||||
!pSoldier->inv[HANDPOS].exists() && _KeyDown( SHIFT ))
|
!pSoldier->inv[HANDPOS].exists() && _KeyDown( SHIFT ))
|
||||||
{
|
{
|
||||||
pSoldier->TakeNewBombFromIventory(pObj->usItem);
|
pSoldier->TakeNewBombFromIventory(pObj->usItem);
|
||||||
|
|||||||
@@ -714,14 +714,6 @@ void RenderTopmostTacticalInterface( )
|
|||||||
|
|
||||||
RenderAccumulatedBurstLocations( );
|
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
|
// Loop through all mercs and make go
|
||||||
for ( cnt = 0; cnt < guiNumMercSlots; cnt++ )
|
for ( cnt = 0; cnt < guiNumMercSlots; cnt++ )
|
||||||
{
|
{
|
||||||
@@ -752,6 +744,14 @@ void RenderTopmostTacticalInterface( )
|
|||||||
DrawSelectedUIAboveGuy((UINT16)gsSelectedGuy );
|
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
|
// FOR THE MOST PART, DISABLE INTERFACE STUFF WHEN IT'S ENEMY'S TURN
|
||||||
if ( gTacticalStatus.ubCurrentTeam == gbPlayerNum )
|
if ( gTacticalStatus.ubCurrentTeam == gbPlayerNum )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3869,18 +3869,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
}
|
}
|
||||||
else
|
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
|
// 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 ) ) )
|
( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ OPTIONS_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) )
|
||||||
{
|
{
|
||||||
if( !fDisableMapInterfaceDueToBattle )
|
if( !fDisableMapInterfaceDueToBattle )
|
||||||
@@ -4224,8 +4214,43 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
//else if( gusSelectedSoldier != NOBODY )
|
//else if( gusSelectedSoldier != NOBODY )
|
||||||
break;
|
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
|
// added by Flugente
|
||||||
case '.':
|
case '.':
|
||||||
if ( fCtrl && fAlt ) //jikuja: Create item by reusing old entered number
|
if ( fCtrl && fAlt ) //jikuja: Create item by reusing old entered number
|
||||||
{
|
{
|
||||||
if ( CHEATER_CHEAT_LEVEL( ) )
|
if ( CHEATER_CHEAT_LEVEL( ) )
|
||||||
@@ -4257,28 +4282,6 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
|
|
||||||
break;
|
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 '-':
|
||||||
case '_':
|
case '_':
|
||||||
//if the display cover or line of sight is being displayed
|
//if the display cover or line of sight is being displayed
|
||||||
@@ -6580,7 +6583,7 @@ void QueryTBWheel( UINT32 *puiNewEvent )
|
|||||||
if ( GetSoldier( &pSoldier, gusSelectedSoldier ) )
|
if ( GetSoldier( &pSoldier, gusSelectedSoldier ) )
|
||||||
{
|
{
|
||||||
if( gGameExternalOptions.bAimedBurstEnabled )
|
if( gGameExternalOptions.bAimedBurstEnabled )
|
||||||
HandleWheelAdjustCursor( pSoldier, usMapPos, -gViewportRegion.WheelState,brstmode );
|
HandleWheelAdjustCursor( pSoldier, usMapPos, -gViewportRegion.WheelState, brstmode );
|
||||||
else
|
else
|
||||||
HandleWheelAdjustCursorWOAB( pSoldier, usMapPos, -gViewportRegion.WheelState);
|
HandleWheelAdjustCursorWOAB( pSoldier, usMapPos, -gViewportRegion.WheelState);
|
||||||
}
|
}
|
||||||
|
|||||||
+110
-41
@@ -2416,65 +2416,132 @@ void HandleRightClickAdjustCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos )
|
|||||||
case TARGETCURS:
|
case TARGETCURS:
|
||||||
|
|
||||||
// CHECK IF GUY HAS IN HAND A WEAPON
|
// 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;
|
// pSoldier->aiData.bShownAimTime = REFINE_AIM_BURST;
|
||||||
}
|
}
|
||||||
else if(pSoldier->bDoAutofire)
|
else if(pSoldier->bDoAutofire)
|
||||||
{
|
{
|
||||||
INT16 sCurAPCosts;
|
// aiming in auto mode using hotkey for mousewheel not working
|
||||||
UINT16 usShotsLeft = pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft;
|
if( gfKeyState[ COMMA ] && gGameExternalOptions.bAimedBurstEnabled )
|
||||||
if (pSoldier->IsValidSecondHandBurst())
|
|
||||||
{
|
{
|
||||||
usShotsLeft = min( (pSoldier->inv[ SECONDHANDPOS ][0]->data.gun.ubGunShotsLeft), usShotsLeft );
|
sGridNo = usMapPos;
|
||||||
}
|
bTargetLevel = (INT8)gsInterfaceLevel;
|
||||||
|
|
||||||
if(pSoldier->flags.autofireLastStep)
|
// Look for a target here...
|
||||||
{
|
if ( gfUIFullTargetFound )
|
||||||
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++;
|
// Get target soldier, if one exists
|
||||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
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;
|
if ( bFutureAim <= maxAimLevels )
|
||||||
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
pSoldier->bDoAutofire++;
|
sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, (INT8)(bFutureAim ) );
|
||||||
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);
|
// Determine if we can afford!
|
||||||
|
if ( EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) )
|
||||||
if(!EnoughPoints( pSoldier, sAPCosts, 0, FALSE )) //We've not enough points to fire those bullets
|
{
|
||||||
{
|
pSoldier->aiData.bShownAimTime+= 1;
|
||||||
pSoldier->flags.autofireLastStep = TRUE;
|
if ( pSoldier->aiData.bShownAimTime > maxAimLevels )
|
||||||
pSoldier->bDoAutofire--;
|
{
|
||||||
|
pSoldier->aiData.bShownAimTime = maxAimLevels;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Else - goto first level!
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !gfDisplayFullCountRing )
|
||||||
|
{
|
||||||
|
gfDisplayFullCountRing = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pSoldier->aiData.bShownAimTime = REFINE_AIM_1;
|
||||||
|
gfDisplayFullCountRing = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
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
|
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
|
else
|
||||||
{
|
{
|
||||||
sGridNo = usMapPos;
|
sGridNo = usMapPos;
|
||||||
@@ -3672,7 +3739,8 @@ void HandleWheelAdjustCursorWOAB( SOLDIERTYPE *pSoldier, INT32 sMapPos, INT32 sD
|
|||||||
case PUNCHCURS:
|
case PUNCHCURS:
|
||||||
|
|
||||||
bFutureAim = (INT8)( pSoldier->aiData.bShownAimTime + (sDelta*REFINE_PUNCH_2) );
|
bFutureAim = (INT8)( pSoldier->aiData.bShownAimTime + (sDelta*REFINE_PUNCH_2) );
|
||||||
if(bFutureAim<0) return;
|
if(bFutureAim<0)
|
||||||
|
return;
|
||||||
if ( bFutureAim <= REFINE_PUNCH_2 )
|
if ( bFutureAim <= REFINE_PUNCH_2 )
|
||||||
{
|
{
|
||||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, (INT8)(bFutureAim / 2) );
|
sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, (INT8)(bFutureAim / 2) );
|
||||||
@@ -3698,7 +3766,8 @@ if(bFutureAim<0) return;
|
|||||||
case KNIFECURS:
|
case KNIFECURS:
|
||||||
|
|
||||||
bFutureAim = (INT8)( pSoldier->aiData.bShownAimTime + (sDelta*REFINE_KNIFE_2) );
|
bFutureAim = (INT8)( pSoldier->aiData.bShownAimTime + (sDelta*REFINE_KNIFE_2) );
|
||||||
if(bFutureAim<0) return;
|
if(bFutureAim<0)
|
||||||
|
return;
|
||||||
if ( bFutureAim <= REFINE_KNIFE_2 )
|
if ( bFutureAim <= REFINE_KNIFE_2 )
|
||||||
{
|
{
|
||||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, (INT8)(bFutureAim / 2) );
|
sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, (INT8)(bFutureAim / 2) );
|
||||||
|
|||||||
Reference in New Issue
Block a user