diff --git a/devTools/types/FC/gameState.d.ts b/devTools/types/FC/gameState.d.ts index 8ecaf5d2105d79386e780e376e5ce0ee20658de7..d5217a28ac6b0dd06739a5385c22e093d0afdbe3 100644 --- a/devTools/types/FC/gameState.d.ts +++ b/devTools/types/FC/gameState.d.ts @@ -92,6 +92,8 @@ declare namespace FC { milkmaidHealthBonus?: number; activeSlave: Zeroable<SlaveState>; + readySlave: Zeroable<SlaveState>; + newSlavePool: Array<FC.SlaveState> event?: InstanceType<typeof App.Events.BaseEvent>; AS: number; seed?: string; diff --git a/src/endWeek/reports/brothelReport.js b/src/endWeek/reports/brothelReport.js index 28fb980af2271acff5bbe1629ab9641b6c8d74d0..3713800278ac40aa075f885cb00d3eac16edd938 100644 --- a/src/endWeek/reports/brothelReport.js +++ b/src/endWeek/reports/brothelReport.js @@ -61,9 +61,9 @@ App.EndWeek.brothelReport = function() { const { he, him, his, himself, He, His, wife } = getPronouns(S.Madam); - /* apply following SA passages to facility leader */ r = []; + r.push(`${SlaveFullName(S.Madam)} is serving as the madam.`); if (S.Madam.relationship === -3 && S.Madam.devotion > 50) { r.push(`As your loving ${wife}, ${he} does ${his} best to attract attention to your brothel.`); } @@ -119,7 +119,7 @@ App.EndWeek.brothelReport = function() { } = getPronouns(slave).appendSuffix('2'); if (S.Madam.rivalryTarget === slave.ID) { - r.push(`${He} forces ${his} ${rivalryTerm(S.Madam)}, to service all the men in the brothel.`); + r.push(`${He} forces ${his} ${rivalryTerm(S.Madam)}, ${slave.slaveName}, to service all the men in the brothel.`); slave.devotion -= 2; slave.trust -= 2; if (canDoVaginal(slave)) { diff --git a/src/facilities/arcade/arcade.js b/src/facilities/arcade/arcade.js index f2995b95522f953ce95147d34cf1780d65742916..6972a1bc1d2fa4038d97929c3f9035a401459e63 100644 --- a/src/facilities/arcade/arcade.js +++ b/src/facilities/arcade/arcade.js @@ -76,11 +76,13 @@ App.Facilities.Arcade.arcade = class Arcade extends App.Facilities.Facility { "standard": `is a standard Free Cities sex arcade: a pair of hallways extend away from the entrance, lined with doorless stalls like those in a public restroom. One hallway offers mouths, the other ${V.seeDicks !== 100 ? `vaginas and ` : ``}anuses.`, }; - if (!Object.keys(FS).includes(V.arcadeDecoration)) { + const res = FS[V.arcadeDecoration]; + + if (!res) { throw new Error(`Unknown V.arcadeDecoration value of '${V.arcadeDecoration}' found in decorations().`); } - return FS[V.arcadeDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/brothel/brothel.js b/src/facilities/brothel/brothel.js index 9f43b5bb2bf6e9444dce6b5197d91625cb8f62e4..edd77423508ef2a2af287bb9d80186e663c5d481 100644 --- a/src/facilities/brothel/brothel.js +++ b/src/facilities/brothel/brothel.js @@ -65,11 +65,13 @@ App.Facilities.Brothel.brothel = class Brothel extends App.Facilities.Facility { "standard": `is utilitarian. There's a businesslike foyer with an area for the merchandise to stand. Customers make their selection (or selections) and then lead the whores back into little rooms.`, }; - if (!Object.keys(FS).includes(V.brothelDecoration)) { + const res = FS[V.brothelDecoration]; + + if (!res) { throw new Error(`Unknown V.brothelDecoration value of '${V.brothelDecoration}' found in decorations().`); } - return FS[V.brothelDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/cellblock/cellblock.js b/src/facilities/cellblock/cellblock.js index 7d0d2496189b120f6839860d74abc9538986dee0..3b8c73690cbfa46f2e63a3b07c0f9152ca9c024f 100644 --- a/src/facilities/cellblock/cellblock.js +++ b/src/facilities/cellblock/cellblock.js @@ -72,11 +72,13 @@ App.Facilities.Cellblock.cellblock = class Cellblock extends App.Facilities.Faci "standard": `could be mistaken for a modern prison. A close inspection, however, reveals restraints in each cell that will hold inmates in sexually compromising positions, and compliance systems to force them to place their wrists and ankles in them.`, }; - if (!Object.keys(FS).includes(V.cellblockDecoration)) { + const res = FS[V.cellblockDecoration]; + + if (!res) { throw new Error(`Unknown V.cellblockDecoration value of '${V.cellblockDecoration}' found in decorations().`); } - return FS[V.cellblockDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/clinic/clinic.js b/src/facilities/clinic/clinic.js index 7f12356a1798de393883326d0596339f39e2041e..4383df66037fe547846823471ea98032cccbdd0c 100644 --- a/src/facilities/clinic/clinic.js +++ b/src/facilities/clinic/clinic.js @@ -77,11 +77,13 @@ App.Facilities.Clinic.clinic = class Clinic extends App.Facilities.Facility { "standard": `is a well-equipped modern medical facility. Each patient has their own area, with heavy automation to provide them treatment without any human intervention at all.`, }; - if (!Object.keys(FS).includes(V.clinicDecoration)) { + const res = FS[V.clinicDecoration]; + + if (!res) { throw new Error(`Unknown V.clinicDecoration value of '${V.clinicDecoration}' found in decorations().`); } - return FS[V.clinicDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/club/club.js b/src/facilities/club/club.js index 029ec9bdab181455f6aafa92347e46541c29dfd6..1687f646ada61e01e965a19bb696ebe480ac361c 100644 --- a/src/facilities/club/club.js +++ b/src/facilities/club/club.js @@ -196,7 +196,7 @@ App.Facilities.Club.club = class Club extends App.Facilities.Facility { text.push(`The faint sound of a slave giving head can be heard from one of the private rooms.`); break; case "Statuesque Glorification": - text.push(`The faint banging of a patron banging a slave against the wall can be heard echoing from one of the private rooms.`); + text.push(`The faint thumping of a patron banging a slave against the wall can be heard echoing from one of the private rooms.`); break; default: text.push(`The faint but unmistakable sound of a shrill climax can be heard from one of the private rooms.`); @@ -243,11 +243,13 @@ App.Facilities.Club.club = class Club extends App.Facilities.Facility { "standard": `is set up in an uncomplicated way. There's a bar for drinks, a dance floor for slave girls, and private rooms for slave sex.`, }; - if (!Object.keys(FS).includes(V.clubDecoration)) { + const res = FS[V.clubDecoration]; + + if (!res) { throw new Error(`Unknown V.clubDecoration value of '${V.clubDecoration}' found in decorations().`); } - return FS[V.clubDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/facilityRetrievalWorkaround.js b/src/facilities/facilityRetrievalWorkaround.js index 7045820a7f14d1632d33f145e163fb631ad570d7..864638388abd43dd3485abac205ebe5804441876 100644 --- a/src/facilities/facilityRetrievalWorkaround.js +++ b/src/facilities/facilityRetrievalWorkaround.js @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Currently setup for the Incubator and Nursery * @param {string} facility @@ -72,6 +71,10 @@ App.UI.facilityRetrievalWorkaround = function(facility) { } } + /** + * @param {FC.SlaveState} slave + * @param {"father"|"mother"} type + */ function parent(slave, type) { const r = new DocumentFragment(); const missingTableEntry = V.missingTable[slave[type]]; diff --git a/src/facilities/farmyard/farmyard.js b/src/facilities/farmyard/farmyard.js index 21a603315a015a11759f1fa13747111bfe8f6678..287f1df6ef37e3f339ad928299d6195a8117e389 100644 --- a/src/facilities/farmyard/farmyard.js +++ b/src/facilities/farmyard/farmyard.js @@ -115,11 +115,13 @@ App.Facilities.Farmyard.farmyard = class Farmyard extends App.Facilities.Facilit "standard": `It is very much a converted warehouse still, sectioned off in various 'departments'${V.farmyardUpgrades.machinery ? ` with machinery placed where it can be` : V.farmyardUpgrades.hydroponics ? ` and plumbing for the hydroponics system running every which way` : ``}.`, }; - if (!Object.keys(FS).includes(V.farmyardDecoration)) { + const res = FS[V.farmyardDecoration]; + + if (!res) { throw new Error(`Unknown V.farmyardDecoration value of '${V.farmyardDecoration}' found in decorations().`); } - return FS[V.farmyardDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/incubator/incubatorInteract.js b/src/facilities/incubator/incubatorInteract.js index 9cbff5f8aaf197535c9c70364e826bfd4242a445..967c764ed41d8fa267e1c3f37768477b66baea47 100644 --- a/src/facilities/incubator/incubatorInteract.js +++ b/src/facilities/incubator/incubatorInteract.js @@ -1,4 +1,3 @@ -// @ts-nocheck App.UI.incubator = function() { V.nextButton = "Back to Main"; V.nextLink = "Main"; @@ -13,10 +12,10 @@ App.UI.incubator = function() { const introDiv = App.UI.DOM.appendNewElement("div", el, intro()); - const showPC = (V.PC.pregKnown === 1 - && (V.arcologies[0].FSRestart === "unset" - || V.eugenicsFullControl === 1 - || (V.PC.pregSource !== -1 && V.PC.pregSource !== -6) + const showPC = (V.PC.pregKnown === 1 && + (V.arcologies[0].FSRestart === "unset" || + V.eugenicsFullControl === 1 || + (V.PC.pregSource !== -1 && V.PC.pregSource !== -6) )); const mothersContent = App.UI.DOM.makeElement('span', mothers()); const pcContent = App.UI.DOM.makeElement('span', PC()); @@ -1030,7 +1029,6 @@ App.UI.incubator = function() { function tankSettings() { const el = new DocumentFragment(); - let cost; let p; let r = []; let row; @@ -1119,7 +1117,7 @@ App.UI.incubator = function() { if (V.incubator.upgrade.speed === 52) { row.append(`It has been upgraded with perfected growth accelerants; children grow at the rate of 1 week to 1 year.`); } else if (V.incubator.upgrade.speed === 18) { - cost = Math.trunc(500000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(500000 * V.upgradeMultiplierArcology); row.append(`It has been upgraded with advanced experimental growth accelerants; children grow at the rate of 3 weeks to 1 year. `); row.append( choice( @@ -1134,7 +1132,7 @@ App.UI.incubator = function() { ) ); } else if (V.incubator.upgrade.speed === 9) { - cost = Math.trunc(75000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(75000 * V.upgradeMultiplierArcology); row.append(`It has been upgraded with advanced growth accelerants; children grow at the rate of 6 weeks to 1 year. `); row.append( choice( @@ -1149,7 +1147,7 @@ App.UI.incubator = function() { ) ); } else if (V.incubator.upgrade.speed === 6) { - cost = Math.trunc(30000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(30000 * V.upgradeMultiplierArcology); row.append(`It has been upgraded with growth accelerants; children grow at the rate of 9 weeks to 1 year. `); row.append( choice( @@ -1164,7 +1162,7 @@ App.UI.incubator = function() { ) ); } else if (V.incubator.upgrade.speed === 5) { - cost = Math.trunc(30000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(30000 * V.upgradeMultiplierArcology); row.append(`The incubation tanks are basic; children grow at the rate of 12 weeks to 1 year. `); row.append( choice( @@ -1208,7 +1206,7 @@ App.UI.incubator = function() { } row.append(App.UI.DOM.generateLinksStrip(linkArray)); } else { - cost = Math.trunc(20000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(20000 * V.upgradeMultiplierArcology); row.append(`There are no systems in place to control a growing child's weight; they will likely come out emaciated from the rapid growth. `); row.append( choice( @@ -1255,7 +1253,7 @@ App.UI.incubator = function() { row.append(App.UI.DOM.generateLinksStrip(linkArray)); } else { - cost = Math.trunc(20000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(20000 * V.upgradeMultiplierArcology); row.append(`There are no systems in place to control a growing child's musculature; they will likely come out frail and weak from the rapid growth. `); row.append( choice( @@ -1371,7 +1369,7 @@ App.UI.incubator = function() { p.append(row); el.append(p); } else { - cost = Math.trunc(50000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(50000 * V.upgradeMultiplierArcology); row.append(`There are no systems in place to control a growing child's reproductive capability. `); row.append( choice( @@ -1395,7 +1393,7 @@ App.UI.incubator = function() { if (V.incubator.upgrade.organs === 1) { row.append(`Surgical tools have been added to the tank to be able to extract tissue samples from the occupant.`); } else if (V.organFarmUpgrade >= 1) { - cost = Math.trunc(10000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(10000 * V.upgradeMultiplierArcology); row.append(`The tanks lack the ability to extract tissue samples to be used by the organ fabricator. `); row.append( choice( @@ -1441,7 +1439,7 @@ App.UI.incubator = function() { } row.append(App.UI.DOM.generateLinksStrip(linkArray)); } else if (V.growthStim === 1) { - cost = Math.trunc(20000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(20000 * V.upgradeMultiplierArcology); row.append(`There are no systems in place to control a growing child's height. `); row.append( choice( @@ -1484,7 +1482,7 @@ App.UI.incubator = function() { } else if (V.incubator.upgrade.growthStims < 1) { row.append(`${incubatorNameCaps} lacks advanced monitoring and stimulant injection systems. Construction not possible.`); } else { - cost = Math.trunc(2000000 * V.upgradeMultiplierArcology); + const cost = Math.trunc(2000000 * V.upgradeMultiplierArcology); row.append( choice( `Manufacture and install this subsystem`, diff --git a/src/facilities/masterSuite/masterSuite.js b/src/facilities/masterSuite/masterSuite.js index 9fc731150b3ee96cf3e4c62ffea35f343d37d4e8..dd8414dc6ca76765be0c5d377fc294a42502b7b9 100644 --- a/src/facilities/masterSuite/masterSuite.js +++ b/src/facilities/masterSuite/masterSuite.js @@ -238,11 +238,13 @@ App.Facilities.MasterSuite.masterSuite = class MasterSuite extends App.Facilitie }; } - if (!Object.keys(FS).includes(V.masterSuiteDecoration)) { + const res = FS[V.masterSuiteDecoration]; + + if (!res) { throw new Error(`Unknown V.masterSuiteDecoration value of '${V.masterSuiteDecoration}' found in decorations().`); } - return FS[V.masterSuiteDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/pit/pit.js b/src/facilities/pit/pit.js index 7b934982aa4d23a3d4f190904bd5a5fda17cdfc4..2aff80a9521f30eaad8e07b676c8b605b62a2e61 100644 --- a/src/facilities/pit/pit.js +++ b/src/facilities/pit/pit.js @@ -185,9 +185,9 @@ App.Facilities.Pit.pit = class Pit extends App.Facilities.Facility { link: `Random`, value: 'random', prereqs: [ - () => (!!V.active.canine && !!V.active.hooved) - || (!!V.active.canine && !!V.active.feline) - || (!!V.active.hooved && !!V.active.feline) + () => (!!V.active.canine && !!V.active.hooved) || + (!!V.active.canine && !!V.active.feline) || + (!!V.active.hooved && !!V.active.feline) ], }, ], diff --git a/src/facilities/schoolroom/schoolroom.js b/src/facilities/schoolroom/schoolroom.js index f3828222be795d5841849c4273bb0163a848db89..c45e8183787eee36a68f60bd79d69ed80c37d2e5 100644 --- a/src/facilities/schoolroom/schoolroom.js +++ b/src/facilities/schoolroom/schoolroom.js @@ -75,11 +75,13 @@ App.Facilities.Schoolroom.schoolroom = class Schoolroom extends App.Facilities.F "standard": `reviewing the often complex subject of how to address citizens other that one's owner.`, }; - if (!Object.keys(FS).includes(V.schoolroomDecoration)) { + const res = FS[V.schoolroomDecoration]; + + if (!res) { throw new Error(`Unknown V.schoolroomDecoration value of '${V.schoolroomDecoration}' found in decorations().`); } - return FS[V.schoolroomDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/servantsQuarters/servantsQuarters.js b/src/facilities/servantsQuarters/servantsQuarters.js index 872c79b0b307278b359ab9bc609109b78e89093c..68b4736d795aaa298ce1049c78c100807b41aa4c 100644 --- a/src/facilities/servantsQuarters/servantsQuarters.js +++ b/src/facilities/servantsQuarters/servantsQuarters.js @@ -72,11 +72,13 @@ App.Facilities.ServantsQuarters.servantsQuarters = class ServantsQuarters extend "standard": `are comfortable. Servants sleep together in a dormitory, eat together in a little kitchen, bathe together in a communal shower, and then head out into the penthouse to serve.`, }; - if (!Object.keys(FS).includes(V.servantsQuartersDecoration)) { + const res = FS[V.servantsQuartersDecoration]; + + if (!res) { throw new Error(`Unknown V.servantsQuartersDecoration value of '${V.servantsQuartersDecoration}' found in decorations().`); } - return FS[V.servantsQuartersDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */ diff --git a/src/facilities/spa/spa.js b/src/facilities/spa/spa.js index 3add926756fcef5a91fc5cb91deb3a45bc7b98bf..f337101287356fcaf692ff42081dd3e7b3227ed5 100644 --- a/src/facilities/spa/spa.js +++ b/src/facilities/spa/spa.js @@ -78,11 +78,13 @@ App.Facilities.Spa.spa = class Spa extends App.Facilities.Facility { "standard": `is well-appointed, with massage tables, hot tubs, and a cold pool.`, }; - if (!Object.keys(FS).includes(V.spaDecoration)) { + const res = FS[V.spaDecoration]; + + if (!res) { throw new Error(`Unknown V.spaDecoration value of '${V.spaDecoration}' found in decorations().`); } - return FS[V.spaDecoration]; + return res; } /** @returns {FC.Facilities.Expand} */