mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
- The base chance for gun degradation, BASIC_DEPRECIATE_CHANCE, is now externalised to Item_Settings.ini.
- Fix: BASIC_RELIABILITY_ODDS now ranges from 0 to 10000. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7208 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+2
-1
@@ -2783,6 +2783,7 @@ void LoadItemSettings()
|
|||||||
|
|
||||||
// -------------- COMMON MODIFIERS ----------------
|
// -------------- COMMON MODIFIERS ----------------
|
||||||
gItemSettings.fBestLaserRangeModifier = iniReader.ReadFloat ("Common Settings","BEST_LASER_RANGE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
gItemSettings.fBestLaserRangeModifier = iniReader.ReadFloat ("Common Settings","BEST_LASER_RANGE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||||
|
gItemSettings.usBasicDeprecateChance = iniReader.ReadInteger("Common Settings","BASIC_DEPRECIATE_CHANCE", 15, 1, 10000 );
|
||||||
|
|
||||||
// -------------- WEAPON MODIFIERS ----------------
|
// -------------- WEAPON MODIFIERS ----------------
|
||||||
// weapon overheating modifiers
|
// weapon overheating modifiers
|
||||||
@@ -3259,7 +3260,7 @@ void LoadCTHConstants()
|
|||||||
gGameCTHConstants.SCOPE_EFFECTIVENESS_MINIMUM_SNIPER = iniReader.ReadInteger("General", "SCOPE_EFFECTIVENESS_MINIMUM_SNIPER", 100, 0, 100);
|
gGameCTHConstants.SCOPE_EFFECTIVENESS_MINIMUM_SNIPER = iniReader.ReadInteger("General", "SCOPE_EFFECTIVENESS_MINIMUM_SNIPER", 100, 0, 100);
|
||||||
gGameCTHConstants.SIDE_FACING_DIVISOR = iniReader.ReadFloat("General", "SIDE_FACING_DIVISOR", 2.0, 1.0f, 10.0f);
|
gGameCTHConstants.SIDE_FACING_DIVISOR = iniReader.ReadFloat("General", "SIDE_FACING_DIVISOR", 2.0, 1.0f, 10.0f);
|
||||||
// HEADROCK HAM 5: Basic chance to lose condition point when firing
|
// HEADROCK HAM 5: Basic chance to lose condition point when firing
|
||||||
gGameCTHConstants.BASIC_RELIABILITY_ODDS = iniReader.ReadInteger("General", "BASIC_RELIABILITY_ODDS", 15, 0, 100);
|
gGameCTHConstants.BASIC_RELIABILITY_ODDS = iniReader.ReadInteger("General", "BASIC_RELIABILITY_ODDS", 15, 0, 10000);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Coefficients for factors affecting Base CTH
|
// Coefficients for factors affecting Base CTH
|
||||||
|
|||||||
@@ -2224,6 +2224,7 @@ typedef struct
|
|||||||
{
|
{
|
||||||
// -------------- COMMON MODIFIERS ----------------
|
// -------------- COMMON MODIFIERS ----------------
|
||||||
FLOAT fBestLaserRangeModifier;
|
FLOAT fBestLaserRangeModifier;
|
||||||
|
UINT16 usBasicDeprecateChance;
|
||||||
|
|
||||||
// -------------- WEAPON MODIFIERS ----------------
|
// -------------- WEAPON MODIFIERS ----------------
|
||||||
// weapon overheating modifiers
|
// weapon overheating modifiers
|
||||||
|
|||||||
+2
-2
@@ -6022,13 +6022,13 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
|
|||||||
if ( UsingNewCTHSystem() == true)
|
if ( UsingNewCTHSystem() == true)
|
||||||
{
|
{
|
||||||
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
||||||
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)BASIC_DEPRECIATE_CHANCE); // Compare original odds to new odds.
|
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)gItemSettings.usBasicDeprecateChance); // Compare original odds to new odds.
|
||||||
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * GetReliability( pObj ) - iOverheatReliabilityMalus);
|
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * GetReliability( pObj ) - iOverheatReliabilityMalus);
|
||||||
uiDepreciateTest = max(0, uiDepreciateTest);
|
uiDepreciateTest = max(0, uiDepreciateTest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * GetReliability( pObj ) - iOverheatReliabilityMalus, 0);
|
uiDepreciateTest = max( gItemSettings.usBasicDeprecateChance + 3 * GetReliability( pObj ) - iOverheatReliabilityMalus, 0 );
|
||||||
}
|
}
|
||||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObj)[0]->data.objectStatus > 1) )
|
if ( !PreRandom( uiDepreciateTest ) && ( (*pObj)[0]->data.objectStatus > 1) )
|
||||||
{
|
{
|
||||||
|
|||||||
+10
-10
@@ -1925,13 +1925,13 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
if ( UsingNewCTHSystem() == true)
|
if ( UsingNewCTHSystem() == true)
|
||||||
{
|
{
|
||||||
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
||||||
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)BASIC_DEPRECIATE_CHANCE); // Compare original odds to new odds.
|
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)gItemSettings.usBasicDeprecateChance); // Compare original odds to new odds.
|
||||||
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * (Item[ iter->usItem ].bReliability + ammoReliability) );
|
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * (Item[ iter->usItem ].bReliability + ammoReliability) );
|
||||||
uiDepreciateTest = max(0, uiDepreciateTest);
|
uiDepreciateTest = max(0, uiDepreciateTest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uiDepreciateTest = max(0,BASIC_DEPRECIATE_CHANCE + 3 * (Item[ iter->usItem ].bReliability + ammoReliability));
|
uiDepreciateTest = max( 0, gItemSettings.usBasicDeprecateChance + 3 * (Item[iter->usItem].bReliability + ammoReliability) );
|
||||||
}
|
}
|
||||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjAttHand)[0]->data.objectStatus > 1) )
|
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjAttHand)[0]->data.objectStatus > 1) )
|
||||||
{
|
{
|
||||||
@@ -2317,18 +2317,18 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
// ammoReliability = Item[(*pGun)[0]->data.gun.usGunAmmoItem].bReliability;
|
// ammoReliability = Item[(*pGun)[0]->data.gun.usGunAmmoItem].bReliability;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// Flugente FTW 1: Added a malus to reliability for overheated guns
|
// Flugente: Added a malus to reliability for overheated guns
|
||||||
// HEADROCK HAM 5: Variable NCTH base change
|
// HEADROCK HAM 5: Variable NCTH base change
|
||||||
if ( UsingNewCTHSystem() == true)
|
if ( UsingNewCTHSystem() == true)
|
||||||
{
|
{
|
||||||
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
||||||
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)BASIC_DEPRECIATE_CHANCE); // Compare original odds to new odds.
|
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)gItemSettings.usBasicDeprecateChance); // Compare original odds to new odds.
|
||||||
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * GetReliability( &(pSoldier->inv[pSoldier->ubAttackingHand]) ) - iOverheatReliabilityMalus);
|
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * GetReliability( &(pSoldier->inv[pSoldier->ubAttackingHand]) ) - iOverheatReliabilityMalus);
|
||||||
uiDepreciateTest = max(0, uiDepreciateTest);
|
uiDepreciateTest = max(0, uiDepreciateTest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * GetReliability( pObjAttHand ) - iOverheatReliabilityMalus, 0);
|
uiDepreciateTest = max( gItemSettings.usBasicDeprecateChance + 3 * GetReliability( pObjAttHand ) - iOverheatReliabilityMalus, 0 );
|
||||||
}
|
}
|
||||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjAttHand)[0]->data.objectStatus > 1) )
|
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjAttHand)[0]->data.objectStatus > 1) )
|
||||||
{
|
{
|
||||||
@@ -2531,13 +2531,13 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
if ( UsingNewCTHSystem() == true )
|
if ( UsingNewCTHSystem() == true )
|
||||||
{
|
{
|
||||||
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
||||||
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)BASIC_DEPRECIATE_CHANCE); // Compare original odds to new odds.
|
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)gItemSettings.usBasicDeprecateChance); // Compare original odds to new odds.
|
||||||
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * (Item[ iter->usItem ].bReliability + ammoReliability) );
|
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * (Item[ iter->usItem ].bReliability + ammoReliability) );
|
||||||
uiDepreciateTest = __max(0, uiDepreciateTest);
|
uiDepreciateTest = __max(0, uiDepreciateTest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uiDepreciateTest = __max(0,BASIC_DEPRECIATE_CHANCE + 3 * (Item[ iter->usItem ].bReliability + ammoReliability));
|
uiDepreciateTest = __max( 0, gItemSettings.usBasicDeprecateChance + 3 * (Item[iter->usItem].bReliability + ammoReliability) );
|
||||||
}
|
}
|
||||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjUsed)[0]->data.objectStatus > 1) )
|
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjUsed)[0]->data.objectStatus > 1) )
|
||||||
{
|
{
|
||||||
@@ -2957,17 +2957,17 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Flugente FTW 1: Added a malus to reliability for overheated guns
|
// Flugente: Added a malus to reliability for overheated guns
|
||||||
if ( UsingNewCTHSystem() == true )
|
if ( UsingNewCTHSystem() == true )
|
||||||
{
|
{
|
||||||
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
UINT16 usBaseChance = gGameCTHConstants.BASIC_RELIABILITY_ODDS;
|
||||||
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)BASIC_DEPRECIATE_CHANCE); // Compare original odds to new odds.
|
FLOAT dReliabilityRatio = 3.0f * ((FLOAT)usBaseChance / (FLOAT)gItemSettings.usBasicDeprecateChance); // Compare original odds to new odds.
|
||||||
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * GetReliability( &(pSoldier->inv[ pSoldier->ubAttackingHand ])) - iOverheatReliabilityMalus);
|
uiDepreciateTest = usBaseChance + (INT16)( dReliabilityRatio * GetReliability( &(pSoldier->inv[ pSoldier->ubAttackingHand ])) - iOverheatReliabilityMalus);
|
||||||
uiDepreciateTest = max(0, uiDepreciateTest);
|
uiDepreciateTest = max(0, uiDepreciateTest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * ( GetReliability( pObjUsed ) ) - iOverheatReliabilityMalus, 0);
|
uiDepreciateTest = max( gItemSettings.usBasicDeprecateChance + 3 * (GetReliability( pObjUsed )) - iOverheatReliabilityMalus, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjUsed)[0]->data.objectStatus > 1) )
|
if ( !PreRandom( uiDepreciateTest ) && ( (*pObjUsed)[0]->data.objectStatus > 1) )
|
||||||
|
|||||||
+2
-1
@@ -80,8 +80,9 @@ void HandleTacticalEffectsOfEquipmentChange( SOLDIERTYPE *pSoldier, UINT32 uiInv
|
|||||||
|
|
||||||
#define MIN_MORTAR_RANGE 150 // minimum range of a mortar
|
#define MIN_MORTAR_RANGE 150 // minimum range of a mortar
|
||||||
|
|
||||||
|
// Flugente: this value is now externalised to gItemSettings.usBasicDeprecateChance
|
||||||
// NB this is arbitrary, chances in DG ranged from 1 in 6 to 1 in 20
|
// NB this is arbitrary, chances in DG ranged from 1 in 6 to 1 in 20
|
||||||
#define BASIC_DEPRECIATE_CHANCE 15
|
//#define BASIC_DEPRECIATE_CHANCE 15
|
||||||
|
|
||||||
// WEAPON CLASSES
|
// WEAPON CLASSES
|
||||||
enum
|
enum
|
||||||
|
|||||||
Reference in New Issue
Block a user