mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Sandro's feature pack (by Sandro)
- Dual Burst/Autofire Enabled - Alternative Weapon Holding (firing from hip + pistol with one hand) - Energy Cost on Weapon Manipulation (holding it shouldered, firing) - Suppression Effectiveness Modified by Caliber and Gun Loudness - No Enemy Auto-ready Weapon Option - Fancy Big Merc Rifle Holding Animations - More Random Idle Animations - Kick in HtH Implemented - Jumping Implemented - (Included Fix for IIS with Martial Arts Bonus) - further infos: http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/308884/A_Small_Compilation_of_New_Fea.html#Post308884 - you also need the latest GameDir files! git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5471 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+50
-18
@@ -388,6 +388,11 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
if(pSoldier->bDoAutofire == 1) //try to maximize the # of bullets because 1 may not be optimal
|
||||
{
|
||||
INT16 sCurAPCosts, sAPCosts;
|
||||
UINT16 usShotsLeft = pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft;
|
||||
if (pSoldier->IsValidSecondHandBurst())
|
||||
{
|
||||
usShotsLeft = min( (pSoldier->inv[ SECONDHANDPOS ][0]->data.gun.ubGunShotsLeft), usShotsLeft );
|
||||
}
|
||||
|
||||
sCurAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
|
||||
@@ -396,13 +401,17 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
pSoldier->bDoAutofire++;
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
}
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft >= pSoldier->bDoAutofire);
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && usShotsLeft >= pSoldier->bDoAutofire);
|
||||
pSoldier->bDoAutofire--;
|
||||
}
|
||||
|
||||
gfUIAutofireBulletCount = TRUE;
|
||||
gsBulletCount = pSoldier->bDoAutofire;
|
||||
gsTotalBulletCount = pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft;
|
||||
if (pSoldier->IsValidSecondHandBurst())
|
||||
{
|
||||
gsTotalBulletCount = min( (pSoldier->inv[ SECONDHANDPOS ][0]->data.gun.ubGunShotsLeft), gsTotalBulletCount );
|
||||
}
|
||||
|
||||
if(pSoldier->flags.autofireLastStep) //set the orange tint on the numbers if we at the last step
|
||||
gTintBulletCounts = TRUE;
|
||||
@@ -425,7 +434,7 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
}
|
||||
|
||||
// If we don't have any points and we are at the first refine, do nothing but warn!
|
||||
if ( !EnoughPoints( pSoldier, gsCurrentActionPoints, 0 , FALSE ) )
|
||||
if ( !EnoughPoints( pSoldier, gsCurrentActionPoints, 0 , FALSE ) && (pSoldier->aiData.bShownAimTime == 0))
|
||||
{
|
||||
gfUIDisplayActionPointsInvalid = TRUE;
|
||||
|
||||
@@ -441,7 +450,8 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
if (reverse == 0)
|
||||
{
|
||||
// WANNE: Current AP costs for targeting
|
||||
sAPCosts = MinAPsToAttack( pSoldier, usMapPos, TRUE ) + ( bFutureAim );
|
||||
//sAPCosts = MinAPsToAttack( pSoldier, usMapPos, TRUE, bFutureAim ) + ( bFutureAim );
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, bFutureAim );
|
||||
|
||||
//gsCurrentActionPoints = sAPCosts;
|
||||
|
||||
@@ -453,11 +463,13 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
}
|
||||
else
|
||||
{
|
||||
sAPCosts = MinAPsToAttack( pSoldier, usMapPos, TRUE ) + maxAimLevels - (bFutureAim + 1);
|
||||
//sAPCosts = MinAPsToAttack( pSoldier, usMapPos, TRUE, (maxAimLevels - (bFutureAim + 1)) ) + maxAimLevels - (bFutureAim + 1);
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, (maxAimLevels - (bFutureAim + 1)) );
|
||||
|
||||
gsCurrentActionPoints = sAPCosts;
|
||||
|
||||
sAPCostsMin = MinAPsToAttack( pSoldier, usMapPos, TRUE );
|
||||
//sAPCostsMin = MinAPsToAttack( pSoldier, usMapPos, TRUE, 0 );
|
||||
sAPCostsMin = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, 0 );
|
||||
if (sAPCosts < sAPCostsMin)
|
||||
{
|
||||
fEnoughPoints = FALSE;
|
||||
@@ -545,13 +557,18 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
if(gbNumBurstLocations > pSoldier->bDoAutofire)
|
||||
{
|
||||
INT16 sAPCosts;
|
||||
UINT16 usShotsLeft = pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft;
|
||||
if (pSoldier->IsValidSecondHandBurst())
|
||||
{
|
||||
usShotsLeft = min( (pSoldier->inv[ SECONDHANDPOS ][0]->data.gun.ubGunShotsLeft), usShotsLeft );
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
pSoldier->bDoAutofire++;
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, gsBurstLocations[0].sGridNo, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
}
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft >= pSoldier->bDoAutofire && gbNumBurstLocations >= pSoldier->bDoAutofire);
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && usShotsLeft >= pSoldier->bDoAutofire && gbNumBurstLocations >= pSoldier->bDoAutofire);
|
||||
pSoldier->bDoAutofire--;
|
||||
|
||||
gsCurrentActionPoints = CalcTotalAPsToAttack( pSoldier, gsBurstLocations[0].sGridNo, TRUE, pSoldier->aiData.bShownAimTime );
|
||||
@@ -614,7 +631,7 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
FLOAT dDeltaY = (FLOAT)(CenterY( pSoldier->sGridNo ) - CenterY( usMapPos ));
|
||||
FLOAT d2DDistance = sqrt((dDeltaX*dDeltaX)+(dDeltaY*dDeltaY));
|
||||
|
||||
CalcMagFactorSimple( pSoldier, d2DDistance, pSoldier->aiData.bShownAimTime );
|
||||
CalcMagFactorSimple( pSoldier, d2DDistance, pSoldier->aiData.bShownAimTime, usMapPos );
|
||||
|
||||
pSoldier->bTargetLevel = bTempTargetLevel;
|
||||
}
|
||||
@@ -720,7 +737,7 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
FLOAT dDeltaY = (FLOAT)(CenterY( pSoldier->sGridNo ) - CenterY( usMapPos ));
|
||||
FLOAT d2DDistance = sqrt((dDeltaX*dDeltaX)+(dDeltaY*dDeltaY));
|
||||
|
||||
CalcMagFactorSimple( pSoldier, d2DDistance, pSoldier->aiData.bShownAimTime );
|
||||
CalcMagFactorSimple( pSoldier, d2DDistance, pSoldier->aiData.bShownAimTime, usMapPos );
|
||||
|
||||
pSoldier->bTargetLevel = bTempTargetLevel;
|
||||
}
|
||||
@@ -822,7 +839,7 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos, BOOLEA
|
||||
FLOAT dDeltaY = (FLOAT)(CenterY( pSoldier->sGridNo ) - CenterY( usMapPos ));
|
||||
FLOAT d2DDistance = sqrt((dDeltaX*dDeltaX)+(dDeltaY*dDeltaY));
|
||||
|
||||
CalcMagFactorSimple( pSoldier, d2DDistance, pSoldier->aiData.bShownAimTime );
|
||||
CalcMagFactorSimple( pSoldier, d2DDistance, pSoldier->aiData.bShownAimTime, usMapPos );
|
||||
}
|
||||
|
||||
pSoldier->bTargetLevel = bTempTargetLevel;
|
||||
@@ -2351,6 +2368,11 @@ void HandleRightClickAdjustCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos )
|
||||
else if(pSoldier->bDoAutofire)
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -2360,11 +2382,11 @@ void HandleRightClickAdjustCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos )
|
||||
}
|
||||
|
||||
|
||||
if(pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft > pSoldier->bDoAutofire )
|
||||
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 && pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft > pSoldier->bDoAutofire) //Increment the bullet count until we run out of APs or we spend the whole AP
|
||||
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);
|
||||
@@ -2379,7 +2401,7 @@ void HandleRightClickAdjustCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos )
|
||||
pSoldier->bDoAutofire++;
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
}
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft >= pSoldier->bDoAutofire);
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && usShotsLeft >= pSoldier->bDoAutofire);
|
||||
pSoldier->bDoAutofire--;
|
||||
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, usMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
@@ -3211,6 +3233,11 @@ void HandleWheelAdjustCursor( SOLDIERTYPE *pSoldier, INT32 sMapPos, INT32 sDelta
|
||||
INT32 sGridNo;
|
||||
INT8 bTargetLevel;
|
||||
|
||||
UINT16 usShotsLeft = pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft;
|
||||
if (pSoldier->IsValidSecondHandBurst())
|
||||
{
|
||||
usShotsLeft = min( (pSoldier->inv[ SECONDHANDPOS ][0]->data.gun.ubGunShotsLeft), usShotsLeft );
|
||||
}
|
||||
|
||||
usInHand = pSoldier->inv[HANDPOS].usItem;
|
||||
|
||||
@@ -3239,11 +3266,11 @@ void HandleWheelAdjustCursor( SOLDIERTYPE *pSoldier, INT32 sMapPos, INT32 sDelta
|
||||
|
||||
if(pSoldier->bDoAutofire==1 && sDelta<0) return;
|
||||
|
||||
if(pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft > pSoldier->bDoAutofire )
|
||||
if(usShotsLeft > pSoldier->bDoAutofire )
|
||||
{
|
||||
//Calculate how many bullets we need to fire to add at least one more AP
|
||||
sAPCosts = sCurAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts <= sCurAPCosts && pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft > pSoldier->bDoAutofire) //Increment the bullet count until we run out of APs or we spend the whole AP
|
||||
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, sMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
@@ -3258,7 +3285,7 @@ void HandleWheelAdjustCursor( SOLDIERTYPE *pSoldier, INT32 sMapPos, INT32 sDelta
|
||||
pSoldier->bDoAutofire+=sDelta;
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
}
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft >= pSoldier->bDoAutofire);
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && usShotsLeft >= pSoldier->bDoAutofire);
|
||||
pSoldier->bDoAutofire--;
|
||||
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
@@ -3427,6 +3454,11 @@ void HandleWheelAdjustCursorWOAB( SOLDIERTYPE *pSoldier, INT32 sMapPos, INT32 sD
|
||||
INT32 sGridNo;
|
||||
INT8 bTargetLevel;
|
||||
|
||||
UINT16 usShotsLeft = pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft;
|
||||
if (pSoldier->IsValidSecondHandBurst())
|
||||
{
|
||||
usShotsLeft = min( (pSoldier->inv[ SECONDHANDPOS ][0]->data.gun.ubGunShotsLeft), usShotsLeft );
|
||||
}
|
||||
|
||||
usInHand = pSoldier->inv[HANDPOS].usItem;
|
||||
|
||||
@@ -3457,11 +3489,11 @@ void HandleWheelAdjustCursorWOAB( SOLDIERTYPE *pSoldier, INT32 sMapPos, INT32 sD
|
||||
|
||||
if(pSoldier->bDoAutofire==1 && sDelta<0) return;
|
||||
|
||||
if(pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft > pSoldier->bDoAutofire )
|
||||
if(usShotsLeft > pSoldier->bDoAutofire )
|
||||
{
|
||||
//Calculate how many bullets we need to fire to add at least one more AP
|
||||
sAPCosts = sCurAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts <= sCurAPCosts && pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft > pSoldier->bDoAutofire) //Increment the bullet count until we run out of APs or we spend the whole AP
|
||||
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, sMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
@@ -3476,7 +3508,7 @@ void HandleWheelAdjustCursorWOAB( SOLDIERTYPE *pSoldier, INT32 sMapPos, INT32 sD
|
||||
pSoldier->bDoAutofire+=sDelta;
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
}
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.gun.ubGunShotsLeft >= pSoldier->bDoAutofire);
|
||||
while(EnoughPoints( pSoldier, sAPCosts, 0, FALSE ) && sAPCosts == sCurAPCosts && usShotsLeft >= pSoldier->bDoAutofire);
|
||||
pSoldier->bDoAutofire--;
|
||||
|
||||
sAPCosts = CalcTotalAPsToAttack( pSoldier, sMapPos, TRUE, pSoldier->aiData.bShownAimTime);
|
||||
|
||||
Reference in New Issue
Block a user