mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
New weapon type modifiers for:
- damage - single shot AP - burst AP - auto fire AP Fixed some parts where the raw item property was used instead of the Get... function that should be used. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6470 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+61
-11
@@ -2405,7 +2405,7 @@ void LoadItemSettings()
|
||||
{
|
||||
CIniReader iniReader(ITEM_SETTINGS_FILE);
|
||||
|
||||
// silversurfer: New values to fine-tune weapon overheating for different gun classes
|
||||
// values to fine-tune weapon overheating for different weapon types
|
||||
// --------- PISTOLS ----------
|
||||
gItemSettings.fOverheatJamThresholdModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_JAM_THRESHOLD_PISTOL_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fOverheatDamageThresholdModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_DAMAGE_THRESHOLD_PISTOL_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
@@ -2452,17 +2452,67 @@ void LoadItemSettings()
|
||||
gItemSettings.fOverheatTemperatureModifierLauncher = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_TEMPERATURE_LAUNCHER_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fOverheatCooldownModifierLauncher = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_COOLDOWN_LAUNCHER_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
|
||||
// silversurfer: new values to adjust weapon range for different gun classes
|
||||
gItemSettings.fRangeModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","RANGE_PISTOL_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","RANGE_MP_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","RANGE_SMG_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","RANGE_RIFLE_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","RANGE_SNIPER_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","RANGE_AR_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","RANGE_LMG_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","RANGE_SHOTGUN_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
// values to adjust weapon range for different weapon types
|
||||
gItemSettings.fRangeModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","RANGE_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","RANGE_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","RANGE_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","RANGE_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","RANGE_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","RANGE_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","RANGE_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fRangeModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","RANGE_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
// -------- LAUNCHERs ---------
|
||||
gItemSettings.fRangeModifierLauncher = iniReader.ReadFloat ("Weapon Settings","RANGE_LAUNCHER_MODIFIER", 1.0f, 0.1f, 10.0f);
|
||||
gItemSettings.fRangeModifierLauncher = iniReader.ReadFloat ("Weapon Settings","RANGE_LAUNCHER_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
|
||||
// values to adjust damage for different weapon types
|
||||
// ----------- GUNS -----------
|
||||
gItemSettings.fDamageModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
// ----------- MELEE ----------
|
||||
gItemSettings.fDamageModifierBlade = iniReader.ReadFloat ("Weapon Settings","DAMAGE_BLADE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierPunch = iniReader.ReadFloat ("Weapon Settings","DAMAGE_PUNCH_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fDamageModifierTentacle = iniReader.ReadFloat ("Weapon Settings","DAMAGE_TENTACLE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
|
||||
// values to adjust APs needed for a single attack
|
||||
gItemSettings.fShotsPer4TurnsModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","SP4T_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","SP4T_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","SP4T_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","SP4T_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","SP4T_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","SP4T_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","SP4T_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","SP4T_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierLauncher = iniReader.ReadFloat ("Weapon Settings","SP4T_LAUNCHER_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierBlade = iniReader.ReadFloat ("Weapon Settings","SP4T_BLADE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierPunch = iniReader.ReadFloat ("Weapon Settings","SP4T_PUNCH_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierTentacle = iniReader.ReadFloat ("Weapon Settings","SP4T_TENTACLE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fShotsPer4TurnsModifierThrowKnife = iniReader.ReadFloat ("Weapon Settings","SP4T_THROWKNIFE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
|
||||
// values to adjust Burst APs for different weapon types
|
||||
gItemSettings.fBurstAPModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fBurstAPModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fBurstAPModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fBurstAPModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fBurstAPModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fBurstAPModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fBurstAPModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fBurstAPModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
|
||||
// values to adjust Auto Fire APs for different weapon types
|
||||
gItemSettings.fAFShotsPer5APModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fAFShotsPer5APModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fAFShotsPer5APModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fAFShotsPer5APModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fAFShotsPer5APModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fAFShotsPer5APModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fAFShotsPer5APModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
gItemSettings.fAFShotsPer5APModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
|
||||
}
|
||||
|
||||
INT16 DynamicAdjustAPConstants(INT16 iniReadValue, INT16 iniDefaultValue, BOOLEAN reverse)
|
||||
|
||||
+17
-1
@@ -1742,7 +1742,7 @@ typedef struct
|
||||
// silversurfer: item property modifiers
|
||||
typedef struct
|
||||
{
|
||||
// weapon overheating modifiers for the different gun classes
|
||||
// weapon overheating modifiers for the different weapon types
|
||||
FLOAT fOverheatJamThresholdModifierGun[9];
|
||||
FLOAT fOverheatDamageThresholdModifierGun[9];
|
||||
FLOAT fOverheatTemperatureModifierGun[9];
|
||||
@@ -1754,6 +1754,22 @@ typedef struct
|
||||
// range modifiers for different weapon types
|
||||
FLOAT fRangeModifierGun[9];
|
||||
FLOAT fRangeModifierLauncher;
|
||||
// damage modifiers for different weapon types
|
||||
FLOAT fDamageModifierGun[9];
|
||||
FLOAT fDamageModifierBlade;
|
||||
FLOAT fDamageModifierPunch;
|
||||
FLOAT fDamageModifierTentacle;
|
||||
// AP modifiers for single attacks (ubShotsPer4Turns)
|
||||
FLOAT fShotsPer4TurnsModifierGun[9];
|
||||
FLOAT fShotsPer4TurnsModifierLauncher;
|
||||
FLOAT fShotsPer4TurnsModifierBlade;
|
||||
FLOAT fShotsPer4TurnsModifierPunch;
|
||||
FLOAT fShotsPer4TurnsModifierTentacle;
|
||||
FLOAT fShotsPer4TurnsModifierThrowKnife;
|
||||
// Burst AP modifiers for different weapon types
|
||||
FLOAT fBurstAPModifierGun[9];
|
||||
// AP modifiers for Auto Fire Shots per 5 AP (bAutofireShotsPerFiveAP)
|
||||
FLOAT fAFShotsPer5APModifierGun[9];
|
||||
|
||||
}ITEM_SETTINGS;
|
||||
|
||||
|
||||
+17
-5
@@ -2165,12 +2165,22 @@ UINT16 DisplayDamage(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight)
|
||||
// HEADROCK HAM 3.6: Can now take a negative modifier
|
||||
gunDamage = (UINT16)GetModifiedGunDamage( Weapon[ usIndex ].ubImpact );
|
||||
//gunDamage = (UINT16)( Weapon[ usIndex ].ubImpact + ( (double) Weapon[ usIndex ].ubImpact / 100) * gGameExternalOptions.ubGunDamageMultiplier );
|
||||
|
||||
// modify by ini values
|
||||
if ( Item[ usIndex ].usItemClass == IC_GUN )
|
||||
gunDamage *= gItemSettings.fDamageModifierGun[ Weapon[ usIndex ].ubWeaponType ];
|
||||
}
|
||||
else
|
||||
{
|
||||
// HEADROCK HAM 3.6: Can now take a negative modifier
|
||||
gunDamage = (UINT16)GetModifiedMeleeDamage( Weapon[ usIndex ].ubImpact );
|
||||
//gunDamage = (UINT16)( Weapon[ usIndex ].ubImpact + ( (double) Weapon[ usIndex ].ubImpact / 100) * gGameExternalOptions.ubMeleeDamageMultiplier );
|
||||
|
||||
// modify by ini values
|
||||
if ( Item[ usIndex ].usItemClass == IC_BLADE )
|
||||
gunDamage *= gItemSettings.fDamageModifierBlade;
|
||||
else if ( Item[ usIndex ].usItemClass == IC_PUNCH )
|
||||
gunDamage *= gItemSettings.fDamageModifierPunch;
|
||||
}
|
||||
|
||||
DrawTextToScreen(BobbyRText[BOBBYR_GUNS_DAMAGE], BOBBYR_ITEM_WEIGHT_TEXT_X, (UINT16)usPosY, 0, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||
@@ -3939,6 +3949,8 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
||||
// HEADROCK HAM 3.6: Can now take a negative modifier.
|
||||
//UINT16 gunDamage = (UINT16)( Weapon[ usItemNumber ].ubImpact + ( (double) Weapon[ usItemNumber ].ubImpact / 100) * gGameExternalOptions.ubGunDamageMultiplier );
|
||||
UINT16 gunDamage = (UINT16)GetModifiedGunDamage( Weapon[ usItemNumber ].ubImpact );
|
||||
// modify by ini values
|
||||
gunDamage *= gItemSettings.fDamageModifierGun[ Weapon[ usItemNumber ].ubWeaponType ];
|
||||
UINT16 readyAPs = (UINT16)(( Weapon[ usItemNumber ].ubReadyTime * (100 - Item[ usItemNumber ].percentreadytimeapreduction)) / 100);
|
||||
UINT16 gunRange = (UINT16)GetModifiedGunRange(usItemNumber);
|
||||
|
||||
@@ -4113,10 +4125,10 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
||||
case IC_LAUNCHER:
|
||||
{
|
||||
// HEADROCK HAM 3.6: Can now take a negative modifier.
|
||||
UINT16 gunDamage = (UINT16)GetModifiedGunDamage( Weapon[ usItemNumber ].ubImpact );
|
||||
UINT16 readyAPs = (UINT16)(( Weapon[ usItemNumber ].ubReadyTime * (100 - Item[ usItemNumber ].percentreadytimeapreduction)) / 100);
|
||||
UINT16 usRange = (UINT16)GetModifiedGunRange(usItemNumber);
|
||||
INT8 accuracy = (UsingNewCTHSystem()==true?Weapon[ usItemNumber ].nAccuracy:Weapon[ usItemNumber ].bAccuracy);
|
||||
UINT16 gunDamage = (UINT16)GetModifiedGunDamage( Weapon[ usItemNumber ].ubImpact );
|
||||
UINT16 readyAPs = (UINT16)(( Weapon[ usItemNumber ].ubReadyTime * (100 - Item[ usItemNumber ].percentreadytimeapreduction)) / 100);
|
||||
UINT16 usRange = (UINT16)GetModifiedGunRange(usItemNumber);
|
||||
INT8 accuracy = (UsingNewCTHSystem()==true?Weapon[ usItemNumber ].nAccuracy:Weapon[ usItemNumber ].bAccuracy);
|
||||
//UINT16 gunDamage = (UINT16)( Weapon[ usItemNumber ].ubImpact + ( (double) Weapon[ usItemNumber ].ubImpact / 100) * gGameExternalOptions.ubGunDamageMultiplier );
|
||||
|
||||
//Calculate AP's
|
||||
@@ -4301,4 +4313,4 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4484,8 +4484,9 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
||||
//Attacker hits
|
||||
if( !fMelee )
|
||||
{
|
||||
//ubImpact = (UINT8) GetDamage(&pAttacker->pSoldier->inv[ pAttacker->bWeaponSlot ]);
|
||||
ubImpact = Weapon[ pAttacker->pSoldier->inv[ pAttacker->bWeaponSlot ].usItem ].ubImpact;
|
||||
// silversurfer: We want to use the function instead of the raw value because it applies the modifiers that we configured in the ini.
|
||||
ubImpact = (UINT8) GetDamage(&pAttacker->pSoldier->inv[ pAttacker->bWeaponSlot ]);
|
||||
//ubImpact = Weapon[ pAttacker->pSoldier->inv[ pAttacker->bWeaponSlot ].usItem ].ubImpact;
|
||||
iRandom = PreRandom( 100 );
|
||||
if( iRandom < 15 )
|
||||
ubLocation = AIM_SHOT_HEAD;
|
||||
|
||||
@@ -6080,7 +6080,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
||||
// Get base damage value
|
||||
UINT8 iDamageValue = GetBasicDamage ( gpItemDescObject );
|
||||
|
||||
// Get Modified Accuracy value
|
||||
// Get Modified damage value
|
||||
UINT8 iFinalDamageValue = GetDamage ( gpItemDescObject );
|
||||
|
||||
// Get difference
|
||||
|
||||
@@ -3618,7 +3618,9 @@ UINT32 ItemFitness( OBJECTTYPE* pObj, UINT8 idx )
|
||||
}
|
||||
else if ( Item[ pObj->usItem ].usItemClass & (IC_BLADE|IC_PUNCH) )
|
||||
{
|
||||
value = (*pObj)[idx]->data.objectStatus * Weapon[ Item[ pObj->usItem ].ubClassIndex ].ubImpact;
|
||||
value = GetDamage(pObj);
|
||||
|
||||
value *= (*pObj)[idx]->data.objectStatus;
|
||||
}
|
||||
else if ( Item[ pObj->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) )
|
||||
{
|
||||
|
||||
+10
-8
@@ -8021,25 +8021,27 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
pSoldier = MercPtrs[ubCausedAttacker];
|
||||
if ( Item[ pSoldier->inv[pSoldier->ubAttackingHand].usItem ].usItemClass == IC_GUN )
|
||||
{
|
||||
UINT8 ubDamage = GetBasicDamage(&pSoldier->inv[pSoldier->ubAttackingHand]);
|
||||
|
||||
// +1% per point above 20 impact
|
||||
if ( Weapon[ pSoldier->inv[pSoldier->ubAttackingHand].usItem ].ubImpact > 20 )
|
||||
if ( ubDamage > 20 )
|
||||
{
|
||||
sFinalSuppressionEffectiveness += (Weapon[pSoldier->inv[pSoldier->ubAttackingHand].usItem].ubImpact - 20);
|
||||
sFinalSuppressionEffectiveness += (ubDamage - 20);
|
||||
|
||||
// +2% per point above 30 impact
|
||||
if ( Weapon[ pSoldier->inv[pSoldier->ubAttackingHand].usItem ].ubImpact > 30 )
|
||||
if ( ubDamage > 30 )
|
||||
{
|
||||
sFinalSuppressionEffectiveness += (Weapon[pSoldier->inv[pSoldier->ubAttackingHand].usItem].ubImpact - 30);
|
||||
sFinalSuppressionEffectiveness += (ubDamage - 30);
|
||||
|
||||
// +3% per point above 40 impact
|
||||
if ( Weapon[ pSoldier->inv[pSoldier->ubAttackingHand].usItem ].ubImpact > 40 )
|
||||
if ( ubDamage > 40 )
|
||||
{
|
||||
sFinalSuppressionEffectiveness += (Weapon[pSoldier->inv[pSoldier->ubAttackingHand].usItem].ubImpact - 40);
|
||||
sFinalSuppressionEffectiveness += (ubDamage - 40);
|
||||
|
||||
// +4% per point above 50 impact, some crazy gun here
|
||||
if ( Weapon[ pSoldier->inv[pSoldier->ubAttackingHand].usItem ].ubImpact > 50 )
|
||||
if ( ubDamage > 50 )
|
||||
{
|
||||
sFinalSuppressionEffectiveness += (Weapon[pSoldier->inv[pSoldier->ubAttackingHand].usItem].ubImpact - 50);
|
||||
sFinalSuppressionEffectiveness += (ubDamage - 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+51
-9
@@ -1492,11 +1492,15 @@ INT16 GetBreathPerAP( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
//UINT8 CalcAPsToBurst( INT8 bBaseActionPoints, UINT16 usItem )
|
||||
INT16 CalcAPsToBurst( INT16 bBaseActionPoints, OBJECTTYPE * pObj, SOLDIERTYPE* pSoldier )
|
||||
{
|
||||
INT32 aps;
|
||||
INT32 aps, iModifiedAPs;
|
||||
|
||||
iModifiedAPs = Weapon[ pObj->usItem ].bBurstAP;
|
||||
// modify by ini values
|
||||
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
|
||||
iModifiedAPs *= gItemSettings.fBurstAPModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
|
||||
// base APs is what you'd get from CalcActionPoints();
|
||||
// NB round UP, so 21-25 APs pay full
|
||||
aps = ( Weapon[ pObj->usItem ].bBurstAP * bBaseActionPoints + (APBPConstants[AP_MAXIMUM] - 1) ) / APBPConstants[AP_MAXIMUM];
|
||||
aps = ( iModifiedAPs * bBaseActionPoints + (APBPConstants[AP_MAXIMUM] - 1) ) / APBPConstants[AP_MAXIMUM];
|
||||
|
||||
/*if ( GetPercentBurstFireAPReduction(pObj)>0 )
|
||||
{
|
||||
@@ -1514,7 +1518,7 @@ INT16 CalcAPsToBurst( INT16 bBaseActionPoints, OBJECTTYPE * pObj, SOLDIERTYPE* p
|
||||
aps = ( aps * ( 100 - GetPercentAPReduction(pSoldier, pObj) ) ) / 100;
|
||||
|
||||
// Snap: moved this up to allow burst AP reduction up to 100%
|
||||
aps = __max( aps, ( Weapon[ pObj->usItem ].bBurstAP + 1 ) / 2 );
|
||||
aps = __max( aps, ( iModifiedAPs + 1 ) / 2 );
|
||||
|
||||
aps = ( aps * ( 100 - GetPercentBurstFireAPReduction(pObj) ) ) / 100;
|
||||
|
||||
@@ -1528,11 +1532,17 @@ INT16 CalcAPsToBurst( INT16 bBaseActionPoints, OBJECTTYPE * pObj, SOLDIERTYPE* p
|
||||
// HEADROCK HAM 4: Same as above, without percent modifiers.
|
||||
INT16 CalcAPsToBurstNoModifier( INT16 bBaseActionPoints, OBJECTTYPE * pObj )
|
||||
{
|
||||
INT32 aps;
|
||||
INT32 aps, iModifiedAPs;
|
||||
|
||||
aps = ( Weapon[ pObj->usItem ].bBurstAP * bBaseActionPoints + (APBPConstants[AP_MAXIMUM] - 1) ) / APBPConstants[AP_MAXIMUM];
|
||||
iModifiedAPs = Weapon[ pObj->usItem ].bBurstAP;
|
||||
// modify by ini values
|
||||
// although the function says "no modifier" the ini values represent our new base value
|
||||
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
|
||||
iModifiedAPs *= gItemSettings.fBurstAPModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
|
||||
|
||||
aps = __max( aps, ( Weapon[ pObj->usItem ].bBurstAP + 1 ) / 2 );
|
||||
aps = ( iModifiedAPs * bBaseActionPoints + (APBPConstants[AP_MAXIMUM] - 1) ) / APBPConstants[AP_MAXIMUM];
|
||||
|
||||
aps = __max( aps, ( iModifiedAPs + 1 ) / 2 );
|
||||
|
||||
if ( aps < 0 ) aps = 0;
|
||||
else if ( aps > APBPConstants[AP_MAXIMUM] ) aps = APBPConstants[AP_MAXIMUM];
|
||||
@@ -1637,7 +1647,7 @@ INT16 CalcTotalAPsToAttack( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubAddTur
|
||||
usItemNum = pSoldier->inv[HANDPOS].usItem;
|
||||
uiItemClass = Item[ usUBItemNum ].usItemClass;
|
||||
|
||||
if ( uiItemClass == IC_GUN || uiItemClass == IC_LAUNCHER || uiItemClass == IC_TENTACLES || uiItemClass == IC_THROWING_KNIFE )
|
||||
if ( uiItemClass == IC_GUN || uiItemClass == IC_LAUNCHER || uiItemClass == IC_THROWING_KNIFE )
|
||||
{
|
||||
sAPCost = MinAPsToAttack( pSoldier, sGridNo, ubAddTurningCost, bAimTime );
|
||||
|
||||
@@ -1724,7 +1734,7 @@ INT16 CalcTotalAPsToAttack( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubAddTur
|
||||
//sAPCost = 5;
|
||||
}
|
||||
|
||||
if ( uiItemClass == IC_PUNCH || uiItemClass == IC_BLADE )//dnl ch73 031013
|
||||
if ( uiItemClass == IC_PUNCH || uiItemClass == IC_BLADE || uiItemClass == IC_TENTACLES )//dnl ch73 031013, silversurfer: tentacles are melee too
|
||||
{
|
||||
// IF we are at this gridno, calc min APs but if not, calc cost to goto this lication
|
||||
if ( pSoldier->sGridNo != sGridNo )
|
||||
@@ -1933,6 +1943,21 @@ INT16 BaseAPsToShootOrStab( INT16 bAPs, INT16 bAimSkill, OBJECTTYPE * pObj, SOLD
|
||||
// Their info is an array of item status, not weapon info, and they don't repeat
|
||||
// fire anyway.
|
||||
rof = Weapon[ pObj->usItem ].ubShotsPer4Turns;
|
||||
|
||||
// modify by ini values
|
||||
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierLauncher;
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_BLADE )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierBlade;
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_PUNCH )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierPunch;
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_TENTACLES )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierTentacle;
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_THROWING_KNIFE )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierThrowKnife;
|
||||
|
||||
//CHRISL: Resolves a problem with stackable weapons not using attachments like Reflex sight. Found by Mugsy
|
||||
//if (ItemSlotLimit(pObj, STACK_SIZE_LIMIT) == 1)//NOT STACKABLE!
|
||||
{
|
||||
@@ -1979,6 +2004,21 @@ INT16 BaseAPsToShootOrStabNoModifier( INT16 bAPs, INT16 bAimSkill, OBJECTTYPE *
|
||||
|
||||
rof = Weapon[ pObj->usItem ].ubShotsPer4Turns;
|
||||
|
||||
// modify by ini values
|
||||
// although this function says "no modifiers" our ini values are supposed to provide new base values
|
||||
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierLauncher;
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_BLADE )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierBlade;
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_PUNCH )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierPunch;
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_TENTACLES )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierTentacle;
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_THROWING_KNIFE )
|
||||
rof *= gItemSettings.fShotsPer4TurnsModifierThrowKnife;
|
||||
|
||||
Top = 8 * bAPs * 100;
|
||||
|
||||
INT16 baseAPsToShootOrStab = -1;
|
||||
@@ -4244,7 +4284,9 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
|
||||
|
||||
// Impact indirectly speaks of the size of the bullet, and thus strength of the backforce, theoretically.. so take it to the account.
|
||||
// (Other than that, we have nothing to base our calculation on by now, the solution would be to make a new tag in weapons.xml, but that's modder-unfriendly.)
|
||||
INT32 iKickPower = (INT32)(Weapon[pSoldier->inv[pSoldier->ubAttackingHand].usItem].ubImpact);
|
||||
// silversurfer: Let's use the function that is designed for that.
|
||||
//INT32 iKickPower = (INT32)(Weapon[pSoldier->inv[pSoldier->ubAttackingHand].usItem].ubImpact);
|
||||
INT32 iKickPower = (INT32)GetBasicDamage(&pSoldier->inv[pSoldier->ubAttackingHand]);
|
||||
|
||||
// get weapon total weight
|
||||
// Weapon weight here actually helps us, since it absorbs the power of the backforce.
|
||||
|
||||
+41
-1
@@ -11626,12 +11626,28 @@ UINT8 GetDamage ( OBJECTTYPE *pObj )
|
||||
if(UsingNewCTHSystem() == true)
|
||||
{
|
||||
ubDamage = Weapon[ pObj->usItem ].ubImpact;
|
||||
// modify by ini values
|
||||
if ( Item[pObj->usItem].usItemClass == IC_BLADE )
|
||||
ubDamage *= gItemSettings.fDamageModifierBlade;
|
||||
else if ( Item[pObj->usItem].usItemClass == IC_PUNCH )
|
||||
ubDamage *= gItemSettings.fDamageModifierPunch;
|
||||
else
|
||||
ubDamage *= gItemSettings.fDamageModifierTentacle;
|
||||
|
||||
ubDamage += GetMeleeDamageBonus(pObj);
|
||||
ubDamage = (UINT8)GetModifiedMeleeDamage( ubDamage );
|
||||
}
|
||||
else
|
||||
{
|
||||
ubDamage = (UINT8)GetModifiedMeleeDamage( Weapon[ pObj->usItem ].ubImpact );
|
||||
// modify by ini values
|
||||
if ( Item[pObj->usItem].usItemClass == IC_BLADE )
|
||||
ubDamage *= gItemSettings.fDamageModifierBlade;
|
||||
else if ( Item[pObj->usItem].usItemClass == IC_PUNCH )
|
||||
ubDamage *= gItemSettings.fDamageModifierPunch;
|
||||
else
|
||||
ubDamage *= gItemSettings.fDamageModifierTentacle;
|
||||
|
||||
ubDamage += GetMeleeDamageBonus(pObj);
|
||||
}
|
||||
//return min(255, (UINT8)( (ubDamage) + ( (double)ubDamage / 100) * gGameExternalOptions.iMeleeDamageModifier ) );
|
||||
@@ -11644,6 +11660,9 @@ UINT8 GetDamage ( OBJECTTYPE *pObj )
|
||||
if(UsingNewCTHSystem() == true)
|
||||
{
|
||||
ubDamage = Weapon[ pObj->usItem ].ubImpact;
|
||||
// modify by ini values
|
||||
if ( Item[pObj->usItem].usItemClass == IC_GUN )
|
||||
ubDamage *= gItemSettings.fDamageModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
|
||||
// HEADROCK HAM 4: I've decided to remove this condition. It makes no friggin sense.
|
||||
//if (FitsInSmallPocket(pObj) == true)
|
||||
//{
|
||||
@@ -11654,6 +11673,9 @@ UINT8 GetDamage ( OBJECTTYPE *pObj )
|
||||
else
|
||||
{
|
||||
ubDamage = (UINT8)GetModifiedGunDamage( Weapon[ pObj->usItem ].ubImpact );
|
||||
// modify by ini values
|
||||
if ( Item[pObj->usItem].usItemClass == IC_GUN )
|
||||
ubDamage *= gItemSettings.fDamageModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
|
||||
|
||||
// WTF? Why do only small weapons get their damage bonus?!
|
||||
if (FitsInSmallPocket(pObj) == true)
|
||||
@@ -11672,12 +11694,24 @@ UINT8 GetBasicDamage ( OBJECTTYPE *pObj )
|
||||
{
|
||||
// HEADROCK HAM 3.6: Can now take a negative modifier
|
||||
UINT8 ubDamage = (UINT8)GetModifiedMeleeDamage( Weapon[ pObj->usItem ].ubImpact );
|
||||
// modify by ini values
|
||||
if ( Item[pObj->usItem].usItemClass == IC_BLADE )
|
||||
ubDamage *= gItemSettings.fDamageModifierBlade;
|
||||
else if ( Item[pObj->usItem].usItemClass == IC_PUNCH )
|
||||
ubDamage *= gItemSettings.fDamageModifierPunch;
|
||||
else
|
||||
ubDamage *= gItemSettings.fDamageModifierTentacle;
|
||||
|
||||
return ubDamage;
|
||||
}
|
||||
else
|
||||
{
|
||||
// HEADROCK HAM 3.6: Can now take a negative modifier
|
||||
UINT8 ubDamage = (UINT8)GetModifiedGunDamage( Weapon[ pObj->usItem ].ubImpact );
|
||||
// modify by ini values
|
||||
if ( Item[pObj->usItem].usItemClass == IC_GUN )
|
||||
ubDamage *= gItemSettings.fDamageModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
|
||||
|
||||
return ubDamage;
|
||||
}
|
||||
}
|
||||
@@ -11754,9 +11788,15 @@ UINT8 GetAutofireShotsPerFiveAPs( OBJECTTYPE *pObj )
|
||||
// HEADROCK HAM B2.6: Added overall modifier
|
||||
if (Weapon[ pObj->usItem ].bAutofireShotsPerFiveAP > 0)
|
||||
{
|
||||
UINT8 usAutoFireShots = Weapon[ pObj->usItem ].bAutofireShotsPerFiveAP;
|
||||
|
||||
// modify by ini values
|
||||
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
|
||||
usAutoFireShots *= gItemSettings.fAFShotsPer5APModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
|
||||
|
||||
// WANNE: Fix by Headrock
|
||||
// Weapons shouldn't ever lose their Bp5AP due to this modifier.
|
||||
return __max((Weapon[ pObj->usItem ].bAutofireShotsPerFiveAP + gGameExternalOptions.bAutofireBulletsPer5APModifier), 1);
|
||||
return __max((usAutoFireShots + gGameExternalOptions.bAutofireBulletsPer5APModifier), 1);
|
||||
|
||||
//return __max((Weapon[ pObj->usItem ].bAutofireShotsPerFiveAP + gGameExternalOptions.bAutofireBulletsPer5APModifier), 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user