diff --git a/src/js/hTagMacroJS.js b/src/js/hTagMacroJS.js deleted file mode 100644 index 0862ab250863651d47801df38e295ed8f0f70969..0000000000000000000000000000000000000000 --- a/src/js/hTagMacroJS.js +++ /dev/null @@ -1,44 +0,0 @@ - -/* -* <<htag>> macro -* A simple macro which allows to create wrapping html elements with dynamic IDs. -* idea blatantly robbed from the spanMacroJS.tw but expanded to a more generic -* case, allowing <div>, <button> or whatever you want. elements, default is for -* the div though. In addition, you can pass an object in as the first argument -* instead of an id, and each of the object's attributes will become attributes -* of the generate tag. -* -* Usage: <<htag id>>...<</htag>> -* Usage: <<htag id tag>>...<</htag>> -* Usage: <<htag attributes>>...<</htag>> -* Usage: <<htag attributes tag>>...<</htag>> -*/ -Macro.add('htag', { - tags: null, - handler() { - const payload = this.payload[0].contents.replace(/(^\n+|\n+$)/, ''); - let htag = 'div'; - let attributes; - - function munge(val, key) { - return `${key}="${val}"`; - } - - if (this.args.length === 0) { return this.error('invalid syntax, format: <<htag [id [ tag ] | attributes [ tag ] >>'); } - if (this.args.length > 1) { htag = String(this.args[1]).trim(); } - if (typeof this.args[0] === "object") { - attributes = $.map(this.args[0], munge).join(" "); - } else { - attributes = `id="${String(this.args[0]).trim()}"`; - } - if (Config.debug) { - this.debugView.modes({ - block: true - }); - } - - jQuery(`<${htag} ${attributes} />`) - .wiki(payload) - .appendTo(this.output); - } -}); diff --git a/src/js/modification.js b/src/js/modification.js index 2a9358b08cdf07248ec5b33b88270aa6a3782fee..bfc134987e926095a0ec115fe2bc7da489b3d51a 100644 --- a/src/js/modification.js +++ b/src/js/modification.js @@ -65,7 +65,6 @@ App.Medicine.Modification.removeScar = function(slave, scar, design) { */ App.Medicine.Modification.addScourged = function(slave, weight) { let scarArray = ["left breast", "right breast", "back", "lower back", "left buttock", "right buttock"]; - let i = 0; // Whip if (getLeftArmID(slave) === 1) { scarArray.push("left upper arm"); @@ -80,7 +79,7 @@ App.Medicine.Modification.addScourged = function(slave, weight) { scarArray.push("right thigh"); } - for (i = 0; i < scarArray.length; i++) { + for (let i = 0; i < scarArray.length; i++) { App.Medicine.Modification.addScar(slave, scarArray[i], "whip", weight); } // Manacles @@ -97,7 +96,7 @@ App.Medicine.Modification.addScourged = function(slave, weight) { if (getRightLegID(slave) === 1) { scarArray.push("right ankle"); } - for (i = 0; i < scarArray.length; i++) { + for (let i = 0; i < scarArray.length; i++) { App.Medicine.Modification.addScar(slave, scarArray[i], "chain", weight); } }; @@ -151,8 +150,7 @@ App.Medicine.Modification.addBulkScars = function(slave, location, type, weight) scarArray.push("back", "lower back"); } - let i = 0; - for (i = 0; i < scarArray.length; i++) { + for (let i = 0; i < scarArray.length; i++) { App.Medicine.Modification.addScar(slave, scarArray[i], type, weight); } }; @@ -294,7 +292,7 @@ App.Medicine.Modification.setPiercing = function(slave, location, weight) { } } - if (slave.genes === "XY" && slave.attrXY <= 35 && ["ear", "eyebrow", "lips", "navel", "nose"].contains(location)) { + if (slave.genes === "XY" && slave.attrXY <= 35 && ["ear", "eyebrow", "lips", "navel", "nose"].includes(location)) { r += `${His} girly new `; switch (location) { case "ear": diff --git a/src/js/pregJS.js b/src/js/pregJS.js index addda73e7fb64548d9d50c716e82124ae0e0b148..6aea68b3cac8c1ed0e5ae2394e3a14021e12b425 100644 --- a/src/js/pregJS.js +++ b/src/js/pregJS.js @@ -13,8 +13,7 @@ globalThis.getPregBellySize = function(s) { targetLen = ((-0.00003266 * Math.pow(gestationWeek, 2)) + (0.076 * gestationWeek) + 43.843); } - let bellySize = ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)) * fetuses); - return bellySize; + return ((4 / 3) * (Math.PI) * (phi / 2) * (Math.pow((targetLen / 2), 3)) * fetuses); }; /** diff --git a/src/js/utilsSC.js b/src/js/utilsSC.js index 50d0a12b4442d3d8c0de0775568a82e7224393de..b796c63e8d24b639e726aa4d28dee707f6908a72 100644 --- a/src/js/utilsSC.js +++ b/src/js/utilsSC.js @@ -114,35 +114,6 @@ App.UI.replace = function(selector, newContent) { target.append(ins); }; -/** - * A simple macro which allows to create wrapping html elements with dynamic IDs. - * - * idea blatantly robbed from the spanMacroJS.tw but expanded to a more generic case, allowing <div>, - * <button> or whatever you want elements, default is for the div though. - * In addition, you can pass an object in as the first argument instead of an id, and each of the - * object's attributes will become attributes of the generate tag. - * - * @example - * htag('test', "red") // <div id="red">test</div> - * htag('test', {class: red}); // <div class="red">test</div> - * htag('test', {class: red, id: green}); // <div class="red" id="green">test</div> - * @param {string} text - * @param {string|object} attributes - * @param {string} [tag='div'] (optional) - * @returns {string} - */ -App.UI.htag = function(text, attributes, tag = 'div') { - const payload = text.replace(/(^\n+|\n+$)/, ""); - - if (typeof attributes === "object") { - attributes = $.map(attributes, (val, key) => `${key}="${val}"`).join(" "); - } else { - attributes = `id="${attributes.trim()}"`; - } - - return `<${tag} ${attributes}>${payload}</${tag}>`; -}; - App.UI.tabBar = function() { return { openTab: openTab, diff --git a/src/npc/bodyguard/bgDescription.js b/src/npc/bodyguard/bgDescription.js index 3526467c4ab8433e8bc6c3bb3cc54083b9a187e2..c308fc6421dca887451208047582ba71dfb4b519 100644 --- a/src/npc/bodyguard/bgDescription.js +++ b/src/npc/bodyguard/bgDescription.js @@ -8,7 +8,7 @@ App.Desc.bodyguard = function(slave) { his, He, he } = getPronouns(slave); if (slave.fuckdoll !== 0 || slave.ID !== V.BodyguardID) { - return; + return ""; } r.push(`${He} is your bodyguard.`); r.push(bgWeapon());