- new jam damage thresholds for guns - when a gun jams it can only take damage if its status is below the threshold

- modified damage calculation for jam damage
- modified cleaning point calculation for mercs
- natural dirt level of sectors now halved if the shooter is inside a building

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8370 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2017-01-22 13:33:44 +00:00
parent 9a46c2a9fc
commit a6b2568e24
5 changed files with 40 additions and 29 deletions
+10
View File
@@ -3123,6 +3123,16 @@ void LoadItemSettings()
gItemSettings.fRecoilXModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","RECOILX_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fRecoilYModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","RECOILY_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.usJamDamageThresholdGun[NOT_GUN] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_NOT_GUN", 0, 0, 100 );
gItemSettings.usJamDamageThresholdGun[GUN_PISTOL] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_PISTOL", 50, 0, 100 );
gItemSettings.usJamDamageThresholdGun[GUN_M_PISTOL] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_MP", 75, 0, 100 );
gItemSettings.usJamDamageThresholdGun[GUN_SMG] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_SMG", 70, 0, 100 );
gItemSettings.usJamDamageThresholdGun[GUN_RIFLE] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_RIFLE", 40, 0, 100 );
gItemSettings.usJamDamageThresholdGun[GUN_SN_RIFLE] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_SNIPER", 45, 0, 100 );
gItemSettings.usJamDamageThresholdGun[GUN_AS_RIFLE] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_AR", 65, 0, 100 );
gItemSettings.usJamDamageThresholdGun[GUN_LMG] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_LMG", 60, 0, 100 );
gItemSettings.usJamDamageThresholdGun[GUN_SHOTGUN] = iniReader.ReadInteger("Weapon Settings","JAM_DAMAGE_THRESHOLD_SHOTGUN", 30, 0, 100 );
// -------------- ARMOR MODIFIERS ----------------
gItemSettings.fCamoLBEoverVestModifier = iniReader.ReadFloat ("Armor Settings","CAMO_LBE_OVER_VEST_MODIFIER", 0.2f, 0.0f, 1.0f);
gItemSettings.fCamoLBEoverPantsModifier = iniReader.ReadFloat ("Armor Settings","CAMO_LBE_OVER_PANTS_MODIFIER", 0.2f, 0.0f, 1.0f);
+2
View File
@@ -2355,6 +2355,8 @@ typedef struct
// Recoil modifiers
FLOAT fRecoilXModifierGun[GUN_TYPES_MAX];
FLOAT fRecoilYModifierGun[GUN_TYPES_MAX];
// Jam damage thresholds
UINT16 usJamDamageThresholdGun[GUN_TYPES_MAX];
// -------------- ARMOR MODIFIERS ----------------
FLOAT fCamoLBEoverVestModifier;
+9 -9
View File
@@ -15,9 +15,9 @@
#ifdef JA2EDITOR
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8364 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.8370 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8364 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.8370 (Development Build)" };
#endif
// ------------------------------
@@ -27,11 +27,11 @@
//DEBUG BUILD VERSION
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8364 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.8370 (Development Build)" };
#elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8364 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.8370 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8364 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.8370 (Development Build)" };
#endif
#elif defined CRIPPLED_VERSION
@@ -46,16 +46,16 @@
//RELEASE BUILD VERSION
#ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8364 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.8370 (Development Build)" };
#elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8364 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.8370 (Development Build)" };
#else
CHAR16 zVersionLabel[256] = { L"Release v1.13.8364 (Development Build)" };
CHAR16 zVersionLabel[256] = { L"Release v1.13.8370 (Development Build)" };
#endif
#endif
CHAR8 czVersionNumber[16] = { "Build 17.01.14" }; //YY.MM.DD
CHAR8 czVersionNumber[16] = { "Build 17.01.22" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" };
// SAVE_GAME_VERSION is defined in header, change it there
+2 -13
View File
@@ -3029,27 +3029,18 @@ UINT8 CalculateCleaningPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxP
}
// calculate effective repair rate (adjusted for drugs, alcohol, etc.)
usCleaningPts = (UINT16) ((EffectiveMechanical( pSoldier ) * EffectiveDexterity( pSoldier, FALSE ) * (100 + ( 5 * EffectiveExpLevel( pSoldier) ) )) / ( gGameExternalOptions.ubCleaningRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay ));
usCleaningPts = (UINT32)( (( EffectiveMechanical( pSoldier ) + 3 * EffectiveDexterity( pSoldier, FALSE ) + 50 * EffectiveExpLevel( pSoldier) ) * 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
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.ubCleaningRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay);
*pusMaxPts = ( ( mechanical + 3 * dexterity + 50 * pSoldier->stats.bExpLevel ) * 1000 ) / (gGameExternalOptions.ubCleaningRateDivisor * gGameExternalOptions.ubAssignmentUnitsPerDay);
// SANDRO - Technician trait gives a good bonus to repair items
// we also use that for cleaning guns
if ( gGameOptions.fNewTraitSystem )
{
usCleaningPts = usCleaningPts * (100 + gSkillTraitValues.bSpeedModifierRepairing) / 100;
*pusMaxPts = *pusMaxPts * (100 + gSkillTraitValues.bSpeedModifierRepairing) / 100;
if ( HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) )
{
usCleaningPts += usCleaningPts * gSkillTraitValues.usTERepairSpeedBonus * (NUM_SKILL_TRAITS( pSoldier, TECHNICIAN_NT )) / 100;
*pusMaxPts += *pusMaxPts * gSkillTraitValues.usTERepairSpeedBonus * (NUM_SKILL_TRAITS( pSoldier, TECHNICIAN_NT )) / 100;
}
// Penalty for aggressive people
if ( DoesMercHavePersonality( pSoldier, CHAR_TRAIT_AGGRESSIVE ) )
{
@@ -3071,8 +3062,6 @@ UINT8 CalculateCleaningPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxP
if ( gGameOptions.fFoodSystem )
ReducePointsForHunger( pSoldier, &usCleaningPts );
usKitPts = CleaningKitPoints( pSoldier );
// return current cleaning pts
return(( UINT8 )usCleaningPts);
}
+17 -7
View File
@@ -27,6 +27,7 @@
#include "tile animation.h"
#include "Dialogue Control.h"
#include "SkillCheck.h"
#include "Render Fun.h"
#include "explosion control.h"
#include "Quests.h"
#include "Physics.h"
@@ -1334,15 +1335,18 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
// Deduct AMMO!
DeductAmmo( pSoldier, pSoldier->ubAttackingHand );
// silversurfer: Our gun can now take damage when it jams
if ( PreRandom( 100 ) < (90 - condition + (Item[(*pObj).usItem].usDamageChance / 2.0f)) )
// silversurfer: Our gun can now take damage when it jams but only if the gun is below the jam damage threshold
if ( condition < gItemSettings.usJamDamageThresholdGun[Weapon[(*pObj).usItem].ubWeaponType] )
{
// damage depends on gun status. The better the status the less damage it takes. Limit it to max 5 or it can be frustrating for the player.
UINT32 uiJamDamage = __min( 5, PreRandom( __max( 0, (UINT32)((90 - condition) / 2.0f ) ) ));
if ( uiJamDamage > 0 )
if ( PreRandom( 100 ) < ( Item[(*pObj).usItem].usDamageChance + ( 100 - condition ) / 5 ) )
{
(*pObj)[0]->data.objectStatus -= __min( uiJamDamage, (*pObj)[0]->data.objectStatus );
(*pObj)[0]->data.sRepairThreshold -= __min( uiJamDamage, (*pObj)[0]->data.sRepairThreshold );
// damage depends on gun status. The better the status the less damage it takes. Leave a chance for 0 damage.
UINT32 uiJamDamage = __max( 0, PreRandom( 5 - UINT32(condition / 30.0f) ) );
if ( uiJamDamage > 0 )
{
(*pObj)[0]->data.objectStatus -= __min( uiJamDamage, (*pObj)[0]->data.objectStatus );
(*pObj)[0]->data.sRepairThreshold -= __min( uiJamDamage, (*pObj)[0]->data.sRepairThreshold );
}
}
}
@@ -2348,6 +2352,9 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
else if ( ubSectorId >= 0 && ubSectorId < 256 )
{
sectormod = SectorExternalData[ubSectorId][gbWorldSectorZ].usNaturalDirt;
// half dirt value if we are in a building (room)
if ( InARoom( pSoldier->sGridNo, NULL ) )
sectormod /= 2;
}
// the current sector determines how likely it is that dirt increases
@@ -3047,6 +3054,9 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
else if ( ubSectorId >= 0 && ubSectorId < 256 )
{
sectormod = SectorExternalData[ubSectorId][gbWorldSectorZ].usNaturalDirt;
// half dirt value if we are in a building (room)
if ( InARoom( pSoldier->sGridNo, NULL ) )
sectormod /= 2;
}
// the current sector determines how likely it is that dirt increases