mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fix: Squadleader level bonus for other mercs was applied in strategic.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8479 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+12
-12
@@ -2832,7 +2832,7 @@ UINT16 CalculateHealingPointsForDoctor(SOLDIERTYPE *pDoctor, UINT16 *pusMaxPts,
|
||||
}
|
||||
|
||||
// calculate effective doctoring rate (adjusted for drugs, alcohol, etc.)
|
||||
usHealPts = (UINT32) (( EffectiveMedical( pDoctor ) * (( EffectiveDexterity( pDoctor, FALSE ) + EffectiveWisdom( pDoctor ) ) / 2) * (100 + ( 5 * EffectiveExpLevel( pDoctor) ) ) ) / gGameExternalOptions.ubDoctoringRateDivisor);
|
||||
usHealPts = (UINT32) (( EffectiveMedical( pDoctor ) * (( EffectiveDexterity( pDoctor, FALSE ) + EffectiveWisdom( pDoctor ) ) / 2) * (100 + ( 5 * EffectiveExpLevel( pDoctor, FALSE) ) ) ) / gGameExternalOptions.ubDoctoringRateDivisor);
|
||||
usHealPts = __max(0, (usHealPts * sSectorModifier)/100);
|
||||
|
||||
// calculate normal doctoring rate - what it would be if his stats were "normal" (ignoring drugs, fatigue, equipment condition)
|
||||
@@ -2934,7 +2934,7 @@ UINT8 CalculateRepairPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts
|
||||
ubKitEffectiveness = 100 + Item[pSoldier->inv[HANDPOS].usItem].RepairModifier;
|
||||
|
||||
// calculate effective repair rate (adjusted for drugs, alcohol, etc.)
|
||||
usRepairPts = (UINT16) ((EffectiveMechanical( pSoldier ) * EffectiveDexterity( pSoldier, FALSE ) * (100 + ( 5 * EffectiveExpLevel( pSoldier) ) ) ) / ( gGameExternalOptions.ubRepairRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay ));
|
||||
usRepairPts = (UINT16) ((EffectiveMechanical( pSoldier ) * EffectiveDexterity( pSoldier, FALSE ) * (100 + ( 5 * EffectiveExpLevel( pSoldier, FALSE) ) ) ) / ( gGameExternalOptions.ubRepairRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay ));
|
||||
|
||||
// calculate normal repair rate - what it would be if his stats were "normal" (ignoring drugs, fatigue, equipment condition)
|
||||
// and equipment was not a hindrance
|
||||
@@ -3027,7 +3027,7 @@ UINT8 CalculateCleaningPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxP
|
||||
}
|
||||
|
||||
// calculate effective repair rate (adjusted for drugs, alcohol, etc.)
|
||||
usCleaningPts = (UINT32)( (( EffectiveMechanical( pSoldier ) + 3 * EffectiveDexterity( pSoldier, FALSE ) + 50 * EffectiveExpLevel( pSoldier) ) * 1000 ) / ( gGameExternalOptions.ubCleaningRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay ) );
|
||||
usCleaningPts = (UINT32)( (( EffectiveMechanical( pSoldier ) + 3 * EffectiveDexterity( pSoldier, FALSE ) + 50 * EffectiveExpLevel( pSoldier, FALSE) ) * 1000 ) / ( gGameExternalOptions.ubCleaningRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay ) );
|
||||
|
||||
// calculate normal repair rate - what it would be if his stats were "normal" (ignoring drugs, fatigue, equipment condition)
|
||||
// and equipment was not a hindrance
|
||||
@@ -3087,7 +3087,7 @@ UINT32 CalculateInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts )
|
||||
if ( !*pusMaxPts )
|
||||
return 0;
|
||||
|
||||
usInterrogationPoints = 20 + 3 * EffectiveExpLevel( pSoldier ) + EffectiveLeadership( pSoldier ) / 2;
|
||||
usInterrogationPoints = 20 + 3 * EffectiveExpLevel( pSoldier, FALSE ) + EffectiveLeadership( pSoldier ) / 2;
|
||||
|
||||
// adjust for threatening value
|
||||
INT32 threatenvalue = CalcThreateningEffectiveness( pSoldier->ubProfile ) * gMercProfiles[pSoldier->ubProfile].usApproachFactor[2] ;
|
||||
@@ -3147,7 +3147,7 @@ UINT32 CalculatePrisonGuardValue(SOLDIERTYPE *pSoldier )
|
||||
if ( pSoldier->bAssignment == FACILITY_PRISON_SNITCH )
|
||||
return 0;
|
||||
|
||||
usValue = 15 * EffectiveExpLevel( pSoldier ) + EffectiveLeadership( pSoldier ) / 2 + 2 * EffectiveStrength( pSoldier, FALSE);
|
||||
usValue = 15 * EffectiveExpLevel( pSoldier, FALSE ) + EffectiveLeadership( pSoldier ) / 2 + 2 * EffectiveStrength( pSoldier, FALSE);
|
||||
|
||||
if (gGameOptions.fNewTraitSystem)
|
||||
{
|
||||
@@ -3179,7 +3179,7 @@ UINT32 CalculateSnitchGuardValue(SOLDIERTYPE *pSoldier )
|
||||
if ( pSoldier->bAssignment != FACILITY_PRISON_SNITCH )
|
||||
return 0;
|
||||
|
||||
usValue = 15 * EffectiveExpLevel( pSoldier ) + EffectiveLeadership( pSoldier ) / 2 + 2 * EffectiveWisdom( pSoldier );
|
||||
usValue = 15 * EffectiveExpLevel( pSoldier, FALSE ) + EffectiveLeadership( pSoldier ) / 2 + 2 * EffectiveWisdom( pSoldier );
|
||||
|
||||
// snitch trait doesn't give bonus, as it's required to take assignment anyway
|
||||
if (gGameOptions.fNewTraitSystem)
|
||||
@@ -3298,7 +3298,7 @@ UINT32 CalculateSnitchInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPt
|
||||
if ( !*pusMaxPts )
|
||||
return 0;
|
||||
|
||||
usInterrogationPoints = 20 + 3 * EffectiveExpLevel( pSoldier ) + EffectiveLeadership( pSoldier )/2 + EffectiveWisdom( pSoldier )/2;
|
||||
usInterrogationPoints = 20 + 3 * EffectiveExpLevel( pSoldier, FALSE) + EffectiveLeadership( pSoldier )/2 + EffectiveWisdom( pSoldier )/2;
|
||||
|
||||
// no bonuses for snitch trait, as merc has to have it to take this assignment anyway
|
||||
if (gGameOptions.fNewTraitSystem)
|
||||
@@ -3388,7 +3388,7 @@ INT16 GetTrainWorkerPts(SOLDIERTYPE *pSoldier)
|
||||
if ( pSoldier->flags.fMercAsleep )
|
||||
return 0;
|
||||
|
||||
INT16 val = 3 * EffectiveExpLevel( pSoldier ) + EffectiveLeadership( pSoldier );
|
||||
INT16 val = 3 * EffectiveExpLevel( pSoldier, FALSE) + EffectiveLeadership( pSoldier );
|
||||
|
||||
if (gGameOptions.fNewTraitSystem)
|
||||
{
|
||||
@@ -3432,7 +3432,7 @@ BOOL HandleSnitchExposition(SOLDIERTYPE *pSoldier)
|
||||
INT16 aPrisoners[PRISONER_MAX] = {0};
|
||||
UINT16 numprisoners = GetNumberOfPrisoners( pSectorInfo, aPrisoners );
|
||||
|
||||
uiCoverQuality = ( 10 * EffectiveExpLevel( pSoldier ) + 2 * EffectiveLeadership( pSoldier ) + EffectiveWisdom( pSoldier ) ) / 4;
|
||||
uiCoverQuality = ( 10 * EffectiveExpLevel( pSoldier, FALSE) + 2 * EffectiveLeadership( pSoldier ) + EffectiveWisdom( pSoldier ) ) / 4;
|
||||
|
||||
uiSuspicion = 10 + aPrisoners[PRISONER_ELITE] + aPrisoners[PRISONER_OFFICER];
|
||||
|
||||
@@ -3464,7 +3464,7 @@ BOOL HandleSnitchExposition(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
ScreenMsg( FONT_GRAY2, MSG_INTERFACE, pSnitchPrisonExposedStrings[ SNITCH_PRISON_EXPOSED_FINE_LEADERSHIP ], pSoldier->GetName() );
|
||||
}
|
||||
else if( EffectiveExpLevel( pSoldier ) > PreRandom(100) ) // he avoided ambush
|
||||
else if( EffectiveExpLevel( pSoldier, FALSE ) > PreRandom(100) ) // he avoided ambush
|
||||
{
|
||||
ScreenMsg( FONT_GRAY2, MSG_INTERFACE, pSnitchPrisonExposedStrings[ SNITCH_PRISON_EXPOSED_FINE_EXPLEVEL ], pSoldier->GetName() );
|
||||
}
|
||||
@@ -6144,7 +6144,7 @@ void HandleGatheringInformationBySoldier( SOLDIERTYPE* pSoldier )
|
||||
|
||||
UINT16 usNormalGroupSize = 2 * zDiffSetting[gGameOptions.ubDifficultyLevel].iMinEnemyGroupSize;
|
||||
|
||||
FLOAT fBaseChance = ( EffectiveLeadership(pSoldier) + EffectiveWisdom(pSoldier) + EffectiveExpLevel(pSoldier) * 10 ) / 3000.0f;
|
||||
FLOAT fBaseChance = ( EffectiveLeadership(pSoldier) + EffectiveWisdom(pSoldier) + EffectiveExpLevel(pSoldier, FALSE) * 10 ) / 3000.0f;
|
||||
|
||||
if ( DoesMercHaveDisability( pSoldier, DEAF ) )
|
||||
{
|
||||
@@ -7908,7 +7908,7 @@ INT16 GetTownTrainPtsForCharacter( SOLDIERTYPE *pTrainer, UINT16 *pusMaxPts )
|
||||
|
||||
// calculate effective training points (this is hundredths of pts / hour)
|
||||
// typical: 300/hr, maximum: 600/hr
|
||||
sTotalTrainingPts = ( EffectiveWisdom( pTrainer ) + EffectiveLeadership ( pTrainer ) + ( 10 * EffectiveExpLevel ( pTrainer ) ) ) * gGameExternalOptions.ubTownMilitiaTrainingRate;
|
||||
sTotalTrainingPts = ( EffectiveWisdom( pTrainer ) + EffectiveLeadership ( pTrainer ) + ( 10 * EffectiveExpLevel ( pTrainer, FALSE) ) ) * gGameExternalOptions.ubTownMilitiaTrainingRate;
|
||||
|
||||
// check for teaching bonuses
|
||||
if( gGameOptions.fNewTraitSystem ) // old/new traits - SANDRO
|
||||
|
||||
@@ -967,7 +967,7 @@ INT16 FacilityRiskResult( SOLDIERTYPE *pSoldier, UINT8 ubRiskType, UINT8 ubFacil
|
||||
INT16 ubWisdom = EffectiveWisdom( pSoldier );
|
||||
UINT8 ubLeadership = EffectiveLeadership( pSoldier );
|
||||
UINT8 ubExplosives = EffectiveExplosive( pSoldier );
|
||||
UINT8 ubExpLevel = EffectiveExpLevel( pSoldier );
|
||||
UINT8 ubExpLevel = EffectiveExpLevel( pSoldier, FALSE);
|
||||
UINT8 ubLocalLoyalty = 0;
|
||||
if (GetTownIdForSector( pSoldier->sSectorX, pSoldier->sSectorY ) != BLANK_SECTOR )
|
||||
{
|
||||
|
||||
@@ -419,7 +419,7 @@ void HourlyLarryUpdate()
|
||||
{
|
||||
if( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && pSoldier->bSectorZ == pOtherSoldier->bSectorZ )
|
||||
{
|
||||
UINT16 bPreventChance = ( EffectiveLeadership( pOtherSoldier ) + EffectiveExpLevel( pOtherSoldier ) / 2);
|
||||
UINT16 bPreventChance = ( EffectiveLeadership( pOtherSoldier ) + EffectiveExpLevel( pOtherSoldier, FALSE) / 2);
|
||||
if (gGameOptions.fNewTraitSystem)
|
||||
{
|
||||
bPreventChance += 25 * NUM_SKILL_TRAITS( pOtherSoldier, SQUADLEADER_NT );
|
||||
@@ -587,7 +587,7 @@ void HourlyDisabilityUpdate( )
|
||||
{
|
||||
if ( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && pSoldier->bSectorZ == pOtherSoldier->bSectorZ )
|
||||
{
|
||||
UINT16 bPreventChance = (EffectiveLeadership( pOtherSoldier ) + EffectiveExpLevel( pOtherSoldier ) / 2);
|
||||
UINT16 bPreventChance = (EffectiveLeadership( pOtherSoldier ) + EffectiveExpLevel( pOtherSoldier, FALSE) / 2);
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
{
|
||||
bPreventChance += 25 * NUM_SKILL_TRAITS( pOtherSoldier, SQUADLEADER_NT );
|
||||
@@ -678,7 +678,7 @@ void HourlyStealUpdate()
|
||||
{
|
||||
if( pSoldier->sSectorX == pOtherSoldier->sSectorX && pSoldier->sSectorY == pOtherSoldier->sSectorY && pSoldier->bSectorZ == pOtherSoldier->bSectorZ )
|
||||
{
|
||||
UINT16 bPreventChance = ( EffectiveLeadership( pOtherSoldier ) + EffectiveExpLevel( pOtherSoldier ) / 2);
|
||||
UINT16 bPreventChance = ( EffectiveLeadership( pOtherSoldier ) + EffectiveExpLevel( pOtherSoldier, FALSE) / 2);
|
||||
if (gGameOptions.fNewTraitSystem)
|
||||
{
|
||||
bPreventChance += 25 * NUM_SKILL_TRAITS( pOtherSoldier, SQUADLEADER_NT );
|
||||
|
||||
@@ -172,7 +172,8 @@ INT8 EffectiveLeadership( SOLDIERTYPE * pSoldier )
|
||||
return( (INT8) iEffLeadership );
|
||||
}
|
||||
|
||||
INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier )
|
||||
// Flugente: modifiers that depend on physical position (squadleader, afraid of heights) only apply if fTactical is TRUE
|
||||
INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier, BOOLEAN fTactical )
|
||||
{
|
||||
INT32 iEffExpLevel;
|
||||
INT8 bDrunkLevel;
|
||||
@@ -187,7 +188,7 @@ INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier )
|
||||
iEffExpLevel = pSoldier->stats.bExpLevel;
|
||||
|
||||
// SANDRO - STOMP traits - Squadleader bonus to effective level
|
||||
if ( gGameOptions.fNewTraitSystem && IS_MERC_BODY_TYPE( pSoldier ))
|
||||
if ( fTactical && gGameOptions.fNewTraitSystem && IS_MERC_BODY_TYPE( pSoldier ))
|
||||
{
|
||||
iEffExpLevel += (gSkillTraitValues.ubSLEffectiveLevelInRadius * GetSquadleadersCountInVicinity( pSoldier, TRUE, FALSE ));
|
||||
}
|
||||
@@ -209,7 +210,7 @@ INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier )
|
||||
// SANDRO - fear of insects, and we are in tropical sector
|
||||
iEffExpLevel -= 1;
|
||||
}
|
||||
else if ( DoesMercHaveDisability( pSoldier, AFRAID_OF_HEIGHTS ) && pSoldier->pathing.bLevel > 0 )
|
||||
else if ( fTactical & DoesMercHaveDisability( pSoldier, AFRAID_OF_HEIGHTS ) && pSoldier->pathing.bLevel > 0 )
|
||||
{
|
||||
// Flugente: fear of heights
|
||||
iEffExpLevel -= 2;
|
||||
|
||||
@@ -17,7 +17,7 @@ INT8 EffectiveExplosive( SOLDIERTYPE *pSoldier );
|
||||
INT8 EffectiveLeadership( SOLDIERTYPE *pSoldier );
|
||||
INT8 EffectiveMarksmanship( SOLDIERTYPE *pSoldier );
|
||||
INT16 EffectiveDexterity( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
|
||||
INT8 EffectiveExpLevel( SOLDIERTYPE *pSoldier );
|
||||
INT8 EffectiveExpLevel( SOLDIERTYPE *pSoldier, BOOLEAN fTactical = TRUE );
|
||||
INT8 EffectiveMedical( SOLDIERTYPE *pSoldier );
|
||||
|
||||
enum SkillChecks
|
||||
|
||||
Reference in New Issue
Block a user