From 2b69e823969740bccb6a7ac58201767c66061d59 Mon Sep 17 00:00:00 2001 From: DCoded <dsoloha@live.com> Date: Sun, 30 Jun 2019 02:01:57 -0400 Subject: [PATCH] Somewhat fixed things, got child report to work --- src/facilities/nursery/childrenReport.tw | 2 +- src/facilities/nursery/nurseryWidgets.js | 83 +++++++++++++-------- src/uncategorized/slaveAssignmentsReport.tw | 2 +- 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/src/facilities/nursery/childrenReport.tw b/src/facilities/nursery/childrenReport.tw index ad6a9f11f99..3f3d82eda13 100644 --- a/src/facilities/nursery/childrenReport.tw +++ b/src/facilities/nursery/childrenReport.tw @@ -1,3 +1,3 @@ :: Children Report [nobr] -<<run App.Facilities.Nursery.childrenReport>> \ No newline at end of file +<<print App.Facilities.Nursery.childrenReport()>> \ No newline at end of file diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js index 5117ab2a3d3..dbd4ce30973 100644 --- a/src/facilities/nursery/nurseryWidgets.js +++ b/src/facilities/nursery/nurseryWidgets.js @@ -16457,10 +16457,23 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { for (let i = 0; i < V.cribs.length; i++) { const - child = V.cribs[i], - { - he, him, his, He, His - } = getPronouns(child); + child = V.cribs[i]; + // { + // he, him, his, He, His + // } = getPronouns(child); + + let + he, + him, + his, + He, + His; + + // FIXME: extremely dirty fix for broken pronouns + child.genes === "XX" ? he = 'she' : he = 'he'; + child.genes === "XX" ? him = 'her' : him = 'him'; + child.genes === "XX" ? his = "her" : his = 'his'; + He = capFirstChar(he), His = capFirstChar(his); child.birthWeek++; @@ -16473,7 +16486,7 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { if (child.growTime > 0) { child.growTime--; - r += `<br><span class="pink">${child.slaveName}</span> is growing steadily. ${He} ${child.growTime <= 0 ? `is <span class="lime">ready for release.</span> ${He} will be ejected from ${his} crib upon your approach` : `will be ready for release in about ${child.growTime} weeks`}. `; + r += `<br><span class="pink">${child.slaveName}</span> is growing steadily. ${He} will be ready for release in about ${child.growTime} weeks. `; } else { r += `<span class="pink">${child.slaveName}</span> is <span class="lime">ready for release.</span> ${He} will be removed from ${V.nurseryName} upon your approach.`; } @@ -16535,6 +16548,7 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { } } r += `<br>`; + return r; }; @@ -16714,6 +16728,8 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { const slave = getSlave(V.NurseryiIDs[dI]); + V.i = App.Utils.slaveIndexForId(slave.ID); + slave.devotion += devBonus, slave.trust += trustBonus, slave.health += healthBonus; // TODO: rework these @@ -16756,14 +16772,13 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { /* 000-250-006 */ r += `<strong><u><span class="pink">${SlaveFullName(slave)}</span></u></strong>`; if (slave.choosesOwnAssignment === 2) { - r += `<<include "SA chooses own job">>`; // TODO: + r += `${choosesOwnJob(slave)}`; } else { r += ` is working in ${V.nurseryName}. `; } // TODO: clean this mess up r += `<br> ${He} ${saNanny(slave)}<br> `; - r += `${saChoosesOwnClothes(slave)}`; - r += `${saRules(slave)}`; + r += `${saChoosesOwnClothes(slave)} ${saRules(slave)}`; r += `<<include "SA diet">>`; // TODO: r += `<<include "SA long term effects">>`; // TODO: r += `<<include "SA drugs">>`; // TODO: @@ -16771,10 +16786,8 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { r += `<<include "SA rivalries">>`; // TODO: r += `<br><<include "SA devotion">>`; // TODO: } else { - r += `<<silently>><<include "SA chooses own job">>`; - r += `${saNanny(slave)}`; - r += `${saChoosesOwnClothes(slave)}`; - r += `${saRules(slave)}`; + r += `<<silently>>`; + r += `${choosesOwnJob(slave)} ${saNanny(slave)} ${saChoosesOwnClothes(slave)} ${saRules(slave)}`; r += `<<include "SA diet">>`; r += `<<include "SA long term effects">>`; r += `<<include "SA drugs">>`; @@ -16801,35 +16814,41 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { return r; } - function longTermEffects(slave) { - let r = ``; + // function diet(slave) { + // let r = ``; - return r; - } + // return r; + // } - function drugs(slave) { - let r = ``; + // function longTermEffects(slave) { + // let r = ``; - return r; - } + // return r; + // } - function relationships(slave) { - let r = ``; + // function drugs(slave) { + // let r = ``; - return r; - } + // return r; + // } - function rivalries(slave) { - let r = ``; + // function relationships(slave) { + // let r = ``; - return r; - } + // return r; + // } - function devotion(slave) { - let r = ``; + // function rivalries(slave) { + // let r = ``; - return r; - } + // return r; + // } + + // function devotion(slave) { + // let r = ``; + + // return r; + // } return r; }; diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw index c64459476dd..5d5fcd69924 100644 --- a/src/uncategorized/slaveAssignmentsReport.tw +++ b/src/uncategorized/slaveAssignmentsReport.tw @@ -739,7 +739,7 @@ $NPCMarketShareLC = Math.trunc(($NPCSexSupply.lowerClass * 1000) / ($NPCSexSuppl ["Spa Report", $spaNameCaps, $spa, $spaSlaves, $Attendant, "Attendant"], ["Nursery Report", $nurseryNameCaps, $nurseryNannies, $nurserySlaves, $Matron, "Matron"], ["Servants' Quarters Report", $servantsQuartersNameCaps, $servantsQuarters, $servantsQuartersSlaves, $Stewardess, "Stewardess"], - ["Children Report", "Children Report", $nurseryCribs, $nurseryBabies, -1, -1], + ["Children Report", "Nursery Children", $nursery, $nurseryBabies, -1, -1], ["Incubator Report", $incubatorNameCaps, $incubator, $incubatorSlaves, -1, -1], ["Master Suite Report", $masterSuiteNameCaps, $masterSuite, $masterSuiteSlaves, $Concubine, "Concubine"], ["Penthouse Report", "The Penthouse", 1, $slavesVisible, -1, -1], -- GitLab