diff --git a/src/endWeek/reports/spaReport.js b/src/endWeek/reports/spaReport.js index dc68b39c5ceb1021198a082cebc6f5c3a7cddc49..344c8ef017f65f410205356fa34664d88414d840 100644 --- a/src/endWeek/reports/spaReport.js +++ b/src/endWeek/reports/spaReport.js @@ -4,20 +4,20 @@ App.EndWeek.dairyReport = function() { const el = new DocumentFragment(); let r; - - _slaves = App.Utils.sortedEmployees(App.Entity.facilities.spa); - _DL = _slaves.length, _SL = V.slaves.length, _bonusToggle = 0, _healthBonus = 0, _idleBonus = 0, _restedSlaves = 0, _trustBonus = 0; + + const _slaves = App.Utils.sortedEmployees(App.Entity.facilities.spa); + let _DL = _slaves.length, _SL = V.slaves.length, _bonusToggle = 0, _healthBonus = 0, _idleBonus = 0, _restedSlaves = 0, _trustBonus = 0, _devBonus; if (V.spaDecoration !== "standard") { _devBonus = 1; } else { _devBonus = 0; } - V.flSex = App.EndWeek.getFLSex(App.Entity.facilities.spa); - r.push(` /* FIXME: should be local, passed as a parameter to saRules */`); + V.flSex = App.EndWeek.getFLSex(App.Entity.facilities.spa); /* FIXME: should be local, passed as a parameter to saRules */ if (V.AttendantID !== 0) { + r = []; if (S.Attendant.health.condition < 100) { improveCondition(S.Attendant, normalRandInt(20)); } @@ -30,10 +30,10 @@ App.EndWeek.dairyReport = function() { if (S.Attendant.rules.living !== "luxurious") { S.Attendant.rules.living = "luxurious"; } - _FLsFetish = 0; + let _FLsFetish = 0; if (S.Attendant.fetishStrength <= 95) { if (S.Attendant.fetish !== "submissive") { - if (fetishChangeChance(S.Attendant) > random(0,100)) { + if (fetishChangeChance(S.Attendant) > random(0, 100)) { _FLsFetish = 1, S.Attendant.fetishKnown = 1, S.Attendant.fetish = "submissive"; } } else if (S.Attendant.fetishKnown === 0) { @@ -42,17 +42,19 @@ App.EndWeek.dairyReport = function() { _FLsFetish = 2, S.Attendant.fetishStrength += 4; } } - if (S.Attendant.fetish === "none") || (S.Attendant.fetish === "submissive") { + if (S.Attendant.fetish === "none" || S.Attendant.fetish === "submissive") { _devBonus++; } S.Attendant.devotion += _devBonus; - <<setLocalPronouns S.Attendant>> - - V.SlaveFullName(S.Attendant) - r.push(` is serving as the spa attendant.`); - if (S.Attendant.relationship === -3 && S.Attendant.devotion > 50) { - r.push(` ${He} tries ${his} best to be your perfect attentive, caring and loving ${V.wife}.`); - } + const { + He, His, + he, his, him, himself, wife + } = getPronouns(S.Attendant); + // + r.push(`${SlaveFullName(S.Attendant)} is serving as the spa attendant.`); + if (S.Attendant.relationship === -3 && S.Attendant.devotion > 50) { + r.push(` ${He} tries ${his} best to be your perfect attentive, caring and loving ${wife}.`); + } if (_FLsFetish === 1) { r.push(`When ${he} is paid a visit by a slave with sexual issues to work out, ${he} provides them with an understanding, willing, giving partner. ${He} finds real satisfaction in helping your slaves find sexual gratification, and <span class="lightsalmon">becomes a submissive.</span>`); } else if ((_FLsFetish === 2)) { @@ -65,30 +67,26 @@ App.EndWeek.dairyReport = function() { r.push(`${He} has experience with counseling from working for you, making ${him} better at building rapport with troubled slaves, and giving ${him} a better chance of softening flaws into beneficial quirks.`); _bonusToggle = 1, _idleBonus++; } else { - S.Attendant.skill.attendant += random(1,Math.ceil((S.Attendant.intelligence+S.Attendant.intelligenceImplant)/15) + 8); + S.Attendant.skill.attendant += random(1, Math.ceil((S.Attendant.intelligence + S.Attendant.intelligenceImplant) / 15) + 8); } if (!canSee(S.Attendant)) { r.push(`${His} blindness allows ${him} to deeply connect with ${his} charges.`); _idleBonus++; } if (S.Attendant.fetish === "none") { - S.Attendant.slaveName respects the slaves lounging in the spa, allowing them to relax completely. + r.push(`${S.Attendant.slaveName} respects the slaves lounging in the spa, allowing them to relax completely.`); _idleBonus++; - } else if ((S.Attendant.fetish === "submissive")) { - S.Attendant.slaveName lets the slaves resting in the spa take the lead sexually, doing ${his} best to please them. + } else if (S.Attendant.fetish === "submissive") { + r.push(`${S.Attendant.slaveName} lets the slaves resting in the spa take the lead sexually, doing ${his} best to please them.`); _idleBonus++; - } else if ((S.Attendant.fetishKnown === 1)) { - S.Attendant.slaveName can't keep ${his} hand - if (hasBothArms(S.Attendant)) { - r.push(`s`); - } - r.push(` to ${himself}, preventing the slaves in the spa from relaxing completely.`); + } else if (S.Attendant.fetishKnown === 1) { + r.push(`${S.Attendant.slaveName} can't keep ${his} ${hasBothArms(S.Attendant) ? `hands` : `hand`} to ${himself}, preventing the slaves in the spa from relaxing completely.`); } if (S.Attendant.visualAge > 35) { r.push(`${His} apparent maturity encourages the slaves in the spa to relax and pour out their troubles to ${him}.`); _healthBonus++, _idleBonus++; } - if (S.Attendant.intelligence+S.Attendant.intelligenceImplant > 15) { + if (S.Attendant.intelligence + S.Attendant.intelligenceImplant > 15) { r.push(`${He}'s so intelligent ${he} can suss out the cause of slaves' emotional issues and counsel them effectively.`); _idleBonus++; } @@ -96,212 +94,186 @@ App.EndWeek.dairyReport = function() { r.push(`${He} has a natural mothering instinct and really makes ${his} charges feel at home.`); _idleBonus++, _healthBonus++; } - _attendantUsedCure = 0; - <<for _slave range _slaves>> - V.i = V.slaveIndices[_slave.ID]; - <<setLocalPronouns _slave 2>> - if (_slave.fetish === "mindbroken") && (_slave.health.condition > 20) && (_attendantUsedCure === 0) && (V.spaFix !== 2) { + let _attendantUsedCure = 0; + for (const _slave of _slaves) { + const { + He2, His2, + he2, his2, him2, himself2, wife2 + } = getPronouns(_slave).appendSuffix("2"); + if (_slave.fetish === "mindbroken" && _slave.health.condition > 20 && _attendantUsedCure === 0 && V.spaFix !== 2) { _attendantUsedCure = 1; - if (random(1,100) > 90-S.Attendant.devotion) { - <br> <span class="green">Something almost miraculous has happened.</span> S.Attendant.slaveName has always refused to believe that _slave.slaveName could not be reached, and has lavished patient tenderness on ${_him2} in V.spaName. _slave.slaveName has begun to respond, and is stirring from ${_his2} mental torpor. - _slave.devotion = -3, _slave.sexualFlaw = "apathetic", _slave.behavioralFlaw = either("hates men", "odd"), _slave.fetish = "none", _slave.fetishKnown = 1; - _spr = V.genePool.findIndex(function(s) { return s.ID === _slave.ID; }); + if (random(1, 100) > 90 - S.Attendant.devotion) { + //<br> + r.push(`<span class="green">Something almost miraculous has happened.</span> ${S.Attendant.slaveName} has always refused to believe that ${_slave.slaveName} could not be reached, and has lavished patient tenderness on ${_him2} in ${V.spaName}. ${_slave.slaveName} has begun to respond, and is stirring from ${_his2} mental torpor.`); + _slave.devotion = -3; + _slave.sexualFlaw = "apathetic"; + _slave.behavioralFlaw = either("hates men", "odd"); + _slave.fetish = "none"; + _slave.fetishKnown = 1; + const _spr = V.genePool.findIndex(function(s) { return s.ID === _slave.ID; }); if (V.genePool[_spr].intelligence >= -95) { - _slave.intelligence = V.genePool[_spr].intelligence-30; + _slave.intelligence = V.genePool[_spr].intelligence - 30; } if (V.arcologies[0].FSPaternalist > 0) { - r.push(`Society <span class="green">strongly approves</span> of${ _${slave.slaveName}} being restored to sanity, which advances ideals about enlightened slaveownership.`); - V.arcologies[0].FSPaternalist += 0.01*V.FSSingleSlaveRep; - repX(2*V.FSSingleSlaveRep*(V.arcologies[0].FSPaternalist/V.FSLockinLevel), "spa", _slave); + r.push(`Society <span class="green">strongly approves</span> of${_slave.slaveName} being restored to sanity, which advances ideals about enlightened slaveownership.`); + V.arcologies[0].FSPaternalist += 0.01 * V.FSSingleSlaveRep; + repX(2 * V.FSSingleSlaveRep * (V.arcologies[0].FSPaternalist / V.FSLockinLevel), "spa", _slave); } } } - _seed = _bonusToggle * 10; + const _seed = _bonusToggle * 10; if (_bonusToggle === 1 && _slave.trust < 60) { _slave.trust++; } if (S.Attendant.rivalryTarget === _slave.ID) { - r.push(`${He} constantly harasses ${his} `); - V.rivalryTerm(S.Attendant) - r.push(`,${ _${slave.slaveName}}, preventing ${_him2} from getting comfortable and forcing ${_him2} to keep ${_his2} guard up.`); + r.push(`${He} constantly harasses ${his} ${rivalryTerm(S.Attendant)}, ${_slave.slaveName}, preventing ${_him2} from getting comfortable and forcing ${_him2} to keep ${_his2} guard up.`); _slave.devotion -= 4, _slave.trust -= 4; - if (random(1,100) > 35) { + if (random(1, 100) > 35) { S.Attendant.rivalry++, S.Attendant.rivalry++, _slave.rivalry++; } } else if (S.Attendant.relationshipTarget === _slave.ID) { - r.push(`${He} dedicates most of ${his} attention to ${his} `); - V.relationshipTerm(S.Attendant) - r.push(`,${ _${slave.slaveName}}, making ${_his2} stress, both physical and mental, wash away.`); + r.push(`${He} dedicates most of ${his} attention to ${his} ${relationshipTerm(S.Attendant)}, ${_slave.slaveName}, making ${_his2} stress, both physical and mental, wash away.`); _slave.devotion += 3, _slave.trust += 3; } else if (areRelated(S.Attendant, _slave)) { - r.push(`${He} makes sure to spend extra time caring for ${his} `); - V.relativeTerm(S.Attendant,_slave) - r.push(`,${ _${slave.slaveName}.}`); + r.push(`${He} makes sure to spend extra time caring for ${his} ${relativeTerm(S.Attendant, _slave)}, ${_slave.slaveName}.`); _slave.trust++; improveCondition(_slave, 1); } switch (_slave.prestigeDesc) { - case "${He} is a famed Free Cities whore, and commands top prices.": - r.push(`${He} does ${his} best to relax the famous whore,${ _${slave.slaveName}}, making sure to`); - if (_slave.vagina > 2 || _slave.anus > 2) { - r.push(`pay special attention to ${_his2} worn holes.`); - } else { - r.push(`get ${_him2} clean and relaxed for ${_his2} next usage.`); - } - _slave.devotion += 3, _slave.trust += 3; - case "${He} is a famed Free Cities slut, and can please anyone.": - r.push(`${He} does ${his} best to soothe the famous entertainer,${ _${slave.slaveName}}, letting ${_him2} relax in blissful peace.`); - _slave.devotion += 3, _slave.trust += 3; - case "${He} is remembered for winning best in show as a cockmilker.": - if (_slave.balls > 6) && (_slave.dick !== 0) { - if (S.Attendant.fetish === "cumslut") { - r.push(`${He} can't keep ${his} hand`); - if (hasBothArms(S.Attendant)) { - r.push(`s`); - } - r.push(` off${ _${slave.slaveName}}'s cock and balls, but ${_he2} doesn't mind being milked constantly. Before long, strands of cum can be found floating all throughout the bath.`); - S.Attendant.fetishStrength += 4; + case "$He is a famed Free Cities whore, and commands top prices.": + r.push(`${He} does ${his} best to relax the famous whore,${_slave.slaveName}, making sure to`); + if (_slave.vagina > 2 || _slave.anus > 2) { + r.push(`pay special attention to ${_his2} worn holes.`); } else { - r.push(`${He} does ${his} best to accommodate${ _${slave.slaveName}}'s massive genitals and tends to ${_him2} whenever ${_he2} feels a need for release.`); - if (random(1,100) > 65 && S.Attendant.fetish === "none") { - r.push(`After taking several massive loads to the face, ${S.Attendant.slaveName} begins to find satisfaction in being coated in cum.`); - S.Attendant.fetish = "cumslut"; - } + r.push(`get ${_him2} clean and relaxed for ${_his2} next usage.`); } - } - _slave.devotion += 3, _slave.trust += 3; - case "${He} is remembered for winning best in show as a dairy cow.": - if (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant) > 6000) { - if (S.Attendant.fetish === "boobs") { - r.push(`${He} can't keep ${his} hand`); - if (hasBothArms(S.Attendant)) { - r.push(`s`); - } - r.push(` off${ _${slave.slaveName}}'s huge breasts, but ${_he2} doesn't mind being milked constantly. Before long the bath gains a white tint.`); - S.Attendant.fetishStrength += 4, S.Attendant.fetishStrength += 4; - } else { - r.push(`${He} does ${his} best to accommodate${ _${slave.slaveName}}'s massive breasts and tends to ${_him2} whenever ${_he2} feels a need for release.`); - if (random(1,100) > 65 && S.Attendant.fetish === "none") { - r.push(`After multiple milking sessions, ${S.Attendant.slaveName} begins to find ${himself} fantasizing about having giant milky breasts too.`); - S.Attendant.fetish = "boobs"; + _slave.devotion += 3, _slave.trust += 3; + case "$He is a famed Free Cities slut, and can please anyone.": + r.push(`${He} does ${his} best to soothe the famous entertainer, ${_slave.slaveName}, letting ${_him2} relax in blissful peace.`); + _slave.devotion += 3, _slave.trust += 3; + case "${He} is remembered for winning best in show as a cockmilker.": + if (_slave.balls > 6 && _slave.dick !== 0) { + if (S.Attendant.fetish === "cumslut") { + r.push(`${He} can't keep ${his} ${hasBothArms(S.Attendant) ? `hands` : `hand`} off ${_slave.slaveName}'s cock and balls, but ${_he2} doesn't mind being milked constantly. Before long, strands of cum can be found floating all throughout the bath.`); + S.Attendant.fetishStrength += 4; + } else { + r.push(`${He} does ${his} best to accommodate ${_slave.slaveName}'s massive genitals and tends to ${_him2} whenever ${_he2} feels a need for release.`); + if (random(1, 100) > 65 && S.Attendant.fetish === "none") { + r.push(`After taking several massive loads to the face, ${S.Attendant.slaveName} begins to find satisfaction in being coated in cum.`); + S.Attendant.fetish = "cumslut"; + } } } - _slave.devotion += 3, _slave.trust += 3, _slave.lactationDuration = 2, _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0; - } - case "${He} is remembered for winning best in show as a breeder.": - if (_slave.bellyPreg >= 5000) { - if (S.Attendant.fetish === "pregnancy") { - r.push(`${He} can't keep ${his} hand`); - if (hasBothArms(S.Attendant)) { - r.push(`s`); - } - r.push(` off${ _${slave.slaveName}}'s pregnancy, but ${_he2} doesn't mind ${_his2} full belly being fondled.`); - S.Attendant.fetishStrength += 4, S.Attendant.fetishStrength += 4; - } else { - r.push(`${He} does ${his} best to accommodate${ _${slave.slaveName}}'s pregnancy and to make sure the mother-to-be is happy and comfortable.`); - if (random(1,100) > 65 && S.Attendant.fetish === "none") { - r.push(`After massaging${ _${slave.slaveName}}'s growing belly multiple times, ${S.Attendant.slaveName} begins to find ${himself} fantasizing about being swollen with life too.`); - S.Attendant.fetish = "pregnancy"; + _slave.devotion += 3, _slave.trust += 3; + case "$He is remembered for winning best in show as a dairy cow.": + if (_slave.lactation > 0 && (_slave.boobs - _slave.boobsImplant) > 6000) { + if (S.Attendant.fetish === "boobs") { + r.push(`${He} can't keep ${his} ${hasBothArms(S.Attendant) ? `hands` : `hand`} off ${_slave.slaveName}'s huge breasts, but ${_he2} doesn't mind being milked constantly. Before long the bath gains a white tint.`); + S.Attendant.fetishStrength += 4, S.Attendant.fetishStrength += 4; + } else { + r.push(`${He} does ${his} best to accommodate ${_slave.slaveName}'s massive breasts and tends to ${_him2} whenever ${_he2} feels a need for release.`); + if (random(1, 100) > 65 && S.Attendant.fetish === "none") { + r.push(`After multiple milking sessions, ${S.Attendant.slaveName} begins to find ${himself} fantasizing about having giant milky breasts too.`); + S.Attendant.fetish = "boobs"; + } } + _slave.devotion += 3, _slave.trust += 3, _slave.lactationDuration = 2, _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0; } - _slave.devotion += 3, _slave.trust += 3; - } else { - if (S.Attendant.fetish === "pregnancy") { - r.push(`${He} can't help but pester${ _${slave.slaveName}} with questions about ${_his2} famous pregnancy, limiting ${_his2} ability to truly relax.`); - _slave.devotion += 1, _slave.trust += 1; - } else if (canGetPregnant(_slave)) { - r.push(`${He} does ${his} best to encourage${ _${slave.slaveName}}'s fertilization by performing any fertility boosting actions ${he} can.`); + case "$He is remembered for winning best in show as a breeder.": + if (_slave.bellyPreg >= 5000) { + if (S.Attendant.fetish === "pregnancy") { + r.push(`${He} can't keep ${his} ${hasBothArms(S.Attendant) ? `hands` : `hand`} off ${_slave.slaveName}'s pregnancy, but ${_he2} doesn't mind ${_his2} full belly being fondled.`); + S.Attendant.fetishStrength += 4, S.Attendant.fetishStrength += 4; + } else { + r.push(`${He} does ${his} best to accommodate ${_slave.slaveName}'s pregnancy and to make sure the mother-to-be is happy and comfortable.`); + if (random(1, 100) > 65 && S.Attendant.fetish === "none") { + r.push(`After massaging ${_slave.slaveName}'s growing belly multiple times, ${S.Attendant.slaveName} begins to find ${himself} fantasizing about being swollen with life too.`); + S.Attendant.fetish = "pregnancy"; + } + } _slave.devotion += 3, _slave.trust += 3; + } else { + if (S.Attendant.fetish === "pregnancy") { + r.push(`${He} can't help but pester ${_slave.slaveName} with questions about ${_his2} famous pregnancy, limiting ${_his2} ability to truly relax.`); + _slave.devotion += 1, _slave.trust += 1; + } else if (canGetPregnant(_slave)) { + r.push(`${He} does ${his} best to encourage ${_slave.slaveName}'s fertilization by performing any fertility boosting actions ${he} can.`); + _slave.devotion += 3, _slave.trust += 3; + } } - } } - if (S.Attendant.intelligence+S.Attendant.intelligenceImplant > 15) && (_attendantUsedCure === 0) && ((S.Attendant.intelligence+S.Attendant.intelligenceImplant)+_seed) > random(1,200) && (V.spaFix === 0) { + if (S.Attendant.intelligence + S.Attendant.intelligenceImplant > 15) && (_attendantUsedCure === 0) && ((S.Attendant.intelligence + S.Attendant.intelligenceImplant) + _seed) > random(1, 200) && (V.spaFix === 0) { if (_slave.behavioralFlaw !== "none") { SoftenBehavioralFlaw(_slave); _attendantUsedCure += 1; - <br> S.Attendant.slaveName works carefully with _slave.slaveName, and successfully <span class="green">softens ${_his2} behavioral flaw</span> into an appealing quirk. + //<br> + r.push(`${S.Attendant.slaveName} works carefully with _slave.slaveName, and successfully <span class="green">softens ${_his2} behavioral flaw</span> into an appealing quirk.`); } else if (_slave.sexualFlaw !== "none") { SoftenSexualFlaw(_slave); _attendantUsedCure += 1; - <br> S.Attendant.slaveName works carefully with _slave.slaveName, and successfully <span class="green">softens ${_his2} sexual flaw</span> into an appealing quirk. + //<br> + r.push(`${S.Attendant.slaveName} works carefully with _slave.slaveName, and successfully <span class="green">softens ${_his2} sexual flaw</span> into an appealing quirk.`); } } if (_slave.lactation > 0) { - S.Attendant.slaveName takes care to keep _slave.slaveName's breasts comfortably drained. + r.push(`${S.Attendant.slaveName} takes care to keep _slave.slaveName's breasts comfortably drained.`); _slave.lactationDuration = 2, _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0; } - <</for>> + } if (_DL < V.spa) { - _seed = random(1,10)+((V.spa-_DL)*(random(150,170)+(_idleBonus*10))); + const _seed = random(1, 10) + ((V.spa - _DL) * (random(150, 170) + (_idleBonus * 10))); cashX(_seed, "spa", S.Attendant); - <br> Since ${he} doesn't have enough slaves to occupy all ${his} time, the spa takes in citizens' slaves on a contract basis and ${he} helps them too, earning <span class="yellowgreen"> - V.cashFormat(_seed) - r.push(`.</span>`); - if (V.arcologies[0].FSHedonisticDecadence > 0) && (_DL === 0) { + //<br> + r.push(`Since ${he} doesn't have enough slaves to occupy all ${his} time, the spa takes in citizens' slaves on a contract basis and ${he} helps them too, earning <span class="yellowgreen"> ${cashFormat(_seed)}.</span>`); + if (V.arcologies[0].FSHedonisticDecadence > 0 && _DL === 0) { r.push(`Society <span class="green">loves</span> being allowed to lounge in your spa, greatly advancing your laid back culture.`); FutureSocieties.Change("Hedonistic", 2); } } - if (_DL > 0) {<br><br> - } } if (_DL > 0) { - '' - if (_DL > 1) { - r.push(`There are${ _DL} slaves`); - } else { - r.push(`There is one slave`); - } + // + if (_DL > 1) { + r.push(`''There are${_DL} slaves`); + } else { + r.push(`''There is one slave`); + } r.push(` resting and recuperating in the spa.''`); - if (V.arcologies[0].FSHedonisticDecadence > 0) && (_DL === 0) { + if (V.arcologies[0].FSHedonisticDecadence > 0 && _DL === 0) { r.push(`Society <span class="green">approves</span> of your slaves being pampered this way, greatly advancing your laid back culture.`); FutureSocieties.Change("Hedonistic", 1); } } if (S.Attendant) { - V.i = V.slaveIndices[V.AttendantID]; - r.push(` /* apply following SA passages to facility leader */`); + const slave = S.Attendant; + /* apply following SA passages to facility leader */ if (V.showEWD !== 0) { - <br><br> - /* 000-250-006 */ + const attendantEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); if (V.seeImages && V.seeReportImages) { - <div class="imageRef smlImg"> - r.push(`${V.SlaveArt(${S.Attendant}}, 0, 0)`); - </div> + App.UI.DOM.appendNewElement("div", attendantEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); } - /* 000-250-006 */ - <<includeDOM App.EndWeek.favoriteIcon(S.Attendant)>> - <span class='slave-name'> - V.SlaveFullName(S.Attendant)</span> is serving as the Attendant in V.spaName. - <br> - r.push(`${V.App.SlaveAssignment.choosesOwnClothes(${S.Attendant)}}`); - tired(S.Attendant); - <<includeDOM App.SlaveAssignment.rules(S.Attendant)>> - r.push(`${V.App.SlaveAssignment.diet(${S.Attendant)}}`); - <<includeDOM App.SlaveAssignment.longTermEffects(S.Attendant)>> - r.push(`${V.App.SlaveAssignment.drugs(${S.Attendant)}}`); - r.push(`${V.App.SlaveAssignment.relationships(${S.Attendant)}}`); - r.push(`${V.App.SlaveAssignment.rivalries(${S.Attendant)}}`); - <br> - V.App.SlaveAssignment.devotion(S.Attendant) + attendantEntry.append(App.EndWeek.favoriteIcon(slave), " "); + App.Events.addNode( + attendantEntry, + [ + App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"), + `is serving as the Attendant in ${V.spaName}`, + App.SlaveAssignment.standardSlaveReport(slave, false), + ] + ); } else { - App.SlaveAssignment.choosesOwnClothes(S.Attendant); - tired(S.Attendant); - App.SlaveAssignment.rules(); - App.SlaveAssignment.diet(S.Attendant); - App.SlaveAssignment.longTermEffects(S.Attendant); - App.SlaveAssignment.drugs(S.Attendant); - App.SlaveAssignment.relationships(S.Attendant); - App.SlaveAssignment.rivalries(S.Attendant); - App.SlaveAssignment.devotion(S.Attendant); + App.SlaveAssignment.standardSlaveReport(slave, true); } } - <<for _slave range _slaves>> - V.i = V.slaveIndices[_slave.ID]; - <<setLocalPronouns _slave>> + for (const _slave of _slaves) { + const { } + const { + He, His, + he, his, him, himself, wife + } = getPronouns(_slave); _slave.devotion += _devBonus, _slave.trust += _trustBonus; improveCondition(_slave, 5 + _healthBonus); if (_slave.health.condition < -80) { @@ -311,10 +283,10 @@ App.EndWeek.dairyReport = function() { } else if (_slave.health.condition < 0) { improveCondition(_slave, 5); } - if (V.spaUpgrade === 1) && (_slave.health.condition < 100) { + if (V.spaUpgrade === 1 && _slave.health.condition < 100) { improveCondition(_slave, normalRandInt(8)); } - if (_slave.devotion < 60) && (_slave.trust < 60) { + if (_slave.devotion < 60 && _slave.trust < 60) { _slave.devotion++, _slave.trust++; } else if ((_slave.trust < 40)) { _slave.trust += 10; @@ -322,117 +294,103 @@ App.EndWeek.dairyReport = function() { _slave.devotion += 10; } switch (V.spaDecoration) { - case "Chattel Religionist" "Chinese Revivalist": - _slave.rules.living = "normal"; - case "Degradationist": - _slave.rules.living = "spare"; - default: - _slave.rules.living = "luxurious"; + case "Chattel Religionist": + case "Chinese Revivalist": + _slave.rules.living = "normal"; + case "Degradationist": + _slave.rules.living = "spare"; + default: + _slave.rules.living = "luxurious"; } - if (_slave.health.condition >= 20) && (_slave.health.tired <= 30) && (_slave.trust > 60) && (_slave.devotion > 60) && (_slave.fetish !== "mindbroken") && (_slave.sexualFlaw === "none") && (_slave.behavioralFlaw === "none") { - <p> - <span class="slave-name">_slave.slaveName</span> is feeling well enough to leave V.spaName, - <span class="noteworthy"> - if (V.assignmentRecords[_slave.ID]) { - _oldJob = V.assignmentRecords[_slave.ID]; - r.push(`${V.assignJobSafely(_slave},${ _oldJob)}`); - if (_slave.choosesOwnAssignment === 1) { - r.push(`and ${he} is resting before choosing another task.`); - } else if (_slave.assignment === "rest") { - if (_oldJob !== "rest") { - r.push(`and since ${he} was unable to return to ${his} old task to `); - V._oldJob - r.push(`, ${his} assignment has defaulted to rest.`); - } else { - r.push(`so ${he} has returned to rest.`); - } - } else { - r.push(`so ${he} goes back to `); - V._slave.assignment - r.push(`.`); - } + if (_slave.health.condition >= 20 && _slave.health.tired <= 30 && _slave.trust > 60 && _slave.devotion > 60 && _slave.fetish !== "mindbroken" && _slave.sexualFlaw === "none" && _slave.behavioralFlaw === "none") { + //<p> + r.push(`<span class="slave-name">${_slave.slaveName}</span> is feeling well enough to leave ${V.spaName},`); + //<span class="noteworthy"> + if (V.assignmentRecords[_slave.ID]) { + const _oldJob = V.assignmentRecords[_slave.ID]; + assignJobSafely(_slave, _oldJob); + if (_slave.choosesOwnAssignment === 1) { + r.push(`and ${he} is resting before choosing another task.`); + } else if (_slave.assignment === "rest") { + if (_oldJob !== "rest") { + r.push(`and since ${he} was unable to return to ${his} old task to ${_oldJob}, ${his} assignment has defaulted to rest.`); } else { - r.push(`so ${his} assignment has defaulted to rest.`); - r.push(`${V.removeJob(_slave}, "rest in the spa")`); + r.push(`so ${he} has returned to rest.`); } - </span> - </p> + } else { + r.push(`so ${he} goes back to ${_slave.assignment}.`); + } + } else { + r.push(`so ${his} assignment has defaulted to rest.`); + removeJob(_slave, "rest in the spa"); + } + //</span> + //</p> _restedSlaves++, _DL--, _dI--; - <<continue>> + continue; } + + + + + if (V.showEWD !== 0) { - <br><br> - /* 000-250-006 */ + const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); if (V.seeImages && V.seeReportImages) { - <div class="imageRef smlImg"> - r.push(`${V.SlaveArt(_slave}, 0, 0)`); - </div> + App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); } - /* 000-250-006 */ - <<includeDOM App.EndWeek.favoriteIcon(_slave)>> - <span class='slave-name'> - V.SlaveFullName(_slave)</span> - if (_slave.choosesOwnAssignment === 2) { - r.push(`${V.App.SlaveAssignment.choosesOwnJob(_slave)}`); + slaveEntry.append(App.EndWeek.favoriteIcon(slave), " "); + r = []; + r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); + if (slave.choosesOwnAssignment === 2) { + r.push(App.SlaveAssignment.choosesOwnJob(slave)); } else { r.push(`is resting in ${V.spaName}.`); } - <br> ${He} - V.App.SlaveAssignment.rest(_slave) + App.Events.addNode(slaveEntry, r, "div"); + + const { He } = getPronouns(slave); + r = [ + He, + App.SlaveAssignment.rest(_slave) + ] + if (_slave.fetish === "mindbroken") { r.push(`${He} remains in the Spa, completely mindbroken.`); - <<elseif(_slave.sexualFlaw !== "none") || (_slave.behavioralFlaw !== "none")>> + } else if (_slave.sexualFlaw !== "none" || _slave.behavioralFlaw !== "none") { r.push(`${He} remains in the Spa, stubborn in ${his} flaw.`); - } else if ((_slave.trust < 60) || (_slave.devotion < 60)) { + } else if (_slave.trust < 60 || _slave.devotion < 60) { r.push(`${He} remains in the Spa, as ${he} is still learning to accept life as a slave.`); - } else if ((_slave.health.condition < 20)) { + } else if (_slave.health.condition < 20) { r.push(`${He} remains in the Spa, as ${he} is benefiting from its healing properties.`); - } else if ((_slave.health.tired > 30)) { + } else if (_slave.health.tired > 30) { r.push(`${He} remains in the Spa, continuing to soak away ${his} fatigue.`); } - <br> - r.push(`${V.App.SlaveAssignment.choosesOwnClothes(_slave)}`); - <<includeDOM App.SlaveAssignment.rules(_slave)>> - r.push(`${V.App.SlaveAssignment.diet(_slave)}`); - <<includeDOM App.SlaveAssignment.longTermEffects(_slave)>> - r.push(`${V.App.SlaveAssignment.drugs(_slave)}`); - r.push(`${V.App.SlaveAssignment.relationships(_slave)}`); - r.push(`${V.App.SlaveAssignment.rivalries(_slave)}`); - <br> - V.App.SlaveAssignment.devotion(_slave) + r.push(App.SlaveAssignment.standardSlaveReport(slave, false)) + App.Events.addNode(slaveEntry, r, "div", "indent"); } else { - App.SlaveAssignment.choosesOwnJob(_slave); - App.SlaveAssignment.choosesOwnClothes(_slave); - App.SlaveAssignment.rest(_slave); - App.SlaveAssignment.rules(_slave); - App.SlaveAssignment.diet(_slave); - App.SlaveAssignment.longTermEffects(_slave); - App.SlaveAssignment.drugs(_slave); - App.SlaveAssignment.relationships(_slave); - App.SlaveAssignment.rivalries(_slave); - App.SlaveAssignment.devotion(_slave); + // discard return values silently + App.SlaveAssignment.choosesOwnJob(slave); + App.SlaveAssignment.standardSlaveReport(slave, true); } - <</for>> + } if (_restedSlaves > 0) { - <br><br> + //<br><br> if (_restedSlaves === 1) { + //TODO: fix pronoun r.push(`One slave has rested until ${he} reached a state of <span class="hotpink">devotion</span> and <span class="mediumaquamarine">trust</span> and will leave the spa before the end of the week.`); } else { - _restedSlaves slaves have rested until they reached a state of <span class="hotpink">devotion</span> and <span class="mediumaquamarine">trust</span> and will leave the spa before the end of the week. + r.push(`${_restedSlaves} slaves have rested until they reached a state of <span class="hotpink">devotion</span> and <span class="mediumaquamarine">trust</span> and will leave the spa before the end of the week.`); } if (V.spaDecoration !== "standard") { - <br><br> - V.capFirstChar(V.spaName)'s V.spaDecoration atmosphere <span class="hotpink">had an impact on - if (_restedSlaves === 1) { - r.push(`${him} while ${he} was`); - } else { - r.push(`them while they were`); - } - r.push(`</span> resting.`); + //<br><br> + r.push(`${capFirstChar(V.spaName)}'s ${V.spaDecoration} atmosphere <span class="hotpink">had an impact on`); + if (_restedSlaves === 1) { + r.push(`${him} while ${he} was`); + } else { + r.push(`them while they were`); + } + r.push(`</span> resting.`); } } - if (_DL > 0 || S.Attendant) { - <br><br> - } - }; - \ No newline at end of file +};