From 97d9740c533e2588435ae42d7291ba3563e3ceee Mon Sep 17 00:00:00 2001 From: Svornost <11434-svornost@users.noreply.gitgud.io> Date: Fri, 18 Oct 2019 23:43:13 -0700 Subject: [PATCH] Refactor speechLessons a little to reduce duplication, and differentiate in text between learning a language to accent level 3 and accent level 2 in language-upgrading schoolrooms. --- src/endWeek/saTakeClasses.js | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/endWeek/saTakeClasses.js b/src/endWeek/saTakeClasses.js index 29be82f7612..c25203b5258 100644 --- a/src/endWeek/saTakeClasses.js +++ b/src/endWeek/saTakeClasses.js @@ -349,30 +349,21 @@ window.saTakeClasses = (function saServeThePublic() { function speechLessons(slave) { if (slave.intelligenceImplant >= 15 || slave.intelligenceImplant < 0) { if (slave.intelligence > jsRandom(-110, 110)) { - if (V.schoolroomUpgradeLanguage === 0) { - if (slave.accent > 3 && (V.week - slave.weekAcquired > 24)) { + if (slave.accent > 3) { + const langWeekThreshold = (V.schoolroomUpgradeLanguage === 0) ? 24 : 16; + if (V.week - slave.weekAcquired > langWeekThreshold) { r += ` ${He} has <span class="green">learned some ${V.language},</span> and can make ${his} point with some gesturing, though ${he} speaks ${V.language} horribly.`; slave.accent--; if (slave.speechRules === "language lessons") { slave.speechRules = "accent elimination"; } - } else if (slave.accent === 3) { - r += ` ${He} has <span class="green">learned functional ${V.language},</span> and can make ${himself} understood, though ${his} ${aNational(slave.nationality)} accent is still quite heavy.`; - slave.accent--; - } - } else { - if (slave.accent > 3) { - if (V.week - slave.weekAcquired > 16) { - r += ` ${He} has <span class="green">learned some ${V.language},</span> and can make ${his} point with some gesturing, though ${he} speaks ${V.language} horribly.`; - slave.accent--; - if (slave.speechRules === "language lessons") { - slave.speechRules = "accent elimination"; - } - } - } else if (slave.accent >= 2) { - r += ` ${He} has <span class="green">learned decent ${V.language},</span> though ${he} retains enough of ${his} ${aNational(slave.nationality)} accent to make ${his} voice distinctly sexy.`; - slave.accent--; } + } else if (slave.accent === 3) { + r += ` ${He} has <span class="green">learned functional ${V.language},</span> and can make ${himself} understood, though ${his} ${aNational(slave.nationality)} accent is still quite heavy.`; + slave.accent--; + } else if (slave.accent === 2 && V.schoolroomUpgradeLanguage === 1) { + r += ` ${He} has <span class="green">learned decent ${V.language},</span> though ${he} retains enough of ${his} ${aNational(slave.nationality)} accent to make ${his} voice distinctly sexy.`; + slave.accent--; } } } -- GitLab