diff --git a/devTools/types/FC/medicine.d.ts b/devTools/types/FC/medicine.d.ts index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e3972630faf3f4c8f9ca3cce2698ba6879b485e9 100644 --- a/devTools/types/FC/medicine.d.ts +++ b/devTools/types/FC/medicine.d.ts @@ -0,0 +1,4 @@ +declare namespace FC { + type prostheticID = "interfaceP1" | "interfaceP2" | "basicL" | "sexL" | "beautyL" | "combatL" | "cyberneticL" | + "ocular" | "cochlear" | "electrolarynx" | "interfaceTail" | "modT" | "sexT" | "combatT" | "erectile"; +} diff --git a/js/003-data/slaveProstheticsData.js b/js/003-data/slaveProstheticsData.js index a212d2ce48625aba23a24b1882e493fb6867198b..80b89c1a22a502648eaed8ba15b60c75a3faf90c 100644 --- a/js/003-data/slaveProstheticsData.js +++ b/js/003-data/slaveProstheticsData.js @@ -1,7 +1,7 @@ /** * do not change order, order = display order * - * @type {string[]} + * @type {FC.prostheticID[]} */ App.Data.prostheticIDs = ["interfaceP1", "interfaceP2", "basicL", "sexL", "beautyL", "combatL", "cyberneticL", "ocular", "cochlear", @@ -20,7 +20,7 @@ App.Data.prostheticIDs = */ /** - * @type {Object<string, prosthetics>} + * @type {Object<FC.prostheticID, prosthetics>} */ App.Data.prosthetics = { interfaceP1: { @@ -161,21 +161,16 @@ App.Data.modTails = new Map([ ]); /** - * TODO expand with beauty stats and similar - * - * @type {Map<number, {minimumInterface: number, prostheticKey: string, short: string}>} + * @typedef {object} prostheticLimb + * @property {string} short + * @property {FC.prostheticID} prostheticKey + * @property {number} minimumInterface */ -App.Data.limbs = new Map([ - /* TODO think about how to include these - [0, { - short: "None", - isProsthetic: false, - }], - [0, { - short: "Human", - isProsthetic: false, - }], - */ + +/** + * @type {Map<number, prostheticLimb>} + */ +App.Data.prostheticLimbs = new Map([ [2, { short: "basic prosthetic", prostheticKey: "basicL", diff --git a/src/facilities/surgery/remoteSurgery.tw b/src/facilities/surgery/remoteSurgery.tw index 10eb2b11eaa4ec8482d3d216ff8c068a8b8d039c..f42f7006b456e47196a99a437d8c2e80802757d0 100644 --- a/src/facilities/surgery/remoteSurgery.tw +++ b/src/facilities/surgery/remoteSurgery.tw @@ -897,7 +897,7 @@ <<link "Amputate limb(s)">> <<set _atleastOne = 0>> /* temporary story variable */ - <<set $oldLimbs = App.Medicine.Prosthetics.currentLimbs(getSlave($AS))>> + <<set $oldLimbs = App.Medicine.Limbs.currentLimbs(getSlave($AS))>> <<if _LA === 1>> <<run removeLimbs(getSlave($AS), "left arm")>> <<set _atleastOne++>> @@ -931,13 +931,13 @@ <div> <<if !hasAllNaturalLimbs(getSlave($AS)) && getSlave($AS).PLimb == 0>> <<if isProstheticAvailable(getSlave($AS), "interfaceP1")>> - [[Install basic prosthetic interface|Surgery Degradation][$oldLimbs = App.Medicine.Prosthetics.currentLimbs(getSlave($AS)), getSlave($AS).PLimb = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", getSlave($AS)), surgeryDamage(getSlave($AS),20), $surgeryType = "PLimb interface"]] + [[Install basic prosthetic interface|Surgery Degradation][$oldLimbs = App.Medicine.Limbs.currentLimbs(getSlave($AS)), getSlave($AS).PLimb = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", getSlave($AS)), surgeryDamage(getSlave($AS),20), $surgeryType = "PLimb interface"]] <</if>> <<if isProstheticAvailable(getSlave($AS), "interfaceP2")>> | - [[Install advanced prosthetic interface|Surgery Degradation][$oldLimbs = App.Medicine.Prosthetics.currentLimbs(getSlave($AS)), getSlave($AS).PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", getSlave($AS)), surgeryDamage(getSlave($AS),20), $surgeryType = "PLimb interface"]] + [[Install advanced prosthetic interface|Surgery Degradation][$oldLimbs = App.Medicine.Limbs.currentLimbs(getSlave($AS)), getSlave($AS).PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", getSlave($AS)), surgeryDamage(getSlave($AS),20), $surgeryType = "PLimb interface"]] <</if>> <<elseif getSlave($AS).PLimb == 1 && isProstheticAvailable(getSlave($AS), "interfaceP2")>> - [[Upgrade to advanced prosthetic interface|Surgery Degradation][$oldLimbs = App.Medicine.Prosthetics.currentLimbs(getSlave($AS)), getSlave($AS).PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", getSlave($AS)), surgeryDamage(getSlave($AS),5), $surgeryType = "PLimb interface"]] + [[Upgrade to advanced prosthetic interface|Surgery Degradation][$oldLimbs = App.Medicine.Limbs.currentLimbs(getSlave($AS)), getSlave($AS).PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", getSlave($AS)), surgeryDamage(getSlave($AS),5), $surgeryType = "PLimb interface"]] <</if>> </div> diff --git a/src/interaction/prostheticConfig.js b/src/interaction/prostheticConfig.js index 01c07dceccad1ba509fd0f28e000ddbb18b175f5..c7cdf6bbd3cb80d1700740e1b95d56eaf826044f 100644 --- a/src/interaction/prostheticConfig.js +++ b/src/interaction/prostheticConfig.js @@ -39,6 +39,9 @@ App.UI.prostheticsConfig = function(slave) { return fragment; + /** + * @returns {DocumentFragment} + */ function eyes() { const f = document.createDocumentFragment(); @@ -144,6 +147,9 @@ App.UI.prostheticsConfig = function(slave) { return f; } + /** + * @returns {DocumentFragment} + */ function ears() { const f = document.createDocumentFragment(); if (slave.earImplant === 1) { @@ -185,6 +191,9 @@ App.UI.prostheticsConfig = function(slave) { return f; } + /** + * @returns {DocumentFragment} + */ function voice() { const f = document.createDocumentFragment(); @@ -234,15 +243,21 @@ App.UI.prostheticsConfig = function(slave) { return f; } + /** + * @returns {DocumentFragment} + */ function limbs() { const f = document.createDocumentFragment(); App.UI.DOM.appendNewElement("h2", f, "Limbs"); - App.UI.DOM.appendNewElement("p", f, App.Medicine.Prosthetics.selector(slave, App.Medicine.Prosthetics.currentLimbs(slave))); + App.UI.DOM.appendNewElement("p", f, App.Medicine.Limbs.selector(slave, App.Medicine.Limbs.currentLimbs(slave))); return f; } + /** + * @returns {DocumentFragment} + */ function tail() { const f = document.createDocumentFragment(); App.UI.DOM.appendNewElement("h2", f, "Tail"); @@ -315,6 +330,9 @@ App.UI.prostheticsConfig = function(slave) { return f; } + /** + * @returns {DocumentFragment} + */ function buyScreen() { const f = document.createDocumentFragment(); App.UI.DOM.appendNewElement("h2", f, "Prosthetics"); diff --git a/src/interaction/prostheticConfig.tw b/src/interaction/prostheticConfig.tw index c26fc69341fc707febae20b65be828080cd36ecf..5dd8cb5d9410fc400efc9bc239c70496f666ef77 100644 --- a/src/interaction/prostheticConfig.tw +++ b/src/interaction/prostheticConfig.tw @@ -23,7 +23,7 @@ <<case "limbs">> <<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Configuration">> - <<includeDOM App.Medicine.Prosthetics.reaction(getSlave($AS), $oldLimbs)>> + <<includeDOM App.Medicine.Limbs.reaction(getSlave($AS), $oldLimbs)>> <<unset $oldLimbs>> /* diff --git a/src/npc/descriptions/limbs.js b/src/npc/descriptions/limbs.js index 3ed278edafea2863b396b554bd3ed2d454ecfb7b..47814db3b52f2f988f2495591f964f1886123f40 100644 --- a/src/npc/descriptions/limbs.js +++ b/src/npc/descriptions/limbs.js @@ -1,230 +1,221 @@ -App.Medicine.Prosthetics = (function() { - return { - currentLimbs: currentLimbs, - amputate: amputate, - prosthetic: prosthetic, - selector: selector, - applySelector: applySelector, - reaction: reaction - }; +App.Medicine.Limbs = {}; + +/** + * Generates an object usable with the standard limb check functions. + * @param {App.Entity.SlaveState} slave + * @returns {FC.LimbsState} + */ +App.Medicine.Limbs.currentLimbs = function(slave) { + let s = {arm: {left: {type: 1}, right: {type: 1}}, leg: {left: {type: 1}, right: {type: 1}}, PLimb: 0}; + if (hasLeftArm(slave)) { + s.arm.left.type = getLeftArmID(slave); + } else { + s.arm.left = null; + } + if (hasRightArm(slave)) { + s.arm.right.type = getRightArmID(slave); + } else { + s.arm.right = null; + } + if (hasLeftLeg(slave)) { + s.leg.left.type = getLeftLegID(slave); + } else { + s.leg.left = null; + } + if (hasRightLeg(slave)) { + s.leg.right.type = getRightLegID(slave); + } else { + s.leg.right = null; + } + s.PLimb = slave.PLimb; + return s; +}; + +/** + * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} oldLimbs + * @param {string} returnTo + * @returns {Element|DocumentFragment} + */ +App.Medicine.Limbs.amputate = function(slave, oldLimbs, returnTo) { + const {his} = getPronouns(slave); + + const r = []; + + let implant = false; + if (slave.PLimb < 1 && isProstheticAvailable(slave, "interfaceP1")) { + implant = true; + r.push(App.UI.DOM.makeElement("div", App.UI.DOM.link("Install basic interface", () => install(1)))); + } + if (slave.PLimb < 2 && isProstheticAvailable(slave, "interfaceP2")) { + implant = true; + r.push(App.UI.DOM.makeElement("div", App.UI.DOM.link("Install advanced interface", () => install(2)))); + } - /** - * Generates an object usable with the standard limb check functions. - * @param {App.Entity.SlaveState} slave - * @returns {FC.LimbsState} - */ - function currentLimbs(slave) { - let s = {arm: {left: {type: 1}, right: {type: 1}}, leg: {left: {type: 1}, right: {type: 1}}, PLimb: 0}; - if (hasLeftArm(slave)) { - s.arm.left.type = getLeftArmID(slave); - } else { - s.arm.left = null; - } - if (hasRightArm(slave)) { - s.arm.right.type = getRightArmID(slave); - } else { - s.arm.right = null; - } - if (hasLeftLeg(slave)) { - s.leg.left.type = getLeftLegID(slave); - } else { - s.leg.left = null; - } - if (hasRightLeg(slave)) { - s.leg.right.type = getRightLegID(slave); - } else { - s.leg.right = null; - } - s.PLimb = slave.PLimb; - return s; + // check if we can install a limb interface and if yes, give player the option to do so. + if (implant) { + const outerDiv = document.createElement("div"); + outerDiv.id = "amputate"; + outerDiv.append( + App.UI.DOM.makeElement("div", `Since you already have a prosthetic interface prepared for this slave, you can install it during the operation. The procedure will put additional strain on ${his} health but less so than if you were to perform the procedures separately.`), + ...r, + App.UI.DOM.makeElement("div", App.UI.DOM.link("Do not install", noInstall))); + return outerDiv; } /** - * @param {App.Entity.SlaveState} slave - * @param {FC.LimbsState} oldLimbs - * @param {string} returnTo - * @returns {Element|DocumentFragment} + * @param {number} id */ - function amputate(slave, oldLimbs, returnTo) { - const {his} = getPronouns(slave); + function install(id) { + slave.PLimb = id; + surgeryDamage(slave, 10); + App.UI.DOM.replace("#amputate", App.Medicine.Limbs.prosthetic(slave, oldLimbs, returnTo)); + } - const r = []; + function noInstall() { + App.UI.DOM.replace("#amputate", App.Medicine.Limbs.reaction(slave, oldLimbs, returnTo)); + } - let implant = false; - if (slave.PLimb < 1 && isProstheticAvailable(slave, "interfaceP1")) { - implant = true; - r.push(App.UI.DOM.makeElement("div", App.UI.DOM.link("Install basic interface", () => install(1)))); - } - if (slave.PLimb < 2 && isProstheticAvailable(slave, "interfaceP2")) { - implant = true; - r.push(App.UI.DOM.makeElement("div", App.UI.DOM.link("Install advanced interface", () => install(2)))); - } + // check if there is a limb interface installed already, if there is show limb selection screen + if (slave.PLimb > 0) { + return App.Medicine.Limbs.prosthetic(slave, oldLimbs, returnTo); + } + return App.Medicine.Limbs.reaction(slave, oldLimbs, returnTo); +}; + +/** + * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} oldLimbs + * @param {string} returnTo + * @returns {DocumentFragment|HTMLDivElement} + */ +App.Medicine.Limbs.prosthetic = function(slave, oldLimbs, returnTo) { + if (!(isProstheticAvailable(slave, "basicL") || isProstheticAvailable(slave, "sexL") + || isProstheticAvailable(slave, "beautyL") || isProstheticAvailable(slave, "combatL") + || (isProstheticAvailable(slave, "cyberneticL") && slave.PLimb > 1))) { + return App.Medicine.Limbs.reaction(slave, oldLimbs, returnTo); + } + const {him} = getPronouns(slave); + + const div = document.createElement("div"); + div.id = "selector"; + + App.UI.DOM.appendNewElement("div", div, `Since you already have limbs prepared for ${him} you might as well attach them while you are working on ${him}:`); + div.append(App.Medicine.Limbs.selector(slave, oldLimbs, returnTo)); + + return div; +}; + +/** + * Displays a selector for prosthetic limbs of getSlave(V.AS) + * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} oldLimbs + * @param {string} [returnTo=""] + * @returns {HTMLSpanElement|DocumentFragment} + */ +App.Medicine.Limbs.selector = function(slave, oldLimbs, returnTo = "") { + const {her} = getPronouns(slave); + if (hasAllNaturalLimbs(slave)) { + return App.UI.DOM.makeElement("span", `You must amputate ${her} limbs before you can attach prosthetics.`, "detail"); + } + if (slave.PLimb < 1) { + return App.UI.DOM.makeElement("span", `You must install a prosthetic interface before you can attach prosthetics.`, "detail"); + } - // check if we can install a limb interface and if yes, give player the option to do so. - if (implant) { - const outerDiv = document.createElement("div"); - outerDiv.id = "amputate"; - outerDiv.append( - App.UI.DOM.makeElement("div", `Since you already have a prosthetic interface prepared for this slave, you can install it during the operation. The procedure will put additional strain on ${his} health but less so than if you were to perform the procedures separately.`), - ...r, - App.UI.DOM.makeElement("div", App.UI.DOM.link("Do not install", noInstall))); - return outerDiv; - } + const {his} = getPronouns(slave); + const newState = currentState(slave); - /** - * @param {number} id - */ - function install(id) { - slave.PLimb = id; - surgeryDamage(slave, 10); - App.UI.DOM.replace("#amputate", App.Medicine.Prosthetics.prosthetic(slave, oldLimbs, returnTo)); - } + const f = document.createDocumentFragment(); - function noInstall() { - App.UI.DOM.replace("#amputate", App.Medicine.Prosthetics.reaction(slave, oldLimbs, returnTo)); - } + const limbSelector = document.createElement("div"); + limbSelector.classList.add("limb-selector"); + + App.UI.DOM.appendNewElement("div", limbSelector, ""); + App.UI.DOM.appendNewElement("div", limbSelector, "Left Arm"); + App.UI.DOM.appendNewElement("div", limbSelector, "Right Arm"); + App.UI.DOM.appendNewElement("div", limbSelector, "Left Leg"); + App.UI.DOM.appendNewElement("div", limbSelector, "Right Leg"); - // check if there is a limb interface installed already, if there is show limb selection screen - if (slave.PLimb > 0) { - return prosthetic(slave, oldLimbs, returnTo); + limbSelector.append(row("None", 0)); + App.Data.prostheticLimbs.forEach((limb, key) => { + if (isProstheticAvailable(slave, limb.prostheticKey)) { + if (limb.minimumInterface <= slave.PLimb) { + limbSelector.append(row(capFirstChar(limb.short), key)); + } else { + App.UI.DOM.appendNewElement("div", limbSelector, + `You need to upgrade ${his} prosthetic interface to attach ${limb.short} limbs.`, ["full", "detail"]); + } } - return reaction(slave, oldLimbs, returnTo); + }); + + f.append(limbSelector); + f.append(apply()); + + return f; + + function apply() { + V.AS = slave.ID; + + return App.UI.DOM.link("Apply", () => { + applySelector(slave, newState); + if (returnTo) { + App.UI.DOM.replace("#selector", App.Medicine.Limbs.reaction(slave, oldLimbs, returnTo)); + } else { + V.prostheticsConfig = "limbs"; + V.oldLimbs = oldLimbs; + Engine.play("Prosthetics Configuration"); + } + }); } /** + * Generates an array with the current limbs of a slave. * @param {App.Entity.SlaveState} slave - * @param {FC.LimbsState} oldLimbs - * @param {string} returnTo - * @returns {DocumentFragment|HTMLDivElement} + * @returns {number[]} */ - function prosthetic(slave, oldLimbs, returnTo) { - if (!(isProstheticAvailable(slave, "basicL") || isProstheticAvailable(slave, "sexL") - || isProstheticAvailable(slave, "beautyL") || isProstheticAvailable(slave, "combatL") - || (isProstheticAvailable(slave, "cyberneticL") && slave.PLimb > 1))) { - return reaction(slave, oldLimbs, returnTo); - } - const {him} = getPronouns(slave); + function currentState(slave) { + return [getLeftArmID(slave), getRightArmID(slave), getLeftLegID(slave), getRightLegID(slave)]; + } + /** + * @param {number} limb + * @param {number} id + * @returns {HTMLDivElement} + */ + function radio(limb, id) { const div = document.createElement("div"); - div.id = "selector"; - App.UI.DOM.appendNewElement("div", div, `Since you already have limbs prepared for ${him} you might as well attach them while you are working on ${him}:`); - div.append(selector(slave, oldLimbs, returnTo)); + if (newState[limb] !== 1) { + const radio = document.createElement("input"); + radio.type = "radio"; + radio.name = "limb" + limb; + if (newState[limb] === id) { + radio.checked = true; + } + radio.onclick = () => { + newState[limb] = id; + }; + div.append(radio); + } return div; } /** - * Displays a selector for prosthetic limbs of getSlave(V.AS) - * @param {App.Entity.SlaveState} slave - * @param {FC.LimbsState} oldLimbs - * @param {string} [returnTo=""] - * @returns {HTMLSpanElement|DocumentFragment} + * @param {string} title + * @param {number} id + * @returns {DocumentFragment} */ - function selector(slave, oldLimbs, returnTo = "") { - const {her} = getPronouns(slave); - if (hasAllNaturalLimbs(slave)) { - return App.UI.DOM.makeElement("span", `You must amputate ${her} limbs before you can attach prosthetics.`, "detail"); - } - if (slave.PLimb < 1) { - return App.UI.DOM.makeElement("span", `You must install a prosthetic interface before you can attach prosthetics.`, "detail"); - } - - const {his} = getPronouns(slave); - const newState = currentState(slave); - + function row(title, id) { const f = document.createDocumentFragment(); - const limbSelector = document.createElement("div"); - limbSelector.classList.add("limb-selector"); - - App.UI.DOM.appendNewElement("div", limbSelector, ""); - App.UI.DOM.appendNewElement("div", limbSelector, "Left Arm"); - App.UI.DOM.appendNewElement("div", limbSelector, "Right Arm"); - App.UI.DOM.appendNewElement("div", limbSelector, "Left Leg"); - App.UI.DOM.appendNewElement("div", limbSelector, "Right Leg"); - - limbSelector.append(row("None", 0)); - App.Data.limbs.forEach((limb, key) => { - if (isProstheticAvailable(slave, limb.prostheticKey)) { - if (limb.minimumInterface <= slave.PLimb) { - limbSelector.append(row(capFirstChar(limb.short), key)); - } else { - App.UI.DOM.appendNewElement("div", limbSelector, - `You need to upgrade ${his} prosthetic interface to attach ${limb.short} limbs.`, ["full", "detail"]); - } - } - }); - - f.append(limbSelector); - f.append(apply()); - - return f; - - function apply() { - V.AS = slave.ID; - - return App.UI.DOM.link("Apply", () => { - App.Medicine.Prosthetics.applySelector(slave, newState); - if (returnTo) { - App.UI.DOM.replace("#selector", reaction(slave, oldLimbs, returnTo)); - } else { - V.prostheticsConfig = "limbs"; - V.oldLimbs = oldLimbs; - Engine.play("Prosthetics Configuration"); - } - }); - } + App.UI.DOM.appendNewElement("div", f, title); - /** - * Generates an array with the current limbs of a slave. - * @param {App.Entity.SlaveState} slave - * @returns {number[]} - */ - function currentState(slave) { - return [getLeftArmID(slave), getRightArmID(slave), getLeftLegID(slave), getRightLegID(slave)]; + for (let i = 0; i < newState.length; i++) { + f.append(radio(i, id)); } - /** - * @param {number} limb - * @param {number} id - * @returns {HTMLDivElement} - */ - function radio(limb, id) { - const div = document.createElement("div"); - - if (newState[limb] !== 1) { - const radio = document.createElement("input"); - radio.type = "radio"; - radio.name = "limb" + limb; - if (newState[limb] === id) { - radio.checked = true; - } - radio.onclick = () => { - newState[limb] = id; - }; - div.append(radio); - } - - return div; - } - - /** - * @param {string} title - * @param {number} id - * @returns {DocumentFragment} - */ - function row(title, id) { - const f = document.createDocumentFragment(); - - App.UI.DOM.appendNewElement("div", f, title); - - for (let i = 0; i < newState.length; i++) { - f.append(radio(i, id)); - } - - return f; - } + return f; } /** @@ -266,40 +257,40 @@ App.Medicine.Prosthetics = (function() { } } } +}; + +/** + * @param {App.Entity.SlaveState} slave + * @param {FC.LimbsState} oldLimbs + * @param {string} returnTo + * @returns {DocumentFragment} + */ +App.Medicine.Limbs.reaction = function(slave, oldLimbs, returnTo = "") { + let r = ""; + if (oldLimbs.PLimb !== slave.PLimb) { + r += `Prosthetic interface was ${oldLimbs.PLimb === 0 ? "none" : "basic"} and is now ${slave.PLimb === 1 ? "basic" : "advanced"}. `; + } + if (getLeftArmID(oldLimbs) !== getLeftArmID(slave)) { + r += `Left arm was ${idToDescription(getLeftArmID(oldLimbs))} and is now ${idToDescription(getLeftArmID(slave))}. `; + } + if (getRightArmID(oldLimbs) !== getRightArmID(slave)) { + r += `Right arm was ${idToDescription(getRightArmID(oldLimbs))} and is now ${idToDescription(getRightArmID(slave))}. `; + } + if (getLeftLegID(oldLimbs) !== getLeftLegID(slave)) { + r += `Left leg was ${idToDescription(getLeftLegID(oldLimbs))} and is now ${idToDescription(getLeftLegID(slave))}. `; + } + if (getRightLegID(oldLimbs) !== getRightLegID(slave)) { + r += `Right leg was ${idToDescription(getRightLegID(oldLimbs))} and is now ${idToDescription(getRightLegID(slave))}. `; + } - /** - * @param {App.Entity.SlaveState} slave - * @param {FC.LimbsState} oldLimbs - * @param {string} returnTo - * @returns {DocumentFragment} - */ - function reaction(slave, oldLimbs, returnTo = "") { - let r = ""; - if (oldLimbs.PLimb !== slave.PLimb) { - r += `Prosthetic interface was ${oldLimbs.PLimb === 0 ? "none" : "basic"} and is now ${slave.PLimb === 1 ? "basic" : "advanced"}. `; - } - if (getLeftArmID(oldLimbs) !== getLeftArmID(slave)) { - r += `Left arm was ${idToDescription(getLeftArmID(oldLimbs))} and is now ${idToDescription(getLeftArmID(slave))}. `; - } - if (getRightArmID(oldLimbs) !== getRightArmID(slave)) { - r += `Right arm was ${idToDescription(getRightArmID(oldLimbs))} and is now ${idToDescription(getRightArmID(slave))}. `; - } - if (getLeftLegID(oldLimbs) !== getLeftLegID(slave)) { - r += `Left leg was ${idToDescription(getLeftLegID(oldLimbs))} and is now ${idToDescription(getLeftLegID(slave))}. `; - } - if (getRightLegID(oldLimbs) !== getRightLegID(slave)) { - r += `Right leg was ${idToDescription(getRightLegID(oldLimbs))} and is now ${idToDescription(getRightLegID(slave))}. `; - } - - const f = document.createDocumentFragment(); - - App.UI.DOM.appendNewElement("p", f, r,); - App.UI.DOM.appendNewElement("p", f, "Slave's reaction", "note"); + const f = document.createDocumentFragment(); - if (returnTo) { - f.append(App.UI.DOM.passageLink("Continue", returnTo)); - } + App.UI.DOM.appendNewElement("p", f, r,); + App.UI.DOM.appendNewElement("p", f, "Slave's reaction", "note"); - return f; + if (returnTo) { + f.append(App.UI.DOM.passageLink("Continue", returnTo)); } -})(); + + return f; +}; diff --git a/src/npc/surgery/surgeryDegradation.js b/src/npc/surgery/surgeryDegradation.js index 4e3bc2bf43f1066d3dc759d496441dcde29c12a7..1d2d186b04c68c68ed82796b09e807f671e7e1f2 100644 --- a/src/npc/surgery/surgeryDegradation.js +++ b/src/npc/surgery/surgeryDegradation.js @@ -3485,12 +3485,12 @@ App.UI.SlaveInteract.surgeryDegradation = function(slave) { break; case "amp": V.nextButton = " "; - r.push(App.Medicine.Prosthetics.amputate(slave, V.oldLimbs, "Remote Surgery")); + r.push(App.Medicine.Limbs.amputate(slave, V.oldLimbs, "Remote Surgery")); delete V.oldLimbs; break; case "PLimb interface": V.nextButton = " "; - r.push(App.Medicine.Prosthetics.prosthetic(slave, V.oldLimbs, "Remote Surgery")); + r.push(App.Medicine.Limbs.prosthetic(slave, V.oldLimbs, "Remote Surgery")); delete V.oldLimbs; break; /* diff --git a/src/uncategorized/multiImplant.tw b/src/uncategorized/multiImplant.tw index 2ecb17b0c920f3f006c67ab4841257494a8c51a4..6547e98662dd9dd7df3b337d8cd1b7441286c240 100644 --- a/src/uncategorized/multiImplant.tw +++ b/src/uncategorized/multiImplant.tw @@ -139,38 +139,38 @@ that are ready be sent down. //Since $he must have a prosthetic interface installed to attach prosthetic limbs the <<= App.Data.prosthetics[_p.id].name>> will be put into storage.// <<else>> <<if _p.id == "basicL">> - <<set _state = App.Medicine.Prosthetics.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 2)>> + <<set _state = App.Medicine.Limbs.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 2)>> <<if _change>> - <<includeDOM App.Medicine.Prosthetics.reaction(getSlave($AS), _state)>> + <<includeDOM App.Medicine.Limbs.reaction(getSlave($AS), _state)>> <<else>> //Since $he already has more advanced prosthetic limbs attached the <<= App.Data.prosthetics.basicL.name>> will be put into storage.// <</if>> <<elseif _p.id == "sexL">> - <<set _state = App.Medicine.Prosthetics.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 3)>> + <<set _state = App.Medicine.Limbs.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 3)>> <<if _change>> - <<includeDOM App.Medicine.Prosthetics.reaction(getSlave($AS), _state)>> + <<includeDOM App.Medicine.Limbs.reaction(getSlave($AS), _state)>> <<else>> //Since $he already has advanced prosthetic limbs attached the <<= App.Data.prosthetics.sexL.name>> will be put into storage.// <</if>> <<elseif _p.id == "beautyL">> - <<set _state = App.Medicine.Prosthetics.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 4)>> + <<set _state = App.Medicine.Limbs.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 4)>> <<if _change>> - <<includeDOM App.Medicine.Prosthetics.reaction(getSlave($AS), _state)>> + <<includeDOM App.Medicine.Limbs.reaction(getSlave($AS), _state)>> <<else>> //Since $he already has advanced prosthetic limbs attached the <<= App.Data.prosthetics.beautyL.name>> will be put into storage.// <</if>> <<elseif _p.id == "combatL">> - <<set _state = App.Medicine.Prosthetics.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 5)>> + <<set _state = App.Medicine.Limbs.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 5)>> <<if _change>> - <<includeDOM App.Medicine.Prosthetics.reaction(getSlave($AS), _state)>> + <<includeDOM App.Medicine.Limbs.reaction(getSlave($AS), _state)>> <<else>> //Since $he already has advanced prosthetic limbs attached the <<= App.Data.prosthetics.combatL.name>> will be put into storage.// <</if>> <<else>> <<if getSlave($AS).PLimb == 2>> - <<set _state = App.Medicine.Prosthetics.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 2)>> + <<set _state = App.Medicine.Limbs.currentLimbs(getSlave($AS)), _change = upgradeLimbs(getSlave($AS), 2)>> <<if _change>> - <<includeDOM App.Medicine.Prosthetics.reaction(getSlave($AS), _state)>> + <<includeDOM App.Medicine.Limbs.reaction(getSlave($AS), _state)>> <</if>> <<else>> //Since $he must have <<= addA(App.Data.prosthetics.interfaceP2.name)>> installed to attach cybernetic limbs the <<= App.Data.prosthetics.cyberneticL.name>> will be put into storage.//