diff --git a/devTools/dictionaries/misc.txt b/devTools/dictionaries/misc.txt index 5cec5cbe74809f5227ff76d0366c2ff5b78b779d..8d376ed6eba569e00b6b86dcab7bd1adcea7fd57 100644 --- a/devTools/dictionaries/misc.txt +++ b/devTools/dictionaries/misc.txt @@ -4,6 +4,7 @@ mcmonkeyprojects orthodontal rgthree SDXL +Svornost swinir unapprovingly uncircumcise diff --git a/src/005-passages/interactPassages.js b/src/005-passages/interactPassages.js index 3c51051720ccf9437ec43118f34e25fb58200ad2..2ffd7cb450d99d10d1aa62e43869bc29d487d9ba 100644 --- a/src/005-passages/interactPassages.js +++ b/src/005-passages/interactPassages.js @@ -33,17 +33,17 @@ new App.DomPassage( "Husk Slave Swap Workaround", () => { V.nextButton = "Abort Operation"; - if (!V.temp.activeSlave) { - throw new Error(`V.temp.activeSlave is not set`); + if (!V.temp.husk) { + throw new Error(`V.temp.husk is not set`); } - if (V.temp.activeSlave.tankBaby !== 3) { + if (V.temp.husk.tankBaby !== 3) { V.nextLink = "Scheduled Event"; V.returnTo = "Scheduled Event"; } else { V.nextLink = "Main"; V.returnTo = "Incubator"; } - return huskSwapSelection(V.temp.activeSlave); + return huskSwapSelection(V.temp.husk); } ); diff --git a/src/events/scheduled/seHuskSlaveDelivery.js b/src/events/scheduled/seHuskSlaveDelivery.js index 42ef18f1361308db2e737249693da86a529ec985..bee1f108784e795d3360f4f88b9af6528d4e1d36 100644 --- a/src/events/scheduled/seHuskSlaveDelivery.js +++ b/src/events/scheduled/seHuskSlaveDelivery.js @@ -15,6 +15,8 @@ App.Events.SEHuskSlaveDelivery = class SEHuskSlaveDelivery extends App.Events.Ba if (V.huskSlave.race !== "not important") { pram.race = V.huskSlave.race; } + + /** @type {FC.SlaveState} */ let husk; if (V.huskSlave.sex === 2) { husk = GenerateNewSlave("XY", pram); @@ -73,7 +75,7 @@ App.Events.SEHuskSlaveDelivery = class SEHuskSlaveDelivery extends App.Events.Ba App.Events.addResponses(node, choices); function accept() { - V.temp.activeSlave = husk; + V.temp.husk = husk; V.returnTo = V.nextLink; Engine.play("Husk Slave Swap Workaround"); return ``; diff --git a/src/js/wombJS.js b/src/js/wombJS.js index a04a4b9e29257e6ff5c7af1bc883efde9d31549d..4f2225c617209bef8713a0533564284d361c8570 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -866,10 +866,14 @@ globalThis.WombCleanGenericReserve = function(actor, type, count) { /** * @param {FC.HumanState} actor - * @param {"incubator"|"nursery"} type + * @param {"incubator"|"nursery"|"both"} type * @returns {number} */ globalThis.WombReserveCount = function(actor, type) { + if (type === "both") { + return WombReserveCount(actor, "incubator") + WombReserveCount(actor, "nursery"); + } + let cnt = 0; actor.womb.forEach(function(ft) { diff --git a/src/npc/surgery/bodySwap/bodySwap.js b/src/npc/surgery/bodySwap/bodySwap.js index 2f3970c7a0aa5c902ae33a3331a4ccea96be8376..6b5448d8c063490434ba7a40a1b2bf1f7a925432 100644 --- a/src/npc/surgery/bodySwap/bodySwap.js +++ b/src/npc/surgery/bodySwap/bodySwap.js @@ -339,7 +339,7 @@ globalThis.huskSwapSelection = function(body) { if (!hasAnyProstheticLimbs(soul)) { if (soul.indenture === -1) { if (soul.breedingMark === 0 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || !FutureSocieties.isActive('FSRestart')) { - if (WombReserveCount(soul) === 0) { + if (WombReserveCount(soul, "both") === 0) { if (soul.ID !== body.ID) { App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( diff --git a/src/npc/surgery/bodySwap/huskSlaveSwap.js b/src/npc/surgery/bodySwap/huskSlaveSwap.js index b55cba76b879d44ed7871eadb609260c56f935df..d35d3fc59949070cb2c1e8b5a117615d03ddaaa2 100644 --- a/src/npc/surgery/bodySwap/huskSlaveSwap.js +++ b/src/npc/surgery/bodySwap/huskSlaveSwap.js @@ -1,27 +1,40 @@ + +/** + * Places the mind of the slave at `V.temp.swappingSlave` in a body husk (at `V.temp.husk`) and returns a description of the procedure + * @returns {DocumentFragment} + */ App.UI.SlaveInteract.huskSlaveSwap = function() { const node = new DocumentFragment(); const target = getSlave(V.temp.swappingSlave); const oldSlave = clone(target); + /** @type {FC.SlaveState} */ + const husk = V.temp.husk; + if (!husk) { + throw new Error(`V.temp.husk was not set`); + } const { he } = getPronouns(target); App.UI.DOM.appendNewElement("p", node, `You strap ${target.slaveName}, and the body to which ${he} will be transferred, into the remote surgery and stand back as it goes to work.`); - bodySwap(target, asSlave(V.temp.activeSlave), false); - const gps = isInGenePool(V.temp.activeSlave) ? getGenePoolRecordWriteMode(V.temp.activeSlave) : undefined; - // special exception to swap genePool since the temporary body lacks an entry. Otherwise we could just call bodySwap using the genePool entries - gps.race = target.race; - gps.origRace = target.origRace; - gps.skin = target.skin; - gps.markings = target.markings; - gps.eye.origColor = target.eye.origColor; - gps.origHColor = target.origHColor; - gps.origSkin = target.origSkin; - gps.face = target.face; - gps.pubicHStyle = target.pubicHStyle; - gps.underArmHStyle = target.underArmHStyle; - gps.eyebrowHStyle = target.eyebrowHStyle; + bodySwap(target, asSlave(husk), false); + const gps = isInGenePool(husk) ? getGenePoolRecordWriteMode(husk) : undefined; + if (gps) { + // not sure what Svornost was trying to accomplish with this, but gps will always be undefined due to how this function is called. So this code should never run, but I left it here just in case - FranklyGeorge + // special exception to swap genePool since the temporary body lacks an entry. Otherwise we could just call bodySwap using the genePool entries - Svornost + gps.race = target.race; + gps.origRace = target.origRace; + gps.skin = target.skin; + gps.markings = target.markings; + gps.eye.origColor = target.eye.origColor; + gps.origHColor = target.origHColor; + gps.origSkin = target.origSkin; + gps.face = target.face; + gps.pubicHStyle = target.pubicHStyle; + gps.underArmHStyle = target.underArmHStyle; + gps.eyebrowHStyle = target.eyebrowHStyle; + } App.Events.addParagraph(node, [ `After an honestly impressive procedure, ${target.slaveName} is recovering nicely.`, @@ -57,7 +70,7 @@ App.UI.SlaveInteract.huskSlaveSwap = function() { App.Events.addParagraph(node, r); target.bodySwap++; cashX(payout, "slaveTransfer"); - V.temp.activeSlave = 0; + V.temp.husk = undefined; V.temp.swappingSlave = 0; return node; };