diff --git a/src/endWeek/minorInjuryResponse.js b/src/endWeek/minorInjuryResponse.js index 170a649946cb35cc570d8db7b22a5f418d40a086..1fd23ae608ac5a58a689a9606be34ebcc32b7087 100644 --- a/src/endWeek/minorInjuryResponse.js +++ b/src/endWeek/minorInjuryResponse.js @@ -7,239 +7,68 @@ window.minorInjuryResponse = function minorInjuryResponse(slave) { const arcologyUpgrade = State.variables.arcologyUpgrade; const {he, himself, He} = getPronouns(slave); let r = ""; + let trackedCategory = ""; switch (slave.assignment) { case window.Job.WHORE: - if (arcology.FSDegradationist > 20) { - r += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; - } else if (arcology.FSPaternalist > 20) { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepWhore", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepWhore", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepWhore", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepWhore", slave); - } - } else { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } - } + trackedCategory = "slaveUpkeepWhore"; break; case window.Job.MADAM: - if (arcology.FSDegradationist > 20) { - r += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; - } else if (arcology.FSPaternalist > 20) { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepMadam", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepMadam", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepMadam", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepMadam", slave); - } - } else { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepMadam", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepMadam", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepMadam", slave); - } - } + trackedCategory = "slaveUpkeepMadam"; break; case window.Job.BROTHEL: - if (arcology.FSDegradationist > 20) { - r += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; - } else if (arcology.FSPaternalist > 20) { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepBrothel", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepBrothel", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepBrothel", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepBrothel", slave); - } - } else { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepBrothel", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepBrothel", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepBrothel", slave); - } - } + trackedCategory = "slaveUpkeepBrothel" break; case window.Job.PUBLIC: - if (arcology.FSDegradationist > 20) { - r += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; - } else if (arcology.FSPaternalist > 20) { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepPublic", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepPublic", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepPublic", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepPublic", slave); - } - } else { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepPublic", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepPublic", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepPublic", slave); - } - } + trackedCategory = "slaveUpkeepPublic" break; case window.Job.DJ: - if (arcology.FSDegradationist > 20) { - r += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; - } else if (arcology.FSPaternalist > 20) { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepDj", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepDj", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepDj", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepDj", slave); - } - } else { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepDj", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepDj", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepDj", slave); - } - } + trackedCategory = "slaveUpkeepDj"; break; case window.Job.CLUB: - if (arcology.FSDegradationist > 20) { - r += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; - } else if (arcology.FSPaternalist > 20) { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepClub", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepClub", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepClub", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepClub", slave); - } - } else { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepClub", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepClub", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepClub", slave); - } - } + trackedCategory = "slaveUpkeepClub"; break; default: - if (arcology.FSDegradationist > 20) { - r += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; - } else if (arcology.FSPaternalist > 20) { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepUndefined", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepUndefined", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepUndefined", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; - cashX(50, "slaveUpkeepUndefined", slave); - } - } else { - if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { - r += ` The security drones successfully detain him and oblige him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepWhore", slave); - } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { - r += ` The computer systems successfully detain him and require him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepUndefined", slave); - } else if (slave.skill.whoring > jsRandom(1, 100)) { - r += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepUndefined", slave); - } else if (slave.skill.combat > 0) { - r += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay minor <span class="yellowgreen">compensation.</span>`; - cashX(10, "slaveUpkeepUndefined", slave); - } - } + trackedCategory = "slaveUpkeepUndefined"; break; } + r = responseWithTracking(slave, trackedCategory); + + function responseWithTracking(s, category) { + let o = ""; + if (arcology.FSDegradationist > 20) { + o += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; + } else if (arcology.FSPaternalist > 20) { + if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { + o += ` The security drones successfully detain him and oblige him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; + cashX(50, category, slave); + } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { + o += ` The computer systems successfully detain him and require him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; + cashX(50, category, slave); + } else if (slave.skill.whoring > jsRandom(1, 100)) { + o += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; + cashX(50, category, slave); + } else if (slave.skill.combat > 0) { + o += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay significant <span class="yellowgreen">compensation,</span> since abusing slaves is discouraged here.`; + cashX(50, category, slave); + } + } else { + if (arcologyUpgrade.drones === 1 && jsRandom(1, 100) > 50) { + o += ` The security drones successfully detain him and oblige him to pay minor <span class="yellowgreen">compensation.</span>`; + cashX(10, category, slave); + } else if (arcologyUpgrade.grid === 1 && jsRandom(1, 100) > 50) { + o += ` The computer systems successfully detain him and require him to pay minor <span class="yellowgreen">compensation.</span>`; + cashX(10, category, slave); + } else if (slave.skill.whoring > jsRandom(1, 100)) { + o += ` ${slave.slaveName} is used to this sort of thing, and convinces him to pay minor <span class="yellowgreen">compensation.</span>`; + cashX(10, category, slave); + } else if (slave.skill.combat > 0) { + o += ` ${slave.slaveName} can take care of ${himself}, and ${he} successfully forces him to pay minor <span class="yellowgreen">compensation.</span>`; + cashX(10, category, slave); + } + } + return o; + } + return r; };