diff --git a/src/interaction/siModify.js b/src/interaction/siModify.js new file mode 100644 index 0000000000000000000000000000000000000000..11f52477e4c8a234ff52ad57aa030ba2f5984a52 --- /dev/null +++ b/src/interaction/siModify.js @@ -0,0 +1,59 @@ +/** + * @param {App.Entity.SlaveState} slave + * @returns {Node} + */ +App.UI.SlaveInteract.modify = function(slave) { + const {he, his} = getPronouns(slave); + let el = new DocumentFragment(); + + const isAgent = [Job.AGENT, Job.AGENTPARTNER].includes(slave.assignment); + + App.UI.DOM.appendNewElement('p', el, isAgent ? "Recall your agent to modify them." : "Take slave to another room.", "scene-intro"); + + if (isAgent) { + return el; + } + + /** + * Create a link with a note to send a slave to a specific room + * @param {Node} c + * @param {string} caption + * @param {string} passage + * @param {string} note + * @param {function ():void} [handler] + */ + function makeRoomLink(c, caption, passage, note, handler = () => {}) { + const res = document.createElement('div'); + c.appendChild(res); + res.appendChild(App.UI.DOM.link(caption, handler, [], passage)); + App.UI.DOM.appendNewElement('span', res, note, "note"); + return res; + } + + makeRoomLink(el, "Auto salon", "Salon", ' Modify hair (color, length, style), nails, and even skin color.'); + + makeRoomLink(el, "Body mod studio", "Body Modification", ' Mark your slave with piercings, tattoos, brands or even scars.', + () => { + V.degradation = 0; + V.tattooChoice = undefined; + }, + ); + + makeRoomLink(el, "Remote surgery", "Remote Surgery", ` Surgically modify your slave with state of the art plastic surgery and more. Alter ${his} senses, skeletal structure, organs, and even more.`); + + // Prosthetics + if (V.prostheticsUpgrade > 0) { + makeRoomLink(el, "Configure cybernetics", "Prosthetics Configuration", ` Configure prosthetics, if ${he} has been surgically implanted with interfaces that support it.`, + () => { + V.prostheticsConfig = "main"; + } + ); + } + + // Analyze Pregnancy + if (V.pregnancyMonitoringUpgrade > 0) { + makeRoomLink(el, "Internal scan", "Analyze Pregnancy", ` Full scan of abdomen and reproductive organs.`); + } + + return el; +}; \ No newline at end of file diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index f6851c1be55d9fcb81d8c75b25fd14c65241efbe..07a3aa0a8bef8511d6c9865cfa5a1f891df0b76f 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -62,66 +62,6 @@ App.UI.SlaveInteract.navigation = function(slave) { } }; -/** - * @param {App.Entity.SlaveState} slave - * @returns {Node} - */ -App.UI.SlaveInteract.modify = function(slave) { - const {he, his} = getPronouns(slave); - let el = new DocumentFragment(); - - const isAgent = [Job.AGENT, Job.AGENTPARTNER].includes(slave.assignment); - - App.UI.DOM.appendNewElement('p', el, isAgent ? "Recall your agent to modify them." : "Take slave to another room.", "scene-intro"); - - if (isAgent) { - return el; - } - - /** - * Create a link with a note to send a slave to a specific room - * @param {Node} c - * @param {string} caption - * @param {string} passage - * @param {string} note - * @param {function ():void} [handler] - */ - function makeRoomLink(c, caption, passage, note, handler = () => {}) { - const res = document.createElement('div'); - c.appendChild(res); - res.appendChild(App.UI.DOM.link(caption, handler, [], passage)); - App.UI.DOM.appendNewElement('span', res, note, "note"); - return res; - } - - makeRoomLink(el, "Auto salon", "Salon", ' Modify hair (color, length, style), nails, and even skin color.'); - - makeRoomLink(el, "Body mod studio", "Body Modification", ' Mark your slave with piercings, tattoos, brands or even scars.', - () => { - V.degradation = 0; - V.tattooChoice = undefined; - }, - ); - - makeRoomLink(el, "Remote surgery", "Remote Surgery", ` Surgically modify your slave with state of the art plastic surgery and more. Alter ${his} senses, skeletal structure, organs, and even more.`); - - // Prosthetics - if (V.prostheticsUpgrade > 0) { - makeRoomLink(el, "Configure cybernetics", "Prosthetics Configuration", ` Configure prosthetics, if ${he} has been surgically implanted with interfaces that support it.`, - () => { - V.prostheticsConfig = "main"; - } - ); - } - - // Analyze Pregnancy - if (V.pregnancyMonitoringUpgrade > 0) { - makeRoomLink(el, "Internal scan", "Analyze Pregnancy", ` Full scan of abdomen and reproductive organs.`); - } - - return el; -}; - /** * @param {App.Entity.SlaveState} slave * @returns {HTMLElement} diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index 45d0513bf615faef35504c8fbd78bf2826b4aaa5..af14eb5cf94181c357f70597e94f13bd3273394e 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -83,10 +83,7 @@ <div id="Modify" class="tab-content"> <div class="content"> - <p id="modifySection"></p> - <script> - jQuery('#modifySection').empty().append(App.UI.SlaveInteract.modify(getSlave(V.AS))) - </script> + <<includeDOM App.UI.SlaveInteract.modify(getSlave(V.AS))>> </div> </div>