From c323cbbaaa26f029b6dbd0df74a299f33598309a Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Fri, 13 Nov 2020 18:24:47 -0500 Subject: [PATCH] more --- src/endWeek/death.js | 256 +++++++++++++++++++++-------------------- src/pregmod/seDeath.tw | 4 +- 2 files changed, 131 insertions(+), 129 deletions(-) diff --git a/src/endWeek/death.js b/src/endWeek/death.js index 9fc7b7168e9..04fac1723b4 100644 --- a/src/endWeek/death.js +++ b/src/endWeek/death.js @@ -2,19 +2,14 @@ globalThis.planDeath = function(slave, reason) { V.slaveDeath[reason].push(slave.ID); }; -App.EndWeek.allDeaths = function() { +globalThis.allDeaths = function() { const el = new DocumentFragment(); for (const deathType in V.slaveDeath) { for (const id of V.slaveDeath[deathType]) { - console.log(id); - const obit = document.createElement("p"); const deceased = getSlave(id); if (deceased) { - App.SlaveAssignment.appendSlaveArt(obit, deceased); - obit.append(death[deathType](deceased)); - el.append(obit); - el.append(sectionBreak()); + App.UI.DOM.appendNewElement("p", el, death(deceased, deathType)); removeSlave(deceased); } } @@ -23,151 +18,158 @@ App.EndWeek.allDeaths = function() { } return el; - - function sectionBreak() { - const hr = document.createElement("hr"); - hr.style.margin = "0"; - return hr; - } }; -globalThis.death = function(slave) { +/** + * + * @param {App.Entity.SlaveState} slave + * @param {"oldAge"|"overdosed"|"lowHealth"} deathType + */ +globalThis.death = function(slave, deathType) { const el = new DocumentFragment(); const r = []; const { He, His, he, his } = getPronouns(slave); - return {oldAge, overdosed, lowHealth}; + App.UI.DOM.appendNewElement("div", el, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "smlImg"]); - function oldAge() { - if (slave.assignment === "be confined in the arcade") { - r.push(`You are notified by ${V.arcadeName} staff that one of the cabinets has broken down and will need to be replaced. It would seem ''<span class="pink">${slave.slaveName}</span>'', the fucktoy encased in it, died`); - if (slave.physicalAge >= 70) { - r.push(`naturally of old age despite`); - } else { - r.push(`suddenly, unrelated to`); - } - r.push(`${his} living conditions. ${He} was a good unit; logs show ${he} was taking dick up until the very end.`); - } else if (slave.assignment === "work in the dairy" && V.dairyRestraintsSetting > 1) { - r.push(`You are notified by ${V.dairyName} staff that one of the occupied milkers has ceased producing. Upon inspection, it would seem ''<span class="pink">${slave.slaveName}</span>'', the cow restrained in it, died`); - if (slave.physicalAge >= 70) { - r.push(`naturally of old age despite`); - } else { - r.push(`suddenly, unrelated to`); - } - r.push(`${his} living conditions. ${He} was a good cow; ${he} gave milk up until ${his} death.`); - } else if (slave.fuckdoll > 0) { - r.push(`One of your Fuckdolls' monitoring systems alerts you that the slave contained within has died. It would seem ''<span class="pink">${slave.slaveName}</span>'' has died`); - if (slave.physicalAge >= 70) { - r.push(`naturally of old age despite`); - } else { - r.push(`suddenly, unrelated to`); - } - r.push(`${his} living conditions. Thankfully the suit notifies its owner of such things; especially with the rumors of earlier models and necrophilia you hear occasionally.`); - } else { - r.push(`''<span class="pink">${slave.slaveName}</span>'' failed to report in for a routine inspection, something that rarely occurs under your watch. It doesn't take long to track down the wayward slave.`); - const deathSeed = random(1, 100); - if (deathSeed > 75) { - r.push(`${He} is found dead in ${his} bed, having died sometime during the previous night.`); - } else if (deathSeed > 50) { - r.push(`${He} is found dead in a stairwell, having had a heart attack while trying to climb it.`); - } else if (deathSeed > 25) { - r.push(`${He} is found dead in the showers, having slipped sometime earlier.`); - } else { - if (App.Utils.hasNonassignmentSex(slave)) { - r.push(`${He} is found dead in the bed of another slave, having died during intercourse. ${His} lover is not taking it well.`); + switch (deathType) { + case "oldAge": { + if (slave.assignment === "be confined in the arcade") { + r.push(`You are notified by ${V.arcadeName} staff that one of the cabinets has broken down and will need to be replaced. It would seem ''<span class="pink">${slave.slaveName}</span>'', the fucktoy encased in it, died`); + if (slave.physicalAge >= 70) { + r.push(`naturally of old age despite`); } else { - r.push(`${He} is found dead in the cafeteria, having died during breakfast; ${he} ruined the day for a number of your slaves.`); + r.push(`suddenly, unrelated to`); } - } - r.push(`${slave.slaveName} died at the age of ${slave.actualAge};`); - if (slave.actualAge < 10) { - r.push(`${he} lived a tragically short life.`); - } else if (slave.actualAge < 20) { - r.push(`${he} died far too young.`); - } else if (slave.actualAge < 30) { - r.push(`${he} died in what would be a sex slave's prime.`); - } else if (slave.actualAge < 50) { - r.push(`${he} died in ${his} prime.`); - } else if (slave.actualAge < 65) { - r.push(`${he} lived a fair life, good or bad.`); - } else if (slave.actualAge < 90) { - r.push(`${he} lived a long life and experienced much during it.`); + r.push(`${his} living conditions. ${He} was a good unit; logs show ${he} was taking dick up until the very end.`); + } else if (slave.assignment === "work in the dairy" && V.dairyRestraintsSetting > 1) { + r.push(`You are notified by ${V.dairyName} staff that one of the occupied milkers has ceased producing. Upon inspection, it would seem ''<span class="pink">${slave.slaveName}</span>'', the cow restrained in it, died`); + if (slave.physicalAge >= 70) { + r.push(`naturally of old age despite`); + } else { + r.push(`suddenly, unrelated to`); + } + r.push(`${his} living conditions. ${He} was a good cow; ${he} gave milk up until ${his} death.`); + } else if (slave.fuckdoll > 0) { + r.push(`One of your Fuckdolls' monitoring systems alerts you that the slave contained within has died. It would seem ''<span class="pink">${slave.slaveName}</span>'' has died`); + if (slave.physicalAge >= 70) { + r.push(`naturally of old age despite`); + } else { + r.push(`suddenly, unrelated to`); + } + r.push(`${his} living conditions. Thankfully the suit notifies its owner of such things; especially with the rumors of earlier models and necrophilia you hear occasionally.`); } else { - r.push(`${he} lived a very long life that few get to see.`); + r.push(`''<span class="pink">${slave.slaveName}</span>'' failed to report in for a routine inspection, something that rarely occurs under your watch. It doesn't take long to track down the wayward slave.`); + const deathSeed = random(1, 100); + if (deathSeed > 75) { + r.push(`${He} is found dead in ${his} bed, having died sometime during the previous night.`); + } else if (deathSeed > 50) { + r.push(`${He} is found dead in a stairwell, having had a heart attack while trying to climb it.`); + } else if (deathSeed > 25) { + r.push(`${He} is found dead in the showers, having slipped sometime earlier.`); + } else { + if (App.Utils.hasNonassignmentSex(slave)) { + r.push(`${He} is found dead in the bed of another slave, having died during intercourse. ${His} lover is not taking it well.`); + } else { + r.push(`${He} is found dead in the cafeteria, having died during breakfast; ${he} ruined the day for a number of your slaves.`); + } + } + r.push(`${slave.slaveName} died at the age of ${slave.actualAge};`); + if (slave.actualAge < 10) { + r.push(`${he} lived a tragically short life.`); + } else if (slave.actualAge < 20) { + r.push(`${he} died far too young.`); + } else if (slave.actualAge < 30) { + r.push(`${he} died in what would be a sex slave's prime.`); + } else if (slave.actualAge < 50) { + r.push(`${he} died in ${his} prime.`); + } else if (slave.actualAge < 65) { + r.push(`${he} lived a fair life, good or bad.`); + } else if (slave.actualAge < 90) { + r.push(`${he} lived a long life and experienced much during it.`); + } else { + r.push(`${he} lived a very long life that few get to see.`); + } } + break; } - App.Events.addNode(el, r); - return el; - } - function overdosed() { - if (slave.assignment === "be confined in the arcade") { - r.push(`You are notified by ${V.arcadeName} staff that one of the cabinets has broken down and will need to be replaced. It would seem ''<span class="pink">${slave.slaveName}</span>'', the fucktoy encased in it, died of an aphrodisiac overdose from the constant aphrodisiac injections. ${He} was a good unit; logs show ${he} was taking dick up until the very end.`); - } else if (slave.assignment === "work in the dairy" && V.dairyRestraintsSetting > 1) { - r.push(`You are notified by ${V.dairyName} staff that one of the occupied milkers has ceased producing. Upon inspection, it would seem ''<span class="pink">${slave.slaveName}</span>'', the cow restrained in it, died of an aphrodisiac overdose. How ${he} managed to get them is unknown, but ${he} was a good cow; ${he} gave milk up until ${his} death.`); - } else if (slave.fuckdoll > 0) { - r.push(`One of your Fuckdolls' monitoring systems alerts you that the slave contained within has died. It would seem ''<span class="pink">${slave.slaveName}</span>'' has died of an aphrodisiac overdose. Thankfully the suit notifies its owner of such things; especially with the rumors of earlier models and necrophilia you hear occasionally. It does little to deal with the resulting mess of the orgasm ${he} died during, however.`); - } else { - r.push(`''<span class="pink">${slave.slaveName}</span>'' failed to report in for a routine inspection, something that rarely occurs under your watch. It doesn't take long to track down the wayward slave.`); - r.push(`${He} is found dead in ${his} bed, having died sometime earlier. Judging by the mess and the expression on ${his} face, ${he} died of a heart attack during a particularly intense orgasm bought about by the massive amount of aphrodisiacs in ${his} system. ${slave.slaveName} died at the age of ${slave.actualAge};`); - if (slave.actualAge < 10) { - r.push(`${he} lived a tragically short life.`); - } else if (slave.actualAge < 20) { - r.push(`${he} died far too young.`); - } else if (slave.actualAge < 30) { - r.push(`${he} died in what would be a sex slave's prime.`); - } else if (slave.actualAge < 50) { - r.push(`${he} died in ${his} prime.`); - } else if (slave.actualAge < 65) { - r.push(`${he} lived a fair life, good or bad.`); - } else if (slave.actualAge < 90) { - r.push(`${he} lived a long life and experienced much during it.`); + case "overdosed": { + if (slave.assignment === "be confined in the arcade") { + r.push(`You are notified by ${V.arcadeName} staff that one of the cabinets has broken down and will need to be replaced. It would seem ''<span class="pink">${slave.slaveName}</span>'', the fucktoy encased in it, died of an aphrodisiac overdose from the constant aphrodisiac injections. ${He} was a good unit; logs show ${he} was taking dick up until the very end.`); + } else if (slave.assignment === "work in the dairy" && V.dairyRestraintsSetting > 1) { + r.push(`You are notified by ${V.dairyName} staff that one of the occupied milkers has ceased producing. Upon inspection, it would seem ''<span class="pink">${slave.slaveName}</span>'', the cow restrained in it, died of an aphrodisiac overdose. How ${he} managed to get them is unknown, but ${he} was a good cow; ${he} gave milk up until ${his} death.`); + } else if (slave.fuckdoll > 0) { + r.push(`One of your Fuckdolls' monitoring systems alerts you that the slave contained within has died. It would seem ''<span class="pink">${slave.slaveName}</span>'' has died of an aphrodisiac overdose. Thankfully the suit notifies its owner of such things; especially with the rumors of earlier models and necrophilia you hear occasionally. It does little to deal with the resulting mess of the orgasm ${he} died during, however.`); } else { - r.push(`${he} lived a very long life that few get to see.`); + r.push(`''<span class="pink">${slave.slaveName}</span>'' failed to report in for a routine inspection, something that rarely occurs under your watch. It doesn't take long to track down the wayward slave.`); + r.push(`${He} is found dead in ${his} bed, having died sometime earlier. Judging by the mess and the expression on ${his} face, ${he} died of a heart attack during a particularly intense orgasm bought about by the massive amount of aphrodisiacs in ${his} system. ${slave.slaveName} died at the age of ${slave.actualAge};`); + if (slave.actualAge < 10) { + r.push(`${he} lived a tragically short life.`); + } else if (slave.actualAge < 20) { + r.push(`${he} died far too young.`); + } else if (slave.actualAge < 30) { + r.push(`${he} died in what would be a sex slave's prime.`); + } else if (slave.actualAge < 50) { + r.push(`${he} died in ${his} prime.`); + } else if (slave.actualAge < 65) { + r.push(`${he} lived a fair life, good or bad.`); + } else if (slave.actualAge < 90) { + r.push(`${he} lived a long life and experienced much during it.`); + } else { + r.push(`${he} lived a very long life that few get to see.`); + } } + break; } - App.Events.addNode(el, r); - return el; - } - function lowHealth() { - if (slave.assignment === "be confined in the arcade") { - r.push(`You are notified by ${V.arcadeName} staff that one of the cabinets has broken down and will need to be replaced. It would seem ''<span class="pink">${slave.slaveName}</span>'', the fucktoy encased in it, died to poor health caused by ${his} living conditions. ${He} was a good unit; logs show ${he} was taking dick up until the very end.`); - } else if (slave.assignment === "work in the dairy" && V.dairyRestraintsSetting > 1) { - r.push(`You are notified by ${V.dairyName} staff that one of the occupied milkers has ceased producing. Upon inspection, it would seem ''<span class="pink">${slave.slaveName}</span>'', the cow restrained in it, died to poor health caused by ${his} living conditions. ${He} was a good cow; ${he} gave milk up until ${his} death.`); - } else if (slave.fuckdoll > 0) { - r.push(`One of your Fuckdolls' monitoring systems alerts you that the slave contained within has died. It would seem ''<span class="pink">${slave.slaveName}</span>'' has died of general poor health. Thankfully the suit notifies its owner of such things; especially with the rumors of earlier models and necrophilia you hear occasionally. Clean up is easy enough, however.`); - } else { - r.push(`''<span class="pink">${slave.slaveName}</span>'' failed to report in for a routine inspection, something that rarely occurs under your watch. It doesn't take long to track down the wayward slave.`); - r.push(`${He} is found dead in ${his} bed, having died sometime during the night. ${He} has been in very poor health lately, so you knew this was a possibility. ${slave.slaveName} died at the age of ${slave.actualAge};`); - if (slave.actualAge < 10) { - r.push(`${he} lived a tragically short life.`); - } else if (slave.actualAge < 20) { - r.push(`${he} died far too young.`); - } else if (slave.actualAge < 30) { - r.push(`${he} died in what would be a sex slave's prime.`); - } else if (slave.actualAge < 50) { - r.push(`${he} died in ${his} prime.`); - } else if (slave.actualAge < 65) { - r.push(`${he} lived a fair life, good or bad.`); - } else if (slave.actualAge < 90) { - r.push(`${he} lived a long life and experienced much during it.`); + case "lowHealth": { + if (slave.assignment === "be confined in the arcade") { + r.push(`You are notified by ${V.arcadeName} staff that one of the cabinets has broken down and will need to be replaced. It would seem ''<span class="pink">${slave.slaveName}</span>'', the fucktoy encased in it, died to poor health caused by ${his} living conditions. ${He} was a good unit; logs show ${he} was taking dick up until the very end.`); + } else if (slave.assignment === "work in the dairy" && V.dairyRestraintsSetting > 1) { + r.push(`You are notified by ${V.dairyName} staff that one of the occupied milkers has ceased producing. Upon inspection, it would seem ''<span class="pink">${slave.slaveName}</span>'', the cow restrained in it, died to poor health caused by ${his} living conditions. ${He} was a good cow; ${he} gave milk up until ${his} death.`); + } else if (slave.fuckdoll > 0) { + r.push(`One of your Fuckdolls' monitoring systems alerts you that the slave contained within has died. It would seem ''<span class="pink">${slave.slaveName}</span>'' has died of general poor health. Thankfully the suit notifies its owner of such things; especially with the rumors of earlier models and necrophilia you hear occasionally. Clean up is easy enough, however.`); } else { - r.push(`${he} lived a very long life that few get to see.`); - } - if (V.arcologies[0].FSPaternalist !== "unset" && slave.actualAge < 75) { - r.push(`Allowing a slave to die under your care <span class="red">severely damages</span> your image as a caring slaveowner and <span class="red">calls into question</span> your paternalistic resolve.`); - FutureSocieties.Change("Paternalist", -10); + r.push(`''<span class="pink">${slave.slaveName}</span>'' failed to report in for a routine inspection, something that rarely occurs under your watch. It doesn't take long to track down the wayward slave.`); + r.push(`${He} is found dead in ${his} bed, having died sometime during the night. ${He} has been in very poor health lately, so you knew this was a possibility. ${slave.slaveName} died at the age of ${slave.actualAge};`); + if (slave.actualAge < 10) { + r.push(`${he} lived a tragically short life.`); + } else if (slave.actualAge < 20) { + r.push(`${he} died far too young.`); + } else if (slave.actualAge < 30) { + r.push(`${he} died in what would be a sex slave's prime.`); + } else if (slave.actualAge < 50) { + r.push(`${he} died in ${his} prime.`); + } else if (slave.actualAge < 65) { + r.push(`${he} lived a fair life, good or bad.`); + } else if (slave.actualAge < 90) { + r.push(`${he} lived a long life and experienced much during it.`); + } else { + r.push(`${he} lived a very long life that few get to see.`); + } + if (V.arcologies[0].FSPaternalist !== "unset" && slave.actualAge < 75) { + r.push(`Allowing a slave to die under your care <span class="red">severely damages</span> your image as a caring slaveowner and <span class="red">calls into question</span> your paternalistic resolve.`); + FutureSocieties.Change("Paternalist", -10); + } } + break; } - App.Events.addNode(el, r); - return el; + } + App.Events.addNode(el, r); + el.append(sectionBreak()); + return el; + + function sectionBreak() { + const hr = document.createElement("hr"); + hr.style.margin = "0"; + return hr; } }; -globalThis.deathCheck = function(){ +globalThis.deathCheck = function() { for (const deathType in V.slaveDeath) { if (V.slaveDeath[deathType].length > 0) { return true; diff --git a/src/pregmod/seDeath.tw b/src/pregmod/seDeath.tw index 27ae7d667b5..0aa3e98c7c5 100644 --- a/src/pregmod/seDeath.tw +++ b/src/pregmod/seDeath.tw @@ -1,5 +1,5 @@ :: SE Death [nobr] -<<set $nextButton = "Continue", $nextLink = "Scheduled Event", _killedSlaves = []>> +<<set $nextButton = "Continue", $nextLink = "Scheduled Event">> -<<includeDOM App.EndWeek.allDeaths()>> +<<includeDOM allDeaths()>> -- GitLab