diff --git a/.eslintrc.json b/.eslintrc.json index 52ea40bb78d4b1600c0aced78ca7ece50094da51..ec260871e10ed6f2676377e2ae9d3c3794b8ec00 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -44,7 +44,6 @@ "block-scoped-var": "warn", "dot-notation": "off", "linebreak-style": ["error", "unix"], - "no-else-return": "warn", "eol-last": "warn", "unicode-bom": [ "error", diff --git a/src/js/assayJS.js b/src/js/assayJS.js index 1f10b570c62e3e6a45aa6d455d063fe7335cf495..797ddc67fae3c802df4672587189deecc8659e6f 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -1,6 +1,11 @@ /* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ -window.isSlim = /** @param {App.Entity.SlaveState} slave */ function(slave) { +window.isSlim = +/** + * @param {App.Entity.SlaveState} slave + * @returns {} + */ +function(slave) { let slim = false; const ArcologyZero = State.variables.arcologies[0]; @@ -29,7 +34,12 @@ window.isSlim = /** @param {App.Entity.SlaveState} slave */ function(slave) { return slim; }; -window.slimPass = /** @param {App.Entity.SlaveState} slave */ function(slave) { +window.slimPass = +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +function(slave) { let slimPass = 0; const ArcologyZero = State.variables.arcologies[0]; @@ -68,19 +78,39 @@ window.isRivalP = function isRivalP(slave, target) { return slave.rivalryTarget === target.ID; }; -window.supremeRaceP = /** @param {App.Entity.SlaveState} slave */ function supremeRaceP(slave) { +window.supremeRaceP = +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +function supremeRaceP(slave) { return State.variables.arcologies[0].FSSupremacistRace === slave.race; }; -window.inferiorRaceP = /** @param {App.Entity.SlaveState} slave */ function inferiorRaceP(slave) { +window.inferiorRaceP = +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +function inferiorRaceP(slave) { return State.variables.arcologies[0].FSSubjugationistRace === slave.race; }; -window.hasVisibleHeterochromia = /** @param {App.Entity.SlaveState} slave */ function hasVisibleHeterochromia(slave) { +window.hasVisibleHeterochromia = +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +function hasVisibleHeterochromia(slave) { return slave.geneticQuirks.heterochromia !== 0 && slave.geneticQuirks.heterochromia !== 1 && slave.geneticQuirks.albinism !== 2 && slave.geneticQuirks.heterochromia !== slave.eyeColor && slave.eyeColor === slave.origEye; }; -window.isLeaderP = /** @param {App.Entity.SlaveState} slave */ function isLeaderP(slave) { +window.isLeaderP = +/** + * @param {App.Entity.SlaveState} slave + * @returns {boolean} // I think + */ +function isLeaderP(slave) { const V = State.variables; /** @type {App.Entity.SlaveState[]}*/ const leaders = [V.HeadGirl, V.Bodyguard, V.Recruiter, V.Concubine, V.Nurse, V.Attendant, V.Matron, V.Madam, V.DJ, V.Milkmaid, V. Farmer, V.Stewardess, V.Schoolteacher, V.Wardeness]; @@ -103,7 +133,11 @@ window.properMaster = function properMaster() { else return "Mistress"; }; -window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave(slave) { +window.newSlave = +/** + * @param {App.Entity.SlaveState} slave + */ +function newSlave(slave) { const V = State.variables; if (slave.override_Eye_Color !== 1) { @@ -139,7 +173,7 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( if (slave.override_Skin !== 1) { slave.origSkin = slave.skin; } - + /* eslint-disable camelcase */ slave.override_Race = 0; slave.override_H_Color = 0; slave.override_Arm_H_Color = 0; @@ -147,6 +181,7 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( slave.override_Brow_H_Color = 0; slave.override_Skin = 0; slave.override_Eye_Color = 0; + /* eslint-enable camelcase */ if (V.surnamesForbidden === 1) { slave.slaveSurname = 0; @@ -239,7 +274,11 @@ window.newSlave = /** @param {App.Entity.SlaveState} slave */ function newSlave( } }; -window.newChild = /** @param {App.Entity.SlaveState} slave */ function newChild(child) { +window.newChild = +/** + * @param {App.Entity.SlaveState} child + */ +function newChild(child) { const V = State.variables; child.age = 0; /* not sure if this is the correct way to do this or if more is required */ @@ -278,7 +317,7 @@ window.newChild = /** @param {App.Entity.SlaveState} slave */ function newChild( if (child.override_Skin !== 1) { child.origSkin = child.skin; } - + /* eslint-disable */ child.override_Race = 0; child.override_H_Color = 0; child.override_Arm_H_Color = 0; @@ -286,6 +325,7 @@ window.newChild = /** @param {App.Entity.SlaveState} slave */ function newChild( child.override_Brow_H_Color = 0; child.override_Skin = 0; child.override_Eye_Color = 0; + /* eslint-enable */ if (V.surnamesForbidden === 1) { child.childSurname = 0; @@ -321,7 +361,11 @@ window.newChild = /** @param {App.Entity.SlaveState} slave */ function newChild( State.variables.nurseryBabies++; }; -window.addSlave = /** @param {App.Entity.SlaveState} slave */ function addSlave(slave) { +window.addSlave = +/** + * @param {App.Entity.SlaveState} slave + */ +function addSlave(slave) { State.variables.slaves.push(slave); State.variables.slaveIndices[slave.ID] = State.variables.slaves.length - 1; }; @@ -339,7 +383,12 @@ window.slaves2indices = function slaves2indices() { State.variables.slaves.forEach((slave, i) => obj[slave.ID] = i); return obj; }; -window.getSlave = /** @returns {App.Entity.SlaveState} */ function getSlave(ID) { +window.getSlave = +/** + * @param {number} ID + * @returns {App.Entity.SlaveState} + */ +function getSlave(ID) { const index = State.variables.slaveIndices[ID]; if (index === undefined) return undefined; else return State.variables.slaves[index]; @@ -348,7 +397,12 @@ window.getChild = function getChild(ID) { const V = State.variables; return V.cribs.find(function(s) { return s.ID === ID; }); }; -window.getPronouns = /** @param {App.Entity.SlaveState} slave */ function getPronouns(slave) { +window.getPronouns = +/** + * @param {App.Entity.SlaveState} slave + * @returns {object} + */ +function getPronouns(slave) { return { pronoun: slave.pronoun, possessivePronoun: slave.possessivePronoun, @@ -358,7 +412,11 @@ window.getPronouns = /** @param {App.Entity.SlaveState} slave */ function getPro noun: slave.noun}; }; -window.SlavePronouns = /** @param {App.Entity.SlaveState} slave */ function SlavePronouns(slave) { +window.SlavePronouns = +/** + * @param {App.Entity.SlaveState} slave + */ +function SlavePronouns(slave) { const V = State.variables; const pronouns = getPronouns(slave); V.pronoun = pronouns.pronoun; @@ -368,7 +426,12 @@ window.SlavePronouns = /** @param {App.Entity.SlaveState} slave */ function Slav V.object = pronouns.object; }; -window.WrittenMaster = /** @param {App.Entity.SlaveState} slave */ function WrittenMaster(slave) { +window.WrittenMaster = +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} // I think + */ +function WrittenMaster(slave) { const V = State.variables; if (slave !== undefined) Enunciate(slave); @@ -377,7 +440,11 @@ window.WrittenMaster = /** @param {App.Entity.SlaveState} slave */ function Writ return V.writtenTitle; }; -window.Enunciate = /** @param {App.Entity.SlaveState} slave */ function Enunciate(slave) { +window.Enunciate = +/** + * @param {App.Entity.SlaveState} slave + */ +function Enunciate(slave) { const V = State.variables; if (SlaveStatsChecker.checkForLisp(slave)) { if (V.PC.customTitleLisp !== undefined) @@ -518,7 +585,12 @@ window.Enunciate = /** @param {App.Entity.SlaveState} slave */ function Enunciat } }; -window.fetishChangeChance = /** @param {App.Entity.SlaveState} slave */ function fetishChangeChance(slave) { +window.fetishChangeChance = +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +function fetishChangeChance(slave) { const V = State.variables; let chance = 0, sex = 0; @@ -535,7 +607,12 @@ window.fetishChangeChance = /** @param {App.Entity.SlaveState} slave */ function return chance; }; -window.SlaveFullName = /** @param {App.Entity.SlaveState} slave */ function SlaveFullName(slave) { +window.SlaveFullName = +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +function SlaveFullName(slave) { const V = State.variables; const pair = slave.slaveSurname ? [slave.slaveName, slave.slaveSurname] : [slave.slaveName]; if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(slave.nationality)) || (V.surnameOrder === 2)) @@ -543,7 +620,12 @@ window.SlaveFullName = /** @param {App.Entity.SlaveState} slave */ function Slav return pair.join(" "); }; -window.SlaveFullBirthName = /** @param {App.Entity.SlaveState} slave */ function SlaveFullBirthName(slave) { +window.SlaveFullBirthName = +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +function SlaveFullBirthName(slave) { const V = State.variables; const pair = slave.birthSurname ? [slave.birthName, slave.birthSurname] : [slave.birthName]; if ((V.surnameOrder !== 1 && ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(slave.nationality)) || (V.surnameOrder === 2)) @@ -1095,7 +1177,12 @@ window.PCTitle = function PCTitle() { } }; -window.PoliteRudeTitle = /** @param {App.Entity.SlaveState} slave */ function PoliteRudeTitle(slave) { +window.PoliteRudeTitle = +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +function PoliteRudeTitle(slave) { const V = State.variables; const PC = V.PC; const s = V.sEnunciate; @@ -1122,7 +1209,12 @@ window.PoliteRudeTitle = /** @param {App.Entity.SlaveState} slave */ function Po return r; }; -window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTitle(slave) { +window.SlaveTitle = +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +function SlaveTitle(slave) { const V = State.variables; let r = ""; if (V.newDescriptions === 1) { @@ -1480,7 +1572,11 @@ window.SlaveTitle = /** @param {App.Entity.SlaveState} slave */ function SlaveTi return r; }; -window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function DegradingName(slave) { +window.DegradingName = +/** + * @param {App.Entity.SlaveState} slave + */ +function DegradingName(slave) { const V = State.variables; const leadershipPosition = [ "be the Attendant", @@ -1880,7 +1976,12 @@ window.DegradingName = /** @param {App.Entity.SlaveState} slave */ function Degr slave.slaveSurname = surname; }; -window.SlaveSort = /** @param {App.Entity.SlaveState[]} slaves */ function SlaveSort(slaves, main = false) { +window.SlaveSort = +/** + * @param {App.Entity.SlaveState[]} slaves + * @param {boolean} main + */ +function SlaveSort(slaves, main = false) { const V = State.variables; if (main) { switch (V.sortSlavesBy) { @@ -1935,7 +2036,12 @@ window.SlaveSort = /** @param {App.Entity.SlaveState[]} slaves */ function Slave } }; -window.slaveSortMinor = /** @param {App.Entity.SlaveState[]} slaves */ function slaveSortMinor(slaves) { +window.slaveSortMinor = +/** + * @param {App.Entity.SlaveState[]} slaves + */ +// eslint-disable-next-line no-unused-vars +function slaveSortMinor(slaves) { slaves = slaves.sort((a, b) => a.slaveName < b.slaveName ? -1 : 1); }; @@ -1993,7 +2099,13 @@ window.MenialPopCap = function MenialPopCap() { return r; }; -window.faceIncrease = /** @param {App.Entity.SlaveState} slave */ function faceIncrease(slave, amount) { +window.faceIncrease = +/** + * @param {App.Entity.SlaveState} slave + * @param {number} amount + * @returns {string} + */ +function faceIncrease(slave, amount) { const pronouns = getPronouns(slave); const his = pronouns.possessive; const His = capFirstChar(his); @@ -2015,7 +2127,12 @@ window.faceIncrease = /** @param {App.Entity.SlaveState} slave */ function faceI return r; }; -window.Deadliness = /** @param {App.Entity.SlaveState} slave */ function Deadliness(slave) { +window.Deadliness = +/** + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +function Deadliness(slave) { const V = State.variables; let deadliness = 2; diff --git a/src/js/nursery.js b/src/js/nursery.js new file mode 100644 index 0000000000000000000000000000000000000000..eda1a9121c6620a87ba82c3c80bd77a3ae5dff7d --- /dev/null +++ b/src/js/nursery.js @@ -0,0 +1,17 @@ +/* eslint-disable no-unused-vars */ +/* eslint-disable no-undef */ +App.Nursery.longChild = /** @param {App.Entity.SlaveState} child */ function (child) { + const V = State.variables; + let r = ``; + let pronouns = getPronouns(slave); + let he = pronouns.pronoun; + let him = pronouns.object; + let his = pronouns.possessive; + let hers = pronouns.possessivePronoun; + let himself = pronouns.objectReflexive; + let boy = pronouns.noun; + let He = capFirstChar(he); + let His = capFirstChar(his); + + r += ``; +}