diff --git a/src/endWeek/persBusiness.js b/src/endWeek/persBusiness.js index 68ae947c86813d64795e94338780fff5070b4eb6..6c0dfbf1a48f8b632cdc0a2cc8cabfb35634f1c6 100644 --- a/src/endWeek/persBusiness.js +++ b/src/endWeek/persBusiness.js @@ -1,16 +1,16 @@ App.EndWeek.personalBusiness = function() { const el = new DocumentFragment(); let r = []; - let he, his, him; + let he, him; let _income; let _Cal; let _X; let _windfall; let _Catchtchance; let _upgradeCount; - let _dataGain + let _dataGain; if (V.useTabs === 0) { - App.UI.DOM.appendNewElement("h2", el, `Personal Business`) + App.UI.DOM.appendNewElement("h2", el, `Personal Business`); } if (V.cash < 0) { @@ -254,7 +254,8 @@ App.EndWeek.personalBusiness = function() { r.push(`one of the Societal Elite's`); } r.push(` semen to allow some desperate girls to be pregnant. Anonymity is really hard to attain, and it is easy to find out what you've been doing. Even if you did manage to make <span class="yellowgreen">${cashFormat(_income)},</span> the Societal Elite are <span class="red">quite displeased</span> by your actions.`); - V.failedElite += 50, _caught = 1; + V.failedElite += 50; + _caught = 1; } else { r.push(`You are smuggling `); if (V.PC.dick !== 0) { @@ -398,12 +399,13 @@ App.EndWeek.personalBusiness = function() { break; case"chinese law": _income += random(2000, 3000); - ({ he, him, his } = getPronouns(S.HeadGirl)); + ({he, him} = getPronouns(S.HeadGirl)); r.push(`This time, you have a good idea that will also make use of your Head Girl. You coax ${him} into thinking ${he} should accept bribes for the time being, making up a good reason on the spot, and ${he} ends up bringing back <span class="yellowgreen">${cashFormat(_income)}</span> from all the bribes people gave for ${him} to turn the other way.`); break; case"chinese": _income += random(1500, 2500); r.push(`Being under what people call the Mandate of Heaven means you have a crucial importance in society, and some desperate people are willing to pay just for you to throw a word or small gesture in their direction, such as simply acknowledging a child or a slave, thinking that such things will make sure the Heavens smile upon them. For these services, you get <span class="yellowgreen">${cashFormat(_income)}.</span>`); + break; default: _income += random(500, 2000); r.push(`You use former contacts to get you some opportunities in your arcology and deal with them. You make little money, only <span class="yellowgreen">${cashFormat(_income)}.</span>`); @@ -460,7 +462,7 @@ App.EndWeek.personalBusiness = function() { } _income += Math.trunc(Math.min(3000 * Math.log(V.cash + 1), V.cash * 0.07)); r.push(`This week, your illicit and legitimate business dealings earned you a combined total of <span class="yellowgreen">`); - cashFormat(_income) + cashFormat(_income); r.push(`.</span>`); cashX(_income, "personalBusiness"); } else if ((V.cash > 1000) && (V.personalAttention === "business")) { @@ -480,7 +482,7 @@ App.EndWeek.personalBusiness = function() { _income += Math.trunc(Math.min(3500 * Math.log(V.cash), V.cash * 0.07)); } r.push(`<span class="yellowgreen">`); - cashFormat(_income) + cashFormat(_income); r.push(`.</span>`); cashX(_income, "personalBusiness"); if (V.arcologies[0].FSRomanRevivalist !== "unset") { @@ -496,7 +498,7 @@ App.EndWeek.personalBusiness = function() { } else if ((V.cash > 1000)) { _income = Math.trunc(Math.min(3000 * Math.log(V.cash), V.cash * 0.07)); r.push(`This week, your business endeavors made you <span class="yellowgreen">`); - cashFormat(_income) + cashFormat(_income); r.push(`.</span>`); cashX(_income, "personalBusiness"); } else { @@ -528,7 +530,8 @@ App.EndWeek.personalBusiness = function() { } else { cashX(-8000, "personalBusiness"); } - V.SecExp.proclamation.cooldown = 4, V.personalAttention = "business"; + V.SecExp.proclamation.cooldown = 4; + V.personalAttention = "business"; } else { r.push(`As you currently lack the minimum amount of your chosen proclamation currency, ${V.SecExp.proclamation.currency}, it would be unwise to attempt execution of your V.SecExp.proclamation.type this week.`); } @@ -759,7 +762,8 @@ App.EndWeek.personalBusiness = function() { break; case"technical accidents": - _windfall = Math.trunc((150 * V.PC.skill.hacking) + random(100, 2500)), _X = 0; + _windfall = Math.trunc((150 * V.PC.skill.hacking) + random(100, 2500)); + _X = 0; if (V.PC.skill.hacking === -100) { _Catchtchance = 10; } else if (V.PC.skill.hacking <= -75) { @@ -803,14 +807,13 @@ App.EndWeek.personalBusiness = function() { r.push(`${IncreasePCSkills('hacking', 0.5)}`); } cashX(_windfall, "personalBusiness"); - } } if (V.policies.cashForRep === 1) { if (V.cash > 1000) { r.push(`This week you gave up business opportunities worth `); - cashFormat(policies.cost()) + cashFormat(policies.cost()); r.push(` to help deserving citizens, <span class="green">burnishing your reputation.</span>`); repX(1000, "personalBusiness"); cashX(forceNeg(policies.cost()), "policies"); @@ -825,7 +828,7 @@ App.EndWeek.personalBusiness = function() { if (V.policies.goodImageCampaign === 1) { if (V.cash > 5000) { r.push(`This week you paid `); - cashFormat(policies.cost()) + cashFormat(policies.cost()); r.push(` to have positive rumors spread about you, <span class="green">making you look good`); if (V.PC.degeneracy > 1) { r.push(` and weakening existing undesirable rumors`); @@ -841,7 +844,7 @@ App.EndWeek.personalBusiness = function() { if (V.rep > 20) { if (V.policies.cashForRep === -1) { r.push(`This week you used your position to secure business opportunities worth `); - cashFormat(policies.cost()) + cashFormat(policies.cost()); r.push(` at the expense of citizens, <span class="red">damaging your reputation.</span>`); repX(-20, "personalBusiness"); cashX(policies.cost(), "personalBusiness"); @@ -872,7 +875,7 @@ App.EndWeek.personalBusiness = function() { _dataGain = _upgradeCount * 200; if (!Number.isInteger(_dataGain)) { - //<br> + // <br> r.push(`<span class="red">Error, dataGain is NaN</span>`); } else { r.push(`You are selling the data collected by your security department, which earns a discreet sum of <span class="yellowgreen">${cashFormat(_dataGain)}.</span>`); @@ -898,11 +901,12 @@ App.EndWeek.personalBusiness = function() { } r.push(` to finish repair works.`); cashX(-5000, "personalBusiness"); - V.arcRepairTime--, IncreasePCSkills('engineering', 0.1); + V.arcRepairTime--; + IncreasePCSkills('engineering', 0.1); } if (V.SecExp.buildings.weapManu) { - //<br><br> + // <br><br> r.push(`The weapons manufacturing complex produces armaments`); if (V.SecExp.buildings.weapManu.productivity <= 2) { r.push(` at a steady pace.`); @@ -941,10 +945,10 @@ App.EndWeek.personalBusiness = function() { } _income = Math.trunc(_income * 0.5); r.push(`This week we made <span class="yellowgreen">`); - cashFormat(_income) + cashFormat(_income); r.push(`.</span>`); if (!Number.isInteger(_income)) { - //<br> + // <br> r.push(`<span class="red">Error failed to calculate income</span>`); } else { cashX(_income, "personalBusiness"); @@ -953,11 +957,11 @@ App.EndWeek.personalBusiness = function() { if (V.SecExp.edicts.taxTrade === 1) { const _tradeTax = Math.ceil(V.SecExp.core.trade * random(80, 120)); - //<br> + // <br> r.push(`Fees on transitioning goods this week made <span class="yellowgreen">${cashFormat(_tradeTax)}.</span>`); cashX(Math.ceil(_tradeTax), "personalBusiness"); } - //<br> + // <br> } r.push(`Routine upkeep of your demesne costs <span class="yellow">${cashFormat(V.costs)}.</span>`); @@ -972,11 +976,13 @@ App.EndWeek.personalBusiness = function() { r.push(`${V.arcologies[0].name}'s hardened exterior only partially resisted the extreme weather this week, and it requires repairs costing <span class="yellow">${cashFormat(_weatherRepairCost)}.</span> Your citizens are <span class="green">grateful</span> to you for upgrading ${V.arcologies[0].name} to provide a safe haven from the terrible climate.`); repX(500, "architecture"); } else if (V.weatherCladding === 2) { - _weatherRepairCost = Math.trunc(((V.weatherToday.severity - 4) * (V.arcologies[0].prosperity * random(50, 100))) + random(1, 100)), IncreasePCSkills('engineering', 0.1); + _weatherRepairCost = Math.trunc(((V.weatherToday.severity - 4) * (V.arcologies[0].prosperity * random(50, 100))) + random(1, 100)); + IncreasePCSkills('engineering', 0.1); r.push(`${V.arcologies[0].name}'s hardened exterior only partially resisted the extreme weather this week, and it requires repairs costing <span class="yellow">${cashFormat(_weatherRepairCost)}.</span> Your citizens are <span class="green">grateful</span> to you for upgrading ${V.arcologies[0].name} to provide a safe haven from the terrible climate.`); repX(500, "architecture"); } else { - _weatherRepairCost = Math.trunc(((V.weatherToday.severity - 2) * (V.arcologies[0].prosperity * random(50, 100))) + random(1, 100)), IncreasePCSkills('engineering', 0.1); + _weatherRepairCost = Math.trunc(((V.weatherToday.severity - 2) * (V.arcologies[0].prosperity * random(50, 100))) + random(1, 100)); + IncreasePCSkills('engineering', 0.1); r.push(`Severe weather damaged the arcology this week, requiring repairs costing <span class="yellow">${cashFormat(_weatherRepairCost)}.</span> Your citizens are <span class="red">unhappy</span> that the arcology has proven vulnerable to the terrible climate.`); repX(-50, "architecture"); } @@ -989,13 +995,15 @@ App.EndWeek.personalBusiness = function() { V.failedElite += 100; } if (V.arcologies[0].prosperity > 50) { - V.arcologies[0].prosperity -= random(5, 10), IncreasePCSkills('engineering', 0.1); + V.arcologies[0].prosperity -= random(5, 10); + IncreasePCSkills('engineering', 0.1); } cashX(forceNeg(Math.trunc(_weatherRepairCost / 4)), "weather"); } else { r.push(`Since you lack the resources to effect prompt repairs yourself, prominent citizens step in to repair their own parts of the arcology. This is <span class="red">terrible for your reputation,</span> and it also <span class="red">severely reduces the arcology's prosperity.</span>`); if (V.arcologies[0].prosperity > 50) { - V.arcologies[0].prosperity -= random(5, 10), IncreasePCSkills('engineering', 0.1); + V.arcologies[0].prosperity -= random(5, 10); + IncreasePCSkills('engineering', 0.1); } repX((Math.trunc(V.rep * 0.9)) - V.rep, "weather"); r.push(`${IncreasePCSkills('engineering', 0.1)}`); @@ -1011,16 +1019,16 @@ App.EndWeek.personalBusiness = function() { } } V.costs = Math.trunc(Math.abs(calculateCosts.bill()) * 100) / 100; - /*overwrite the prediction and actually pay the bill. GetCost should return a negative. Round to two decimal places.*/ + /* overwrite the prediction and actually pay the bill. GetCost should return a negative. Round to two decimal places.*/ if (isNaN(V.costs)) { - //<br> + // <br> r.push(`<span class="red">Error, costs is NaN</span>`); } - /*Adding random changes to slave demand and supply*/ + /* Adding random changes to slave demand and supply*/ endWeekSlaveMarket(); if (V.menialDemandFactor <= -35000) { - //<br> + // <br> r.push(`Demand for slaves is approaching a <span class="red">''historic low'',</span> forecasts predict`); if (V.deltaDemand > 0) { r.push(`the market will turn soon and <span class="green">''demand will rise''.</span>`); @@ -1030,7 +1038,7 @@ App.EndWeek.personalBusiness = function() { r.push(`the current demand will <span class="yellow">''stabilize''.</span>`); } } else if (V.menialDemandFactor <= -20000) { - //<br> + // <br> r.push(`Demand for slaves is <span class="red">''very low'',</span> forecasts predict`); if (V.deltaDemand > 0) { r.push(`the market will turn soon and <span class="green">''demand will rise''.</span>`); @@ -1040,7 +1048,7 @@ App.EndWeek.personalBusiness = function() { r.push(`the current demand will <span class="yellow">''stabilize''.</span>`); } } else if (V.menialDemandFactor >= 35000) { - //<br> + // <br> r.push(`Demand for slaves is approaching a <span class="green">''historic high'',</span> forecasts predict`); if (V.deltaDemand > 0) { r.push(`<span class="green">''demand will continue to rise'',</span> but warn the peak is in sight.`); @@ -1050,7 +1058,7 @@ App.EndWeek.personalBusiness = function() { r.push(`the current demand will <span class="yellow">''stabilize''.</span>`); } } else if (V.menialDemandFactor >= 20000) { - //<br> + // <br> r.push(`Demand for slaves is <span class="green">''very high'',</span> forecasts predict`); if (V.deltaDemand > 0) { r.push(`<span class="green">''demand will continue to rise''.</span>`); @@ -1060,7 +1068,7 @@ App.EndWeek.personalBusiness = function() { r.push(`the current demand will <span class="yellow">''stabilize''.</span>`); } } else { - //<br> + // <br> r.push(`Demand for slaves is <span class="yellow">''average'',</span> forecasts predict`); if (V.deltaDemand > 0) { r.push(`the market will see <span class="green">''rising demand''.</span>`); @@ -1071,7 +1079,7 @@ App.EndWeek.personalBusiness = function() { } } if (V.menialSupplyFactor <= -35000) { - //<br> + // <br> r.push(`Supply of slaves is approaching a <span class="green">''historic low'',</span> forecasts predict`); if (V.deltaSupply > 0) { r.push(`the market will turn soon and <span class="red">''supply will rise''.</span>`); @@ -1081,7 +1089,7 @@ App.EndWeek.personalBusiness = function() { r.push(`the current supply will <span class="yellow">''stabilize''.</span>`); } } else if (V.menialSupplyFactor <= -20000) { - //<br> + // <br> r.push(`Supply for slaves is <span class="green">''very low'',</span> forecasts predict`); if (V.deltaSupply > 0) { r.push(`the market will turn soon and <span class="red">''supply will rise''.</span>`); @@ -1091,7 +1099,7 @@ App.EndWeek.personalBusiness = function() { r.push(`the current supply will <span class="yellow">''stabilize''.</span>`); } } else if (V.menialSupplyFactor >= 35000) { - //<br> + // <br> r.push(`Supply for slaves is approaching a <span class="red">''historic high'',</span> forecasts predict`); if (V.deltaSupply > 0) { r.push(`<span class="red">''supply will continue to rise'',</span> but warn the peak is in sight.`); @@ -1101,7 +1109,7 @@ App.EndWeek.personalBusiness = function() { r.push(`the current supply will <span class="yellow">''stabilize''.</span>`); } } else if (V.menialSupplyFactor >= 20000) { - //<br> + // <br> r.push(`Supply for slaves is <span class="red">''very high'',</span> forecasts predict`); if (V.deltaSupply > 0) { r.push(`<span class="red">''supply will continue to rise''.</span>`); @@ -1111,7 +1119,7 @@ App.EndWeek.personalBusiness = function() { r.push(`the current supply will <span class="yellow">''stabilize''.</span>`); } } else { - //<br> + // <br> r.push(`Supply for slaves is <span class="yellow">''average'',</span> forecasts predict`); if (V.deltaSupply > 0) { r.push(`the market will see <span class="red">''rising supply''.</span>`); @@ -1128,14 +1136,14 @@ App.EndWeek.personalBusiness = function() { V.slaveCostFactor = menialSlaveCost() / 1000; if (V.arcologies[0].FSRomanRevivalist > random(1, 150)) { if (V.slaveCostFactor > 0.8) { - //<br><br> + // <br><br> r.push(`<span class="yellow">Your Roman Revivalism is having an effect on the slave market and has driven local prices down</span> by convincing slave traders that this is a staunchly pro-slavery area.`); - //<br> + // <br> V.menialSupplyFactor += 2000; } else { - //<br><br> + // <br><br> r.push(`<span class="yellow">Your Roman Revivalism is having an effect on the slave market and is holding local prices down</span> by convincing slave traders that this is a staunchly pro-slavery area.`); - //<br> + // <br> } } @@ -1171,7 +1179,7 @@ App.EndWeek.personalBusiness = function() { if (V.weatherToday.severity === 3) { V.localEcon -= 1; V.econWeatherDamage += 1; - //<br><br> + // <br><br> r.push(`This week's terrible weather did a number on the region, <span class="red">hurting the local economy.</span> `); if (V.disasterResponse === 0) { r.push(App.UI.DOM.makeElement("span", `Investing in a disaster response unit will speed up recovery`, "note")); @@ -1179,7 +1187,7 @@ App.EndWeek.personalBusiness = function() { } else if (V.weatherToday.severity > 3) { V.localEcon -= 3; V.econWeatherDamage += 3; - //<br><br> + // <br><br> r.push(`This week's extreme weather ravaged the region, <span class="red">the local economy is seriously disrupted.</span>`); if (V.disasterResponse === 0) { r.push(App.UI.DOM.makeElement("span", `Investing in a disaster response unit will speed up recovery`, "note"));