mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Add on option to start at maximum aiming level (#112)
* Add on option to start at maximum aiming level When hovering mouse on an enemy, aiming level is started at maximum instead of no aiming when this option is toggled.
This commit is contained in:
+32
-7
@@ -136,13 +136,13 @@ BOOLEAN GetMouseRecalcAndShowAPFlags( UINT32 *puiCursorFlags, BOOLEAN *pfShowAPs
|
||||
// FUNCTIONS FOR CURSOR DETERMINATION!
|
||||
UINT8 GetProperItemCursor( UINT8 ubSoldierID, UINT16 ubItemIndex, INT32 usMapPos, BOOLEAN fActivated )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT32 uiCursorFlags;
|
||||
BOOLEAN fShowAPs = FALSE;
|
||||
BOOLEAN fRecalc = FALSE;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT32 uiCursorFlags;
|
||||
BOOLEAN fShowAPs = FALSE;
|
||||
BOOLEAN fRecalc = FALSE;
|
||||
INT32 sTargetGridNo = usMapPos;
|
||||
UINT8 ubCursorID=0;
|
||||
UINT8 ubItemCursor;
|
||||
UINT8 ubCursorID=0;
|
||||
UINT8 ubItemCursor = 0;
|
||||
|
||||
pSoldier = MercPtrs[ ubSoldierID ];
|
||||
|
||||
@@ -350,6 +350,7 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
UINT16 usCursor=0;
|
||||
BOOLEAN fMaxPointLimitHit = FALSE;
|
||||
UINT16 usInHand;
|
||||
extern UINT32 guiNewUICursor;
|
||||
|
||||
UINT16 reverse = 0;
|
||||
|
||||
@@ -457,6 +458,30 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
gsCurrentActionPoints = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, (INT8)(pSoldier->aiData.bShownAimTime ) );
|
||||
}
|
||||
|
||||
const bool isCursorOnTarget = (
|
||||
guiNewUICursor == ACTION_SHOOT_UICURSOR || guiNewUICursor == ACTION_TARGETBURST_UICURSOR ||
|
||||
guiNewUICursor == ACTION_FLASH_SHOOT_UICURSOR || guiNewUICursor == ACTION_FLASH_BURST_UICURSOR ||
|
||||
guiNewUICursor == ACTION_NOCHANCE_SHOOT_UICURSOR || guiNewUICursor == ACTION_NOCHANCE_BURST_UICURSOR
|
||||
);
|
||||
// Start at maximum aiming levels if the option is toggled
|
||||
if (gGameSettings.fOptions[TOPTION_ALT_START_AIM] && isCursorOnTarget)
|
||||
{
|
||||
pSoldier->aiData.bShownAimTime = maxAimLevels;
|
||||
sAPCosts = CalcTotalAPsToAttack(pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
// Determine if we can afford!
|
||||
while (!EnoughPoints(pSoldier, sAPCosts, 0, FALSE))
|
||||
{
|
||||
pSoldier->aiData.bShownAimTime -= 1;
|
||||
if (pSoldier->aiData.bShownAimTime < 0)
|
||||
{
|
||||
pSoldier->aiData.bShownAimTime = REFINE_AIM_1;
|
||||
break;
|
||||
}
|
||||
sAPCosts = CalcTotalAPsToAttack(pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
}
|
||||
gsCurrentActionPoints = sAPCosts;
|
||||
}
|
||||
|
||||
// If we don't have any points and we are at the first refine, do nothing but warn!
|
||||
if ( !EnoughPoints( pSoldier, gsCurrentActionPoints, 0 , FALSE ) && (pSoldier->aiData.bShownAimTime == 0))
|
||||
{
|
||||
@@ -4004,4 +4029,4 @@ UINT8 DefaultAutofireBulletsByGunClass( SOLDIERTYPE* pSoldier )
|
||||
}
|
||||
|
||||
return ubBullets;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user