diff --git a/src/endWeek/saTakeClasses.js b/src/endWeek/saTakeClasses.js index 49b307ab266eccc1503e1f770231064366dd9973..15f9f3b588a28909cd0d3098ae48536c6a87bdfe 100644 --- a/src/endWeek/saTakeClasses.js +++ b/src/endWeek/saTakeClasses.js @@ -445,8 +445,22 @@ App.SlaveAssignment.takeClasses = (function() { * */ function speechLessons(slave) { + let teacherBonus = 0; + if (slave.assignment === Job.SCHOOL) { + if (S.Schoolteacher.accent >= 2) { // really === 2, because accent > 2 can't teach at all + teacherBonus -= 5; // penalty for bad example + } + teacherBonus += (S.Schoolteacher.intelligence + S.Schoolteacher.intelligenceImplant) / 20; // -7 to 7 + if (V.schoolroomUpgradeLanguage) { + teacherBonus = Math.max(teacherBonus, 1); // automated teaching counterbalances terrible teachers + } + if (App.Entity.facilities.schoolroom.revivalistLanguageDecorationBonus()) { + teacherBonus += 5; + } + } + if (slave.intelligenceImplant >= 15 || slave.intelligenceImplant < 0) { - if (slave.intelligence > jsRandom(-110, 110)) { + if (slave.intelligence + teacherBonus > jsRandom(-110, 110)) { if (slave.accent > 3) { const langWeekThreshold = (V.schoolroomUpgradeLanguage === 0) ? 24 : 16; if (V.week - slave.weekAcquired > langWeekThreshold) { diff --git a/src/endWeek/schoolroomReport.js b/src/endWeek/schoolroomReport.js index ea0b28a34e6c7eb0f0f9feba31d3914ec4269f2f..ce81af86e823948f3230a7fdd0f1e0f13d606256 100644 --- a/src/endWeek/schoolroomReport.js +++ b/src/endWeek/schoolroomReport.js @@ -45,7 +45,7 @@ App.EndWeek.schoolroomReport = function() { } } - const {He, he, His, his, him, wife} = getPronouns(S.Schoolteacher); + const {He, he, His, his, him, himself, wife} = getPronouns(S.Schoolteacher); r.push(`${S.Schoolteacher.slaveName} is serving as your Schoolteacher.`); if (S.Schoolteacher.relationship === -3 && S.Schoolteacher.devotion > 50) { r.push(`As your loving ${wife}, ${he} tries ${his} best to teach ${his} pupils how to please you.`); @@ -85,6 +85,18 @@ App.EndWeek.schoolroomReport = function() { r.push(`${His} students want to be just like their beautiful teacher.`); idleBonus++; } + if (S.Schoolteacher.accent >= 2) { // really accent === 2, because accent > 2 can't teach anyway + r.push(`${He}'s been tasked with teaching ${V.language}, but ${he}'s barely understandable ${himself}.`); + r.push(`This <span class="warning">slows ${his} students' progress</span> with the language.`); + if (S.Schoolteacher.devotion > 50) { + r.push(`${He} wants to do better, and devotes any extra time ${he} can find to improving ${his} own competency in ${V.language}.`); + idleBonus--; + if (S.Schoolteacher.intelligence + S.Schoolteacher.intelligenceImplant > random(-110, 110)) { // similar chances to saTakeClasses.speechLessons + r.push(`This week, ${he} makes a breakthrough, <span class="improvement">reducing ${his} accent</span> to a clear, pleasant, exoticism.`); + S.Schoolteacher.accent--; + } + } + } for (const slave of slaves) { const {he2} = getPronouns(slave).appendSuffix('2'); @@ -241,6 +253,9 @@ App.EndWeek.schoolroomReport = function() { if (V.schoolroomDecoration !== "standard") { const decorationEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent"); $(decorationEffects).append(`${V.schoolroomNameCaps}'s ${V.schoolroomDecoration} atmosphere <span class="hotpink">has a minor impact on the students.</span>`); + if (App.Entity.facilities.schoolroom.revivalistLanguageDecorationBonus()) { + $(decorationEffects).append(` They also <span class="positive">learn ${V.language} more quickly</span> in this environment.`); + } } return frag; diff --git a/src/facilities/schoolroom/schoolroomFramework.js b/src/facilities/schoolroom/schoolroomFramework.js index 31059cd5e286fffa94a5d5fcab901c0a8441a356..9f2b65111433ea3f158980ca83d7532979752cbe 100644 --- a/src/facilities/schoolroom/schoolroomFramework.js +++ b/src/facilities/schoolroom/schoolroomFramework.js @@ -64,9 +64,28 @@ App.Entity.Facilities.SchoolroomStudentJob = class extends App.Entity.Facilities } }; -App.Entity.facilities.schoolroom = new App.Entity.Facilities.SingleJobFacility( - App.Data.Facilities.schoolroom, - { - student: new App.Entity.Facilities.SchoolroomStudentJob() +App.Entity.Facilities.Schoolroom = class extends App.Entity.Facilities.SingleJobFacility { + constructor() { + super(App.Data.Facilities.schoolroom, { + student: new App.Entity.Facilities.SchoolroomStudentJob() + }); } -); + + /** Does the schoolroom decoration impart a language-learning bonus? + * @returns {boolean} + */ + revivalistLanguageDecorationBonus() { + const decorationBonus = { + "Latin": "Roman Revivalist", + "Nahuatl": "Aztec Revivalist", + "Ancient Egyptian": "Egyptian Revivalist", + "Japanese": "Edo Revivalist", + "Arabic": "Arabian Revivalist", + "Chinese": "Chinese Revivalist" + }; + const bonusDeco = decorationBonus[V.language]; + return bonusDeco && V.schoolroomDecoration === bonusDeco; + } +}; + +App.Entity.facilities.schoolroom = new App.Entity.Facilities.Schoolroom();