diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 19b93893e47e53725e32754e3f04e945fb82b20f..40f9dbb513a549c7258994dc03d092c962136fe0 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -7,8 +7,8 @@ App.Data.defaultGameStateVariables = { storedLink: "", // Version - ver: 0, - pmodVer: 0, + ver: "", + pmodVer: "", releaseID: 0, // Slaves diff --git a/src/futureSocieties/fsDecoration.js b/src/futureSocieties/fsDecoration.js index b937b06c90caf3aef67c299a4f7f0affdeb39164..789d1f662bbd45416dc1300e911ce5c33aa5e5f5 100644 --- a/src/futureSocieties/fsDecoration.js +++ b/src/futureSocieties/fsDecoration.js @@ -10,7 +10,7 @@ App.UI.facilityRedecoration = function() { FutureSocieties.DecorationCleanup(); const applicableFS = FutureSocieties.activeFSes(arc).filter(name => (arc[name] > 20)); - const decorationNames = Array.from(applicableFS, FS => FutureSocieties.decorationName(FS)).filter(Boolean); + const decorationNames = Array.from(applicableFS, FS => FutureSocieties.decorationName(FS)).filter(Boolean); if (V.brothel > 0) { activeFacilities.set(V.brothelName, "brothelDecoration"); diff --git a/src/futureSocieties/fsPassage.js b/src/futureSocieties/fsPassage.js index 9a63c3ded1977f8c7bd83a22a10163134e079d94..47aa8eaa69d4800a591e587e08115b7265d41dca 100644 --- a/src/futureSocieties/fsPassage.js +++ b/src/futureSocieties/fsPassage.js @@ -886,7 +886,6 @@ App.UI.fsPassage = function() { App.Events.addNode(p, r, "div"); el.append(p); - /* Milking stands alone */ r = []; if (arc.FSPastoralist !== "unset") { @@ -911,7 +910,6 @@ App.UI.fsPassage = function() { } App.Events.addNode(el, r, "p"); - /* Physical Idealist vs Hedonist */ p = document.createElement("p"); r = []; diff --git a/src/futureSocieties/futureSociety.js b/src/futureSocieties/futureSociety.js index a59df4b695c06781e6c611db5b76716233b3196f..1be2fda9f85905b3378e5fd5d729556d3e6275fd 100644 --- a/src/futureSocieties/futureSociety.js +++ b/src/futureSocieties/futureSociety.js @@ -51,9 +51,11 @@ globalThis.FutureSocieties = (function() { * @param {number} progress */ function applyBroadProgress(arcologyID, progress) { + /** @type {FC.ArcologyState} */ const arcology = V.arcologies[arcologyID]; for (const fs of activeFSes(arcology)) { if (fs !== "FSNull") { // does not progress this way + // @ts-ignore // Because of activeFSes() we know it cannot be "unset", the only valid non numeric value. arcology[fs] += progress; } } @@ -68,6 +70,7 @@ globalThis.FutureSocieties = (function() { for (const fs of activeFSes(arcology)) { if (fs !== "FSNull") { // no conventional progress if (arcology[fs] > V.FSLockinLevel) { + // @ts-ignore // Because of activeFSes() we know it cannot be "unset", the only valid non numeric value. arcology.influenceBonus += arcology[fs] - V.FSLockinLevel; arcology[fs] = V.FSLockinLevel; } @@ -232,6 +235,7 @@ globalThis.FutureSocieties = (function() { purged.push(fs); arc[fs] = "unset"; } else { + // @ts-ignore // Because of activeFSes() we know it cannot be "unset", the only valid non numeric value. arc[fs] -= 10; } } @@ -450,7 +454,10 @@ globalThis.FutureSocieties = (function() { const arc = V.arcologies[0]; if (FSProp && Number.isFinite(arc[FSProp])) { - arc[FSProp] = Math.clamp(arc[FSProp] + magnitude * V.FSSingleSlaveRep, 0, 100); + /** @type {number} */ + // @ts-ignore // We know this is true because of Number.isFinite() + const n = arc[FSProp]; + arc[FSProp] = Math.clamp(n + magnitude * V.FSSingleSlaveRep, 0, 100); } } diff --git a/src/gui/Encyclopedia/encyclopediaEntries.js b/src/gui/Encyclopedia/encyclopediaEntries.js index 1a96162a5bc2d5426fc1565826585fdb89f75733..fd3cf50d6d78fd67e0b03af510e276b9baaa3499 100644 --- a/src/gui/Encyclopedia/encyclopediaEntries.js +++ b/src/gui/Encyclopedia/encyclopediaEntries.js @@ -72,7 +72,6 @@ App.Encyclopedia.Entries = (function() { App.UI.DOM.combineNodes(topic("Rest"), " is an assignment mostly used to improve ", encyLink("health", "Health"), ". It can be useful to order slaves you wish to intensively modify to rest, since most modifications damage health. It will synergize with curative treatments, providing bonus healing when both are simultaneously applied."); - entries.sexualServitude = () => App.UI.DOM.combineNodes(topic("Sexual servitude"), " is an assignment which pleases other slaves by forcing the slave to service them sexually. Useful for driving the targeted slave's ", diff --git a/src/gui/interactiveDetails.js b/src/gui/interactiveDetails.js index 113756d327e8f602ec55537d329a281d70c26ada..647e970ea5ed9a5eeb283252fa932b25e8bcd8ae 100644 --- a/src/gui/interactiveDetails.js +++ b/src/gui/interactiveDetails.js @@ -7,7 +7,7 @@ App.UI.DOM.InteractiveDetails = class { * @param {function(): HTMLElement|DocumentFragment} [detailsGenerator] function which generates the contents of the details overlay (omit to disable details) * @param {string[]} [linkClasses=[]] list of extra CSS classes to apply to the link */ - constructor(linkText, detailsGenerator, linkClasses=[]) { + constructor(linkText, detailsGenerator, linkClasses = []) { this.span = App.UI.DOM.makeElement("span", "", "details-overlay"); this.span.style.visibility = "hidden"; this.link = detailsGenerator ? App.UI.DOM.link(linkText, () => this.toggle()) : App.UI.DOM.makeElement("span", linkText); diff --git a/src/gui/multipleInspect.js b/src/gui/multipleInspect.js index 93f5fb27a05a43789191b743afcd4423c478fde7..02d20945987c3a60f7f6ffcc619b486d33612ffb 100644 --- a/src/gui/multipleInspect.js +++ b/src/gui/multipleInspect.js @@ -4,7 +4,7 @@ App.UI.MultipleInspect = (function() { * Intended for use from DOM passages. * @param {Array<App.Entity.SlaveState>} slaves * @param {boolean} showFamilyTree - * @param {string} [market] + * @param {FC.SlaveMarketName} [market] * @returns {DocumentFragment} */ function MultipleInspectDOM(slaves, showFamilyTree, market) { @@ -18,7 +18,7 @@ App.UI.MultipleInspect = (function() { if (slaves.length > 1 && showFamilyTree) { const button = App.UI.tabBar.tabButton(`familyTreeTab`, "Family Tree"); - button.addEventListener('click', event => { + button.addEventListener('click', () => { renderFamilyTree(slaves, slaves[0].ID); }); tabBar.append(button); diff --git a/src/gui/options/options.js b/src/gui/options/options.js index f91cfee161a93fa85de552af6ff2ebcd29488b63..90faa04dd30cf834ccdb341f4c20ab22783af958 100644 --- a/src/gui/options/options.js +++ b/src/gui/options/options.js @@ -82,7 +82,6 @@ App.UI.optionsPassage = function() { ) ); - if (isNaN(V.rep)) { links.push( App.UI.DOM.link( @@ -296,7 +295,6 @@ App.UI.optionsPassage = function() { el.append(options.render()); - App.UI.DOM.appendNewElement("h2", el, "Images"); el.append(App.UI.artOptions()); @@ -483,7 +481,6 @@ App.UI.optionsPassage = function() { .addValueList([["Extremely fast", 2], ["Very fast", 1.5], ["Fast", 1.25], ["Normal", 1], ["Slow", 0.75], ["Very slow", 0.5]]); } - if (V.SecExp.settings.battle.enabled > 0) { options.addOption("Commanders gain a prestige rank every 10 victories", "allowSlavePrestige", V.SecExp.settings.battle) .addValue("Yes", 1).on().addValue("No", 0).off(); @@ -610,7 +607,6 @@ App.UI.optionsPassage = function() { tr.append(td); table.append(tr); - tr = document.createElement("tr"); td = document.createElement("td"); td.style.textAlign = "right"; @@ -828,7 +824,6 @@ App.UI.optionsPassage = function() { r.push(App.UI.DOM.makeElement("span", "Cheating will be flagged in your save", "note")); App.Events.addNode(el, r, "div", "scLink2"); - SectorCounts(); links = []; @@ -855,7 +850,6 @@ App.UI.optionsPassage = function() { ); App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(links), "scLink2"); - links = []; links.push( App.UI.DOM.link( diff --git a/src/gui/options/summaryOptions.js b/src/gui/options/summaryOptions.js index 969394b0fa1f8620a1a6837a230899588624dd20..9f00e7897439ad2b8d8e572d0997ca228e310ead 100644 --- a/src/gui/options/summaryOptions.js +++ b/src/gui/options/summaryOptions.js @@ -40,7 +40,7 @@ App.UI.summaryOptions = function() { App.UI.DOM.appendNewElement("h2", el, "Individual panels"); App.UI.DOM.appendNewElement("div", el, "Sample summary:"); - el.append(App.UI.SlaveList.render([V.slaves.random().ID], new Array(), App.UI.SlaveList.SlaveInteract.stdInteract)); + el.append(App.UI.SlaveList.render([V.slaves.random().ID], [], App.UI.SlaveList.SlaveInteract.stdInteract)); options = (new App.UI.OptionsGroup()).enableDoubleColumn(); diff --git a/src/gui/quicklinks.js b/src/gui/quicklinks.js index f993e46a2038ab8f40f373312f0e156ea1212795..151ef4198848d1e8b7d96b58c68f933ecbacad1c 100644 --- a/src/gui/quicklinks.js +++ b/src/gui/quicklinks.js @@ -352,7 +352,6 @@ App.UI.quickMenu = (function() { addBackLink(links); div.append(...links); - // traverse from current passage up to uncollapse. if (currentPassage !== null) { while (!currentPassage.classList.contains("quick-links")) { diff --git a/src/gui/storyCaption.js b/src/gui/storyCaption.js index c5fe10d4fa5ebc1f720b22fd88d3784ab48a145b..57e9de9ff6e8ce77c5a722844cbe73c93fd52880 100644 --- a/src/gui/storyCaption.js +++ b/src/gui/storyCaption.js @@ -244,9 +244,9 @@ App.UI.storyCaption = function() { App.UI.DOM.appendNewElement("span", div, name, "pink"); div.append(" | "); if (pops > cap) { - App.UI.DOM.appendNewElement("span", div, pops, "warning"); + App.UI.DOM.appendNewElement("span", div, String(pops), "warning"); } else { - div.append(pops); + div.append(String(pops)); } div.append(`/${cap}`); return div; @@ -467,6 +467,7 @@ App.UI.storyCaption = function() { } function startingGirls() { + // @ts-ignore // In starting girls we know that there is always an active slave let _slaveCost = startingSlaveCost(V.activeSlave); const p = document.createElement("p");