diff --git a/src/endWeek/reports/clubReport.js b/src/endWeek/reports/clubReport.js index 4cc10a7b3312e80b20da8a12ef759ed2e556ebb5..34a189a67bd6cd0ed0d4a880231fc7af663b34c0 100644 --- a/src/endWeek/reports/clubReport.js +++ b/src/endWeek/reports/clubReport.js @@ -4,18 +4,23 @@ App.EndWeek.clubReport = function() { const el = new DocumentFragment(); let r; + let he, him, his, He, His, wife, girl, himself; - <span id="club-stats"></span> - - _slaves = App.Utils.sortedEmployees(App.Entity.facilities.club); - _DL = _slaves.length, _SL = V.slaves.length, V.legendaryEntertainerID = 0, _FLsFetish = 0; + const slaves = App.Utils.sortedEmployees(App.Entity.facilities.club); + const _DL = slaves.length, _SL = V.slaves.length; + V.legendaryEntertainerID = 0 + let _FLsFetish = 0; V.legendaryWombID = 0; - _minBonus = 50, _maxBonus = 150; + let _minBonus = 50, _maxBonus = 150; + let _possibleBonuses; - <!-- Statistics gathering; income is rep boosts in numbers, and profit will be rep per cash unit, or cash unit per rep --> + //<!-- Statistics gathering; income is rep boosts in numbers, and profit will be rep per cash unit, or cash unit per rep --> V.facility = V.facility || {}, V.facility.club = initFacilityStatistics(V.facility.club); + const clubStats = document.createElement("div"); + el.append(clubStats); if (S.DJ) { + r = []; if (S.DJ.health.condition < -80) { improveCondition(S.DJ, 20); } else if (S.DJ.health.condition < -40) { @@ -50,12 +55,13 @@ App.EndWeek.clubReport = function() { } /* Make sure we have registered living expenses as for any other slave */ getSlaveStatisticData(S.DJ, V.facility.club); - <<setLocalPronouns S.DJ>> - - V.SlaveFullName(S.DJ) - r.push(` is performing as the DJ.`); + ({ + he, him, his, He, His, wife, girl + } = getPronouns(S.DJ)); + // + r.push(`${SlaveFullName(S.DJ)} is performing as the DJ.`); if (S.DJ.relationship === -3 && S.DJ.devotion > 50) { - r.push(`${He} tries ${his} best to be your energetic, cheerful ${V.wife}.`); + r.push(`${He} tries ${his} best to be your energetic, cheerful ${wife}.`); } if (_FLsFetish === 1) { r.push(`${He}'s expected to be the innovative, beautiful DJ spinning beats one minute, and come out of ${his} booth to grind on the floor the next; ${he} enjoys the interplay, and finds greater <span class="lightcoral">pleasure in exhibitionism.</span>`); @@ -67,16 +73,16 @@ App.EndWeek.clubReport = function() { } if (S.DJ.skill.entertainment <= 10) { r.push(`Though ${S.DJ.slaveName} does ${his} best to lead on the club, with ${his} lack of skill ${he} can do little.`); - } else if ((S.DJ.skill.entertainment <= 30)) { - S.DJ.slaveName's basic skills marginally <span class="green">improve</span> the atmosphere in V.clubName. - } else if ((S.DJ.skill.entertainment <= 60)) { - S.DJ.slaveName's skills <span class="green">improve</span> the atmosphere in V.clubName. - } else if ((S.DJ.skill.entertainment < 100)) { - S.DJ.slaveName's skills greatly <span class="green">improve</span> the atmosphere in V.clubName. - } else if ((S.DJ.skill.entertainment >= 100)) { - S.DJ.slaveName's mastery immensely <span class="green">improves</span> the atmosphere in V.clubName. - } - if (S.DJ.muscles > 5) && (S.DJ.muscles <= 95) { + } else if (S.DJ.skill.entertainment <= 30) { + r.push(`${S.DJ.slaveName}'s basic skills marginally <span class="green">improve</span> the atmosphere in ${V.clubName}.`); + } else if (S.DJ.skill.entertainment <= 60) { + r.push(`${S.DJ.slaveName}'s skills <span class="green">improve</span> the atmosphere in ${V.clubName}.`); + } else if (S.DJ.skill.entertainment < 100) { + r.push(`${S.DJ.slaveName}'s skills greatly <span class="green">improve</span> the atmosphere in ${V.clubName}.`); + } else if (S.DJ.skill.entertainment >= 100) { + r.push(`${S.DJ.slaveName}'s mastery immensely <span class="green">improves</span> the atmosphere in ${V.clubName}.`); + } + if (S.DJ.muscles > 5 && S.DJ.muscles <= 95) { r.push(`${His} toned body helps ${him} lead ${his} fellow club sluts by letting ${him} dance all night.`); } if (S.DJ.intelligence+S.DJ.intelligenceImplant > 15) { @@ -92,187 +98,150 @@ App.EndWeek.clubReport = function() { } else { S.DJ.skill.DJ += random(1,Math.ceil((S.DJ.intelligence+S.DJ.intelligenceImplant)/15) + 8); } - if (_DL + V.clubSlavesGettingHelp < 10) && V.DJnoSex !== 1 && !slaveResting(S.DJ) { - if (V.legendaryEntertainerID === 0) && (S.DJ.prestige === 0) && (S.DJ.skill.entertainment >= 100) && (S.DJ.devotion > 50) { + if (_DL + V.clubSlavesGettingHelp < 10 && V.DJnoSex !== 1 && !slaveResting(S.DJ)) { + if (V.legendaryEntertainerID === 0 && S.DJ.prestige === 0 && S.DJ.skill.entertainment >= 100 && S.DJ.devotion > 50) { V.legendaryEntertainerID = S.DJ.ID; } - <br> Since ${he} doesn't have enough sluts in V.clubName to make it worthwhile for ${him} to be on stage 24/7, ${he} spends ${his} extra time slutting it up ${himself}. ${He} has sex with S.DJ.sexAmount citizens, <span class="green">pleasing them immensely,</span> since it's more appealing to fuck the DJ than some club slut. + //<br> + r.push(`Since ${he} doesn't have enough sluts in ${V.clubName} to make it worthwhile for ${him} to be on stage 24/7, ${he} spends ${his} extra time slutting it up ${himself}. ${He} has sex with S.DJ.sexAmount citizens, <span class="green">pleasing them immensely,</span> since it's more appealing to fuck the DJ than some club slut.`); if (V.showEWD !== 0) { - <br> ${He} - V.App.SlaveAssignment.serveThePublic(S.DJ) + //<br> + r.push(He, App.SlaveAssignment.serveThePublic(S.DJ)); } else { App.SlaveAssignment.serveThePublic(S.DJ); } } - if (_DL > 0) {<br><br> - } } if (_DL > 0) { _possibleBonuses = 0; - - if (_DL !== 1) {''The _DL slaves pleasing citizens in V.clubName'' - } else {''The one slave pleasing citizens in V.clubName'' - } - r.push(` worked hard to <span class="green">increase your reputation</span> this week.`); + // + if (_DL !== 1) { + r.push(App.UI.DOM.makeElement("span", `The ${_DL} slaves pleasing citizens in ${V.clubName}`, "bold")); + } else { + r.push(App.UI.DOM.makeElement("span", `The one slave pleasing citizens in ${V.clubName}`, "bold")); + } + r.push(`worked hard to <span class="green">increase your reputation</span> this week.`); } if (S.DJ) { - V.i = V.slaveIndices[V.djID]; - r.push(` /* apply following SA passages to facility leader */`); + const slave = S.DJ; + /* apply following SA passages to facility leader */ if (V.showEWD !== 0) { - <br><br> - /* 000-250-006 */ + const DJEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); if (V.seeImages && V.seeReportImages) { - <div class="imageRef tinyImg"> - r.push(`${V.SlaveArt(${S.DJ}}, 0, 0)`); - </div> + App.UI.DOM.appendNewElement("div", DJEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); } - /* 000-250-006 */ - <<includeDOM App.EndWeek.favoriteIcon(S.DJ)>> - <span class='slave-name'> - V.SlaveFullName(S.DJ)</span> is performing as the DJ in V.clubName. - <br> - r.push(`${V.App.SlaveAssignment.choosesOwnClothes(${S.DJ)}}`); - tired(S.DJ); - <<includeDOM App.SlaveAssignment.rules(S.DJ)>> - r.push(`${V.App.SlaveAssignment.diet(${S.DJ)}}`); - <<includeDOM App.SlaveAssignment.longTermEffects(S.DJ)>> - r.push(`${V.App.SlaveAssignment.drugs(${S.DJ)}}`); - r.push(`${V.App.SlaveAssignment.relationships(${S.DJ)}}`); - r.push(`${V.App.SlaveAssignment.rivalries(${S.DJ)}}`); - <br> - V.App.SlaveAssignment.devotion(S.DJ) + DJEntry.append(App.EndWeek.favoriteIcon(slave), " "); + App.Events.addNode( + DJEntry, + [ + App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"), + `is performing as the DJ in ${V.clubName}.`, + App.SlaveAssignment.standardSlaveReport(slave, false), + ] + ); } else { - App.SlaveAssignment.choosesOwnClothes(S.DJ); - tired(S.DJ); - App.SlaveAssignment.rules(S.DJ); - App.SlaveAssignment.diet(S.DJ); - App.SlaveAssignment.longTermEffects(S.DJ); - App.SlaveAssignment.drugs(S.DJ); - App.SlaveAssignment.relationships(S.DJ); - App.SlaveAssignment.rivalries(S.DJ); - App.SlaveAssignment.devotion(S.DJ); + App.SlaveAssignment.standardSlaveReport(slave, true); } } if (_DL > 0) { - <<for _slave range _slaves>> - V.i = V.slaveIndices[_slave.ID]; - <<setLocalPronouns _slave>> - if (V.legendaryEntertainerID === 0) && (_slave.prestige === 0) && (_slave.skill.entertainment >= 100) && (_slave.devotion > 50) { - V.legendaryEntertainerID = _slave.ID; + for (const slave of slaves) { + ({ + he, him, his, He, His, wife, girl + } = getPronouns(slave)); + if (V.legendaryEntertainerID === 0 && slave.prestige === 0 && slave.skill.entertainment >= 100 && slave.devotion > 50) { + V.legendaryEntertainerID = slave.ID; } - if (V.legendaryWombID === 0) && (!isAmputee(_slave)) && (_slave.preg > _slave.pregData.normalBirth/1.33) && (_slave.broodmother === 0) && (_slave.eggType === "human") && (_slave.counter.births > 10) && (_slave.devotion > 50) && (_slave.prestige === 0) { - V.legendaryWombID = _slave.ID; + if (V.legendaryWombID === 0 && !isAmputee(slave) && slave.preg > slave.pregData.normalBirth/1.33 && slave.broodmother === 0 && slave.eggType === "human" && slave.counter.births > 10 && slave.devotion > 50 && slave.prestige === 0) { + V.legendaryWombID = slave.ID; } - if (_slave.devotion <= 20) && (_slave.trust >= -20) { - _slave.devotion -= 5, _slave.trust -= 5; - } else if ((_slave.devotion < 45)) { - _slave.devotion += 4; - } else if ((_slave.devotion > 50)) { - _slave.devotion -= 4; + if (slave.devotion <= 20 && slave.trust >= -20) { + slave.devotion -= 5, slave.trust -= 5; + } else if (slave.devotion < 45) { + slave.devotion += 4; + } else if (slave.devotion > 50) { + slave.devotion -= 4; } - if (_slave.trust < 30) { - _slave.trust += 5; + if (slave.trust < 30) { + slave.trust += 5; } - 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 < 90)) { - improveCondition(_slave, 7); + 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 < 90)) { + improveCondition(slave, 7); } - if (_slave.rules.living !== "normal") { - _slave.rules.living = "normal"; + if (slave.rules.living !== "normal") { + slave.rules.living = "normal"; } if (V.showEWD !== 0) { - <br><br> - /* 000-250-006 */ + const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report"); if (V.seeImages && V.seeReportImages) { - <div class="imageRef tinyImg"> - r.push(`${V.SlaveArt(_slave}, 0, 0)`); - </div> + App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); } - /* 000-250-006 */ - <<includeDOM App.EndWeek.favoriteIcon(_slave)>> - <span class='slave-name'> - V.SlaveFullName(_slave)</span> - if (_slave.choosesOwnAssignment === 2) { - r.push(`${V.App.SlaveAssignment.choosesOwnJob(_slave)}`); + slaveEntry.append(App.EndWeek.favoriteIcon(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 serving in ${V.clubName}.`); } - <br> ${He} - V.App.SlaveAssignment.serveThePublic(_slave) - <br> - r.push(`${V.App.SlaveAssignment.choosesOwnClothes(_slave)}`); - <<includeDOM App.SlaveAssignment.rules(_slave)>> - r.push(`${V.App.SlaveAssignment.diet(_slave)}`); - <<includeDOM App.SlaveAssignment.longTermEffects(_slave)>> - r.push(`${V.App.SlaveAssignment.drugs(_slave)}`); - r.push(`${V.App.SlaveAssignment.relationships(_slave)}`); - r.push(`${V.App.SlaveAssignment.rivalries(_slave)}`); - <br> - V.App.SlaveAssignment.devotion(_slave) + App.Events.addNode(slaveEntry, r, "div"); + + const indented = document.createElement("div"); + indented.classList.add("indent"); + App.Events.addNode( + indented, + [ + He, + App.SlaveAssignment.serveThePublic(slave), + App.SlaveAssignment.standardSlaveReport(slave, false) + ] + ); + slaveEntry.append(indented); } else { - App.SlaveAssignment.choosesOwnJob(_slave); - App.SlaveAssignment.serveThePublic(_slave); - App.SlaveAssignment.choosesOwnClothes(_slave); - <<includeDOM App.SlaveAssignment.rules(_slave)>> - App.SlaveAssignment.diet(_slave); - App.SlaveAssignment.longTermEffects(_slave); - App.SlaveAssignment.drugs(_slave); - App.SlaveAssignment.relationships(_slave); - App.SlaveAssignment.rivalries(_slave); - App.SlaveAssignment.devotion(_slave); + // discard return values silently + App.SlaveAssignment.choosesOwnJob(slave); + App.SlaveAssignment.serveThePublic(slave); + App.SlaveAssignment.standardSlaveReport(slave, true); } - <</for>> - <p> - r.push(`${V.App.Ads.report("club")}`); - </p> - <!-- Record statistics gathering --> - <<script>> - r.push(`var b = State.variables.facility.club;`); - r.push(`b.whoreIncome = 0;`); - r.push(`b.customers = 0;`); - r.push(`b.whoreCosts = 0;`); - r.push(`b.rep = 0;`); - r.push(`for (var si of b.income.values()) {`); - r.push(`b.whoreIncome += si.income;`); - r.push(`b.customers += si.customers;`); - r.push(`b.whoreCosts += si.cost;`); - r.push(`b.rep += si.rep;`); - } - r.push(`b.adsCosts = State.variables.clubAdsSpending;`); - r.push(`b.maintenance = State.variables.club * State.variables.facilityCost * (1.0 + 0.2 * State.variables.clubUpgradePDAs);`); - r.push(`b.totalIncome = b.whoreIncome + b.adsIncome;`); - r.push(`b.totalExpenses = b.whoreCosts + b.adsCosts + b.maintenance;`); - r.push(`b.profit = b.totalIncome / b.totalExpenses;`); - <</script>> + r.push(App.UI.DOM.makeElement("p", App.Ads.report("club"))); + + //<!-- Record statistics gathering --> + var b = State.variables.facility.club; + b.whoreIncome = 0; + b.customers = 0; + b.whoreCosts = 0; + b.rep = 0; + for (var si of b.income.values()) { + b.whoreIncome += si.income; + b.customers += si.customers; + b.whoreCosts += si.cost; + b.rep += si.rep; + } + b.adsCosts = State.variables.clubAdsSpending; + b.maintenance = State.variables.club * State.variables.facilityCost * (1.0 + 0.2 * State.variables.clubUpgradePDAs); + b.totalIncome = b.whoreIncome + b.adsIncome; + b.totalExpenses = b.whoreCosts + b.adsCosts + b.maintenance; + b.profit = b.totalIncome / b.totalExpenses; if (V.clubDecoration !== "standard") { - <p> - r.push(`${V.capFirstChar(V.clubName)}'s customers enjoy <span class="green">having sex in V.clubDecoration surroundings.</span>`); - </p> + r.push(App.UI.DOM.makeElement("p", `${capFirstChar(V.clubName)}'s customers enjoy <span class="green">having sex in ${V.clubDecoration} surroundings.</span>`)); } - <!-- Statistics output --> - <<includeDOM App.Facilities.Club.Stats(false)>> - <<timed 50ms>> - <<replace #club-stats>> - <<includeDOM App.Facilities.Club.Stats(true)>> - <</replace>> - <</timed>> - } - - if (_DL > 0 || S.DJ) { - <br><br> + // Brothel stats + el.append(App.Facilities.Club.Stats(false)); + clubStats.append(App.Facilities.Brothel.Stats(true)); } - }; + return el; +};