From a42c4b687a03811aaac08fb6ec7473f879952bbd Mon Sep 17 00:00:00 2001 From: DCoded <dcoded@live.com> Date: Fri, 2 Oct 2020 21:38:54 -0400 Subject: [PATCH] Better named variables in killSlave --- src/facilities/pit/killSlave.js | 142 ++++++++++++++++---------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/src/facilities/pit/killSlave.js b/src/facilities/pit/killSlave.js index 2d603b5b6c3..8dde476dd84 100644 --- a/src/facilities/pit/killSlave.js +++ b/src/facilities/pit/killSlave.js @@ -52,99 +52,99 @@ App.Facilities.Pit.killSlave = function(slave) { // MARK: Text Functions function intro() { - const mainDiv = document.createElement("div"); + const introDiv = document.createElement("div"); - mainDiv.append(`You ${canWalk(slave) ? + introDiv.append(`You ${canWalk(slave) ? `call ${slave.slaveName}` : `have ${slave.slaveName} brought`} into your office. `); if (slave.fuckdoll) { - mainDiv.append(`It's hard to tell the expression on the Fuckdoll's face, but your guess is it's `); + introDiv.append(`It's hard to tell the expression on the Fuckdoll's face, but your guess is it's `); if (slave.fetish !== "mindbroken") { - mainDiv.append(`one of `); + introDiv.append(`one of `); if (slave.devotion > 50) { - mainDiv.append(`adoration. `); + introDiv.append(`adoration. `); } else if (slave.devotion > 20) { - mainDiv.append(`calm. `); + introDiv.append(`calm. `); } else if (slave.devotion > -20) { - mainDiv.append(`apprehension. `); + introDiv.append(`apprehension. `); } else { - mainDiv.append(`hatred. `); + introDiv.append(`hatred. `); } } else { - mainDiv.append(`blank. `); + introDiv.append(`blank. `); } } else { - mainDiv.append(`${He} looks at you `); + introDiv.append(`${He} looks at you `); if (slave.devotion > 50) { - mainDiv.append(`with adoration`); + introDiv.append(`with adoration`); } else if (slave.devotion > 20) { - mainDiv.append(`calmly`); + introDiv.append(`calmly`); } else if (slave.devotion > -20) { - mainDiv.append(`with apprehension`); + introDiv.append(`with apprehension`); } else { - mainDiv.append(`with hatred`); + introDiv.append(`with hatred`); } - mainDiv.append(` and waits for you to continue. `); + introDiv.append(` and waits for you to continue. `); } - mainDiv.append(`You tell ${him} that you've gotten tired of having ${him} around and that you decided it is time to get rid of ${him}. `); + introDiv.append(`You tell ${him} that you've gotten tired of having ${him} around and that you decided it is time to get rid of ${him}. `); if (slave.fuckdoll) { - mainDiv.append(`${He} simply nods, not being able to see `); // can fuckdolls nod their heads? + introDiv.append(`${He} simply nods, not being able to see `); // can fuckdolls nod their heads? } else { if (slave.fetish !== "mindbroken") { - mainDiv.append(`${His} expression changes to one of `); + introDiv.append(`${His} expression changes to one of `); if (slave.devotion > 50) { - mainDiv.append(`pure sorrow`); + introDiv.append(`pure sorrow`); } else if (slave.devotion > 20) { - mainDiv.append(`sadness`); + introDiv.append(`sadness`); } else { - mainDiv.append(`relief`); + introDiv.append(`relief`); } - mainDiv.append(` until `); + introDiv.append(` until `); } else { - mainDiv.append(`${He} just nods dumbly and continues to watch you with a vacant expression, even as `); + introDiv.append(`${He} just nods dumbly and continues to watch you with a vacant expression, even as `); } } - mainDiv.append(`you ${canHear(slave) ? `quietly ` : ``}reach behind your desk and pull out your trusty ${weapon}`); + introDiv.append(`you ${canHear(slave) ? `quietly ` : ``}reach behind your desk and pull out your trusty ${weapon}`); if (!slave.fuckdoll && canSee(slave)) { if (slave.fetish !== "mindbroken") { - mainDiv.append(`, at which point abject fear fills ${his} face. ${He} immediately ${hasBothLegs(slave) ? `drops to ${his} knees and ` : ``}begins openly begging for you to show mercy.`); + introDiv.append(`, at which point abject fear fills ${his} face. ${He} immediately ${hasBothLegs(slave) ? `drops to ${his} knees and ` : ``}begins openly begging for you to show mercy.`); } else { - mainDiv.append(`, to which ${he} still doesn't respond. `); + introDiv.append(`, to which ${he} still doesn't respond. `); } } else { - mainDiv.append(`. `); + introDiv.append(`. `); } - return mainDiv; + return introDiv; } function links() { - const mainDiv = App.UI.DOM.makeElement("div", '', "kill-slave-options"); + const linksDiv = App.UI.DOM.makeElement("div", '', "kill-slave-options"); const links = []; const disableReasons = []; const combatLinkText = `Let ${him} win ${his} life in combat`; - mainDiv.id = "kill-scene"; + linksDiv.id = "kill-scene"; links.push( App.UI.DOM.link(`Kill ${him}`, () => { - refresh(mainDiv, kill); + refresh(linksDiv, kill); }), App.UI.DOM.link(`Have mercy on ${him}`, () => { - refresh(mainDiv, mercy); + refresh(linksDiv, mercy); }), ); @@ -170,27 +170,27 @@ App.Facilities.Pit.killSlave = function(slave) { if (disableReasons) { links.push(App.UI.DOM.link(combatLinkText, () => { - refresh(mainDiv, combat); + refresh(linksDiv, combat); })); } else { links.push(App.UI.DOM.disabledLink(combatLinkText, disableReasons)); } - mainDiv.appendChild(App.UI.DOM.generateLinksStrip(links)); + linksDiv.appendChild(App.UI.DOM.generateLinksStrip(links)); - return mainDiv; + return linksDiv; } function kill() { - const mainDiv = document.createElement("div"); + const killDiv = document.createElement("div"); if (!slave.fuckdoll && slave.fetish !== "mindbroken") { - mainDiv.append(`You simply smile at ${him} and tell ${him} not to worry `); + killDiv.append(`You simply smile at ${him} and tell ${him} not to worry `); } else { - mainDiv.append(`You say nothing `); + killDiv.append(`You say nothing `); } - mainDiv.append(`as you continue ${qualifiedFS ? + killDiv.append(`as you continue ${qualifiedFS ? `sharpening your ${weapon}.` : `threading on a suppressor.`} ${slave.slaveName} ${!slave.fuckdoll && slave.fetish !== "mindbroken" ? `gives an audible sigh of relief and begins to thank you profusely, though ${his} thanks are cut short as the sound of` : @@ -198,48 +198,48 @@ App.Facilities.Pit.killSlave = function(slave) { `a sharp edge slicing through flesh` : `a suppressed gunshot`} rings through the room. You have another servant clean up the mess as you continue with what you were previously doing.`); - mainDiv.appendChild(relations()); + killDiv.appendChild(relations()); removeSlave(slave); - return mainDiv; + return killDiv; } function mercy() { - const mainDiv = document.createElement("div"); + const mercyDiv = document.createElement("div"); if (!slave.fuckdoll && slave.fetish !== "mindbroken") { - mainDiv.append(`You make a show of considering sparing ${his} life, then, with a heavy sigh, unbuckle your pants and sit down at your desk. You beckon to ${him}, and ${he} just about trips over ${himself} as ${he} hastily makes ${his} way over to you. ${His} blowjob isn't the best you've ever had, ${him} `, App.UI.DOM.makeElement("span", `thanking you again`, ["devotion", "inc"]), ` as much as ${he} is; but ${his} enthusiasm more than makes up for it. After you finish deep in ${his} throat, ${he} sits back and wipes away ${his} tears, sniffling and `, App.UI.DOM.makeElement("span", `sobbing`, ["trust", "dec"]), ` for giving ${him} another chance.`); + mercyDiv.append(`You make a show of considering sparing ${his} life, then, with a heavy sigh, unbuckle your pants and sit down at your desk. You beckon to ${him}, and ${he} just about trips over ${himself} as ${he} hastily makes ${his} way over to you. ${His} blowjob isn't the best you've ever had, ${him} `, App.UI.DOM.makeElement("span", `thanking you again`, ["devotion", "inc"]), ` as much as ${he} is; but ${his} enthusiasm more than makes up for it. After you finish deep in ${his} throat, ${he} sits back and wipes away ${his} tears, sniffling and `, App.UI.DOM.makeElement("span", `sobbing`, ["trust", "dec"]), ` for giving ${him} another chance.`); } else { - mainDiv.append(`You change your mind, and with a wave of your hand, send ${slave.slaveName} back to $his duties. Maybe some other time.`); + mercyDiv.append(`You change your mind, and with a wave of your hand, send ${slave.slaveName} back to $his duties. Maybe some other time.`); } - getSlave(slave.ID).devotion = slave.devotion < 30 ? 30 : slave.devotion += 30; - getSlave(slave.ID).trust -= 100; + slave.devotion = slave.devotion < 30 ? 30 : slave.devotion += 30; + slave.trust -= 100; - return mainDiv; + return mercyDiv; } function combat() { - const mainDiv = document.createElement("div"); + const combatDiv = document.createElement("div"); - mainDiv.append(`You tell ${him} you'll let your bodyguard decide ${his} fate — if ${he} wants to live, ${he}'ll have to beat ${S.Bodyguard.slaveName} in hand-to-hand combat in ${V.pit.name}.`); + combatDiv.append(`You tell ${him} you'll let your bodyguard decide ${his} fate — if ${he} wants to live, ${he}'ll have to beat ${S.Bodyguard.slaveName} in hand-to-hand combat in ${V.pit.name}.`); if (slave.skill.combat) { - mainDiv.append(`${He} nods ${his} head and straightens up, as though mentally preparing ${himself} for the fight for ${his} life.`); + combatDiv.append(`${He} nods ${his} head and straightens up, as though mentally preparing ${himself} for the fight for ${his} life.`); } else { - mainDiv.append(`The fear on ${his} face is palpable, though ${he} nods slowly and agrees, not seeing another choice.`); + combatDiv.append(`The fear on ${his} face is palpable, though ${he} nods slowly and agrees, not seeing another choice.`); } V.pit.slaveFightingBodyguard = slave.ID; V.pit.animal = null; - return mainDiv; + return combatDiv; } function relations() { // TODO: potentially expand to allow for checking for more than one relation (i.e. sister/mother/lover, etc) - const mainDiv = App.UI.DOM.makeElement("div", '', "kill-slave-relations"); + const relationsDiv = App.UI.DOM.makeElement("div", '', "kill-slave-relations"); const halfSisters = []; const sisters = []; @@ -306,7 +306,7 @@ App.Facilities.Pit.killSlave = function(slave) { mother = getSlave(mother); subDiv.append(`${His} mother ${mother.slaveName} is `, App.UI.DOM.makeElement("span", 'grief-stricken', ["devotion", "dec"]), ` that you would take ${his} ${daughter} from ${getPronouns(mother).him}.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); mother.devotion -= 30; } @@ -317,7 +317,7 @@ App.Facilities.Pit.killSlave = function(slave) { father = getSlave(father); subDiv.append(`${His} father ${father.slaveName} is `, App.UI.DOM.makeElement("span", 'grief-stricken', ["devotion", "dec"]), ` that you would take ${his} ${daughter} from ${getPronouns(father).him}.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); father.devotion -= 30; } @@ -331,7 +331,7 @@ App.Facilities.Pit.killSlave = function(slave) { const {him: him2, daughter: daughter2} = getPronouns(daughter); subDiv.append(`${His} ${daughter2} ${daughter.slaveName} is `, App.UI.DOM.makeElement("span", 'horrified', ["devotion", "dec"]), ` that you would take ${his} ${mother} from ${him2}.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); daughter.devotion -= 25; } else { @@ -355,7 +355,7 @@ App.Facilities.Pit.killSlave = function(slave) { daughters.forEach(i => daughters[i].devotion -= 25); subDiv.append(`${His} children, `, daughtersSpan, `, are `, App.UI.DOM.makeElement("span", 'horrified', ["devotion", "dec"]), ` that you would take their ${mother} from them.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); } } @@ -368,7 +368,7 @@ App.Facilities.Pit.killSlave = function(slave) { const {him: him2} = getPronouns(twin); subDiv.append(`${His} twin ${twin.slaveName} is `, App.UI.DOM.makeElement("span", 'devastated', ["devotion", "dec"]), ` that you would take ${his} ${sister} from ${him2}.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); twin.devotion -= 30; } else { @@ -394,7 +394,7 @@ App.Facilities.Pit.killSlave = function(slave) { twins.forEach(i => twins[i].devotion -= 30); subDiv.append(`${His} twins, `, twinsSpan, `, are `, App.UI.DOM.makeElement("span", 'devastated', ["devotion", "dec"]), ` that you would take their ${sister} from them.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); } } @@ -407,7 +407,7 @@ App.Facilities.Pit.killSlave = function(slave) { const {him: him2} = getPronouns(firstSister); subDiv.append(`${His} sister ${firstSister.slaveName} is `, App.UI.DOM.makeElement("span", 'grief-stricken', ["devotion", "dec"]), ` that you would take ${his} ${sister} from ${him2}.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); firstSister.devotion -= 25; } else { @@ -431,7 +431,7 @@ App.Facilities.Pit.killSlave = function(slave) { sisters.forEach(i => sisters[i].devotion -= 25); subDiv.append(`${His} sister, `, sistersSpan, `, are `, App.UI.DOM.makeElement("span", 'grief-stricken', ["devotion", "dec"]), ` that you would take their ${sister} from them.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); } } @@ -444,7 +444,7 @@ App.Facilities.Pit.killSlave = function(slave) { const {him: him2} = getPronouns(halfSister); subDiv.append(`${His} half-sister ${halfSister.slaveName} is `, App.UI.DOM.makeElement("span", 'saddened', ["devotion", "dec"]), ` that you would take ${his} ${sister} from ${him2}.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); halfSister.devotion -= 20; } else { @@ -468,7 +468,7 @@ App.Facilities.Pit.killSlave = function(slave) { halfSisters.forEach(i => halfSisters[i].devotion -= 20); subDiv.append(`${His} half-sisters, `, halfSistersSpan, `, are `, App.UI.DOM.makeElement("span", 'saddened', ["devotion", "dec"]), ` that you would take their ${sister} from them.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); } } @@ -480,7 +480,7 @@ App.Facilities.Pit.killSlave = function(slave) { subDiv.append(`${target.slaveName} is `, App.UI.DOM.makeElement("span", 'grief-stricken', ["devotion", "dec"]), ` that you have killed ${getPronouns(target).his} best source of comfort and companionship in a life of bondage.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); target.devotion -= target.relationship * 10; } @@ -491,7 +491,7 @@ App.Facilities.Pit.killSlave = function(slave) { subDiv.append(`Killing one of your slave wives is `, App.UI.DOM.makeElement("span", 'socially unacceptable.', ["reputation", "dec"]), ` In addition, you other devoted slaves are `, App.UI.DOM.makeElement("span", 'worried', ["trust", "dec"]), ` that you might not respect their status.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); repX(-200, "event", slave); } @@ -503,24 +503,24 @@ App.Facilities.Pit.killSlave = function(slave) { subDiv.append(`${slave.slaveName}'s rival, ${rival.slaveName}, is `, App.UI.DOM.makeElement("span", 'pleased', ["devotion", "inc"]), ` that ${getPronouns(rival).he} won't have to see ${him} anymore.`); - mainDiv.appendChild(subDiv); + relationsDiv.appendChild(subDiv); rival.devotion += rival.rivalry * 5; } - return mainDiv; + return relationsDiv; } function plannedFight() { - const mainDiv = document.createElement("div"); + const plannedFightsDiv = document.createElement("div"); - mainDiv.append(`${!slave.fuckdoll && slave.fetish !== "mindbroken" ? `You abruptly cut ${his} begging short once you` : `You change your mind as you suddenly`} realize ${getSlave(V.pit.slaveFightingBodyguard).slaveName} is already fighting your bodyguard ${S.Bodyguard.slaveName} for ${his} life this week.`); + plannedFightsDiv.append(`${!slave.fuckdoll && slave.fetish !== "mindbroken" ? `You abruptly cut ${his} begging short once you` : `You change your mind as you suddenly`} realize ${getSlave(V.pit.slaveFightingBodyguard).slaveName} is already fighting your bodyguard ${S.Bodyguard.slaveName} for ${his} life this week.`); - App.UI.DOM.appendNewElement("div", mainDiv, App.UI.DOM.passageLink(`Cancel the fight`, V.returnTo, () => { + App.UI.DOM.appendNewElement("div", plannedFightsDiv, App.UI.DOM.passageLink(`Cancel the fight`, V.returnTo, () => { V.pit.slaveFightingBodyguard = null; }), ["kill-slave-cancel"]); - return mainDiv; + return plannedFightsDiv; } -- GitLab