diff --git a/devTools/types/FC/desc.d.ts b/devTools/types/FC/desc.d.ts index f6c660b3e9d1e8661ac847cdc492f2d2f60f48e5..d3b8667c1dbbea53657f81556ab3270877cfaf86 100644 --- a/devTools/types/FC/desc.d.ts +++ b/devTools/types/FC/desc.d.ts @@ -5,7 +5,7 @@ declare namespace FC { * 0 if the slave is not for sale. Otherwise a string with the name of the market, * partially to determine if laws apply to the market or not. */ - market?: Zeroable<string>; + market?: Zeroable<SlaveMarketName>; eventDescription?: boolean; prisonCrime?: string; noArt?: boolean; diff --git a/devTools/types/FC/gameState.d.ts b/devTools/types/FC/gameState.d.ts index 4cbcd1c81670c5883e8e000bfd1afe575ecefa91..616d6ba916c65c30543bb6b9d669c240e9bd2e03 100644 --- a/devTools/types/FC/gameState.d.ts +++ b/devTools/types/FC/gameState.d.ts @@ -120,7 +120,7 @@ declare namespace FC { */ interface TemporaryVariablesInTheGameState { gameover?: string; - slaveMarket?: "TSS" | "GRI" | "SCP" | "LDE" | "TGA" | "HA" | "TFS" | "TCR" | "NUL" | "corporate"; + slaveMarket?: SlaveMarketName; prisonCrime?: Zeroable<string>; enunciate?: Enunciation; activeSlaveOneTimeMinAge?: number; diff --git a/devTools/types/FC/misc.d.ts b/devTools/types/FC/misc.d.ts index e1d36dbcbbf2eb73d35ce25f73eadb1f5bf6fac5..f87d71ab846ebd2010244c04967fefbf87b62644 100644 --- a/devTools/types/FC/misc.d.ts +++ b/devTools/types/FC/misc.d.ts @@ -1,9 +1,13 @@ declare namespace FC { - export type Gingering = Zeroable<"antidepressant" | "depressant" | "stimulant" | "vasoconstrictor" | "vasodilator" | "aphrodisiac" | "ginger">; - export type GingeringDetection = Zeroable<"slaver" | "mercenary" | "force">; + type SlaveSchoolName = "GRI" | "HA" | "NUL" | "SCP" | "TCR" | "TFS" | "TGA" | "TSS" | "LDE" | "TUO"; + type LawlessMarkets = "generic" | "gangs and smugglers" | "heap" | "indentures" | "low tier criminals" | "military prison" | "neighbor" | + "wetware" | "white collar" | SlaveSchoolName; + type SlaveMarketName = LawlessMarkets | "corporate"; + type Gingering = Zeroable<"antidepressant" | "depressant" | "stimulant" | "vasoconstrictor" | "vasodilator" | "aphrodisiac" | "ginger">; + type GingeringDetection = Zeroable<"slaver" | "mercenary" | "force">; - export namespace SlaveSummary { - export interface SmartPiercing { + namespace SlaveSummary { + interface SmartPiercing { setting: { off: string, submissive: string, diff --git a/devTools/types/SugarCubeExtensions.d.ts b/devTools/types/SugarCubeExtensions.d.ts index 9c8d0bafddfc6021a42efc0975c3934c2f11d518..56e7b3adb81e5d7ad8f17ad1479d97bae03ff832 100644 --- a/devTools/types/SugarCubeExtensions.d.ts +++ b/devTools/types/SugarCubeExtensions.d.ts @@ -98,7 +98,9 @@ declare module "twine-sugarcube" { youngCareers: string[]; fakeBellies: string[]; + filterRaces: string[]; filterRacesLowercase: FC.Race[]; + filterRegions: string[]; heightBoostingShoes: string[]; highHeels: string[]; humiliatingClothes: string[]; diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index a632beba1a2f64dcc587ad48aadc0761125d3447..b91b7c0be7f55b610331272697f8dea67fdc56a2 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -474,6 +474,7 @@ App.Data.resetOnNGPlus = { enduringDevotion: 0, /** @type {FC.RA.Rule[]} */ defaultRules: [], + /** @type {Object.<string, number[]>} */ rulesToApplyOnce: {}, REFeminizationCheckinIDs: [], @@ -1375,9 +1376,13 @@ App.Data.resetOnNGPlus = { murderAttemptWeek: 80, illegalDeals: { - military: 0, trade: 0, /* { week: number, company: string } */ + /** @type {FC.Zeroable<{week: number, company: string}>} */ + military: 0, + /** @type {FC.Zeroable<{week: number, company: string}>} */ + trade: 0, menialDrug: 0, - slave: 0 /* { type: string, company: string */ + /** @type {FC.Zeroable<{type: string, company: string}>} */ + slave: 0 }, tempEventToggle: 0, /** diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index fcbf269784fc60d33176e2567e696f655f1fb4e1..564534e390935d1a6a8509d96614c84d8dacef89 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -1949,6 +1949,27 @@ App.Data.misc = { whoringAssignments: [Job.WHORE, Job.BROTHEL, Job.PUBLIC, Job.CLUB], secExCombatPrestige: ["$He is well known for being a great commander.", "$He is famous for being an incredible commander.", "$He is known as a legendary commander all over the world."], + + schools: ["GRI", "HA", "NUL", "SCP", "TCR", "TFS", "TGA", "TSS", "LDE", "TUO"], + + bioreactorFluids: { + XX: { + femCum: 2, + milk: 800 + }, + XY: { + cum: 100, + milk: 600 + }, + herm: { + cum: 100, + femCum: 2, + milk: 600 + }, + barren: { + milk: 700 + } + } }; /* Nationalities based on $continent value. Note that $continent can be undefined! */ @@ -1968,8 +1989,6 @@ App.Data.misc.nationalityPoolSelector = { "Brazil": App.Data.misc.southAmericaNationalities }; -App.Data.misc.schools = ["GRI", "HA", "NUL", "SCP", "TCR", "TFS", "TGA", "TSS", "LDE", "TUO"]; - // these markets are exempt from law compliance App.Data.misc.lawlessMarkets = [ "generic", @@ -2149,21 +2168,3 @@ App.Data.weather = { ], }; -App.Data.misc.bioreactorFluids = { - XX: { - femCum: 2, - milk: 800 - }, - XY: { - cum: 100, - milk: 600 - }, - herm: { - cum: 100, - femCum: 2, - milk: 600 - }, - barren: { - milk: 700 - } -}; diff --git a/src/002-config/Serializable.js b/src/002-config/Serializable.js index 16ce68b8cb970d595693990ed0ebbb1a59818814..05d742450c278cd41c8fef865a09ed11985242e9 100644 --- a/src/002-config/Serializable.js +++ b/src/002-config/Serializable.js @@ -36,7 +36,7 @@ App.Entity.Serializable = class { /** * @param {object} config * @param {boolean} clean - * @returns {App.Entity.Serializable} + * @returns {this} * @protected */ _init(config, clean = false) { diff --git a/src/004-base/arcologyBuilding.js b/src/004-base/arcologyBuilding.js index 70ea4fb08bbcc9e8473a3e14d485b65832f10548..e596b090e05544c2e994854a83e02f107ab581bb 100644 --- a/src/004-base/arcologyBuilding.js +++ b/src/004-base/arcologyBuilding.js @@ -181,7 +181,7 @@ App.Arcology.Cell.BaseCell = class extends App.Entity.Serializable { /** * @returns {string|Node} - * @private + * @protected */ _setting() { return "baseCell"; @@ -189,7 +189,7 @@ App.Arcology.Cell.BaseCell = class extends App.Entity.Serializable { /** * @returns {Node} - * @private + * @protected */ _body() { return document.createDocumentFragment(); @@ -237,8 +237,9 @@ App.Arcology.Cell.BaseCell = class extends App.Entity.Serializable { // BC code } + /** @return {App.Arcology.Cell.BaseCell} */ clone() { - return (new App.Arcology.Cell.BaseCell())._init(this); + return new App.Arcology.Cell.BaseCell(this.owner)._init(this); } get className() { return "App.Arcology.Cell.BaseCell"; } diff --git a/src/Mods/SecExp/js/Unit.js b/src/Mods/SecExp/js/Unit.js index 0528619da8e62e70e9b5c7d3418b9c4b3668b213..2c9b03766eb89ebb839dcac763baf3a7ba917fc5 100644 --- a/src/Mods/SecExp/js/Unit.js +++ b/src/Mods/SecExp/js/Unit.js @@ -507,7 +507,9 @@ App.SecExp.getEdictUpgradeVal = (function() { return getNetEffect; })(); -/** @typedef {object} BaseUnit +/** + * @interface + * @typedef {object} BaseUnit * @property {number} attack * @property {number} defense * @property {number} morale diff --git a/src/arcologyBuilding/apartments.js b/src/arcologyBuilding/apartments.js index 40c8541b01ec3b93cb82b646cc9a54e18f76bfd7..03c088276cb1c4542ad7b85e90baf15faa22552e 100644 --- a/src/arcologyBuilding/apartments.js +++ b/src/arcologyBuilding/apartments.js @@ -51,7 +51,7 @@ App.Arcology.Cell.Apartment = class extends App.Arcology.Cell.BaseCell { /** * @returns {string|Node} - * @private + * @override @protected */ _setting() { let r = ""; @@ -79,7 +79,7 @@ App.Arcology.Cell.Apartment = class extends App.Arcology.Cell.BaseCell { /** * @returns {Node} - * @private + * @override @protected */ _body() { const fragment = document.createDocumentFragment(); @@ -119,6 +119,7 @@ App.Arcology.Cell.Apartment = class extends App.Arcology.Cell.BaseCell { // BC code } + /** @returns {App.Arcology.Cell.Apartment} */ clone() { return (new App.Arcology.Cell.Apartment(this.owner))._init(this); } diff --git a/src/arcologyBuilding/base.js b/src/arcologyBuilding/base.js index ad4ff6b74877c64f07a0922dbf59bf2bc68c0d01..43209901ab5b50661f696f424c921b9108f3c9ce 100644 --- a/src/arcologyBuilding/base.js +++ b/src/arcologyBuilding/base.js @@ -12,7 +12,7 @@ App.Arcology.getCellLink = function(path, message) { * Intended for use on guaranteed single hits. * * @param {App.Arcology.Building} building - * @param {ObjectConstructor} cellClass + * @param {typeof App.Arcology.Cell.BaseCell} cellClass * @param {*} cellType * @param {*} newType * @param {string} [key="type"] diff --git a/src/arcologyBuilding/decorative.js b/src/arcologyBuilding/decorative.js index 8ab1cde9b8dd30383b203fc7a71adf8b0281cd82..9bd146f3494f75b8805ab3614e36130c3241c97e 100644 --- a/src/arcologyBuilding/decorative.js +++ b/src/arcologyBuilding/decorative.js @@ -8,7 +8,7 @@ App.Arcology.Cell.Decorative = class extends App.Arcology.Cell.BaseCell { * @param {number} [params.cellHeight=0] in px, if default height is not enough to stop stuff going offscreen * @param {number} [params.absoluteWidth=0] 0/1, if width and xOffset should be read as absolute pixels */ - constructor({width, xOffset = 0, yOffset = 0, rotation = 0, cellHeight = 0, absoluteWidth = 0} = {}) { + constructor({width, xOffset = 0, yOffset = 0, rotation = 0, cellHeight = 0, absoluteWidth = 0}) { super(1); this._width = width; this._xOffset = xOffset; diff --git a/src/arcologyBuilding/manufacturing.js b/src/arcologyBuilding/manufacturing.js index 3e285e2392be96fb36e0c610c3a635ad645db876..3740265670b2020829661a47e814058f63a4c792 100644 --- a/src/arcologyBuilding/manufacturing.js +++ b/src/arcologyBuilding/manufacturing.js @@ -70,7 +70,7 @@ App.Arcology.Cell.Manufacturing = class extends App.Arcology.Cell.BaseCell { /** * @returns {string|Node} - * @private + * @protected @override */ _setting() { let r = ""; @@ -105,7 +105,7 @@ App.Arcology.Cell.Manufacturing = class extends App.Arcology.Cell.BaseCell { /** * @returns {Node} - * @private + * @protected @override */ _body() { const fragment = document.createDocumentFragment(); @@ -273,6 +273,7 @@ App.Arcology.Cell.Manufacturing = class extends App.Arcology.Cell.BaseCell { // BC code } + /** @returns {App.Arcology.Cell.Manufacturing} */ clone() { return (new App.Arcology.Cell.Manufacturing(this.owner))._init(this); } diff --git a/src/arcologyBuilding/markets.js b/src/arcologyBuilding/markets.js index 83e1cadcc7755b773adf2c0b1d190591d0839ac0..4d3caebf3da39a6a352492e0dbe317030317a98c 100644 --- a/src/arcologyBuilding/markets.js +++ b/src/arcologyBuilding/markets.js @@ -71,7 +71,7 @@ App.Arcology.Cell.Market = class extends App.Arcology.Cell.BaseCell { /** * @returns {string|Node} - * @private + * @protected @override */ _setting() { /* no need to check type, since you can only get here with the basic type */ @@ -85,7 +85,7 @@ App.Arcology.Cell.Market = class extends App.Arcology.Cell.BaseCell { /** * @returns {Node} - * @private + * @protected @override */ _body() { const fragment = document.createDocumentFragment(); @@ -148,6 +148,7 @@ App.Arcology.Cell.Market = class extends App.Arcology.Cell.BaseCell { // BC code } + /** @returns {App.Arcology.Cell.Market} */ clone() { return (new App.Arcology.Cell.Market(this.owner))._init(this); } diff --git a/src/arcologyBuilding/penthouse.js b/src/arcologyBuilding/penthouse.js index 89c3126993199518f6beb71b0535d4894a520fb7..9f810a8cf8f9f996dcc9ccfb2f191d3fb2727cc5 100644 --- a/src/arcologyBuilding/penthouse.js +++ b/src/arcologyBuilding/penthouse.js @@ -80,6 +80,7 @@ App.Arcology.Cell.Penthouse = class extends App.Arcology.Cell.BaseCell { return fragment; /** + * @param {ParentNode} outer * @returns {HTMLDivElement} */ function getWrapper(outer) { @@ -121,8 +122,9 @@ App.Arcology.Cell.Penthouse = class extends App.Arcology.Cell.BaseCell { // BC code } + /** @returns {App.Arcology.Cell.Penthouse} */ clone() { - return (new App.Arcology.Cell.Penthouse())._init(this); + return new App.Arcology.Cell.Penthouse()._init(this); } get className() { return "App.Arcology.Cell.Penthouse"; } diff --git a/src/arcologyBuilding/presets.js b/src/arcologyBuilding/presets.js index bd0f9adf9472c4c4916b3886c5400e9e9938304a..9157e8bfc5cf6fb268265fd17f12adebecd23541 100644 --- a/src/arcologyBuilding/presets.js +++ b/src/arcologyBuilding/presets.js @@ -74,7 +74,7 @@ App.Arcology.presets = (function() { }; /** - * @param {buildingTemplate} template + * @param {sectionTemplate[]} template * @returns {App.Arcology.Building} */ function templateToBuilding(template) { @@ -178,7 +178,7 @@ App.Arcology.presets = (function() { */ function addFsShop(building, fs) { function randomShop() { - return building.findCells(cell => cell instanceof App.Arcology.Cell.Shop).random(); + return /** @type {App.Arcology.Cell.Shop} */(building.findCells(cell => cell instanceof App.Arcology.Cell.Shop).random()); } switch (fs) { diff --git a/src/arcologyBuilding/shops.js b/src/arcologyBuilding/shops.js index 8428cfc67a6b6296539e7d89334b7873b2dc1776..725b030be4ae65a846a7ad4ed4c41600913f63da 100644 --- a/src/arcologyBuilding/shops.js +++ b/src/arcologyBuilding/shops.js @@ -50,7 +50,7 @@ App.Arcology.Cell.Shop = class extends App.Arcology.Cell.BaseCell { /** * @returns {DocumentFragment} - * @private + * @protected @override */ _setting() { const A = V.arcologies[0]; @@ -307,7 +307,7 @@ App.Arcology.Cell.Shop = class extends App.Arcology.Cell.BaseCell { /** * @returns {Node} - * @private + * @protected @override */ _body() { const fragment = document.createDocumentFragment(); @@ -715,6 +715,7 @@ App.Arcology.Cell.Shop = class extends App.Arcology.Cell.BaseCell { // BC code } + /** @returns {App.Arcology.Cell.Shop} */ clone() { return (new App.Arcology.Cell.Shop(this.owner))._init(this); } diff --git a/src/events/eventUtils.js b/src/events/eventUtils.js index f0c3ca72d929b1f2e85fd6bbd58de26d234e4e2a..da56dda3a448cebf229c30f51f71f2e763546619 100644 --- a/src/events/eventUtils.js +++ b/src/events/eventUtils.js @@ -145,7 +145,7 @@ App.Events.addParagraph = function(node, sentences) { /** assemble an element from an array of DOM nodes, sentences or sentence fragments (which may contain HTML) * @param {Node} node - * @param {Array<string|HTMLElement|DocumentFragment|Node>} sentences + * @param {Array<string|HTMLElement|DocumentFragment>} sentences * @param {string} [element] */ App.Events.addNode = function(node, sentences, element) { diff --git a/src/facilities/incubator/incubatorInteract.js b/src/facilities/incubator/incubatorInteract.js index 76553d603cf9c85b4a106c1d84952c517b694a7b..6bc9b4db831b7e7760bd9b105ec68f6dd2908f47 100644 --- a/src/facilities/incubator/incubatorInteract.js +++ b/src/facilities/incubator/incubatorInteract.js @@ -170,9 +170,9 @@ App.UI.incubator = function() { momEl.id = _slaveId; momEl.classList.add("possible"); - momEl.setAttribute("data-preg-count", slave.womb.length); - momEl.setAttribute("data-reserved-spots", _reservedIncubator); - momEl.setAttribute("data-preg-week", _pregWeek); + momEl.setAttribute("data-preg-count", slave.womb.length.toString()); + momEl.setAttribute("data-reserved-spots", _reservedIncubator.toString()); + momEl.setAttribute("data-preg-week", _pregWeek.toString()); momEl.setAttribute("data-name", _slaveName); linkArray = []; diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 8d8a956ee2cb007cdfe57b036380c0d2e035a721..b6ceabccf72794a7c35b2675e1112fa8f9946d19 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -1005,7 +1005,7 @@ globalThis.DefaultRules = (function() { /** * @param {App.Entity.SlaveState} slave - * @param {object} volume + * @param {number} volume */ function BellySurgery(slave, volume) { // this is a port of the belly implant portion of surgeryDegradation.tw @@ -1173,10 +1173,13 @@ globalThis.DefaultRules = (function() { return; } + /** @typedef {"lips" | "boobs" | "butt" | "dick" | "balls"} DrugTarget */ + // Asset Growth const growthDrugs = new Set(["breast injections", "breast redistributors", "butt injections", "butt redistributors", "hyper breast injections", "hyper butt injections", "hyper penis enhancement", "hyper testicle enhancement", "intensive breast injections", "intensive butt injections", "intensive penis enhancement", "intensive testicle enhancement", "lip atrophiers", "lip injections", "penis atrophiers", "penis enhancement", "testicle atrophiers", "testicle enhancement"]); // WARNING: property names in fleshFunc, growDrugs, and shrinkDrugs must be identical and this fact is used by the drugs() below + /** @type {Record<DrugTarget, (s: App.Entity.SlaveState) => number>} */ const fleshFunc = { lips: s => s.lips - s.lipsImplant, boobs: s => s.boobs - s.boobsImplant - s.boobsMilk, @@ -1185,6 +1188,7 @@ globalThis.DefaultRules = (function() { balls: s => s.balls, }; + /** @type {Record<DrugTarget, number>} */ const maxAssetSize = { lips: V.seeExtreme ? 95 : 85, boobs: 48000, @@ -1193,6 +1197,7 @@ globalThis.DefaultRules = (function() { balls: 125 }; + /** @type {Record<DrugTarget, FC.Drug>} */ const growDrugs = { lips: "lip injections", boobs: "breast injections", @@ -1228,6 +1233,7 @@ globalThis.DefaultRules = (function() { } } + /** @type {Record<DrugTarget, FC.Drug>} */ const shrinkDrugs = { lips: null, boobs: null, @@ -1252,9 +1258,9 @@ globalThis.DefaultRules = (function() { /** * @param {App.Entity.SlaveState} slave - * @param {string} asset + * @param {DrugTarget} asset * @param {FC.RA.NumericTarget} target - * @param {Array} priorities + * @param {{drug: FC.Drug, weight: number}[]} priorities * @param {number} step */ function drugs(slave, asset, target, priorities, step) { @@ -1276,6 +1282,7 @@ globalThis.DefaultRules = (function() { } } + /** @type {{drug: FC.Drug, weight: number}[]} */ let _priorities = []; drugs(slave, "boobs", rule.growth.boobs, _priorities, 200); drugs(slave, "butt", rule.growth.butt, _priorities, 1); @@ -1538,7 +1545,6 @@ globalThis.DefaultRules = (function() { * @param {App.Entity.SlaveState} slave * @param {FC.RA.RuleSetters} rule */ - function ProcessPit(slave, rule) { if (rule.pitRules !== undefined && rule.pitRules !== null) { if (V.pit) { @@ -2978,7 +2984,9 @@ globalThis.DefaultRules = (function() { r += `<br>Highlights of ${slave.slaveName}'s sex life ${yesno} being released.`; } - /** @param {App.Entity.SlaveState} slave */ + /** @param {App.Entity.SlaveState} slave + * @param {FC.RA.RuleSetters} rule + */ function ProcessPorn(slave, rule) { if ((rule.pornFameSpending !== undefined) && (rule.pornFameSpending !== null)) { if (slave.porn.prestige < 3) { @@ -3034,6 +3042,10 @@ globalThis.DefaultRules = (function() { } } + return DefaultRules; +})(); + +globalThis.RuleHasError = function() { const rxCheckEqual = /[^!=<>]=[^=<>]/gi; const compileCheck = function(code) { try { @@ -3044,17 +3056,29 @@ globalThis.DefaultRules = (function() { } return true; }; - globalThis.RuleHasError = (rule) => rule.condition.function === "custom" - && (rule.condition.data.match(rxCheckEqual) - || !compileCheck(rule.condition.data)); - globalThis.DefaultRulesError = () => V.defaultRules.some(r => RuleHasError(r)); - return DefaultRules; -})(); + /** + * @param {FC.RA.Rule} rule + * @returns {boolean} + */ + function check(rule) { + return rule.condition.function === "custom" + && (rule.condition.data.match(rxCheckEqual) + || !compileCheck(rule.condition.data)); + } + + return check; +}(); + +globalThis.DefaultRulesError = () => V.defaultRules.some(r => RuleHasError(r)); + +/** + * @param {App.Entity.SlaveState} slave + */ globalThis.removeFromRulesToApplyOnce = function(slave) { for (const rule of Object.keys(V.rulesToApplyOnce)) { if (V.rulesToApplyOnce[rule].includes(slave.ID)) { V.rulesToApplyOnce[rule].delete(slave.ID); } } -}; \ No newline at end of file +}; diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index c4b70ef5bc344f7dec2d4c91c109faa1aa5b4c9b..93054bd17f9b4552b603710ace42e8267aff4a30 100644 --- a/src/js/SlaveState.js +++ b/src/js/SlaveState.js @@ -690,7 +690,8 @@ App.Entity.SlaveState = class SlaveState { * -1: -10 cm, 0: none, 1: +10 cm * @type {FC.HeightImplant} */ this.heightImplant = 0; - /** slave's nationality */ + /** slave's nationality + * @type {string} */ this.nationality = "slave"; /** slave's race * @type {FC.Race} */ @@ -1001,7 +1002,7 @@ App.Entity.SlaveState = class SlaveState { * * "Sacrilege" * * "Possessive" * * "Paternalist" - * @type {string | number} + * @type {FC.Zeroable<string>} */ this.boobsTat = 0; /** slave lactation @@ -1160,7 +1161,7 @@ App.Entity.SlaveState = class SlaveState { * * "Sacrilege" * * "Possessive" * * "Paternalist" - * @type {string|number} */ + * @type {FC.Zeroable<string>} */ this.lipsTat = 0; /** * teeth type @@ -1219,7 +1220,7 @@ App.Entity.SlaveState = class SlaveState { * * "Sacrilege" * * "Possessive" * * "Paternalist" - * @type {string|number} */ + * @type {FC.Zeroable<string>} */ this.vaginaTat = 0; /** * pregnancy time or state.See Pregnancy Control section for more. diff --git a/src/js/assignJS.js b/src/js/assignJS.js index ff7837a2959e234837c2a1e90ce35b6f047508a8..ad3c86e7414f474341a21fc5832bcdeb7c96a6d4 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -960,7 +960,7 @@ globalThis.assignmentTransition = function(slave, assignTo, passage) { * @param {string} facilityName * @param {FC.Assignment} [managerAssignment] * @param {FC.Assignment} [workerAssignment] - * @returns {Node} + * @returns {DocumentFragment} */ globalThis.removeFacilityWorkers = function(facilityName, managerAssignment, workerAssignment) { const facility = App.Entity.facilities[facilityName]; diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 9f5186ba583ee903766bfd2de03654261d5b9673..09715cd6a34ed937621eda0489dded4be611f6a5 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -2268,7 +2268,7 @@ The third category, the "slave slot" is completely optional. Sometimes you just /** Spend or gain money and record the transaction for accounting * @param {number} cost * @param {string} what - @see App.Data.Records.LastWeeksCash() for a full list - * @param {App.Entity.SlaveState} [who] - the slave whose ledger the transaction should be recorded to. V.PC may be passed but will be ignored. + * @param {FC.HumanState} [who] - the slave whose ledger the transaction should be recorded to. V.PC may be passed but will be ignored. */ globalThis.cashX = function(cost, what, who) { if (!Number.isFinite(cost)) { diff --git a/src/js/eventHandlers.js b/src/js/eventHandlers.js index d5af291a10c850f30c4ff55054fc9ccd1058187a..eb50a55dcb86c13b9bb323e3c9e71e0d25cfa109 100644 --- a/src/js/eventHandlers.js +++ b/src/js/eventHandlers.js @@ -1,6 +1,6 @@ App.EventHandlers = function() { /** - * @param {SugarCubeLib.SaveObject} save + * @param {TwineSugarCube.SaveObject} save */ function onLoad(save) { const v = save.state.history[0].variables; @@ -19,7 +19,7 @@ App.EventHandlers = function() { } /** - * @param {SugarCubeLib.SaveObject} save + * @param {TwineSugarCube.SaveObject} save */ function onSave(save) { } diff --git a/src/js/findSlave.js b/src/js/findSlave.js index c0f8f9e39d452aa611f1a13d5f77106ad5a88afa..3ce15a0cc314b84ecaf8d06336a6eaed17d238c6 100644 --- a/src/js/findSlave.js +++ b/src/js/findSlave.js @@ -2,7 +2,7 @@ App.FindSlave = {}; /** * Fragment searching: See if every needle can found somewhere in the field of haystacks - * @param {string[]} haystacks + * @param {FC.Zeroable<string>[]} haystacks * @param {RegExp[]} needles * @returns {boolean} */ diff --git a/src/js/futureSocietyJS.js b/src/js/futureSocietyJS.js index b2b53e07c8c565af96193c514485ab0b9b27a2cc..32c14eda04df65e2079520f2083ba66aa2bb653c 100644 --- a/src/js/futureSocietyJS.js +++ b/src/js/futureSocietyJS.js @@ -34,9 +34,12 @@ globalThis.FutureSocieties = (function() { PetiteAdmiration: "FSPetiteAdmiration", StatuesqueGlorification: "FSStatuesqueGlorification" }; + /** @type {FC.FutureSociety[]} */ const SocietyList = [...new Set(Object.keys(FSString2Property).map(key => FSString2Property[key]))]; // This returns an array containing the unique values of FSString2Property. E.g. "FSSupremacist" and "FSSubjugationist" + /** @type {FC.FutureSociety[]} */ const NPCSocietyList = [ "FSCummunism", "FSIncestFetishist" ]; // NPC arcologies may use these FSes, but the PC can't + /** @type {FC.FutureSociety[][]} */ const FSMutexGroups = [ [ "FSSupremacist" ], [ "FSSubjugationist" ], @@ -55,6 +58,7 @@ globalThis.FutureSocieties = (function() { [ "FSPetiteAdmiration", "FSStatuesqueGlorification"] ]; + /** @type {Record<FC.FutureSociety, {noun: FC.FutureSocietyNoun, adj: FC.FutureSocietyAdj}} */ const DisplayName = { FSSupremacist: {noun: "Racial Supremacism", adj: "Supremacist"}, FSSubjugationist: {noun: "Racial Subjugationism", adj: "Subjugationist"}, @@ -112,7 +116,7 @@ globalThis.FutureSocieties = (function() { /** get the list of FSes active for a particular arcology * helper function, not callable externally * @param {number} arcologyID - * @returns {Array<string>} + * @returns {FC.FutureSociety[]} */ function activeFSes(arcologyID) { let isSet = (fs) => V.arcologies[arcologyID][fs] !== "unset"; @@ -174,8 +178,8 @@ globalThis.FutureSocieties = (function() { } /** determines whether two named FSes are naturally conflicting or not - * @param {string} left FS - * @param {string} right FS + * @param {FC.FutureSociety} left FS + * @param {FC.FutureSociety} right FS * @returns {boolean} */ function conflictingFSes(left, right) { @@ -191,7 +195,7 @@ globalThis.FutureSocieties = (function() { /** returns an array of all of the FSes that would be valid for this arcology to adopt right now * @param {number} arcID - * @returns {string[]} + * @returns {FC.FutureSociety[]} */ function validAdoptions(arcID) { const arcology = V.arcologies[arcID]; @@ -226,10 +230,13 @@ globalThis.FutureSocieties = (function() { * call as FutureSocieties.diplomaticFSes(arc1ID, arc2ID) * @param {number} arc1ID * @param {number} arc2ID - * @returns {{shared: string[], conflicting: string[][]}} + * @returns {{shared: FC.FutureSociety[], conflicting: FC.FutureSociety[][]}} */ function diplomaticFSes(arc1ID, arc2ID) { - let shared = [], conflicting = []; + /** @type {FC.FutureSociety[]} */ + let shared = []; + /** @type {FC.FutureSociety[][]} */ + let conflicting = []; const arc1FSes = activeFSes(arc1ID); const arc2FSes = activeFSes(arc2ID); // find ordinary shared and conflicting FSes @@ -273,16 +280,16 @@ globalThis.FutureSocieties = (function() { } /** returns the future society display name (typically an "ism") for the given property - * @param {string} FSProp - * @returns {string} + * @param {FC.FutureSociety} FSProp + * @returns {FC.FutureSocietyNoun} */ function displayName(FSProp) { return DisplayName[FSProp].noun; } /** returns the future society adjective (typically an "ist") for the given property - * @param {string} FSProp - * @returns {string} + * @param {FC.FutureSociety} FSProp + * @returns {FC.FutureSocietyAdj} */ function displayAdj(FSProp) { return DisplayName[FSProp].adj; @@ -291,11 +298,12 @@ globalThis.FutureSocieties = (function() { /** decays all the FSes adopted by a particular arcology (for example, because of government instability) * call as FutureSocieties.decay(arcologyID) * @param {number} arcologyID - * @returns {Array<string>} FSes which purged completely + * @returns {FC.FutureSociety[]} FSes which purged completely */ function decayFSes(arcologyID) { const fses = activeFSes(arcologyID); const arc = V.arcologies[arcologyID]; + /** @type {FC.FutureSociety[]} */ let purged = []; for (const fs of fses) { if (fs !== "FSNull") { // exempt for some reason? diff --git a/src/js/relationshipChecks.js b/src/js/relationshipChecks.js index a5969128a77fe284e023db742a749da671204fd5..f3274538f7ea0b5878cdbbbbff675b65d17060a2 100644 --- a/src/js/relationshipChecks.js +++ b/src/js/relationshipChecks.js @@ -66,8 +66,8 @@ globalThis.PCrelationshipTerm = function(id) { * If there is no known relationship between them, returns the name alone. * Use this function instead of just printing the slave's name when you'd like to let the player to know if two actors are related, * even though it's not going to have any mechanical impact on the scene. - * @param {App.Entity.SlaveState|App.Entity.PlayerState} context - * @param {App.Entity.SlaveState|App.Entity.PlayerState} actor + * @param {FC.HumanState} context + * @param {FC.HumanState} actor * @param {boolean|string} [asLink=false] - when true, instead of using the slave's first name, use their full name with a (SC Markup) link to the slave description dialog. when "DOM", generate a DOM link and return a DocumentFragment. * @param {boolean} [insertComma=false] - when true, if a relationship is found, it will be separated from the actor's name by a comma ("her father, Dave" instead of "her father Dave") * @returns {string|DocumentFragment} diff --git a/src/js/salon.js b/src/js/salon.js index e1a2e9a9ad72285b4a33ca698ad5c43fedb1ac34..9a0e8ccdfd578613e480eb56978c00c947dab257 100644 --- a/src/js/salon.js +++ b/src/js/salon.js @@ -1,11 +1,12 @@ /** - * @param {App.Entity.PlayerState|App.Entity.SlaveState} entity - * @param {boolean} player + * @param {FC.HumanState} entity * @returns {HTMLDivElement} */ -App.Medicine.Modification.eyeSelector = function(entity, player = false) { +App.Medicine.Modification.eyeSelector = function(entity) { const {He, him, his} = getPronouns(entity); + const player = entity === V.PC; + let selectedSide = "none"; let selectedIris = "none"; let selectedPupil = "none"; @@ -45,7 +46,7 @@ App.Medicine.Modification.eyeSelector = function(entity, player = false) { /** * @param {string} name * @param {Array<string>} list - * @param {Function}callback + * @param {function(string):void}callback * @param {string} selected * @returns {HTMLDivElement} */ @@ -64,7 +65,7 @@ App.Medicine.Modification.eyeSelector = function(entity, player = false) { /** * @param {string} value - * @param {Function} callback + * @param {(value: string) => void} callback * @param {Array<HTMLAnchorElement>} links * @param {boolean} [disabled] */ @@ -204,6 +205,10 @@ App.Medicine.Modification.eyeSelector = function(entity, player = false) { } } + /** + * @param {string} text + * @param {() => void} callback + */ function removeLink(text, callback) { const a = document.createElement("a"); a.append(text); @@ -219,9 +224,9 @@ App.Medicine.Modification.eyeSelector = function(entity, player = false) { * Update ears in salon * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number|string} [params.primaryEarColor] - * @param {string} [params.secondaryEarColor] - * @returns {node} + * @param {number|string} [params.primaryEarColor=0] + * @param {string} [params.secondaryEarColor=""] + * @returns {JQuery<HTMLElement>} */ App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColor = ""} = {}) { const frag = new DocumentFragment(); @@ -317,7 +322,7 @@ App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColo * @param {object} params * @param {number|string} [params.primaryHairColor] * @param {string} [params.secondaryHairColor] - * @returns {node} + * @returns {JQuery<HTMLElement>} */ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairColor = ""} = {}) { const frag = new DocumentFragment(); @@ -689,7 +694,7 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo * @param {object} params * @param {number|string} [params.primaryTailColor] * @param {string} [params.secondaryTailColor] - * @returns {node} + * @returns {JQuery<HTMLElement>} */ App.Medicine.Salon.tail = function(slave, {primaryTailColor = 0, secondaryTailColor = ""} = {}) { const frag = new DocumentFragment(); diff --git a/src/js/sexActsJS.js b/src/js/sexActsJS.js index c3a42134b2da58bcd8436ae4c2f035e1fa0cc268..8c28f0f0e784f110e1c759c3df3ed7f04b46783b 100644 --- a/src/js/sexActsJS.js +++ b/src/js/sexActsJS.js @@ -474,7 +474,7 @@ globalThis.actX = function(slave, act, count = 1) { * Sex is between two. This is a handy wrapper for actX that emphasizes that. * @param {App.Entity.SlaveState} slave1 always a slave * @param {string} act1 oral, anal, etc - * @param {App.Entity.SlaveState | App.Entity.PlayerState | string} slave2 slave or PC or "public" + * @param {FC.HumanState | "public"} slave2 slave or PC or "public" * @param {string} act2 oral, anal, etc * @param {number} count */ diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js index 64051f6a7a9583f7cf0ea65b34e4e2e88eb5a3db..8e668e6bee4b0ce35e4eb67bdbaf58557318e453 100644 --- a/src/js/slaveListing.js +++ b/src/js/slaveListing.js @@ -410,7 +410,7 @@ App.UI.SlaveList.render = function() { quickIndexBtn.id = `quick-list-toggle${listID}`; quickIndexBtn.setAttribute('data-quick-index', listID.toString()); quickIndexBtn.onclick = function(ev) { - let which = ev.target.attributes["data-quick-index"].value; + let which = /** @type {HTMLElement} */ (ev.target).attributes["data-quick-index"].value; let quick = $("div#list_index" + which); quick.toggleClass("ql-hidden"); }; @@ -728,7 +728,7 @@ App.UI.SlaveList.listNGPSlaves = function() { let imported = []; let nonImported = []; for (const slave of V.slaves) { - /* handle the legacy assignment string */ + // @ts-ignore: handle the legacy assignment string if (slave.assignment === "be imported") { slave.assignment = Job.IMPORTED; } diff --git a/src/js/speech.js b/src/js/speech.js index e3457dd84d7e892040f2de519a73a1ac502e20f4..1995b7a06ac023c9bc4d4b1d622e3b9a09660de6 100644 --- a/src/js/speech.js +++ b/src/js/speech.js @@ -1,15 +1,6 @@ /** Get all the enunciations used by a particular slave as a destructurable object. * @param {App.Entity.SlaveState} slave - * @returns {{title: string, say: string, - * s: string, S: string, ss: string, - * c: string, C: string, cc: string, - * z: string, Z: string, zz: string, - * ch: string, Ch: string, - * ps: string, Ps: string, - * sh: string, Sh: string, - * sc: string, Sc: string, - * sch: string, Sch: string, - * x: string, X: string}} + * @returns {FC.Enunciation} */ globalThis.getEnunciation = function(slave) { let ret = {}; diff --git a/src/js/statsChecker/eyeChecker.js b/src/js/statsChecker/eyeChecker.js index b1e31054c395695ade92a2207f4d754ef147f3e6..afd7bfa80946ea64770e8b30e19f381c739cbcba 100644 --- a/src/js/statsChecker/eyeChecker.js +++ b/src/js/statsChecker/eyeChecker.js @@ -1,7 +1,7 @@ /** * True if slave has at least one eye * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasAnyEyes = function(slave) { @@ -11,7 +11,7 @@ globalThis.hasAnyEyes = function(slave) { /** * True if slave has at least one eye that is natural * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasAnyNaturalEyes = function(slave) { @@ -21,7 +21,7 @@ globalThis.hasAnyNaturalEyes = function(slave) { /** * True if slave has at least one eye that is prosthetic (cyber or glass) * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasAnyProstheticEyes = function(slave) { @@ -31,7 +31,7 @@ globalThis.hasAnyProstheticEyes = function(slave) { /** * True if slave has at least one eye that is cybernetic * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasAnyCyberneticEyes = function(slave) { @@ -41,7 +41,7 @@ globalThis.hasAnyCyberneticEyes = function(slave) { /** * True if slave has both eyes * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasBothEyes = function(slave) { @@ -51,7 +51,7 @@ globalThis.hasBothEyes = function(slave) { /** * True if slave has both eyes and they are natural * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasBothNaturalEyes = function(slave) { @@ -61,7 +61,7 @@ globalThis.hasBothNaturalEyes = function(slave) { /** * True if slave has both eyes and they are prosthetic (cyber or glass) * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasBothProstheticEyes = function(slave) { @@ -71,7 +71,7 @@ globalThis.hasBothProstheticEyes = function(slave) { /** * True if slave has both eyes and they are cybernetic * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasBothCyberneticEyes = function(slave) { @@ -81,7 +81,7 @@ globalThis.hasBothCyberneticEyes = function(slave) { /** * True if slave has left eye * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasLeftEye = function(slave) { @@ -90,7 +90,7 @@ globalThis.hasLeftEye = function(slave) { /** * True if slave has right eye * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasRightEye = function(slave) { @@ -100,7 +100,7 @@ globalThis.hasRightEye = function(slave) { /** * Returns type of the left eye. * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {number} */ globalThis.getLeftEyeType = function(slave) { @@ -114,7 +114,7 @@ globalThis.getLeftEyeType = function(slave) { /** * Returns type of the right eye. * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {number} */ globalThis.getRightEyeType = function(slave) { @@ -126,7 +126,7 @@ globalThis.getRightEyeType = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {number} */ globalThis.getLeftEyeVision = function(slave) { @@ -138,7 +138,7 @@ globalThis.getLeftEyeVision = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {number} */ globalThis.getRightEyeVision = function(slave) { @@ -150,7 +150,7 @@ globalThis.getRightEyeVision = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {number} */ globalThis.getBestVision = function(slave) { @@ -158,7 +158,7 @@ globalThis.getBestVision = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {number} */ globalThis.getWorstVision = function(slave) { @@ -167,7 +167,7 @@ globalThis.getWorstVision = function(slave) { /** * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @param {number} vision * @returns {boolean} */ @@ -176,7 +176,7 @@ globalThis.anyVisionEquals = function(slave, vision) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ globalThis.getLeftEyeColor = function(slave) { @@ -188,7 +188,7 @@ globalThis.getLeftEyeColor = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ globalThis.getRightEyeColor = function(slave) { @@ -200,7 +200,7 @@ globalThis.getRightEyeColor = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ globalThis.getLeftEyePupil = function(slave) { @@ -212,7 +212,7 @@ globalThis.getLeftEyePupil = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ globalThis.getRightEyePupil = function(slave) { @@ -224,7 +224,7 @@ globalThis.getRightEyePupil = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ globalThis.getLeftEyeSclera = function(slave) { @@ -236,7 +236,7 @@ globalThis.getLeftEyeSclera = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ globalThis.getRightEyeSclera = function(slave) { @@ -248,7 +248,7 @@ globalThis.getRightEyeSclera = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.hasVisibleHeterochromia = function(slave) { @@ -258,7 +258,7 @@ globalThis.hasVisibleHeterochromia = function(slave) { /** * Gives the genetic color of the specified eye. * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} playerOrSlave + * @param {FC.HumanState} playerOrSlave * @param {string} side * @returns {string} */ @@ -280,7 +280,7 @@ globalThis.getGeneticEyeColor = function(playerOrSlave, side) { /** * Counts the number of eyes that are not the genetic color * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {number} */ globalThis.getLenseCount = function(slave) { diff --git a/src/js/statsChecker/limbChecker.js b/src/js/statsChecker/limbChecker.js index 1c44af28507483d4660fb7175ccd71bead6a81f1..f13e66a1f3b4d6b9ebd3bf0d1b2094cf7f96b649 100644 --- a/src/js/statsChecker/limbChecker.js +++ b/src/js/statsChecker/limbChecker.js @@ -3,7 +3,7 @@ /** * True if slave has no limbs, neither natural nor prosthetic * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.isAmputee = function(slave) { @@ -13,7 +13,7 @@ globalThis.isAmputee = function(slave) { /** * True if slave has at least one natural limb * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyNaturalLimbs = function(slave) { @@ -23,7 +23,7 @@ globalThis.hasAnyNaturalLimbs = function(slave) { /** * True if slave has at least one prosthetic limb * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyProstheticLimbs = function(slave) { @@ -33,7 +33,7 @@ globalThis.hasAnyProstheticLimbs = function(slave) { /** * True if slave has at least one leg * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyLegs = function(slave) { @@ -43,7 +43,7 @@ globalThis.hasAnyLegs = function(slave) { /** * True if slave has at least one arm * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyArms = function(slave) { @@ -53,7 +53,7 @@ globalThis.hasAnyArms = function(slave) { /** * True if slave has at least one leg that is natural * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyNaturalLegs = function(slave) { @@ -63,7 +63,7 @@ globalThis.hasAnyNaturalLegs = function(slave) { /** * True if slave has at least one arm that is natural * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyNaturalArms = function(slave) { @@ -73,7 +73,7 @@ globalThis.hasAnyNaturalArms = function(slave) { /** * True if slave has at least one leg that is prosthetic * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyProstheticLegs = function(slave) { @@ -83,7 +83,7 @@ globalThis.hasAnyProstheticLegs = function(slave) { /** * True if slave has at least one arm that is prosthetic * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyProstheticArms = function(slave) { @@ -93,7 +93,7 @@ globalThis.hasAnyProstheticArms = function(slave) { /** * True if slave has both legs * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasBothLegs = function(slave) { @@ -103,7 +103,7 @@ globalThis.hasBothLegs = function(slave) { /** * True if slave has both arms * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasBothArms = function(slave) { @@ -113,7 +113,7 @@ globalThis.hasBothArms = function(slave) { /** * True if slave has both legs and they are natural * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasBothNaturalLegs = function(slave) { @@ -123,7 +123,7 @@ globalThis.hasBothNaturalLegs = function(slave) { /** * True if slave has both arms and they are natural * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasBothNaturalArms = function(slave) { @@ -133,7 +133,7 @@ globalThis.hasBothNaturalArms = function(slave) { /** * True if slave has both arms and they are artificial * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasBothProstheticArms = function(slave) { @@ -143,7 +143,7 @@ globalThis.hasBothProstheticArms = function(slave) { /** * True if slave has both legs and they are artificial * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasBothProstheticLegs = function(slave) { @@ -153,7 +153,7 @@ globalThis.hasBothProstheticLegs = function(slave) { /** * True if slave has any limbs * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAnyLimbs = function(slave) { @@ -163,7 +163,7 @@ globalThis.hasAnyLimbs = function(slave) { /** * True if slave has all limbs * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAllLimbs = function(slave) { @@ -173,7 +173,7 @@ globalThis.hasAllLimbs = function(slave) { /** * True if slave has all limbs and all are natural * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasAllNaturalLimbs = function(slave) { @@ -183,7 +183,7 @@ globalThis.hasAllNaturalLimbs = function(slave) { /** * True if slave has left arm * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasLeftArm = function(slave) { @@ -193,7 +193,7 @@ globalThis.hasLeftArm = function(slave) { /** * True if slave has right arm * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasRightArm = function(slave) { @@ -203,7 +203,7 @@ globalThis.hasRightArm = function(slave) { /** * True if slave has left leg * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasLeftLeg = function(slave) { @@ -213,7 +213,7 @@ globalThis.hasLeftLeg = function(slave) { /** * True if slave has right leg * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {boolean} */ globalThis.hasRightLeg = function(slave) { @@ -223,7 +223,7 @@ globalThis.hasRightLeg = function(slave) { /** * Returns limb ID of the left arm. Uses new IDs. * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {number} */ globalThis.getLeftArmID = function(slave) { @@ -237,7 +237,7 @@ globalThis.getLeftArmID = function(slave) { /** * Returns limb ID of the right arm. Uses new IDs. * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {number} */ globalThis.getRightArmID = function(slave) { @@ -251,7 +251,7 @@ globalThis.getRightArmID = function(slave) { /** * Returns limb ID of the left leg. Uses new IDs. * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {number} */ globalThis.getLeftLegID = function(slave) { @@ -265,7 +265,7 @@ globalThis.getLeftLegID = function(slave) { /** * Returns limb ID of the right leg. Uses new IDs. * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @returns {number} */ globalThis.getRightLegID = function(slave) { @@ -324,7 +324,7 @@ globalThis.idToDescription = function(id) { * * No ID means all limbs = 101 * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @param {number} [id] * @returns {number} */ @@ -364,7 +364,7 @@ globalThis.getLimbCount = function(slave, id = 101) { /** * Returns count of specified leg type. Uses new limb IDs. * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @param {number} id * @returns {number} */ @@ -384,7 +384,7 @@ globalThis.getLegCount = function(slave, id) { /** * Returns count of specified arm type. Uses new limb IDs. * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @param {number} id * @returns {number} */ @@ -406,7 +406,7 @@ globalThis.getArmCount = function(slave, id) { * By default a variation of "arms and legs", but this can be changed via parameters. * Expects the slave to at least have one limb. * - * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} slave * @param {string} [arms] * @param {string} [arm] * @param {string} [legs] diff --git a/src/js/statsChecker/statsChecker.js b/src/js/statsChecker/statsChecker.js index 1d6dc69f1a9ed069d0844446a718e8ce142fca4d..5982f0690fdecd940fc94c1ecc43e6d687dccc57 100644 --- a/src/js/statsChecker/statsChecker.js +++ b/src/js/statsChecker/statsChecker.js @@ -619,7 +619,7 @@ globalThis.isEliteBreeder = function(slave) { }; /** - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {boolean} */ globalThis.canGetPregnant = function(slave) { diff --git a/src/js/storyJS.js b/src/js/storyJS.js index f4b6d76ecdcd3bb8fe7f207d29ebd8e5de87c5f7..308b7503bd984cac47cf333603551691dc2a4788 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -69,8 +69,8 @@ globalThis.filterInPlace = function(arr, callback, thisArg) { }; /** pregmod: are slave2's sperm compatible with slave1's eggs? - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave1 - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave2 + * @param {FC.HumanState} slave1 + * @param {FC.HumanState} slave2 * @returns {boolean} */ globalThis.canBreed = function(slave1, slave2) { @@ -83,8 +83,8 @@ globalThis.canBreed = function(slave1, slave2) { /** assuming slave1 is fertile, could slave2 impregnate slave1? * slave2 must have dick and balls with compatible sperm; * both slaves must not be in chastity; slave2 need not achieve erection - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave1 - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave2 + * @param {FC.HumanState} slave1 + * @param {FC.HumanState} slave2 * @returns {boolean} */ globalThis.canImpreg = function(slave1, slave2) { @@ -114,8 +114,8 @@ globalThis.canImpreg = function(slave1, slave2) { /** assuming slave1 is fertile, could slave2 impregnate slave1? * slave2 must have balls with compatible sperm; * a special function intended for tribbing scenes; - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave1 - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave2 + * @param {FC.HumanState} slave1 + * @param {FC.HumanState} slave2 * @returns {boolean} */ globalThis.canFemImpreg = function(slave1, slave2) { diff --git a/src/js/utilsDOM.js b/src/js/utilsDOM.js index e8b63d953cf047d39d4127a0ee981a14ccb41d8c..a904b1117d55ad28749c8419ac08551872fc53e8 100644 --- a/src/js/utilsDOM.js +++ b/src/js/utilsDOM.js @@ -67,9 +67,10 @@ App.UI.DOM.assignmentLink = function(slave, assignment, passage, action, linkTex /** * Creates a markup for a SugarCube link which executes given function with given arguments * + * @template {function(...any):void} F * @param {string} linkText link text - * @param {function(...any):void} handler callable object - * @param {any|Array<any>} args arguments + * @param {F} handler callable object + * @param {Parameters<F>} [args] arguments * @param {string} [passage] the passage name to link to * @param {string} [tooltip] * @returns {HTMLAnchorElement} link in SC markup diff --git a/src/js/utilsSC.js b/src/js/utilsSC.js index ecf2ec5c071aeb43f860dc4716c63abcee508d4e..baf505a24abd25c10d4ef741642a139a24a28f67 100644 --- a/src/js/utilsSC.js +++ b/src/js/utilsSC.js @@ -69,11 +69,12 @@ App.UI.link = function() { /** * Creates a markup for a SugarCube link which executes given function with given arguments - * @template {Function} F + * @template {function(...any):void} F * @param {string} linkText link text * @param {F} handler callable object - * @param {Parameters<F>} args arguments + * @param {Parameters<F>} [args] arguments * @param {string} [passage] the passage name to link to + * @param {string} [tooltip] * @returns {string} link in SC markup */ function makeLink(linkText, handler, args = [], passage = '', tooltip = '') { diff --git a/src/markets/specificMarkets/customSlaveMarket.js b/src/markets/specificMarkets/customSlaveMarket.js index 3b83064f9f4b9659ee239dae3880dd485f61401a..2a6c7ad6d3b78fca0d792a1676834d89afb0c038 100644 --- a/src/markets/specificMarkets/customSlaveMarket.js +++ b/src/markets/specificMarkets/customSlaveMarket.js @@ -72,14 +72,14 @@ App.Markets["Custom Slave"] = function() { } else if (high > V.retirementAge) { const option = document.createElement("option"); option.text = `${low}+`; - option.value = low; + option.value = low.toString(); select.append(option); break; } const option = document.createElement("option"); option.text = `${low}-${high}`; - option.value = high; + option.value = high.toString(); if (slave.age === option.value) { option.selected = true; } diff --git a/src/npc/descriptions/belly/belly.js b/src/npc/descriptions/belly/belly.js index 2dd07baec9e66d815a2410d78deec9d1806c4487..4d0e4ec15f962df6c91f124f1db339c351194dec 100644 --- a/src/npc/descriptions/belly/belly.js +++ b/src/npc/descriptions/belly/belly.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.belly = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/belly/bellyImplant.js b/src/npc/descriptions/belly/bellyImplant.js index 01ff82c8a759e1e4eeaf4ce4e123b00874adfb2b..88a9154692ecc1448db67b52e67c7c9e97237e6b 100644 --- a/src/npc/descriptions/belly/bellyImplant.js +++ b/src/npc/descriptions/belly/bellyImplant.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.bellyImplant = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/belly/bellyInflation.js b/src/npc/descriptions/belly/bellyInflation.js index 623f8001e4a03a1e154d659832e54a1bf19f8a34..516e8b3226e7e04307696ce05ede56a07757b0d5 100644 --- a/src/npc/descriptions/belly/bellyInflation.js +++ b/src/npc/descriptions/belly/bellyInflation.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.bellyInflation = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/boobs/boobs.js b/src/npc/descriptions/boobs/boobs.js index 7dc7dfeed9cd323eb5d69ed995a00bbfbcf60c6f..fa376797fdd51b276e6355dfd6685e8274a4295e 100644 --- a/src/npc/descriptions/boobs/boobs.js +++ b/src/npc/descriptions/boobs/boobs.js @@ -218,8 +218,8 @@ App.Desc.boobs = function() { /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number | string} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ function describe(slave, {market, eventDescription} = {}) { @@ -1441,8 +1441,8 @@ App.Desc.boobs = function() { /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.boobsExtra = function(slave, {market, eventDescription} = {}) { @@ -1636,8 +1636,8 @@ App.Desc.boobsExtra = function(slave, {market, eventDescription} = {}) { /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number | string} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.nipples = function(slave, {market, eventDescription} = {}) { @@ -1832,8 +1832,8 @@ App.Desc.nipples = function(slave, {market, eventDescription} = {}) { /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.areola = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/butt/anus.js b/src/npc/descriptions/butt/anus.js index 09988a307e14e1651d6279ddb9625207c5b6119a..901843c1d23ee531ef59a07f9171962be8e0b198 100644 --- a/src/npc/descriptions/butt/anus.js +++ b/src/npc/descriptions/butt/anus.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.anus = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/butt/butt.js b/src/npc/descriptions/butt/butt.js index 62314f515a7f7bf0663aed3d53c11b3da0020e6c..53cc54a8b2146046838eacc6a9d23706334c7afe 100644 --- a/src/npc/descriptions/butt/butt.js +++ b/src/npc/descriptions/butt/butt.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.butt = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/butt/buttplug.js b/src/npc/descriptions/butt/buttplug.js index a5414d79d19a54010efa391531303263d0af8ac9..bf8bfd502dff87d6cd2b0935e35a0b1b88928ed4 100644 --- a/src/npc/descriptions/butt/buttplug.js +++ b/src/npc/descriptions/butt/buttplug.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.buttplug = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/crotch/crotch.js b/src/npc/descriptions/crotch/crotch.js index 02c1596859d6d0073a7ec65f10928d37543926a8..73c21d997789da26b7937bf25840771dcc0df8fb 100644 --- a/src/npc/descriptions/crotch/crotch.js +++ b/src/npc/descriptions/crotch/crotch.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.crotch = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/crotch/dick.js b/src/npc/descriptions/crotch/dick.js index 670e9c3e55244e4aa09336433b821889c2cf121f..69275681cd968ac69d51e4d69225e11fa66d0906 100644 --- a/src/npc/descriptions/crotch/dick.js +++ b/src/npc/descriptions/crotch/dick.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.dick = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/crotch/vagina.js b/src/npc/descriptions/crotch/vagina.js index 22886aa8c2fb2e4799d10414edb73cb972a29e36..bd8d936cf2fbe2236cedf48bab39251c8cfe4e37 100644 --- a/src/npc/descriptions/crotch/vagina.js +++ b/src/npc/descriptions/crotch/vagina.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.vagina = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/descriptionWidgets.js b/src/npc/descriptions/descriptionWidgets.js index 4a063e8da9c7aaf952058357ebf8d42eeaf1f10a..6853a91f83a27ba1d32fef55b12bde62cea74141 100644 --- a/src/npc/descriptions/descriptionWidgets.js +++ b/src/npc/descriptions/descriptionWidgets.js @@ -63,7 +63,7 @@ App.Desc.makeup = function(slave) { /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] * @param {number} [params.eventDescription] * @returns {string} Slave's eyes */ diff --git a/src/npc/descriptions/eyes.js b/src/npc/descriptions/eyes.js index be99d013ef4c66e885f97252e7c1b1f4f91a5c40..d2b8f17939f6433de0a41ae5119b243ea0d65e77 100644 --- a/src/npc/descriptions/eyes.js +++ b/src/npc/descriptions/eyes.js @@ -2,7 +2,7 @@ * returned string fits in a sentence like this: * She has {return}. * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ App.Desc.eyesType = function(slave) { @@ -51,7 +51,7 @@ App.Desc.eyeTypeToString = function(type) { * Intentionally leaves out some information to make it flow nicer and have less grammatical restrictions. * Use App.Desc.eyesColorLong for a complete eye description. * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @param {string} [adj] * @param {string} [eye] * @param {string} [eyes] @@ -101,7 +101,7 @@ App.Desc.eyesColor = function(slave, adj = "", eye = "eye", eyes = "eyes", a = t * Returns a description of a given slave's eyes. * WARNING: Expects .,:;!? after the string, otherwise there might be grammatical errors! * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ App.Desc.eyesColorLong = function(slave) { @@ -208,7 +208,7 @@ App.Desc.eyesColorLong = function(slave) { * Prefer App.Desc.eyesColor if possible as it works reliably with only one eye. * Example where this is better: {return}-eyed gaze * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} Slave's eye color */ App.Desc.eyeColor = function(slave) { @@ -235,7 +235,7 @@ App.Desc.eyeColor = function(slave) { * returned string fits in a sentence like this: * She has {return}. * - * @param {App.Entity.SlaveState|App.Entity.PlayerState} slave + * @param {FC.HumanState} slave * @returns {string} */ App.Desc.eyesVision = function(slave) { diff --git a/src/npc/descriptions/heels.js b/src/npc/descriptions/heels.js index dd159688cb98e2c63aadff31a2b51cae5c10f3f8..23b1a47a5c6a5ccbb667899ab89314fab81b77a2 100644 --- a/src/npc/descriptions/heels.js +++ b/src/npc/descriptions/heels.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.heels = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/limbs.js b/src/npc/descriptions/limbs.js index 1d18a1c071bab589ad77869a311de0591ab3552e..e520c22826173e15a37f36143fbbd40c612deea0 100644 --- a/src/npc/descriptions/limbs.js +++ b/src/npc/descriptions/limbs.js @@ -41,7 +41,7 @@ App.Desc.limbChange = function() { /** * @param {App.Entity.SlaveState} slave - * @param {{}} oldLimbs + * @param {FC.LimbsState} oldLimbs * @param {string} returnTo * @returns {string} */ @@ -87,7 +87,7 @@ App.Desc.limbChange = function() { /** * @param {App.Entity.SlaveState} slave - * @param {{}} oldLimbs + * @param {FC.LimbsState} oldLimbs * @param {string} returnTo * @returns {string} */ @@ -237,7 +237,7 @@ App.Desc.limbChange = function() { /** * @param {App.Entity.SlaveState} slave - * @param {{}} oldLimbs + * @param {FC.LimbsState} oldLimbs * @param {string} returnTo * @returns {string} */ diff --git a/src/npc/descriptions/longSlave.js b/src/npc/descriptions/longSlave.js index 7d75b6a30e2ee9b5e1d17693bbf097e6c1dff7b0..50c046a11c552739c8798cd128ea0b7a78e3f4b2 100644 --- a/src/npc/descriptions/longSlave.js +++ b/src/npc/descriptions/longSlave.js @@ -213,7 +213,7 @@ App.Desc.longSlave = function(slave = V.activeSlave, {market = 0, eventDescripti r.push(App.Desc.mind(slave, {market: market})); if (!market) { - if (eventDescription === 0) { + if (!eventDescription) { if (canSee(slave)) { if (slave.attrKnown === 1) { if ((slave.assignment !== "work in the dairy") || (V.dairyRestraintsSetting > 1)) { diff --git a/src/npc/descriptions/mind.js b/src/npc/descriptions/mind.js index 841e07912f996b422e58d7e028031ac2aac81c77..db3a4f6894f0ad95ec3488f839658b04bb80adc0 100644 --- a/src/npc/descriptions/mind.js +++ b/src/npc/descriptions/mind.js @@ -1,5 +1,8 @@ /** * @param {App.Entity.SlaveState} slave + * @param {object} params + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.mind = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/sceneIntro.js b/src/npc/descriptions/sceneIntro.js index 869674d018a2313ef4d0e7af9bfa07d44f336a57..015ee8697e6d849e8584d2ec65230f5aaf4f5604 100644 --- a/src/npc/descriptions/sceneIntro.js +++ b/src/npc/descriptions/sceneIntro.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.sceneIntro = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/skin.js b/src/npc/descriptions/skin.js index ce7392890f572f7c139427a9c6894c70be8e77cb..b042181f1fca3b72414940a458d99e960525ab32 100644 --- a/src/npc/descriptions/skin.js +++ b/src/npc/descriptions/skin.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number | string} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.skin = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/style/clothing.js b/src/npc/descriptions/style/clothing.js index b87c7f704616ccfd5ea96d0eb43b595902230c3d..97e5712d6fa652c5374dc7578b7412b84a6e4679 100644 --- a/src/npc/descriptions/style/clothing.js +++ b/src/npc/descriptions/style/clothing.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number | string} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.clothing = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/womb/pregnancy.js b/src/npc/descriptions/womb/pregnancy.js index 39f787d7a9276a338532e03986c30efc73e32bac..46642bde30b0b33c4012a77416090d605c736c5a 100644 --- a/src/npc/descriptions/womb/pregnancy.js +++ b/src/npc/descriptions/womb/pregnancy.js @@ -1,8 +1,8 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number| string} [params.market] - * @param {number} [params.eventDescription] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] + * @param {boolean} [params.eventDescription] * @returns {string} */ App.Desc.pregnancy = function(slave, {market, eventDescription} = {}) { diff --git a/src/npc/descriptions/womb/superfetation.js b/src/npc/descriptions/womb/superfetation.js index 47e49d634bbb8852d0a43561823d23103c73a3c1..38538fec09b106a26a7c1d785552311c02c6cc1d 100644 --- a/src/npc/descriptions/womb/superfetation.js +++ b/src/npc/descriptions/womb/superfetation.js @@ -1,7 +1,7 @@ /** * @param {App.Entity.SlaveState} slave * @param {object} params - * @param {number} [params.market] + * @param {FC.Zeroable<FC.SlaveMarketName>} [params.market] * @param {number} [params.eventDescription] * @returns {string} */ diff --git a/src/npc/generate/slaveGenerationJS.js b/src/npc/generate/slaveGenerationJS.js index ac8f4fe2ea5c301e36e4bb976fcb51078dd2a7d1..adfa6f029209408fb6515913059f9dd37c2e6afe 100644 --- a/src/npc/generate/slaveGenerationJS.js +++ b/src/npc/generate/slaveGenerationJS.js @@ -31,7 +31,7 @@ globalThis.raceToNationality = function(slave) { * @param {string | object} nationality * @param {string | object} race * @param {boolean} male - * @param {undefined} [filter] Default: allow all + * @param {(name: string) => boolean} [filter] Default: allow all * @returns {string} */ globalThis.generateName = function(nationality, race, male, filter = _.stubTrue) { @@ -50,7 +50,7 @@ globalThis.generateName = function(nationality, race, male, filter = _.stubTrue) * @param {string | number} nationality * @param {any} race * @param {any} male - * @param {Function} [filter] Default: allow all + * @param {(name: string) => boolean} [filter] Default: allow all * @returns {string} */ globalThis.generateSurname = function(nationality, race, male, filter = _.stubTrue) { @@ -1578,7 +1578,7 @@ globalThis.applyAgeImplantOlder = function(slave) { /** * Determine whether a given market should apply SMR laws or not. - * @param {string} [market] + * @param {FC.Zeroable<FC.SlaveMarketName>} [market] * @returns {number} [1|0] */ diff --git a/src/npc/surgery/surgery.js b/src/npc/surgery/surgery.js index 7b13dac846201c179b8ed94b164874cade0984ef..611388f00dd03abff441f1eaf9dee8cc6f010b29 100644 --- a/src/npc/surgery/surgery.js +++ b/src/npc/surgery/surgery.js @@ -637,7 +637,7 @@ globalThis.surgeryAmp = function(slave, part) { }; /** - * @param {App.Entity.SlaveState} slave + * @param {FC.HumanState} slave * @param {string} side * @param {string} action */ @@ -721,7 +721,7 @@ globalThis.setEyeColor = function(slave, color, side = "both") { /** * Set all colors of the eye. * - * @param {App.Entity.SlaveState} slave + * @param {FC.HumanState} slave * @param {string} iris * @param {string} pupil * @param {string} sclera @@ -766,7 +766,7 @@ globalThis.setGeneticEyeColor = function(slave, color, heterochromia = false) { * Sets the eye color to the genetic color. * Takes heterochromia and albinism into account. * - * @param {App.Entity.SlaveState} slave + * @param {FC.HumanState} slave * @param {string} [side] */ globalThis.resetEyeColor = function(slave, side = "both") { diff --git a/src/player/js/PlayerState.js b/src/player/js/PlayerState.js index 4f3ad52d09a06e85967a2c6f516194ed2af214ae..df6db7a038871dc1e7453f799b327d8510925ce4 100644 --- a/src/player/js/PlayerState.js +++ b/src/player/js/PlayerState.js @@ -2019,6 +2019,8 @@ App.Entity.PlayerState = class PlayerState { if (false) { // eslint-disable-line /** @type {string|undefined} */ this.customTitle = undefined; + /** @type {string|undefined} */ + this.customTitleLisp = undefined; /** @type {FC.PregnancyData | undefined} */ this.pregData = undefined; /** @type {App.Entity.Fetus[] | undefined} */ diff --git a/src/pregmod/managePersonalAffairs.tw b/src/pregmod/managePersonalAffairs.tw index 922e5d9ee74cdc460793f39be539c8a3021503f9..91c652644efba7938f41f55555e20a6acfaae30f 100644 --- a/src/pregmod/managePersonalAffairs.tw +++ b/src/pregmod/managePersonalAffairs.tw @@ -51,7 +51,7 @@ <<if $playerSurgery == 0>>[[Visit your plastic surgeon.|Elective Surgery][$playerSurgery = 4]]<<elseif $playerSurgery == 1>>Your favorite plastic surgeon is booked solid for the next week.<<else>>Your favorite plastic surgeon is booked solid for the next $playerSurgery weeks.<</if>> </div> - <<includeDOM App.Medicine.Modification.eyeSelector($PC, true)>> + <<includeDOM App.Medicine.Modification.eyeSelector($PC)>> <div> You have a selection of hair dyes available: @@ -688,4 +688,4 @@ <<if $propOutcome == 1 && $arcologies[0].FSRestart != "unset">> <h2>Elite Breeder Qualifications</h2> <p> <<print eliteBreedingExam()>> </p> -<</if>> \ No newline at end of file +<</if>> diff --git a/tsconfig.json b/tsconfig.json index 409eefbb428c086ccb762fe7de84182acc5605a5..15bd704fb06e74387a05b159108e8e79ceef1c71 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,8 @@ "allowJs": true, "checkJs": true, "noEmit": true, - "target": "ESNext" + "target": "ESNext", + "noImplicitAny": false }, "include": [ "js/**/*.js",