diff --git a/src/data/backwardsCompatibility/00_READ_ME_FIRST.txt b/src/data/backwardsCompatibility/00_READ_ME_FIRST.txt index c62a23c619963bde9422fb485fd54bc12953af2f..774b80b2a9e95ee126190b8eaee937d7fd7d96c0 100644 --- a/src/data/backwardsCompatibility/00_READ_ME_FIRST.txt +++ b/src/data/backwardsCompatibility/00_READ_ME_FIRST.txt @@ -1,3 +1,3 @@ -All of the code in this directory is legacy and shouldn't be changed for any reason. +All of the code in this directory is legacy. Changing it will likely break old saves, as the patching system still uses it. To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. \ No newline at end of file diff --git a/src/data/backwardsCompatibility/assistantBC.js b/src/data/backwardsCompatibility/assistantBC.js index dd7a9f95abab1ebe49540a80718f156a7c10d617..82df1c348db7a7717061afcda4a9daa266e2779e 100644 --- a/src/data/backwardsCompatibility/assistantBC.js +++ b/src/data/backwardsCompatibility/assistantBC.js @@ -1,11 +1,13 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ -// @ts-nocheck +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code + App.Update.assistantBC = function() { + // eslint-disable-next-line jsdoc/require-jsdoc function convert(oldVar, variable, value = null) { if (jsDef(V[oldVar])) { if (typeof V[oldVar] !== "number" || (typeof V[oldVar] === "number" && V[oldVar] > 0)) { diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index 16c92b6dc81c30315d077921d330993dccb72e89..e296bf194dbd51181b39dc0ef41c58256564b0f2 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -1,11 +1,17 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ -// @ts-nocheck +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code +/* eslint-disable jsdoc/require-jsdoc */ /* eslint-disable no-lone-blocks */ + +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + * @param {Node} node + */ App.Update.autoshred = function(node) { const set = new Set( Object.getOwnPropertyNames(App.Data.defaultGameStateVariables).concat( @@ -81,6 +87,10 @@ App.Update.backwardsCompatibility = function() { return f; }; +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + * @param {Node} node + */ App.Update.globalVariables = function(node) { V.rival = V.rival || {}; V.rival.FS = V.rival.FS || {}; @@ -1564,6 +1574,10 @@ App.Update.globalVariables = function(node) { node.append(`Done!`); }; +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + * @param {Node} node + */ App.Update.slaveIndices = function(node) { for (let bci = 0; bci < V.slaves.length; bci++) { if (typeof V.slaves[bci] !== "object") { @@ -1576,11 +1590,19 @@ App.Update.slaveIndices = function(node) { node.append(`Done!`); }; +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + * @param {Node} node + */ App.Update.playerCharacter = function(node) { App.Update.Player(V.PC); node.append(`Done!`); }; +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + * @param {Node} node + */ App.Update.slaveRecords = function(node) { const detachedSlaves = [ V.hostage, @@ -1691,6 +1713,7 @@ App.Update.slaveRecords = function(node) { }; /** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. * @param {string} primaryMessage * @param {string|undefined} [secondaryMessage=undefined] * @param {Node|undefined} [node=undefined] @@ -1711,6 +1734,7 @@ App.Update.logIssue = (primaryMessage, secondaryMessage=undefined, node=undefine }; /** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. * Updates a HumanState object * @param {FC.HumanState} actor * @param {"normal"|"PC"|"detached"|"hero"|"incubator"} slaveType @@ -1817,6 +1841,7 @@ App.Update.human = (actor, slaveType, node=undefined) => { }; /** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. * Updates HumanState objects. This includes all slaves and V.PC * Visually errors when there is an unexpected problem * @param {Node} node @@ -1865,6 +1890,10 @@ App.Update.humanRecords = (node) => { node.append(`Done!`); }; +/** + * @param {Node} node + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + */ App.Update.genePoolRecords = function(node) { Object.values(V.missingTable).forEach(s => { if (!jsDef(s.mother)) { @@ -2003,6 +2032,10 @@ App.Update.genePoolRecords = function(node) { } }; +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + * @param {Node} node + */ App.Update.RAassistantData = function(node) { const ruleIDs = V.defaultRules.map(rule => rule.ID); const slaveIDs = V.slaves.map(slave => slave.ID); @@ -2023,6 +2056,10 @@ App.Update.RAassistantData = function(node) { node.append(`Done!`); }; +/** + * @param {Node} node + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + */ App.Update.arcology = function(node) { if (V.continent === "Europe") { const prompt = App.UI.DOM.appendNewElement('div', node); @@ -2053,6 +2090,10 @@ App.Update.arcology = function(node) { } }; +/** + * @param {Node} node + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + */ App.Update.oldVersions = function(node) { V.slaves.filter(s => s.career === 0).forEach(s => s.career = "a slave"); V.slaves.filter(s => s.origin === 0).forEach(s => s.origin = ""); @@ -2784,12 +2825,20 @@ App.Update.oldVersions = function(node) { node.append(`Done!`); }; +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + * @param {Node} node + */ App.Update.FCNN = function(node) { // the game state should not contain any FCNN headlines that we can generate dynamically V.fcnn = _.difference(V.fcnn, App.FCNN.getAllValidText(false)); node.append(`Done!`); }; +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + * @param {Node} node + */ App.Update.cleanUp = function(node) { /* leave this at the bottom of BC */ // if (V.releaseID < App.Version.release) { @@ -2800,6 +2849,9 @@ App.Update.cleanUp = function(node) { node.append(`Done!`); }; +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + */ App.Update.sectorsToBuilding = function() { V.building = new App.Arcology.Building(V.terrain, []); const B = V.building; diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js index d52917b6ad55cef2fee4fe0b182dcf35ec1f78d1..afa5c2ab1cf50908dcf17740aca9dc047647a814 100644 --- a/src/data/backwardsCompatibility/datatypeCleanup.js +++ b/src/data/backwardsCompatibility/datatypeCleanup.js @@ -1,9 +1,11 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code + /** * @deprecated Future cleanup should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. * @@ -1793,7 +1795,7 @@ App.Update.PCDatatypeCleanup = (function PCDatatypeCleanup() { penetrative: PC.degeneracy ?? 0, birth: 0, weakness: 0, - } + }; if (PC.hasOwnProperty("degeneracy")) { delete PC.degeneracy; } @@ -2250,6 +2252,7 @@ App.Update.FacilityDatatypeCleanup = (function() { })(); /** + * @deprecated Future cleanup should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. * Cleans up a slave record assuming it is used for the gene pool. * * It removes all the unneeded properties for the gene pool attributes. @@ -2322,6 +2325,9 @@ App.Update.GenePoolRecordCleanup = (function() { } })(); +/** + * @deprecated Future cleanup should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. + */ App.Update.RARuleDatatypeCleanup = function() { "use strict"; diff --git a/src/data/backwardsCompatibility/farmyardBC.js b/src/data/backwardsCompatibility/farmyardBC.js index 0832fa29e081822665ef8d6bd857111f3160caf2..cd8df192d729eeea4ac242e8c720035ea6efb917 100644 --- a/src/data/backwardsCompatibility/farmyardBC.js +++ b/src/data/backwardsCompatibility/farmyardBC.js @@ -1,10 +1,14 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ -// @ts-nocheck +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code + +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js` + */ App.Facilities.Farmyard.BC = function() { if (typeof V.farmyardUpgrades !== "object") { V.farmyardUpgrades = { diff --git a/src/data/backwardsCompatibility/modsBC.js b/src/data/backwardsCompatibility/modsBC.js index 66da21388acd2c1de2e065ee937fb7adc039d134..68e5f229e12e662f9b824e825f06f0fd79167cec 100644 --- a/src/data/backwardsCompatibility/modsBC.js +++ b/src/data/backwardsCompatibility/modsBC.js @@ -1,9 +1,15 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code + +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js` + * @param {Node} node + */ App.Update.mods = function(node) { food(); diff --git a/src/data/backwardsCompatibility/pitBC.js b/src/data/backwardsCompatibility/pitBC.js index fea7184b853dbe7b1cf3c5d28e60f04a1a08b9cb..4b4911fa404db50e9b1f2ddf864361865687dc72 100644 --- a/src/data/backwardsCompatibility/pitBC.js +++ b/src/data/backwardsCompatibility/pitBC.js @@ -1,11 +1,14 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ -// @ts-nocheck +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js` + */ App.Facilities.Pit.BC = function() { if (V.pit) { if (typeof V.pit === "number") { diff --git a/src/data/backwardsCompatibility/policiesBC.js b/src/data/backwardsCompatibility/policiesBC.js index 9873fa145cff623a009a5efcc5ea17bfb53ae3b3..b804d221bd4ce5c834e1e57814721500f49ffc52 100644 --- a/src/data/backwardsCompatibility/policiesBC.js +++ b/src/data/backwardsCompatibility/policiesBC.js @@ -1,9 +1,15 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code +/* eslint-disable jsdoc/require-jsdoc */ + +/** + * @deprecated Future BC should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js` + */ App.Update.policies = function() { function convertMain(variable, pro, anti) { if (V[pro]) { diff --git a/src/data/backwardsCompatibility/updateCustomSlaveOrder.js b/src/data/backwardsCompatibility/updateCustomSlaveOrder.js index 70f02cb3c7af3fee38f1035aa220aa6df84c4319..6a2c4491d0d2ca59867900224548230f9803c6d8 100644 --- a/src/data/backwardsCompatibility/updateCustomSlaveOrder.js +++ b/src/data/backwardsCompatibility/updateCustomSlaveOrder.js @@ -1,10 +1,13 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ -/** Update custom slave orders (customSlave/huskSlave). +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code + +/** + * Update custom slave orders (customSlave/huskSlave). * @deprecated Future cleanup should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. * @param {FC.CustomSlaveOrder} customSlaveOrder */ diff --git a/src/data/backwardsCompatibility/updatePlayer.js b/src/data/backwardsCompatibility/updatePlayer.js index fb028183060d03f72deab3cf61c38d4a41eea92b..8fe3031cc8be0457fb61e957a3736b533630d9f6 100644 --- a/src/data/backwardsCompatibility/updatePlayer.js +++ b/src/data/backwardsCompatibility/updatePlayer.js @@ -1,10 +1,11 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ -// @ts-nocheck +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code + /** * @deprecated Future cleanup should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. * @param {FC.PlayerState} PC diff --git a/src/data/backwardsCompatibility/updateSlaveObject.js b/src/data/backwardsCompatibility/updateSlaveObject.js index 24588d71512b41395a3cc29133422421af9a1b76..414357b47670011b3788e7fc8587cc4328a56490 100644 --- a/src/data/backwardsCompatibility/updateSlaveObject.js +++ b/src/data/backwardsCompatibility/updateSlaveObject.js @@ -1,10 +1,11 @@ /** - * All of the code in this file is legacy, but changing it could break saves. + * All of the code in this file is legacy. Changing it will likely break old saves, as the patching system still uses it. * * To create a new patch (BC) see the instructions at the top of `/src/data/patches/patch.js`. */ -// @ts-nocheck +// @ts-nocheck this is legacy, all of it's missing/incorrect values where correct when they were implemented. This worked fine with save data structures from release 1258 and before. And saves/new games after 1258 shouldn't be running this code + /** * @deprecated Future cleanup should be handled in `/src/data/patches/patch.js` and `/src/data/verification/verify.js`. * @param {FC.SlaveState} slave @@ -1454,6 +1455,7 @@ App.Update.Slave = function(slave, genepool = false) { } } + // eslint-disable-next-line jsdoc/require-jsdoc function updateSlaveBoobPotential(slave) { const slaveGenes = genepool ? slave : V.genePool.find(s => s.ID === slave.ID); if (!slaveGenes || (slaveGenes.boobs <= 200 && slaveGenes.genes === "XY") || (slaveGenes.boobsImplant > 0 && App.Medicine.fleshSize(slaveGenes, 'boobs') < 300)) {