Trait change: Ambidextrous trait reduces cth penalty for having any item in offhand, not just if it is a handgun (PENALTY_TO_SHOOT_DOUBLE_GUNS_REDUCTION)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8428 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-07-25 18:24:39 +00:00
parent 60233d2f8d
commit 8d3d77ad84
9 changed files with 45 additions and 28 deletions
+29 -20
View File
@@ -6245,31 +6245,18 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
{
iChance -= AIM_PENALTY_SMG;
}
// Flugente: ambidextrous reduces penalty for any second item, regardless whether it is a gun or not
if (gGameOptions.fNewTraitSystem)
{
// Okay, we will shoot from both weapons, calculate penalty to CtH
if ( pSoldier->IsValidSecondHandShot() )
{
// penaly to shoot from dual weapons
iChance -= (INT32)(gSkillTraitValues.ubCtHPenaltyDualShot * (HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) ? ((100 - gSkillTraitValues.ubAMPenaltyDoubleReduction)/100) : 1 ));
}
iChance -= (INT32)(gSkillTraitValues.ubCtHPenaltyDualShot * (HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) ? ((100 - gSkillTraitValues.ubAMPenaltyDoubleReduction) / 100) : 1));
}
else // original code
{
if ( !HAS_SKILL_TRAIT( pSoldier, AMBIDEXT_OT ) )
{
if ( pSoldier->IsValidSecondHandShot( ) )
{
// penalty to aim when firing two pistols
iChance -= AIM_PENALTY_DUAL_PISTOLS;
}
/*
else
{
// penalty to aim with pistol being fired one-handed
iChance -= AIM_PENALTY_ONE_HANDED_PISTOL;
}
*/
// penalty to aim when firing two pistols
iChance -= AIM_PENALTY_DUAL_PISTOLS;
}
}
}
@@ -11718,7 +11705,18 @@ FLOAT CalcNewChanceToHitBaseWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, IN
else
{
// Penalty for shooting a pistol with just one hand
fGunBaseDifficulty *= gGameCTHConstants.BASE_ONE_HANDED;
// Flugente: Ambidextrous trait lowers penalty
FLOAT fTempPenalty = (gGameCTHConstants.BASE_ONE_HANDED * fGunBaseDifficulty) - fGunBaseDifficulty;
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) )
{
fTempPenalty = fTempPenalty * (100 - gSkillTraitValues.ubAMPenaltyDoubleReduction) / 100;
}
else if ( !gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXT_OT ) )
{
fTempPenalty = 0;
}
fGunBaseDifficulty += fTempPenalty;
}
}
}
@@ -12070,7 +12068,18 @@ FLOAT CalcNewChanceToHitAimWeaponBonus(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT
else
{
// Penalty for shooting a pistol with just one hand
fGunAimDifficulty *= gGameCTHConstants.AIM_ONE_HANDED;
// Flugente: Ambidextrous trait lowers penalty
FLOAT fTempPenalty = (gGameCTHConstants.AIM_ONE_HANDED * fGunAimDifficulty) - fGunAimDifficulty;
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) )
{
fTempPenalty = fTempPenalty * (100 - gSkillTraitValues.ubAMPenaltyDoubleReduction) / 100;
}
else if ( !gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXT_OT ) )
{
fTempPenalty = 0;
}
fGunAimDifficulty += fTempPenalty;
}
}
}
+2 -1
View File
@@ -140,6 +140,7 @@ STR16 gzIMPMajorTraitsHelpTextsSniper[]=
L"步枪精确瞄准次数增加 %d次\n",// L"Adds %d more aim clicks for rifle-type guns\n",
L"迅速瞄准:步枪精确瞄准次数加快(即减少)1次\n",//L"Makes aiming faster with rifle-type guns by one aim click\n",
L"迅速瞄准:步枪精确瞄准次数加快(即减少)%d次\n",//L"Makes aiming faster with rifle-type guns by %d aim clicks\n",
L"Focus skill: +%d interrupt modifier in a %d-radius area\n", // TODO.Translate
};
STR16 gzIMPMajorTraitsHelpTextsRanger[]=
@@ -275,7 +276,7 @@ STR16 gzIMPMajorTraitsHelpTextsNone[]=
STR16 gzIMPMinorTraitsHelpTextsAmbidextrous[]=
{
L"双持武器的惩罚降低 %d%s\n",// L"Reduce penalty to shoot dual weapons by %d%s\n",
L"Reduced penalty to shoot if offhand item is equipped by %d%s\n", // TODO.Translate
L"弹匣类武器装填速度 +%d%s\n",// L"+%d%s speed of reloading guns with magazines\n",
L"零散弹药装填速度 +%d%s\n",// L"+%d%s speed of reloading guns with loose rounds\n",
L"拾物品所需行动点 -%d%s\n",// L"-%d%s APs needed to pickup items\n",
+2 -1
View File
@@ -140,6 +140,7 @@ STR16 gzIMPMajorTraitsHelpTextsSniper[]=
L"Adds %d more aim clicks for rifle-type guns\n",
L"Makes aiming faster with rifle-type guns by one aim click\n",
L"Makes aiming faster with rifle-type guns by %d aim clicks\n",
L"Focus skill: +%d interrupt modifier in a %d-radius area\n", // TODO.Translate
};
STR16 gzIMPMajorTraitsHelpTextsRanger[]=
@@ -275,7 +276,7 @@ STR16 gzIMPMajorTraitsHelpTextsNone[]=
STR16 gzIMPMinorTraitsHelpTextsAmbidextrous[]=
{
L"Reduced penalty to shoot dual weapons by %d%s\n",
L"Reduced penalty to shoot if offhand item is equipped by %d%s\n", // TODO.Translate
L"+%d%s speed on reloading guns with magazines\n",
L"+%d%s speed on reloading guns with loose rounds\n",
L"-%d%s APs to pickup items\n",
+2 -1
View File
@@ -140,6 +140,7 @@ STR16 gzIMPMajorTraitsHelpTextsSniper[]=
L"Adds %d more aim clicks for rifle-type guns\n",
L"Makes aiming faster with rifle-type guns by one aim click\n",
L"Makes aiming faster with rifle-type guns by %d aim clicks\n",
L"Focus skill: +%d interrupt modifier in a %d-radius area\n",
};
STR16 gzIMPMajorTraitsHelpTextsRanger[]=
@@ -275,7 +276,7 @@ STR16 gzIMPMajorTraitsHelpTextsNone[]=
STR16 gzIMPMinorTraitsHelpTextsAmbidextrous[]=
{
L"Reduced penalty to shoot dual weapons by %d%s\n",
L"Reduced penalty to shoot if offhand item is equipped by %d%s\n",
L"+%d%s speed on reloading guns with magazines\n",
L"+%d%s speed on reloading guns with loose rounds\n",
L"-%d%s APs to pickup items\n",
+2 -1
View File
@@ -141,6 +141,7 @@ STR16 gzIMPMajorTraitsHelpTextsSniper[]=
L"Fait viser plus rapidement avec un : réduit d'un niveau de visée\n",
L"Fait viser plus rapidement avec un fusil : réduit de %d niveau(x) de visée\n",
L"Focus skill: +%d interrupt modifier in a %d-radius area\n", // TODO.Translate
};
STR16 gzIMPMajorTraitsHelpTextsRanger[]=
@@ -275,7 +276,7 @@ STR16 gzIMPMajorTraitsHelpTextsNone[]=
STR16 gzIMPMinorTraitsHelpTextsAmbidextrous[]=
{
L"Réduit la pénalité de tirer avec deux armes de %d%s\n",
L"Reduced penalty to shoot if offhand item is equipped by %d%s\n", // TODO.Translate
L"+%d%s de vitesse de rechargement d'une arme avec un chargeur\n",
L"+%d%s de vitesse de rechargement d'une arme avec des cartouches\n",
L"-%d%s du nombre de PA nécessaire pour prendre un objet\n",
+2 -1
View File
@@ -140,6 +140,7 @@ STR16 gzIMPMajorTraitsHelpTextsSniper[]=
L"Gibt weitere %d Ziel-Klicks für gewehrartige Waffen\n",
L"Schnelleres Zielen mit Gewehren bei genau einem Zielgenauigkeit-Klick\n",
L"Schnelleres Zielen mit Gewehren bei %d Zielgenauigkeit-Klicks\n",
L"Focus skill: +%d interrupt modifier in a %d-radius area\n", // TODO.Translate
};
STR16 gzIMPMajorTraitsHelpTextsRanger[]=
@@ -275,7 +276,7 @@ STR16 gzIMPMajorTraitsHelpTextsNone[]=
STR16 gzIMPMinorTraitsHelpTextsAmbidextrous[]=
{
L"Die Ungenauigkeit beim Schießen mit zwei Waffen wird um %d%s reduziert\n",
L"Reduced penalty to shoot if offhand item is equipped by %d%s\n", // TODO.Translate
L"+%d%s schnelleres Nachladen mit Magazinen\n",
L"+%d%s schnelleres Nachladen mit einzelnen Patronen\n",
L"-%d%s APs benötigt um Gegenstände aufzuheben\n",
+2 -1
View File
@@ -138,6 +138,7 @@ STR16 gzIMPMajorTraitsHelpTextsSniper[]=
L"Adds %d more aim clicks for rifle-type guns\n",
L"Makes aiming faster with rifle-type guns by one aim click\n",
L"Makes aiming faster with rifle-type guns by %d aim clicks\n",
L"Focus skill: +%d interrupt modifier in a %d-radius area\n", // TODO.Translate
};
STR16 gzIMPMajorTraitsHelpTextsRanger[]=
@@ -273,7 +274,7 @@ STR16 gzIMPMajorTraitsHelpTextsNone[]=
STR16 gzIMPMinorTraitsHelpTextsAmbidextrous[]=
{
L"Reduced penalty to shoot dual weapons by %d%s\n",
L"Reduced penalty to shoot if offhand item is equipped by %d%s\n", // TODO.Translate
L"+%d%s speed on reloading guns with magazines\n",
L"+%d%s speed on reloading guns with loose rounds\n",
L"-%d%s APs to pickup items\n",
+2 -1
View File
@@ -140,6 +140,7 @@ STR16 gzIMPMajorTraitsHelpTextsSniper[]=
L"Adds %d more aim clicks for rifle-type guns\n",
L"Makes aiming faster with rifle-type guns by one aim click\n",
L"Makes aiming faster with rifle-type guns by %d aim clicks\n",
L"Focus skill: +%d interrupt modifier in a %d-radius area\n", // TODO.Translate
};
STR16 gzIMPMajorTraitsHelpTextsRanger[]=
@@ -275,7 +276,7 @@ STR16 gzIMPMajorTraitsHelpTextsNone[]=
STR16 gzIMPMinorTraitsHelpTextsAmbidextrous[]=
{
L"Reduced penalty to shoot dual weapons by %d%s\n",
L"Reduced penalty to shoot if offhand item is equipped by %d%s\n", // TODO.Translate
L"+%d%s speed on reloading guns with magazines\n",
L"+%d%s speed on reloading guns with loose rounds\n",
L"-%d%s APs to pickup items\n",
+2 -1
View File
@@ -140,6 +140,7 @@ STR16 gzIMPMajorTraitsHelpTextsSniper[]=
L"+%d кликов прицеливания для оружия типа винтовок\n",
L"Прицеливание оружия типа винтовок быстрее на один клик прицеливания\n",
L"Прицеливание оружия типа винтовок быстрее на %d кликов прицеливания\n",
L"Focus skill: +%d interrupt modifier in a %d-radius area\n", // TODO.Translate
};
STR16 gzIMPMajorTraitsHelpTextsRanger[]=
@@ -275,7 +276,7 @@ STR16 gzIMPMajorTraitsHelpTextsNone[]=
STR16 gzIMPMinorTraitsHelpTextsAmbidextrous[]=
{
L"Понижен штраф на стрельбу с двух рук на %d%s\n",
L"Reduced penalty to shoot if offhand item is equipped by %d%s\n", // TODO.Translate
L"+%d%s к скорости на перезарядку оружия магазином\n",
L"+%d%s к скорости на дозарядку магазина оружия\n",
L"-%d%s ОД, чтобы поднять предмет\n",