Newer
Older
/**
* @returns {DocumentFragment}
*/
App.EndWeek.cellblockReport = function() {
const el = new DocumentFragment();
let r;
const slaves = App.Utils.sortedEmployees(App.Entity.facilities.cellblock);
let brokenSlaves = 0, idleBonus = 0, softenedQuirks = 0, trustMalus = 0, FLsFetish = 0;
let devBonus = (V.cellblockDecoration !== "standard") ? 1 : 0;
V.flSex = App.EndWeek.getFLSex(App.Entity.facilities.cellblock);/* FIXME: should be local, passed as a parameter to saRules */
const {
He, His,
he, his, him, wife
} = getPronouns(S.Wardeness);
r = [];
if (S.Wardeness.health.condition < -80) {
improveCondition(S.Wardeness, 20);
improveCondition(S.Wardeness, 7);
}
if (S.Wardeness.devotion <= 60) {
S.Wardeness.devotion += 2;
}
if (S.Wardeness.trust < 60) {
S.Wardeness.trust += 3;
}
if (S.Wardeness.rules.living !== "luxurious") {
S.Wardeness.rules.living = "luxurious";
}
if (S.Wardeness.rules.rest !== "restrictive") {
S.Wardeness.rules.rest = "restrictive";
}
if (S.Wardeness.fetishStrength <= 95) {
if (S.Wardeness.fetish !== "sadist") {
if (fetishChangeChance(S.Wardeness) > random(0, 100)) {
S.Wardeness.fetishKnown = 1;
S.Wardeness.fetish = "sadist";
S.Wardeness.fetishStrength = 10;
if (S.Wardeness.energy > 95 || S.Wardeness.fetish === "sadist") {
r.push(`${SlaveFullName(S.Wardeness)} is serving as the Wardeness.`);
if (S.Wardeness.relationship === -3 && S.Wardeness.devotion > 50) {
r.push(`As your ${wife}, ${he} tries ${his} best to break the disobedient slaves to your will.`);
r.push(`One day ${he} demands obedience. The next day ${he} strikes a slave when it isn't given. The next, ${he} seems more excited than embarrassed when beating a prisoner. Soon, ${he}'s looking for an excuse to punish. ${He}'s <span class="pink">become more of a sadist.</span>`);
r.push(`Being not only allowed but encouraged to get off while punishing prisoners <span class="lightsalmon">deepens ${his} sadism.</span>`);
}
if (App.Data.Careers.Leader.wardeness.includes(S.Wardeness.career)) {
r.push(`${He} has experience with detecting security issues and grinding down potential miscreants from ${his} life before ${he} was a slave, making ${him} more effective.`);
} else if (S.Wardeness.skill.wardeness >= V.masteredXP) {
r.push(`${He} has experience with detecting security issues and grinding down potential miscreants from working for you, making ${him} more effective.`);
} else {
S.Wardeness.skill.wardeness += random(1, Math.ceil((S.Wardeness.intelligence + S.Wardeness.intelligenceImplant) / 15) + 8);
}
if (S.Wardeness.fetish === "sadist") {
r.push(`${He} uses the prisoners to gratify ${his} sadism, terrifying them and quickly breaking their resistance.`);
} else if (S.Wardeness.energy > 95) {
r.push(`${He} is so sexually depraved that ${he} constantly molests the prisoners, breaking them to a life of servitude.`);
}
if (S.Wardeness.sexualFlaw === "malicious" || S.Wardeness.sexualFlaw === "abusive") {
r.push(`Sexual abuse of prisoners has become an end for ${him}, not a means. ${He} inspires ${his} prisoners to do everything possible to qualify to get away from ${him}, even as ${he} slowly grinds away their interest in sex to do it.`);
} else if (S.Wardeness.sexualQuirk === "caring") {
r.push(`${His} kindness sometimes shows through ${his} tough facade, letting prisoners get off easier than they should.`);
}
if (S.Wardeness.dick > 2 && canPenetrate(S.Wardeness)) {
r.push(`${His} molestation of the prisoners is more varied and effective because ${he} has a dick to fuck them with.`);
}
if (S.Wardeness.muscles > 35) {
r.push(`${He} is strong enough to restrain anyone that tries anything with ${his} own hands.`);
}
if (S.Wardeness.devotion > 95) {
r.push(`${His} devotion to you is so absolute that ${he} sees breaking bitches for your service as a noble calling.`);
}
App.Events.addNode(el, r, "div", "indent");
for (const slave of slaves) {
r = [];
if (S.Wardeness.rivalryTarget === slave.ID) {
r.push(`${He} greatly enjoys breaking ${his} ${rivalryTerm(S.Wardeness)}, ${slave.slaveName}'s will.`);
slave.devotion++;
slave.trust -= 3;
if (random(1, 100) > 30) {
S.Wardeness.rivalry++;
slave.rivalry++;
} else if (S.Wardeness.relationshipTarget === slave.ID) {
r.push(`${He} hates having to break ${his} ${relationshipTerm(S.Wardeness)}, ${slave.slaveName}, but ${his} devotion to you wins out in the end.`);
slave.devotion++;
slave.trust -= 3;
if (random(1, 100) >= 50) {
r.push(`${His} and ${slave.slaveName}'s relationship has been shattered by these events.`);
S.Wardeness.relationship = 0;
S.Wardeness.relationshipTarget = 0;
slave.relationship = 0;
slave.relationshipTarget = 0;
} else if (areRelated(S.Wardeness, slave)) {
const {he2, his2} = getPronouns(slave).appendSuffix("2");
r.push(`${He} shows ${his} ${relativeTerm(S.Wardeness, slave)} ${slave.slaveName} no mercy, making sure ${he2} understands ${his2} place.`);
slave.devotion++;
slave.trust--;
App.Events.addNode(el, r, "div", "indent");
}
if (slaves.length < V.cellblock && !slaveResting(S.Wardeness)) {
const seed = random(1, 10) + ((V.cellblock - slaves.length) * (random(150, 170) + (idleBonus * 10)));
cashX(seed, "cellblock", S.Wardeness);
App.Events.addNode(el, [`Since ${he} doesn't have enough prisoners to manage to keep ${him} busy, ${he} works on citizens' slaves, earning <span class="yellowgreen"> ${cashFormat(seed)}.</span>`], "div", "indent");
if (slaves.length > 0) {
if (slaves.length === 1) {
App.UI.DOM.appendNewElement("div", el, `One slave is being confined in ${V.cellblockName} until they are willing to obey.`, "indent");
} else {
App.UI.DOM.appendNewElement("div", el, `${slaves.length} slaves are being confined in ${V.cellblockName} until they are willing to obey.`, "indent");
const slave = App.SlaveAssignment.reportSlave(S.Wardeness);
/* apply following SA passages to facility leader */
const wardenessEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");

svornost
committed
App.SlaveAssignment.appendSlaveArt(wardenessEntry, slave);
wardenessEntry.append(App.UI.favoriteToggle(slave), " ");
App.Events.addNode(
wardenessEntry,
[
App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"),
`is serving as the Wardeness in ${V.cellblockName}`,
]
);
wardenessEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
App.SlaveAssignment.standardSlaveReport(slave, true);
for (const slave of App.SlaveAssignment.reportSlaves(slaves)) {
const {He} = getPronouns(slave);
if (slave.devotion <= 20) {
if (slave.trust >= -20) {
if (
(slave.hears === -1 && slave.earwear !== "hearing aids") ||
(slave.hears === 0 && slave.earwear === "muffling ear plugs") ||
(slave.hears === -2)
) {
slave.devotion -= 2;
slave.trust -= 2;
case "Paternalist":
slave.rules.living = "normal";
if (slave.inflation > 0) {
deflate(slave);
break;
case "Pastoralist":
slave.rules.living = "spare";
if (slave.inflation === 0) {
if (slave.pregKnown === 0 && slave.bellyImplant < 1500) {
slave.inflation = 2;
slave.inflationType = "milk";
slave.inflationMethod = 1;
} else {
slave.inflation = 1;
slave.inflationType = "milk";
slave.inflationMethod = 1;
}
SetBellySize(slave);
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
break;
case "Hedonistic":
slave.rules.living = "spare";
if (slave.weight < 200) {
if (slave.weightDirection === 1) {
slave.weight += 5;
} else if (slave.weightDirection === -1) {
slave.weight += 1;
} else {
slave.weight += 3;
}
}
if (slave.muscles > -100) {
slave.muscles -= 2;
}
if (slave.inflation === 0) {
if (slave.pregKnown === 0 && slave.bellyImplant < 1500) {
slave.inflation = 3;
slave.inflationType = "food";
slave.inflationMethod = 1;
} else {
slave.inflation = 1;
slave.inflationType = "food";
slave.inflationMethod = 1;
}
SetBellySize(slave);
}
break;
default:
slave.rules.living = "spare";
if (slave.inflation > 0) {
deflate(slave);
if (slave.behavioralFlaw !== "none" && slave.behavioralQuirk === "none") {
SoftenBehavioralFlaw(slave);
slave.devotion -= 10;
} else if (slave.sexualFlaw !== "none" && slave.sexualQuirk === "none") {
SoftenSexualFlaw(slave);
slave.devotion -= 10;
slave.devotion += devBonus;
slave.trust -= trustMalus;
if (S.Wardeness && S.Wardeness.sexualFlaw === "malicious" && slave.energy >= 2) {
slave.energy -= 2;
if (slave.health.condition < -80) {
improveCondition(slave, 20);
} else if (slave.health.condition < -40) {
improveCondition(slave, 15);
} else if (slave.health.condition < 0) {
improveCondition(slave, 10);
} else if (slave.health.condition < 40) {
improveCondition(slave, 7);
} else if (slave.health.condition < 100) {
improveCondition(slave, 3);
const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");

svornost
committed
App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
slaveEntry.append(App.UI.favoriteToggle(slave), " ");
r = [];
r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
if (slave.choosesOwnAssignment === 2) {
r.push(`${App.SlaveAssignment.choosesOwnJob(slave)}`);
} else {
r.push(`is confined in ${V.cellblockName}.`);
}
App.Events.addNode(slaveEntry, r);
App.Events.addNode(slaveEntry, [He, confinedResults.text], "div", "indent");
if (confinedResults.broken) {
brokenSlaves++;
continue; // slave has been reassigned; remaining report will run at her new assignment
}
slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
// discard return values silently
App.SlaveAssignment.choosesOwnJob(slave);
if (confinedResults.broken) {
brokenSlaves++;
continue; // slave has been reassigned; remaining report will run at her new assignment
}
App.SlaveAssignment.standardSlaveReport(slave, true);
if (softenedQuirks || brokenSlaves) {
r = [];
if (softenedQuirks > 0) {
r.push(`${cellblockNameCaps}'s advanced compliance systems successfully softened`);
if (softenedQuirks === 1) {
r.push(`one slave's mental flaw into an <span class="green">appealing quirk,</span> though the constant correction caused them <span class="mediumorchid">considerable anguish.</span>`);
} else {
r.push(`${softenedQuirks} slaves' mental flaws into <span class="green">appealing quirks,</span> though the constant correction caused them <span class="mediumorchid">considerable anguish.</span>`);
r.push(`One slave is now willing to <span class="hotpink">do as they're told</span> and has been released.`);
} else {
r.push(`${brokenSlaves} slaves are now willing to <span class="hotpink">do as they're told</span> and have been released.`);
App.Events.addNode(el, r, "p", "indent");
r = [];
r.push(`${cellblockNameCaps}'s ${V.cellblockDecoration} atmosphere <span class="hotpink">had an impact on them while they were</span> imprisoned.`);