mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Updates to the HAM/100AP integration.
Added Min/Max Suppression Tolerance values (from Headrock). Bugfix: Took away the ability to reload a weapon from the item description box while using an ammo crate. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2695 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+18
-13
@@ -7196,9 +7196,14 @@ INT8 CalcSuppressionTolerance( SOLDIERTYPE * pSoldier )
|
||||
}
|
||||
}
|
||||
|
||||
if (bTolerance < 0)
|
||||
if (bTolerance < gGameExternalOptions.iSuppressionToleranceMin)
|
||||
{
|
||||
bTolerance = 0;
|
||||
bTolerance = gGameExternalOptions.iSuppressionToleranceMin;
|
||||
}
|
||||
|
||||
if (bTolerance > gGameExternalOptions.iSuppressionToleranceMax)
|
||||
{
|
||||
bTolerance = gGameExternalOptions.iSuppressionToleranceMax;
|
||||
}
|
||||
|
||||
return( bTolerance );
|
||||
@@ -7213,9 +7218,9 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// External options.
|
||||
UINT8 MAX_APS_SUPPRESSED = gGameExternalOptions.iMaxSuppressionAPLossPerAttack;
|
||||
UINT8 MAX_APS_SUPPRESSED_TOTAL = gGameExternalOptions.iMaxSuppressionAPLossPerTurn;
|
||||
INT8 SUPPRESSION_AP_LIMIT = gGameExternalOptions.iMinAPLimitFromSuppression;
|
||||
BOOLEAN APS_SUPPRESSED = gGameExternalOptions.fSuppressionAPLossPerAttack;
|
||||
BOOLEAN APS_SUPPRESSED_TOTAL = gGameExternalOptions.fSuppressionAPLossPerTurn;
|
||||
//INT8 SUPPRESSION_AP_LIMIT = gGameExternalOptions.iMinAPLimitFromSuppression;
|
||||
INT8 MAXIMUM_SUPPRESSION_SHOCK = gGameExternalOptions.iMaxSuppressionShock;
|
||||
INT8 bTolerance;
|
||||
INT16 sClosestOpponent, sClosestOppLoc;
|
||||
@@ -7263,7 +7268,7 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
|
||||
// cap the # of APs we can lose
|
||||
// HEADROCK HAM B2: This now reads an external value. 0 means no limit.
|
||||
if (MAX_APS_SUPPRESSED > 0)
|
||||
if (APS_SUPPRESSED == TRUE)
|
||||
{
|
||||
if (ubPointsLost > APBPConstants[AP_MAX_SUPPRESSED])
|
||||
{
|
||||
@@ -7272,11 +7277,11 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
}
|
||||
|
||||
// HEADROCK HAM B2: This makes sure that we never lose more APs than we're allowed per turn,
|
||||
if (MAX_APS_SUPPRESSED_TOTAL > 0)
|
||||
if (APS_SUPPRESSED_TOTAL = TRUE)
|
||||
{
|
||||
if (pSoldier->ubAPsLostToSuppression + ubPointsLost > MAX_APS_SUPPRESSED_TOTAL)
|
||||
if (pSoldier->ubAPsLostToSuppression + ubPointsLost > APBPConstants[AP_MAX_SUPPRESSED])
|
||||
{
|
||||
ubPointsLost = MAX_APS_SUPPRESSED_TOTAL - pSoldier->ubAPsLostToSuppression;
|
||||
ubPointsLost = APBPConstants[AP_MAX_SUPPRESSED] - pSoldier->ubAPsLostToSuppression;
|
||||
}
|
||||
}
|
||||
// Keeps a number for later reference
|
||||
@@ -7366,9 +7371,9 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
// morale modifier
|
||||
// For every 2 APs lost, subtract morale by a certain value.
|
||||
// HEADROCK: Modified - now externalized to INI.
|
||||
if (gGameExternalOptions.iAPLostPerMoraleDrop > 0 && ubPointsLost > 0)
|
||||
if (APBPConstants[AP_LOST_PER_MORALE_DROP] > 0 && ubPointsLost > 0)
|
||||
{
|
||||
for ( ubLoop2 = 0; ubLoop2 < (ubPointsLost / gGameExternalOptions.iAPLostPerMoraleDrop); ubLoop2++ )
|
||||
for ( ubLoop2 = 0; ubLoop2 < (ubPointsLost / APBPConstants[AP_LOST_PER_MORALE_DROP]); ubLoop2++ )
|
||||
{
|
||||
HandleMoraleEvent( pSoldier, MORALE_SUPPRESSED, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ );
|
||||
}
|
||||
@@ -7451,9 +7456,9 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleSuppressionFire: reduce action points"));
|
||||
// Reduce action points!
|
||||
// HEADROCK HAM Beta 2.2: Enforce a minimum limit via INI.
|
||||
if (pSoldier->bActionPoints - ubPointsLost < gGameExternalOptions.iMinAPLimitFromSuppression )
|
||||
if (pSoldier->bActionPoints - ubPointsLost < APBPConstants[AP_MIN_LIMIT_SUPPRESSION_LOSS] )
|
||||
{
|
||||
pSoldier->bActionPoints = gGameExternalOptions.iMinAPLimitFromSuppression;
|
||||
pSoldier->bActionPoints = APBPConstants[AP_MIN_LIMIT_SUPPRESSION_LOSS];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user