diff --git a/src/js/textInput.js b/src/js/textInput.js deleted file mode 100644 index f7f24d6c434af8a499431aa765cfd55143c50461..0000000000000000000000000000000000000000 --- a/src/js/textInput.js +++ /dev/null @@ -1,56 +0,0 @@ -Macro.add("textinput", { - // Signifies that the macro is a container macro. - tags: null, - - handler: function() { - if (this.args.length < 2) { - const errors = []; - if (this.args.length === 0) { - errors.push("variable name"); - } - if (this.args.length < 2) { - errors.push("default value"); - } - return this.error(`no ${errors.join(" or ")} specified`); - } - - // Ensure that the variable name argument is a string. - if (typeof this.args[0] !== "string") { - return this.error("variable name argument is not a string"); - } - - const varName = this.args[0].trim(); - - // Try to ensure that we receive the variable's name (incl. sigil), not its value. - if (varName[0] !== "$" && varName[0] !== "_") { - return this.error(`variable name '${varName}' is missing its sigil ($ or _)`); - } - - const that = this; - const defaultValue = this.args[1]; - const el = document.createElement("textarea"); - - // Setup and append the textarea element to the output buffer. - jQuery(el) - .attr({ - rows: 4, - // cols: 68, // instead of setting "cols" we set the `min-width` in CSS - tabindex: 0 // for accessibility - }) - .addClass("macro-textarea") // "hijack" the .macro-textarea class - .on("input", function() { - Wikifier.setValue(varName, this.value); - if (that.payload[0].contents !== "") { - Wikifier.wikifyEval(that.payload[0].contents.trim()); - } - }) - .appendTo(this.output); - - // Set the story variable and textarea element to the default value. - Wikifier.setValue(varName, defaultValue); - - // Ideally, we should be setting `.defaultValue` here, but IE doesn't support it, - // so we have to use `.textContent`, which is equivalent. - el.textContent = defaultValue; - } -}); diff --git a/src/npc/agent/agentFramework.js b/src/npc/agent/agentFramework.js index 2dff5de1bf1e6b39c7f99df83735fee336d91526..1ac1425c976ca3817d4e8aafc3ba2e9cbdc3210a 100644 --- a/src/npc/agent/agentFramework.js +++ b/src/npc/agent/agentFramework.js @@ -29,9 +29,9 @@ App.Data.Facilities.arcologyAgent = { App.Entity.Facilities.AgentJob = class extends App.Entity.Facilities.ManagingJob { /** - * @param {App.Entity.SlaveState} slave - * @returns {string[]} - */ + * @param {App.Entity.SlaveState} slave + * @returns {string[]} + */ canEmploy(slave) { let r = super.canEmploy(slave); if (slave.intelligence + slave.intelligenceImplant <= 15) { diff --git a/src/npc/descriptions/boobs/boobs.js b/src/npc/descriptions/boobs/boobs.js index f5dfbc2bb3c50b7b3c72fc826ee1a4b878f4df8f..4953e797df50af7c1c3cc0db2787d5b9d4e81ee6 100644 --- a/src/npc/descriptions/boobs/boobs.js +++ b/src/npc/descriptions/boobs/boobs.js @@ -164,10 +164,10 @@ App.Desc.boobBits = function() { let r = ""; const rec = _getRec(volume); if (adjective ) { - r += rec.adjective.random() + ' '; + r += `${rec.adjective.random()} `; } if (cup && rec.cup.length > 0) { - r += rec.cup + ' '; + r += `${rec.cup} `; } r += rec.noun.random(); return r; @@ -208,7 +208,7 @@ App.Desc.boobBits = function() { App.Desc.boobs = function() { 'use strict'; let V; -/** @type {App.Utils.Pronouns} */ + /** @type {App.Utils.Pronouns} */ let pr; /** @type {string} */ let he, his, him, @@ -228,7 +228,7 @@ App.Desc.boobs = function() { pr = pronouns || getPronouns(slave); ({he, his, him, He, His, girl} = pr); if ((V.showClothing === 1) && (V.saleDescription === 0)) { - return outerInspection(slave) + ' ' + detailedInspection(slave); + return `${outerInspection(slave)} ${detailedInspection(slave)}`; } else { return detailedInspection(slave); } @@ -698,7 +698,7 @@ App.Desc.boobs = function() { } else if (slave.boobs > 800) { r += `${slave.slaveName}'s ${adjNoun} strain against ${his} tailored shirt and tunic.`; } else { - r += `${slave.slaveName} cuts a dashing figure in ${his} tunic. ${slave.boobs < 300 ? His + ' ' + App.Desc.boobBits.adjective(slave.boobs) : ''} breasts are barely there.`; + r += `${slave.slaveName} cuts a dashing figure in ${his} tunic. ${slave.boobs < 300 ? `${His} ${App.Desc.boobBits.adjective(slave.boobs)}` : ''} breasts are barely there.`; } break; case "a long qipao": @@ -711,7 +711,7 @@ App.Desc.boobs = function() { } else if (slave.boobs > 800) { r += `${slave.slaveName}'s ${adjNoun} strain against ${his} dress.`; } else { - r += `${slave.slaveName} cuts a dashing figure in ${his} dress. ${slave.boobs < 300 ? His + ' ' + App.Desc.boobBits.adjective(slave.boobs) : ''} breasts are barely there.`; + r += `${slave.slaveName} cuts a dashing figure in ${his} dress. ${slave.boobs < 300 ? `${His} ${App.Desc.boobBits.adjective(slave.boobs)}` : ''} breasts are barely there.`; } break; case "battlearmor": @@ -724,7 +724,7 @@ App.Desc.boobs = function() { } else if (slave.boobs > 800) { r += `${slave.slaveName}'s ${adjNoun} strain against ${his} armor.`; } else { - r += `${slave.slaveName} cuts a dashing figure in ${his} armor. ${slave.boobs < 300 ? His + ' ' + App.Desc.boobBits.adjective(slave.boobs) : ''} breasts are barely there.`; + r += `${slave.slaveName} cuts a dashing figure in ${his} armor. ${slave.boobs < 300 ? `${His} ${App.Desc.boobBits.adjective(slave.boobs)}` : ''} breasts are barely there.`; } break; case "a dirndl": @@ -737,7 +737,7 @@ App.Desc.boobs = function() { } else if (slave.boobs > 800) { r += `${slave.slaveName}'s ${adjNoun} strain against ${his} dress.`; } else { - r += `${slave.slaveName} cuts a dashing figure in ${his} dress. ${slave.boobs < 300 ? His + ' ' + App.Desc.boobBits.adjective(slave.boobs) : ''} breasts are barely there.`; + r += `${slave.slaveName} cuts a dashing figure in ${his} dress. ${slave.boobs < 300 ? `${His} ${App.Desc.boobBits.adjective(slave.boobs)}` : ''} breasts are barely there.`; } break; case "a biyelgee costume": @@ -750,7 +750,7 @@ App.Desc.boobs = function() { } else if (slave.boobs > 800) { r += `${slave.slaveName}'s ${adjNoun} strain against ${his} dress.`; } else { - r += `${slave.slaveName} cuts a dashing figure in ${his} dress. ${slave.boobs < 300 ? His + ' ' + App.Desc.boobBits.adjective(slave.boobs) : ''} breasts are barely there.`; + r += `${slave.slaveName} cuts a dashing figure in ${his} dress. ${slave.boobs < 300 ? `${His} ${App.Desc.boobBits.adjective(slave.boobs)}` : ''} breasts are barely there.`; } break; case "a nice nurse outfit": @@ -962,11 +962,11 @@ App.Desc.boobs = function() { r += " Free Slut"; break; default: - r += ' ' + App.Desc.inscrip(slave) + ' '; + r += ` ${App.Desc.inscrip(slave)} `; break; } } else { - r += ' ' + App.Desc.inscrip(slave) + ' '; + r += ` ${App.Desc.inscrip(slave)} `; } } r += `is written across ${his} chest in large, vibrant letters.`; @@ -1297,7 +1297,7 @@ App.Desc.boobs = function() { let r = `${His} `; if (slave.boobs < 300) { - r += App.Desc.boobBits.adjective(slave.boobs) + ' breasts are practically non - existent.'; + r += `${App.Desc.boobBits.adjective(slave.boobs)} breasts are practically non - existent.`; } else if (slave.boobs < 10000) { if (V.showBoobCCs) { r += App.Desc.boobBits.format("%ADJ %NOUN, %VOLUME CCs each, would fill %CUPs", slave.boobs); @@ -1305,40 +1305,34 @@ App.Desc.boobs = function() { r += App.Desc.boobBits.format("%ADJ %NOUN, would fill %CUPs", slave.boobs); } if (slave.boobs < 5000 + (slave.muscles * 10) && slave.physicalAge <= 3) { - r += ' and are so large that ' + walkingAbility(slave); + r += ` and are so large that ${walkingAbility(slave)}`; } else { r += '.'; } } else if (slave.boobs < 10000 + (slave.muscles * 20) && slave.physicalAge <= 12) { - r += App.Desc.boobBits.noun(slave.boobs, false) + ' have ' + - slave.boobsImplant ? 'been altered' : 'grown' + - ' past pretense of proportion. '; + r += `${App.Desc.boobBits.noun(slave.boobs, false)} have ${slave.boobsImplant ? 'been altered' : 'grown'} past pretense of proportion. `; if (V.showBoobCCs) { r += `At ${num(slave.boobs)} CCs each, they`; } else { r += 'They'; } - r += ' and are so large that ' + walkingAbility(slave); + r += ` and are so large that ${walkingAbility(slave)}`; } else if (slave.boobs < 20000 + (slave.muscles * 50) && slave.physicalAge < 18) { - r += App.Desc.boobBits.noun(slave.boobs, false) + ' have ' + - slave.boobsImplant ? 'been altered' : 'grown' + - ' past any pretense of proportion. '; + r += `${App.Desc.boobBits.noun(slave.boobs, false)} have ${slave.boobsImplant ? 'been altered' : 'grown'} past any pretense of proportion. `; if (V.showBoobCCs) { r += `At ${num(slave.boobs)} CCs each, they`; } else { r += 'They'; } - r += ' and are so large that ' + walkingAbility(slave); + r += ` and are so large that ${walkingAbility(slave)}`; } else if (slave.boobs < 20000) { - r += App.Desc.boobBits.noun(slave.boobs, false) + ' have ' + - slave.boobsImplant ? 'been altered' : 'grown' + - ' past any pretense of proportion. '; + r += `${App.Desc.boobBits.noun(slave.boobs, false)} have ${slave.boobsImplant ? 'been altered' : 'grown'} past any pretense of proportion. `; } else if (slave.boobs < 30000 + (slave.muscles * 100) && slave.physicalAge >= 18) { r += App.Desc.boobBits.noun(slave.boobs, false); if (V.showBoobCCs) { r += `, ${num(slave.boobs)} CCs each,`; } - r += ' and are so large that ' + walkingAbility(slave); + r += ` and are so large that ${walkingAbility(slave)}`; } else { r += App.Desc.boobBits.noun(slave.boobs, false); if (V.showBoobCCs) {