diff --git a/src/005-passages/interactPassages.js b/src/005-passages/interactPassages.js index 8cfacc014dbde432a6e7525243780c01377f0011..0201ff51249a5e017dc2f05d0e7a7a2c597425c2 100644 --- a/src/005-passages/interactPassages.js +++ b/src/005-passages/interactPassages.js @@ -108,3 +108,15 @@ new App.DomPassage( return App.UI.SlaveInteract.cheatEditSlave(getSlave(V.AS)); }, ["jump-from-safe"] ); + +new App.DomPassage( + "Cheat Edit JS Apply", + () => { + V.nextButton = "Continue"; + V.nextLink = "Slave Interact"; + const el = new DocumentFragment(); + App.UI.DOM.appendNewElement("p", el, `You perform the dark rituals, pray to the dark gods, and sell your soul for the power to change and mold slaves to your will.`); + App.UI.DOM.appendNewElement("p", el, `This slave has been changed forever and you have lost a bit of your soul, YOU CHEATER!`); + return el; + }, ["jump-from-safe"] +); diff --git a/src/cheats/cheatEditSlave.js b/src/cheats/cheatEditSlave.js index fa3350726f543b3f117e81a28f5589ed5dc3c88d..27f3cb941ad1110b24624673067b232112b6009f 100644 --- a/src/cheats/cheatEditSlave.js +++ b/src/cheats/cheatEditSlave.js @@ -2,42 +2,20 @@ App.UI.SlaveInteract.cheatEditSlave = function(slave) { const el = new DocumentFragment(); const r = []; - const {His} = getPronouns(slave); + const { His } = getPronouns(slave); const tempSlave = clone(slave); - /* get all prosthetics that are ready for this slave */ - if (V.adjustProstheticsCompleted > 0) { - V.adjustProsthetics = V.adjustProsthetics.filter(function(p) { - if (p.workLeft <= 0 && p.slaveID === V.AS) { - addProsthetic(tempSlave, p.id); - V.adjustProstheticsCompleted--; - return false; - } - return true; - }); - } App.UI.tabBar.handlePreSelectedTab(V.tabChoice.RemoteSurgery); - App.UI.DOM.appendNewElement("h1", el, "The Remote Surgery"); - r.push(`${tempSlave.slaveName} is lying strapped down on the table in your`); - if (V.surgeryUpgrade === 1) { - r.push(`heavily upgraded and customized`); - } - r.push(`remote surgery. The surgical equipment reads`); - if (tempSlave.health.health < -20) { - r.push(App.UI.DOM.makeElement("span", `SLAVE UNHEALTHY, SURGERY NOT RECOMMENDED.`, "red")); - } else if (tempSlave.health.health <= 20) { - r.push(App.UI.DOM.makeElement("span", `SLAVE HEALTHY, SURGERY SAFE.`, "yellow")); - } else { - r.push(App.UI.DOM.makeElement("span", `SLAVE HEALTHY, SURGERY ENCOURAGED.`, "green")); - } - if (V.PC.skill.medicine >= 100) { - r.push(`The remote surgery mechanisms that allow a surgeon to be brought in by telepresence are inactive, and the autosurgery is ready for your control inputs. Surgery on your slaves is a challenge and a pleasure you wouldn't dream of sharing.`); - } - App.Events.addNode(el, r, "div", "scene-intro"); - if (tempSlave.indentureRestrictions >= 1) { - App.UI.DOM.appendNewElement("div", el, `${His} indenture forbids elective surgery`, ["yellow", "note"]); - } + App.UI.DOM.appendNewElement("h1", el, `Cheat edit ${slave.slaveName}`); + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Apply", + () => { + V.slaves[V.slaveIndices[slave.ID]] = tempSlave; + }, + [], + "Cheat Edit JS Apply" + )); // TODO: move me /**