mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
When displaying a merc's maximum assignment points, factor in backgrounds values.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8050 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+18
-52
@@ -2723,7 +2723,11 @@ UINT16 CalculateHealingPointsForDoctor(SOLDIERTYPE *pDoctor, UINT16 *pusMaxPts,
|
|||||||
|
|
||||||
// calculate normal doctoring rate - what it would be if his stats were "normal" (ignoring drugs, fatigue, equipment condition)
|
// calculate normal doctoring rate - what it would be if his stats were "normal" (ignoring drugs, fatigue, equipment condition)
|
||||||
// and equipment was not a hindrance
|
// and equipment was not a hindrance
|
||||||
*pusMaxPts = ( pDoctor->stats.bMedical * (( pDoctor->stats.bDexterity + pDoctor->stats.bWisdom ) / 2 ) * (100 + ( 5 * pDoctor->stats.bExpLevel) ) ) / gGameExternalOptions.ubDoctoringRateDivisor;
|
INT16 dexterity = (pDoctor->stats.bDexterity * (100 + pDoctor->GetBackgroundValue( BG_DEXTERITY ))) / 100;
|
||||||
|
INT16 medical = (pDoctor->stats.bMedical * (100 + pDoctor->GetBackgroundValue( BG_MEDICAL ))) / 100;
|
||||||
|
INT16 wisdom = (pDoctor->stats.bWisdom * (100 + pDoctor->GetBackgroundValue( BG_WISDOM ))) / 100;
|
||||||
|
|
||||||
|
*pusMaxPts = (medical * ((dexterity + wisdom) / 2) * (100 + (5 * pDoctor->stats.bExpLevel))) / gGameExternalOptions.ubDoctoringRateDivisor;
|
||||||
*pusMaxPts = __max(0,*pusMaxPts);
|
*pusMaxPts = __max(0,*pusMaxPts);
|
||||||
|
|
||||||
// SANDRO - New Doctor Trait
|
// SANDRO - New Doctor Trait
|
||||||
@@ -2820,7 +2824,9 @@ UINT8 CalculateRepairPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts
|
|||||||
|
|
||||||
// calculate normal repair rate - what it would be if his stats were "normal" (ignoring drugs, fatigue, equipment condition)
|
// calculate normal repair rate - what it would be if his stats were "normal" (ignoring drugs, fatigue, equipment condition)
|
||||||
// and equipment was not a hindrance
|
// and equipment was not a hindrance
|
||||||
*pusMaxPts = ( pSoldier->stats.bMechanical * pSoldier->stats.bDexterity * (100 + ( 5 * pSoldier->stats.bExpLevel) ) ) / ( gGameExternalOptions.ubRepairRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay );
|
INT16 mechanical = (pSoldier->stats.bMechanical * (100 + pSoldier->GetBackgroundValue( BG_MECHANICAL ))) / 100;
|
||||||
|
INT16 dexterity = (pSoldier->stats.bDexterity * (100 + pSoldier->GetBackgroundValue( BG_DEXTERITY ))) / 100;
|
||||||
|
*pusMaxPts = (mechanical * dexterity * (100 + (5 * pSoldier->stats.bExpLevel))) / (gGameExternalOptions.ubRepairRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay);
|
||||||
|
|
||||||
// SANDRO - Technician trait gives a good bonus to repair items
|
// SANDRO - Technician trait gives a good bonus to repair items
|
||||||
if ( gGameOptions.fNewTraitSystem )
|
if ( gGameOptions.fNewTraitSystem )
|
||||||
@@ -2956,14 +2962,11 @@ UINT32 CalculateInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Flugente: calculate prison guard value
|
// Flugente: calculate prison guard value
|
||||||
UINT32 CalculatePrisonGuardValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts )
|
UINT32 CalculatePrisonGuardValue(SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
// this is not an assignment. Simply being in the sector will allow us to be counted as guards
|
// this is not an assignment. Simply being in the sector will allow us to be counted as guards
|
||||||
UINT32 usValue = 0;
|
UINT32 usValue = 0;
|
||||||
|
|
||||||
// for max points we display the maximum amount of prisoners instead
|
|
||||||
*pusMaxPts = 0;
|
|
||||||
|
|
||||||
if ( pSoldier->flags.fMercAsleep )
|
if ( pSoldier->flags.fMercAsleep )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -2991,14 +2994,11 @@ UINT32 CalculatePrisonGuardValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts )
|
|||||||
return( usValue );
|
return( usValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 CalculateSnitchGuardValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts )
|
UINT32 CalculateSnitchGuardValue(SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
// this is an assignment
|
// this is an assignment
|
||||||
UINT32 usValue = 0;
|
UINT32 usValue = 0;
|
||||||
|
|
||||||
// for max points we display the maximum amount of prisoners instead
|
|
||||||
*pusMaxPts = 0;
|
|
||||||
|
|
||||||
if ( pSoldier->flags.fMercAsleep )
|
if ( pSoldier->flags.fMercAsleep )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -3043,8 +3043,7 @@ UINT32 CalculateAllGuardsValueInPrison( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
|||||||
{
|
{
|
||||||
if( pSoldier->bActive && ( pSoldier->sSectorX == sMapX ) && ( pSoldier->sSectorY == sMapY ) && ( pSoldier->bSectorZ == bZ) && !pSoldier->flags.fMercAsleep )
|
if( pSoldier->bActive && ( pSoldier->sSectorX == sMapX ) && ( pSoldier->sSectorY == sMapY ) && ( pSoldier->bSectorZ == bZ) && !pSoldier->flags.fMercAsleep )
|
||||||
{
|
{
|
||||||
UINT16 tmp;
|
prisonguardvalue += CalculatePrisonGuardValue(pSoldier );
|
||||||
prisonguardvalue += CalculatePrisonGuardValue(pSoldier, &tmp );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3067,8 +3066,7 @@ UINT32 CalculateAllSnitchesGuardValueInPrison( INT16 sMapX, INT16 sMapY, INT8 bZ
|
|||||||
{
|
{
|
||||||
if( pSoldier->bActive && ( pSoldier->sSectorX == sMapX ) && ( pSoldier->sSectorY == sMapY ) && ( pSoldier->bSectorZ == bZ) && pSoldier->flags.fMercAsleep == FALSE )
|
if( pSoldier->bActive && ( pSoldier->sSectorX == sMapX ) && ( pSoldier->sSectorY == sMapY ) && ( pSoldier->bSectorZ == bZ) && pSoldier->flags.fMercAsleep == FALSE )
|
||||||
{
|
{
|
||||||
UINT16 tmp;
|
prisonguardvalue += CalculateSnitchGuardValue(pSoldier );
|
||||||
prisonguardvalue += CalculateSnitchGuardValue(pSoldier, &tmp );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3174,41 +3172,6 @@ UINT32 CalculateSnitchInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPt
|
|||||||
return( usInterrogationPoints );
|
return( usInterrogationPoints );
|
||||||
}
|
}
|
||||||
|
|
||||||
// anv: totally not a copy of CalculatePrisonGuardValue
|
|
||||||
UINT32 CalculateSnitchPrisonGuardValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts )
|
|
||||||
{
|
|
||||||
UINT32 usValue = 0;
|
|
||||||
|
|
||||||
// for max points we display the maximum amount of prisoners instead
|
|
||||||
*pusMaxPts = 0;
|
|
||||||
|
|
||||||
if ( pSoldier->flags.fMercAsleep )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if ( !CanCharacterSnitchInPrison(pSoldier) )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
usValue = ( 15 * EffectiveExpLevel( pSoldier ) + 2 * EffectiveLeadership( pSoldier ) + EffectiveWisdom( pSoldier ) );
|
|
||||||
|
|
||||||
// no bonuses for snitch trait, as merc has to have it to take this assignment anyway
|
|
||||||
if (gGameOptions.fNewTraitSystem)
|
|
||||||
{
|
|
||||||
usValue += 25 * NUM_SKILL_TRAITS( pSoldier, COVERT_NT ) + 10 * HAS_SKILL_TRAIT( pSoldier, STEALTHY_NT );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
usValue += 10 * HAS_SKILL_TRAIT( pSoldier, STEALTHY_OT );
|
|
||||||
}
|
|
||||||
|
|
||||||
usValue = (UINT32)(gSkillTraitValues.fSNTPrisonSnitchGuardStrengthMultiplier * usValue);
|
|
||||||
|
|
||||||
// adjust for fatigue
|
|
||||||
ReducePointsForFatigue( pSoldier, &usValue );
|
|
||||||
|
|
||||||
// return current repair pts
|
|
||||||
return( usValue );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flugente: Determine the best cth with SAMs in a sector, and which merc has that cth if present
|
// Flugente: Determine the best cth with SAMs in a sector, and which merc has that cth if present
|
||||||
FLOAT GetBestSAMOperatorCTH_Player( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, UINT16 *pubID )
|
FLOAT GetBestSAMOperatorCTH_Player( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, UINT16 *pubID )
|
||||||
{
|
{
|
||||||
@@ -7418,7 +7381,10 @@ INT16 GetTownTrainPtsForCharacter( SOLDIERTYPE *pTrainer, UINT16 *pusMaxPts )
|
|||||||
// UINT8 ubTownId = 0;
|
// UINT8 ubTownId = 0;
|
||||||
|
|
||||||
// calculate normal training pts - what it would be if his stats were "normal" (ignoring drugs, fatigue)
|
// calculate normal training pts - what it would be if his stats were "normal" (ignoring drugs, fatigue)
|
||||||
*pusMaxPts = ( pTrainer->stats.bWisdom + pTrainer->stats.bLeadership + ( 10 * pTrainer->stats.bExpLevel ) ) * gGameExternalOptions.ubTownMilitiaTrainingRate;
|
INT16 wisdom = (pTrainer->stats.bWisdom * (100 + pTrainer->GetBackgroundValue( BG_WISDOM ))) / 100;
|
||||||
|
INT16 leadership = (pTrainer->stats.bLeadership * (100 + pTrainer->GetBackgroundValue( BG_LEADERSHIP ))) / 100;
|
||||||
|
|
||||||
|
*pusMaxPts = (wisdom + leadership + (10 * pTrainer->stats.bExpLevel)) * gGameExternalOptions.ubTownMilitiaTrainingRate;
|
||||||
|
|
||||||
// calculate effective training points (this is hundredths of pts / hour)
|
// calculate effective training points (this is hundredths of pts / hour)
|
||||||
// typical: 300/hr, maximum: 600/hr
|
// typical: 300/hr, maximum: 600/hr
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ UINT8 CalculateRepairPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts
|
|||||||
|
|
||||||
// Flugente: calculate interrogation and prison guard values
|
// Flugente: calculate interrogation and prison guard values
|
||||||
UINT32 CalculateInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts );
|
UINT32 CalculateInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts );
|
||||||
UINT32 CalculatePrisonGuardValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts );
|
UINT32 CalculatePrisonGuardValue(SOLDIERTYPE *pSoldier );
|
||||||
|
|
||||||
UINT32 CalculateSnitchInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts );
|
UINT32 CalculateSnitchInterrogationValue(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts );
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "DynamicDialogue.h" // added by Flugente for HandleDynamicOpinions()
|
#include "DynamicDialogue.h" // added by Flugente for HandleDynamicOpinions()
|
||||||
#include "Drugs And Alcohol.h" // added by Flugente for HourlyDrugUpdate()
|
#include "Drugs And Alcohol.h" // added by Flugente for HourlyDrugUpdate()
|
||||||
#include "Interface.h" // added by Flugente
|
#include "Interface.h" // added by Flugente
|
||||||
|
#include "SkillCheck.h" // added by Flugente
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Luaglobal.h"
|
#include "Luaglobal.h"
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "CampaignStats.h" // added by Flugente
|
#include "CampaignStats.h" // added by Flugente
|
||||||
#include "militiasquads.h" // added by Flugente
|
#include "militiasquads.h" // added by Flugente
|
||||||
|
#include "SkillCheck.h" // added by Flugente
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
// sevenfm: needed for _KeyDown(SHIFT)
|
// sevenfm: needed for _KeyDown(SHIFT)
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "DisplayCover.h"
|
#include "DisplayCover.h"
|
||||||
|
#include "SkillCheck.h" // added by Flugente
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "InterfaceItemImages.h"
|
#include "InterfaceItemImages.h"
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
#include "Soldier Functions.h" // added by Flugente for DoesSoldierWearGasMask(...)
|
#include "Soldier Functions.h" // added by Flugente for DoesSoldierWearGasMask(...)
|
||||||
#include "CampaignStats.h" // added by Flugente
|
#include "CampaignStats.h" // added by Flugente
|
||||||
#include "AIInternals.h"//dnl ch61 180813
|
#include "AIInternals.h"//dnl ch61 180813
|
||||||
|
#include "SkillCheck.h" // added by Flugente
|
||||||
|
|
||||||
#include "GameInitOptionsScreen.h"
|
#include "GameInitOptionsScreen.h"
|
||||||
|
|
||||||
|
|||||||
@@ -245,13 +245,4 @@ void CalcRecoilOffset( SOLDIERTYPE *pShooter, FLOAT *dMuzzleOffsetX, FLOAT *dMuz
|
|||||||
// HEADROCK HAM 5: New function, completely replaces the Counter Force Frequency check.
|
// HEADROCK HAM 5: New function, completely replaces the Counter Force Frequency check.
|
||||||
FLOAT CalcCounterForceChange( SOLDIERTYPE * pShooter, UINT32 uiCounterForceAccuracy, FLOAT dCounterForceMax, FLOAT dMuzzleOffset, FLOAT bRecoil, FLOAT dPrevCounterForce, UINT32 uiIntendedBullets );
|
FLOAT CalcCounterForceChange( SOLDIERTYPE * pShooter, UINT32 uiCounterForceAccuracy, FLOAT dCounterForceMax, FLOAT dMuzzleOffset, FLOAT bRecoil, FLOAT dPrevCounterForce, UINT32 uiIntendedBullets );
|
||||||
|
|
||||||
// HEADROCK HAM 4: Required for shooting mechanic
|
|
||||||
extern INT8 EffectiveMarksmanship( SOLDIERTYPE * pSoldier );
|
|
||||||
extern INT16 EffectiveWisdom( SOLDIERTYPE * pSoldier );
|
|
||||||
extern INT8 EffectiveExpLevel( SOLDIERTYPE * pSoldier );
|
|
||||||
extern INT16 EffectiveDexterity( SOLDIERTYPE * pSoldier, BOOLEAN fTrainer );
|
|
||||||
extern INT16 EffectiveStrength( SOLDIERTYPE * pSoldier, BOOLEAN fTrainer );
|
|
||||||
extern INT16 EffectiveAgility( SOLDIERTYPE * pSoldier, BOOLEAN fTrainer );
|
|
||||||
extern INT8 EffectiveLeadership( SOLDIERTYPE * pSoldier ); // anv: and passed to Hourly Update.cpp apparently, so added this one too
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+14
-17
@@ -1,27 +1,24 @@
|
|||||||
#ifndef __SKILL_CHECK_H
|
#ifndef __SKILL_CHECK_H
|
||||||
#define __SKILL_CHECK_H
|
#define __SKILL_CHECK_H
|
||||||
|
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Soldier Control.h"
|
#include "Soldier Control.h"
|
||||||
|
|
||||||
extern void ReducePointsForFatigue( SOLDIERTYPE *pSoldier, UINT32 *pusPoints );
|
void ReducePointsForFatigue( SOLDIERTYPE *pSoldier, UINT32 *pusPoints );
|
||||||
extern INT32 GetSkillCheckPenaltyForFatigue( SOLDIERTYPE *pSoldier, INT32 iSkill );
|
INT32 GetSkillCheckPenaltyForFatigue( SOLDIERTYPE *pSoldier, INT32 iSkill );
|
||||||
extern INT32 SkillCheck( SOLDIERTYPE *pSoldier, INT8 bReason, INT8 bDifficulty );
|
INT32 SkillCheck( SOLDIERTYPE *pSoldier, INT8 bReason, INT8 bDifficulty );
|
||||||
extern INT16 CalcTrapDetectLevel( SOLDIERTYPE *pSoldier, BOOLEAN fExamining );
|
INT16 CalcTrapDetectLevel( SOLDIERTYPE *pSoldier, BOOLEAN fExamining );
|
||||||
|
|
||||||
|
|
||||||
extern INT16 EffectiveStrength( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
|
|
||||||
extern INT16 EffectiveWisdom( SOLDIERTYPE *pSoldier );
|
|
||||||
extern INT16 EffectiveAgility( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
|
|
||||||
extern INT8 EffectiveMechanical( SOLDIERTYPE *pSoldier );
|
|
||||||
extern INT8 EffectiveExplosive( SOLDIERTYPE *pSoldier );
|
|
||||||
extern INT8 EffectiveLeadership( SOLDIERTYPE *pSoldier );
|
|
||||||
extern INT8 EffectiveMarksmanship( SOLDIERTYPE *pSoldier );
|
|
||||||
extern INT16 EffectiveDexterity( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
|
|
||||||
extern INT8 EffectiveExpLevel( SOLDIERTYPE *pSoldier );
|
|
||||||
extern INT8 EffectiveMedical( SOLDIERTYPE *pSoldier );
|
|
||||||
|
|
||||||
|
INT16 EffectiveStrength( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
|
||||||
|
INT16 EffectiveWisdom( SOLDIERTYPE *pSoldier );
|
||||||
|
INT16 EffectiveAgility( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
|
||||||
|
INT8 EffectiveMechanical( SOLDIERTYPE *pSoldier );
|
||||||
|
INT8 EffectiveExplosive( SOLDIERTYPE *pSoldier );
|
||||||
|
INT8 EffectiveLeadership( SOLDIERTYPE *pSoldier );
|
||||||
|
INT8 EffectiveMarksmanship( SOLDIERTYPE *pSoldier );
|
||||||
|
INT16 EffectiveDexterity( SOLDIERTYPE *pSoldier, BOOLEAN fTrainer );
|
||||||
|
INT8 EffectiveExpLevel( SOLDIERTYPE *pSoldier );
|
||||||
|
INT8 EffectiveMedical( SOLDIERTYPE *pSoldier );
|
||||||
|
|
||||||
enum SkillChecks
|
enum SkillChecks
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user