diff --git a/devTools/types/FC/gameState.d.ts b/devTools/types/FC/gameState.d.ts index 748bce5e5d823197620ee8a2d6a21eae3fea1dad..7226eeb1442ceba8177858fd7c32d68225308b7f 100644 --- a/devTools/types/FC/gameState.d.ts +++ b/devTools/types/FC/gameState.d.ts @@ -34,7 +34,7 @@ declare namespace FC { ID?: number; FS: { name: string; - race?: FC.Race; + race?: FC.Race; adopted?: number; } /** @@ -103,7 +103,6 @@ declare namespace FC { interface TemporaryVariablesInTheGameState { gameover?: string; sortQuickList?: string; - slaveAfterRA?: SlaveState; /** @deprecated */ returnTo: string; diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index c104e5d782ec031e38ee463a35028fd4de3243db..166bd2ffb9b4497c26a822c41d9ace87767bde2e 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -141,7 +141,7 @@ App.Update.globalVariables = function(node) { if (V.hostageAnnounced && !V.slaves.find(s => s.origin.includes("You were acquainted with $him before you were an arcology owner") && s.newGamePlus === 0)) { V.rival.hostageState = 1; } - V.rival.hostageState = V.rival.hostageState || 0; + V.rival.hostageState = V.rival.hostageState || 0; V.rival.state = V.rival.state || 0; V.rival.prosperity = V.rival.prosperity || 0; @@ -1462,7 +1462,6 @@ App.Update.slaveIndices = function(node) { App.Update.slaveRecords = function(node) { const detachedSlaves = [ V.hostage, - V.slaveAfterRA, V.boomerangSlave, V.traitor, V.shelterSlave diff --git a/src/endWeek/reports/penthouseReport.js b/src/endWeek/reports/penthouseReport.js index f2dc91c5624554929312c3bf835cb573c66e2dd7..33a654b76494797f3f4f1b537c3019f1387c3d0d 100644 --- a/src/endWeek/reports/penthouseReport.js +++ b/src/endWeek/reports/penthouseReport.js @@ -518,6 +518,19 @@ App.EndWeek.penthouseReport = function() { App.Events.addNode(el, r, "div", "indent"); return el; + /** + * Gives a back a clone with RA applied to it. The original is not modified. + * Call and then check potential change against it to see if the RA would revert it. + * + * @param {FC.SlaveState} slave + * @returns {FC.SlaveState} + */ + function slaveAfterRA(slave) { + const after = clone(slave); + DefaultRules(after); + return after; + } + function piercingCheck() { let piercingForbidden = 0; if (slave.piercing.ear.weight === 0 && slave.earShape !== "none") { @@ -526,8 +539,7 @@ App.EndWeek.penthouseReport = function() { } else { slave.piercing.ear.weight = 1; } - RulesDeconfliction(slave); - if (slave.piercing.ear.weight !== V.slaveAfterRA.piercing.ear.weight) { + if (slave.piercing.ear.weight !== slaveAfterRA(slave).piercing.ear.weight) { piercingForbidden = 1; slave.piercing.ear.weight = 0; } else { @@ -546,8 +558,7 @@ App.EndWeek.penthouseReport = function() { } else { slave.piercing.nose.weight = 1; } - RulesDeconfliction(slave); - if (slave.piercing.nose.weight !== V.slaveAfterRA.piercing.nose.weight) { + if (slave.piercing.nose.weight !== slaveAfterRA(slave).piercing.nose.weight) { piercingForbidden = 1; slave.piercing.nose.weight = 0; } else { @@ -566,8 +577,7 @@ App.EndWeek.penthouseReport = function() { } else { slave.piercing.eyebrow.weight = 1; } - RulesDeconfliction(slave); - if (slave.piercing.eyebrow.weight !== V.slaveAfterRA.piercing.eyebrow.weight) { + if (slave.piercing.eyebrow.weight !== slaveAfterRA(slave).piercing.eyebrow.weight) { piercingForbidden = 1; slave.piercing.eyebrow.weight = 0; } else { @@ -586,8 +596,7 @@ App.EndWeek.penthouseReport = function() { } else { slave.piercing.lips.weight = 1; } - RulesDeconfliction(slave); - if (slave.piercing.lips.weight !== V.slaveAfterRA.piercing.lips.weight) { + if (slave.piercing.lips.weight !== slaveAfterRA(slave).piercing.lips.weight) { piercingForbidden = 1; slave.piercing.lips.weight = 0; } else { @@ -606,8 +615,7 @@ App.EndWeek.penthouseReport = function() { } else { slave.piercing.navel.weight = 1; } - RulesDeconfliction(slave); - if (slave.piercing.navel.weight !== V.slaveAfterRA.piercing.navel.weight) { + if (slave.piercing.navel.weight !== slaveAfterRA(slave).piercing.navel.weight) { piercingForbidden = 1; slave.piercing.navel.weight = 0; } else { diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 4c47a46bac4741ffd49d61ee0fd6892edcdd2434..5c27802b112fdeb0f9319aa470e670c9f200439d 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -357,17 +357,6 @@ App.RA.newRule = function() { */ globalThis.emptyDefaultRule = App.RA.newRule.rule; -/** - * Saves the slave, silently fires the RA, saves the slave's after-RA state, and then reverts the slave. - * Call and then check potential change against V.slaveAfterRA to see if the RA would revert it. - * @param {App.Entity.SlaveState} slave - */ -globalThis.RulesDeconfliction = function(slave) { - const before = clone(slave); - DefaultRules(slave); - V.slaveAfterRA = clone(slave); - slave = before; -}; /** * Creates RA target object used in rules for body properties