From 8d3d77ad84e0c13d7265f7ca6787479da9c65b42 Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 25 Jul 2017 18:24:39 +0000 Subject: [PATCH] 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 --- Tactical/Weapons.cpp | 49 ++++++++++++++++++++++---------------- Utils/_Ja25ChineseText.cpp | 3 ++- Utils/_Ja25DutchText.cpp | 3 ++- Utils/_Ja25EnglishText.cpp | 3 ++- Utils/_Ja25FrenchText.cpp | 3 ++- Utils/_Ja25GermanText.cpp | 3 ++- Utils/_Ja25ItalianText.cpp | 3 ++- Utils/_Ja25PolishText.cpp | 3 ++- Utils/_Ja25RussianText.cpp | 3 ++- 9 files changed, 45 insertions(+), 28 deletions(-) diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index bd3e08bb8..f2afd105d 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -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; } } } diff --git a/Utils/_Ja25ChineseText.cpp b/Utils/_Ja25ChineseText.cpp index ed36814d0..f61e60a99 100644 --- a/Utils/_Ja25ChineseText.cpp +++ b/Utils/_Ja25ChineseText.cpp @@ -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", diff --git a/Utils/_Ja25DutchText.cpp b/Utils/_Ja25DutchText.cpp index 36c9232d3..25b79e384 100644 --- a/Utils/_Ja25DutchText.cpp +++ b/Utils/_Ja25DutchText.cpp @@ -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", diff --git a/Utils/_Ja25EnglishText.cpp b/Utils/_Ja25EnglishText.cpp index 0a76742fb..70cccb2c2 100644 --- a/Utils/_Ja25EnglishText.cpp +++ b/Utils/_Ja25EnglishText.cpp @@ -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", diff --git a/Utils/_Ja25FrenchText.cpp b/Utils/_Ja25FrenchText.cpp index 0cc2f3f22..91a32df3c 100644 --- a/Utils/_Ja25FrenchText.cpp +++ b/Utils/_Ja25FrenchText.cpp @@ -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", diff --git a/Utils/_Ja25GermanText.cpp b/Utils/_Ja25GermanText.cpp index 636888659..a2b8e9437 100644 --- a/Utils/_Ja25GermanText.cpp +++ b/Utils/_Ja25GermanText.cpp @@ -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", diff --git a/Utils/_Ja25ItalianText.cpp b/Utils/_Ja25ItalianText.cpp index bd077a0a9..e976b56a5 100644 --- a/Utils/_Ja25ItalianText.cpp +++ b/Utils/_Ja25ItalianText.cpp @@ -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", diff --git a/Utils/_Ja25PolishText.cpp b/Utils/_Ja25PolishText.cpp index b16fc7332..8c41e945a 100644 --- a/Utils/_Ja25PolishText.cpp +++ b/Utils/_Ja25PolishText.cpp @@ -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", diff --git a/Utils/_Ja25RussianText.cpp b/Utils/_Ja25RussianText.cpp index 1e1fa9a1a..b09e9e7a9 100644 --- a/Utils/_Ja25RussianText.cpp +++ b/Utils/_Ja25RussianText.cpp @@ -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",