From 7c521ec818f7f902e9a660d5ff911197c321e59c Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Thu, 22 Oct 2020 20:09:40 -0400 Subject: [PATCH] fix printing html --- src/endWeek/economics/arcmgmt.js | 173 ++++++++++++++++--------------- 1 file changed, 92 insertions(+), 81 deletions(-) diff --git a/src/endWeek/economics/arcmgmt.js b/src/endWeek/economics/arcmgmt.js index c0eb296a78f..47dae791b17 100644 --- a/src/endWeek/economics/arcmgmt.js +++ b/src/endWeek/economics/arcmgmt.js @@ -207,13 +207,13 @@ globalThis.arcmgmt = function() { if (V.SecExp.buildings.transportHub.surfaceTransport < 4) { _weatherFreeze = 1; V.weatherAwareness = 1; - App.UI.DOM.appendNewElement("div", el, `The terrible weather is <span class="red">preventing people from entering or leaving</span> your arcology. Improving your transport infrastructure will prevent this from happening.`, "note"); + appendDiv(`The terrible weather is <span class="red">preventing people from entering or leaving</span> your arcology. Improving your transport infrastructure will prevent this from happening.`, "note"); } else { _weatherFreeze = 0; } } else if (V.antiWeatherFreeze < 2) { _weatherFreeze = 1; - App.UI.DOM.appendNewElement("div", el, `The terrible weather is <span class="red">preventing people from entering or leaving</span> your arcology. Improving your transport infrastructure will prevent this from happening.`, "note"); + appendDiv(`The terrible weather is <span class="red">preventing people from entering or leaving</span> your arcology. Improving your transport infrastructure will prevent this from happening.`, "note"); } else { _weatherFreeze = 0; } @@ -221,14 +221,14 @@ globalThis.arcmgmt = function() { if (V.secExpEnabled > 0 && V.SecExp.buildings.transportHub) { if (V.SecExp.buildings.transportHub.surfaceTransport < 3) { _weatherFreeze = 1; - App.UI.DOM.appendNewElement("div", el, `The terrible weather is <span class="red">preventing people from entering or leaving</span> your arcology. Improving your transport infrastructure will prevent this from happening.`, "note"); + appendDiv(`The terrible weather is <span class="red">preventing people from entering or leaving</span> your arcology. Improving your transport infrastructure will prevent this from happening.`, "note"); } else { _weatherFreeze = 0; } } else if (V.antiWeatherFreeze < 1) { _weatherFreeze = 1; V.weatherAwareness = 1; - App.UI.DOM.appendNewElement("div", el, `The terrible weather is <span class="red">preventing people from entering or leaving</span> your arcology. Improving your transport infrastructure will prevent this from happening.`, "note"); + appendDiv(`The terrible weather is <span class="red">preventing people from entering or leaving</span> your arcology. Improving your transport infrastructure will prevent this from happening.`, "note"); } else { _weatherFreeze = 0; } @@ -250,10 +250,10 @@ globalThis.arcmgmt = function() { V.NPCSlaves += _enslavedNPC; } if (_enslaved > 1) { - App.UI.DOM.appendNewElement("div", el, `In total <span class="green"> ${_enslaved} lower class citizens</span> were enslaved for failing to pay their debts.`); - App.UI.DOM.appendNewElement("div", el, `<span class="green">You enslaved ${_enslavedPC}</span> of them while other debtholders in the arcology enslaved the remaining ${_enslavedNPC}.`); + appendDiv(`In total <span class="green"> ${_enslaved} lower class citizens</span> were enslaved for failing to pay their debts.`); + appendDiv(`<span class="green">You enslaved ${_enslavedPC}</span> of them while other debtholders in the arcology enslaved the remaining ${_enslavedNPC}.`); } else if (_enslaved > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">As arcology owner you claimed the slave.</span>`); + appendDiv(`<span class="green">As arcology owner you claimed the slave.</span>`); } } @@ -286,10 +286,10 @@ globalThis.arcmgmt = function() { V.visitors = normalRandInt(50, 2); } if (isNaN(V.visitors)) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">Visitors is NaN, report this issue!</span>`); + appendDiv(`<span class="red">Visitors is NaN, report this issue!</span>`); V.visitors = _oldVisitors; } - App.UI.DOM.appendNewElement("div", el, `<span class="green"> ${V.visitors} traders and tourists</span> visited your arcology this week.`); + appendDiv(`<span class="green"> ${V.visitors} traders and tourists</span> visited your arcology this week.`); /* slaves*/ /* Slaves getting retired*/ @@ -300,16 +300,16 @@ globalThis.arcmgmt = function() { if (_weeklyRetiredMenials > 1) { _weeklyRetiredMenials = Math.trunc(_weeklyRetiredMenials); if (_weeklyRetiredMenials > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red"> ${_weeklyRetiredMenialsof} your menial slaves</span> retired as free citizens this week.`); + appendDiv(`<span class="red"> ${_weeklyRetiredMenialsof} your menial slaves</span> retired as free citizens this week.`); } else { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One of your menial slaves</span> retired as a free citizen this week.`); + appendDiv(`<span class="red">One of your menial slaves</span> retired as a free citizen this week.`); } } else { _weeklyRetiredMenials *= 100; _retirementChance = random(1, 100); if (_weeklyRetiredMenials > _retirementChance) { _weeklyRetiredMenials = 1; - App.UI.DOM.appendNewElement("div", el, `<span class="red">One of your menial slaves</span> retired as a free citizen this week.`); + appendDiv(`<span class="red">One of your menial slaves</span> retired as a free citizen this week.`); } else { _weeklyRetiredMenials = 0; } @@ -317,16 +317,16 @@ globalThis.arcmgmt = function() { if (_weeklyRetiredNPCMenials > 1) { _weeklyRetiredNPCMenials = Math.trunc(_weeklyRetiredNPCMenials); if (_weeklyRetiredNPCMenials > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red"> ${_weeklyRetiredNPCMenials} menial slaves</span> were retired as free citizens by other slave owners in your arcology this week.`); + appendDiv(`<span class="red"> ${_weeklyRetiredNPCMenials} menial slaves</span> were retired as free citizens by other slave owners in your arcology this week.`); } else { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One menial slave</span> was retired as a free citizen by another slave owner in your arcology this week.`); + appendDiv(`<span class="red">One menial slave</span> was retired as a free citizen by another slave owner in your arcology this week.`); } } else { _weeklyRetiredNPCMenials *= 100; _retirementChance2 = random(1, 100); if (_weeklyRetiredNPCMenials > _retirementChance2) { _weeklyRetiredNPCMenials = 1; - App.UI.DOM.appendNewElement("div", el, `<span class="red">One menial slave</span> was retired as a free citizen by another slave owner in your arcology this week.`); + appendDiv(`<span class="red">One menial slave</span> was retired as a free citizen by another slave owner in your arcology this week.`); } else { _weeklyRetiredNPCMenials = 0; } @@ -340,9 +340,9 @@ globalThis.arcmgmt = function() { /* Demand for owning slaves*/ _SCD = Math.trunc((V.upperClass * (2 + _slaveDemandU)) + (V.topClass * (12 + _slaveDemandT))); if (isNaN(_LSCD)) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">LSCD is NaN, report this issue!</span>`); + appendDiv(`<span class="red">LSCD is NaN, report this issue!</span>`); } else if (isNaN(_SCD)) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">SCD is NaN, report this issue!</span>`); + appendDiv(`<span class="red">SCD is NaN, report this issue!</span>`); } else { /* More slaves than they know what to do with*/ if (V.NPCSlaves > _SCD * 1.6) { @@ -350,9 +350,9 @@ globalThis.arcmgmt = function() { V.menialDemandFactor -= _NPCSlavesSold; V.NPCSlaves = Math.trunc(_SCD * 1.6); if (_NPCSlavesSold > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red"> ${_NPCSlavesSoldslaves}</span> were sold by your inhabitants. They've got more than enough of them already.`); + appendDiv(`<span class="red"> ${_NPCSlavesSoldslaves}</span> were sold by your inhabitants. They've got more than enough of them already.`); } else if (_NPCSlavesSold > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One slave</span> was sold by your inhabitants. They've got more than enough of them already.`); + appendDiv(`<span class="red">One slave</span> was sold by your inhabitants. They've got more than enough of them already.`); } /* More slaves than there is work*/ } else if (V.NPCSlaves > (_LSCD / _slaveProductivity) - V.menials + _SCD) { @@ -360,9 +360,9 @@ globalThis.arcmgmt = function() { V.menialDemandFactor -= _NPCSlavesSold; V.NPCSlaves = Math.trunc(_LSCD / _slaveProductivity); if (_NPCSlavesSold > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red"> ${_NPCSlavesSoldslaves}</span> were sold by your inhabitants. There was so little work that they failed to earn their keep.`); + appendDiv(`<span class="red"> ${_NPCSlavesSoldslaves}</span> were sold by your inhabitants. There was so little work that they failed to earn their keep.`); } else if (_NPCSlavesSold > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One slave</span> was sold by your inhabitants. There was so little work that it failed to earn its keep.`); + appendDiv(`<span class="red">One slave</span> was sold by your inhabitants. There was so little work that it failed to earn its keep.`); } /* Cutting back on slaves*/ } else if (V.NPCSlaves > _SCD * 1.4) { @@ -371,9 +371,9 @@ globalThis.arcmgmt = function() { V.menialDemandFactor -= _NPCSlavesSold; V.NPCSlaves -= _NPCSlavesSold; if (_NPCSlavesSold > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red"> ${_NPCSlavesSoldslaves}</span> were sold by your inhabitants. They've got more than enough of them already.`); + appendDiv(`<span class="red"> ${_NPCSlavesSoldslaves}</span> were sold by your inhabitants. They've got more than enough of them already.`); } else if (_NPCSlavesSold > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One slave</span> was sold by your inhabitants. They've got more than enough of them already.`); + appendDiv(`<span class="red">One slave</span> was sold by your inhabitants. They've got more than enough of them already.`); } } /* Selling excess slaves for profit*/ @@ -383,9 +383,9 @@ globalThis.arcmgmt = function() { V.menialDemandFactor -= _NPCSlavesSold; V.NPCSlaves -= _NPCSlavesSold; if (_NPCSlavesSold > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red"> ${_NPCSlavesSoldslaves}</span> were sold by your inhabitants. They saw an opportunity for profit.`); + appendDiv(`<span class="red"> ${_NPCSlavesSoldslaves}</span> were sold by your inhabitants. They saw an opportunity for profit.`); } else if (_NPCSlavesSold > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One slave</span> was sold by your inhabitants. They saw an opportunity for profit.`); + appendDiv(`<span class="red">One slave</span> was sold by your inhabitants. They saw an opportunity for profit.`); } } } @@ -396,7 +396,7 @@ globalThis.arcmgmt = function() { V.menialSupplyFactor -= _NPCSlavesBought; V.NPCSlaves += _NPCSlavesBought; if (_NPCSlavesBought > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">${_NPCSlavesBought} slaves</span> were bought by your inhabitants. They were too cheap to pass up on.`); + appendDiv(`<span class="green">${_NPCSlavesBought} slaves</span> were bought by your inhabitants. They were too cheap to pass up on.`); } /* there's no way this ever ends up needing a 1 slave version*/ } } @@ -412,13 +412,14 @@ globalThis.arcmgmt = function() { _LCD = 0; } if (isNaN(_LCD)) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">LCD is NaN, report this issue!</span>`); + appendDiv(`<span class="red">LCD is NaN, report this issue!</span>`); } else { /* Changing population depending on work available*/ if (V.classSatisfied.lowerClass < 0) { - App.UI.DOM.appendNewElement("div", el, `Your lower class is <span class="red">sexually frustrated</span> and would rather live elsewhere.`); + appendDiv(`Your lower class is <span class="red">sexually frustrated</span> and would rather live elsewhere.`); } else if (V.classSatisfied.lowerClass > 0) { - App.UI.DOM.appendNewElement("div", el, `Your lower class is <span class="green">sexually satiated</span> and their happiness attracts others.`); + appendDiv(`Your lower class is <span class="green">sexually satiated</span> and their happiness attracts others.`); } + r = []; if (V.lowerClass < _LCD) { if (V.arcologies[0].FSIntellectualDependencyLaw === 1) { /* Enslaving the dumb lower class immigrants*/ _LCImmigration = Math.trunc((_LCD - V.lowerClass) * (0.3 * _terrain)) + 1; @@ -426,15 +427,15 @@ globalThis.arcmgmt = function() { _LCImmigration -= _intellectualDependencyEnslaved; _enslaved += _intellectualDependencyEnslaved; V.lowerClass += _LCImmigration; - App.UI.DOM.appendNewElement("span", el, `<span class="green">${_intellectualDependencyEnslaved} dumb immigrants</span> were enslaved for their own good.`); + r.push(`<span class="green">${_intellectualDependencyEnslaved} dumb immigrants</span> were enslaved for their own good.`); } else { _LCImmigration = Math.trunc((_LCD - V.lowerClass) * (0.3 * _terrain)) + 1; V.lowerClass += _LCImmigration; } if (_LCImmigration > 1) { - App.UI.DOM.appendNewElement("span", el, `<span class="green">${_LCImmigration} lower class citizens</span> moved to your arcology.`); + r.push(`<span class="green">${_LCImmigration} lower class citizens</span> moved to your arcology.`); } else if (_LCImmigration > 0) { - App.UI.DOM.appendNewElement("span", el, `<span class="green">One lower class citizen</span> moved to your arcology.`); + r.push(`<span class="green">One lower class citizen</span> moved to your arcology.`); } } else if (V.lowerClass > _LCD) { _LCEmigration = Math.trunc((V.lowerClass - _LCD) * 0.6) + 1; @@ -446,16 +447,17 @@ globalThis.arcmgmt = function() { V.lowerClass -= _LCEmigration; _enslaved += _enslavedEmigrants; if (_LCEmigration > 1) { - App.UI.DOM.appendNewElement("span", el, `<span class="red">${_LCEmigration} lower class citizens</span> had no work and tried to leave your arcology.`); + r.push(`<span class="red">${_LCEmigration} lower class citizens</span> had no work and tried to leave your arcology.`); if (_enslavedEmigrants > 1) { - App.UI.DOM.appendNewElement("span", el, `<span class="green"> ${_enslavedEmigrants} of them were enslaved instead.</span>`); + r.push(`<span class="green"> ${_enslavedEmigrants} of them were enslaved instead.</span>`); } else if (_enslavedEmigrants > 0) { - App.UI.DOM.appendNewElement("span", el, `<span class="green">One of them was enslaved instead.</span>`); + r.push(`<span class="green">One of them was enslaved instead.</span>`); } } else if (_LCEmigration > 0) { - App.UI.DOM.appendNewElement("span", el, `<span class="red">One lower class citizen</span> left your arcology due to a lack of work.`); + r.push(`<span class="red">One lower class citizen</span> left your arcology due to a lack of work.`); } } + App.Events.addNode(el, r, "div"); if (_enslaved > 0) { if (_enslaved < 4) { _enslavedPC = 1; @@ -468,10 +470,10 @@ globalThis.arcmgmt = function() { V.NPCSlaves += _enslavedNPC; } if (_enslaved > 1) { - App.UI.DOM.appendNewElement("div", el, `In total <span class="green">${_enslaved} lower class citizens</span> were enslaved for failing to pay their debts.`); - App.UI.DOM.appendNewElement("div", el, `<span class="green">You enslaved ${_enslavedPC}</span> of them while other debtholders in the arcology enslaved the remaining ${_enslavedNPC}.`); + appendDiv(`In total <span class="green">${_enslaved} lower class citizens</span> were enslaved for failing to pay their debts.`); + appendDiv(`<span class="green">You enslaved ${_enslavedPC}</span> of them while other debtholders in the arcology enslaved the remaining ${_enslavedNPC}.`); } else if (_enslaved > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">As arcology owner you claimed the slave.</span>`); + appendDiv(`<span class="green">As arcology owner you claimed the slave.</span>`); } /* Need more slaves still*/ if (V.NPCSlaves < _SCD) { @@ -479,9 +481,9 @@ globalThis.arcmgmt = function() { V.menialSupplyFactor -= _NPCSlavesBought; V.NPCSlaves += _NPCSlavesBought; if (_NPCSlavesBought > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">${_NPCSlavesBought} slaves</span> were bought by your inhabitants. They did not have enough of them to satisfy their needs.`); + appendDiv(`<span class="green">${_NPCSlavesBought} slaves</span> were bought by your inhabitants. They did not have enough of them to satisfy their needs.`); } else if (_NPCSlavesBought > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">One slave</span> was bought by your inhabitants. They did not quite have enough of them to satisfy their needs.`); + appendDiv(`<span class="green">One slave</span> was bought by your inhabitants. They did not quite have enough of them to satisfy their needs.`); } } } @@ -496,30 +498,30 @@ globalThis.arcmgmt = function() { _MCD = 200; } if (isNaN(_MCD)) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">MCD is NaN, report this issue!</span>`); + appendDiv(`<span class="red">MCD is NaN, report this issue!</span>`); } else { /* Middle Class Citizens immigrating*/ if (V.classSatisfied.middleClass < 0) { - App.UI.DOM.appendNewElement("div", el, `Your middle class is <span class="red">sexually frustrated</span> and would rather live elsewhere.`); + appendDiv(`Your middle class is <span class="red">sexually frustrated</span> and would rather live elsewhere.`); } else if (V.classSatisfied.middleClass > 0) { - App.UI.DOM.appendNewElement("div", el, `Your middle class is <span class="green">sexually satiated</span> and their happiness attracts others.`); + appendDiv(`Your middle class is <span class="green">sexually satiated</span> and their happiness attracts others.`); } if (V.middleClass < _MCD) { _MCImmigration = Math.trunc((_MCD - V.middleClass) * (0.3 * _terrain)) + 1; V.middleClass += _MCImmigration; if (_MCImmigration > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">${_MCImmigration} middle class citizens</span> moved to your arcology.`); + appendDiv(`<span class="green">${_MCImmigration} middle class citizens</span> moved to your arcology.`); } else if (_MCImmigration > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">One middle class citizen</span> moved to your arcology.`); + appendDiv(`<span class="green">One middle class citizen</span> moved to your arcology.`); } /* Middle Class Citizens emigrating*/ } else if (V.middleClass > _MCD) { _MCEmigration = Math.trunc((V.middleClass - _MCD) * 0.6); V.middleClass -= _MCEmigration; if (_MCEmigration > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">${_MCEmigration} middle class citizens</span> left your arcology.`); + appendDiv(`<span class="red">${_MCEmigration} middle class citizens</span> left your arcology.`); } else if (_MCEmigration > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One middle class citizen</span> left your arcology.`); + appendDiv(`<span class="red">One middle class citizen</span> left your arcology.`); } } } @@ -534,30 +536,30 @@ globalThis.arcmgmt = function() { _UCD = 50; } if (isNaN(_UCD)) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">UCD is NaN, report this issue!</span>`); + appendDiv(`<span class="red">UCD is NaN, report this issue!</span>`); } else { /* Upper Class Citizens immigrating*/ if (V.classSatisfied.upperClass < 0) { - App.UI.DOM.appendNewElement("div", el, `Your upper class is <span class="red">sexually frustrated</span> and would rather live elsewhere.`); + appendDiv(`Your upper class is <span class="red">sexually frustrated</span> and would rather live elsewhere.`); } else if (V.classSatisfied.upperClass > 0) { - App.UI.DOM.appendNewElement("div", el, `Your upper class is <span class="green">sexually satiated</span> and their happiness attracts others.`); + appendDiv(`Your upper class is <span class="green">sexually satiated</span> and their happiness attracts others.`); } if (V.upperClass < _UCD) { _UCImmigration = Math.trunc((_UCD - V.upperClass) * (0.3 * _terrain)) + 1; V.upperClass += _UCImmigration; if (_UCImmigration > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">${_UCImmigration} upper class citizens</span> moved to your arcology.`); + appendDiv(`<span class="green">${_UCImmigration} upper class citizens</span> moved to your arcology.`); } else if (_UCImmigration > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">One upper class citizen</span> moved to your arcology.`); + appendDiv(`<span class="green">One upper class citizen</span> moved to your arcology.`); } /* Upper Class Citizens Emigrating*/ } else if (V.upperClass > _UCD) { _UCEmigration = Math.trunc((V.upperClass - _UCD) * 0.6); V.upperClass -= _UCEmigration; if (_UCEmigration > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">${_UCEmigration} upper class citizens</span> left your arcology.`); + appendDiv(`<span class="red">${_UCEmigration} upper class citizens</span> left your arcology.`); } else if (_UCEmigration > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One upper class citizen</span> left your arcology.`); + appendDiv(`<span class="red">One upper class citizen</span> left your arcology.`); } } } @@ -583,30 +585,30 @@ globalThis.arcmgmt = function() { _TCD = 15; } if (isNaN(_TCD)) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">TCD is NaN, report this issue!</span>`); + appendDiv(`<span class="red">TCD is NaN, report this issue!</span>`); } else { /* Top Class Citizens immigrating*/ if (V.classSatisfied.topClass < 0) { - App.UI.DOM.appendNewElement("div", el, `Your millionaires are <span class="red">sexually frustrated</span> and would rather live elsewhere.`); + appendDiv(`Your millionaires are <span class="red">sexually frustrated</span> and would rather live elsewhere.`); } else if (V.classSatisfied.topClass > 0) { - App.UI.DOM.appendNewElement("div", el, `Your millionaires are <span class="green">sexually satiated</span> and their happiness attracts others.`); + appendDiv(`Your millionaires are <span class="green">sexually satiated</span> and their happiness attracts others.`); } if (V.topClass < _TCD) { _TCImmigration = Math.trunc((_TCD - V.topClass) * (0.3 * _terrain)) + 1; V.topClass += _TCImmigration; if (_TCImmigration > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">${_TCImmigration} millionaires</span> moved to your arcology. /*Fat Cat? One-Percenter?*/`); + appendDiv(`<span class="green">${_TCImmigration} millionaires</span> moved to your arcology. /*Fat Cat? One-Percenter?*/`); } else if (_TCImmigration > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="green">One millionaire</span> moved to your arcology.`); + appendDiv(`<span class="green">One millionaire</span> moved to your arcology.`); } /* Top Class Citizens emigrating*/ } else if (V.topClass > _TCD) { _TCEmigration = Math.trunc((V.topClass - _TCD) * 0.6) + 1; V.topClass -= _TCEmigration; if (_TCEmigration > 1) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">${_TCEmigration} millionaires</span> left your arcology.`); + appendDiv(`<span class="red">${_TCEmigration} millionaires</span> left your arcology.`); } else if (_TCEmigration > 0) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">One millionaire</span> left your arcology.`); + appendDiv(`<span class="red">One millionaire</span> left your arcology.`); } } } @@ -624,19 +626,19 @@ globalThis.arcmgmt = function() { _percUpperClass = Math.trunc((V.upperClass / (V.ACitizens + V.ASlaves)) * 1000) / 10; _percTopClass = Math.trunc((V.topClass / (V.ACitizens + V.ASlaves)) * 1000) / 10; if (V.cheatMode === 1) { - App.UI.DOM.appendNewElement("div", el, `${V.arcologies[0].prosperity} Prosperity | ${_FSScore} FS Score | ${_honeymoon} Honeymoon | ${_transportHub} Transporthub | ${_terrain} Terrain | ${_crime} Crime`); - App.UI.DOM.appendNewElement("div", el, `${_LSCD} Lower + Slave Class Demand | ${_SCD} Slave Class Demand | ${_slaveProductivity} Slave Productivity`); - App.UI.DOM.appendNewElement("div", el, `${_LCD} Lower Class Demand | ${_lowerClassP} LC Multiplier`); - App.UI.DOM.appendNewElement("div", el, `${_MCD} Middle Class Demand | ${_middleClassP} MC Multiplier`); - App.UI.DOM.appendNewElement("div", el, `${_UCD} Upper Class Demand | ${_upperClassP} UC Multiplier`); - App.UI.DOM.appendNewElement("div", el, `${_TCD} Top Class Demand | ${_topClassP} TC Multiplier`); + appendDiv(`${V.arcologies[0].prosperity} Prosperity | ${_FSScore} FS Score | ${_honeymoon} Honeymoon | ${_transportHub} Transporthub | ${_terrain} Terrain | ${_crime} Crime`); + appendDiv(`${_LSCD} Lower + Slave Class Demand | ${_SCD} Slave Class Demand | ${_slaveProductivity} Slave Productivity`); + appendDiv(`${_LCD} Lower Class Demand | ${_lowerClassP} LC Multiplier`); + appendDiv(`${_MCD} Middle Class Demand | ${_middleClassP} MC Multiplier`); + appendDiv(`${_UCD} Upper Class Demand | ${_upperClassP} UC Multiplier`); + appendDiv(`${_TCD} Top Class Demand | ${_topClassP} TC Multiplier`); } - App.UI.DOM.appendNewElement("div", el, `${V.arcologies[0].name} is home to the following:`); - App.UI.DOM.appendNewElement("div", el, `Lower Class Citizens | ${V.lowerClass} | ${_percLowerClass}%`); - App.UI.DOM.appendNewElement("div", el, `Middle Class Citizens | ${V.middleClass} | ${_percMiddleClass}% `); - App.UI.DOM.appendNewElement("div", el, `Upper Class Citizens | ${V.upperClass} | ${_percUpperClass}% `); - App.UI.DOM.appendNewElement("div", el, `Millionaires | ${V.topClass} | ${_percTopClass}%`); - App.UI.DOM.appendNewElement("div", el, `Slaves | ${V.ASlaves} | ${_percASlaves}%`); + appendDiv(`${V.arcologies[0].name} is home to the following:`); + appendDiv(`Lower Class Citizens | ${V.lowerClass} | ${_percLowerClass}%`); + appendDiv(`Middle Class Citizens | ${V.middleClass} | ${_percMiddleClass}% `); + appendDiv(`Upper Class Citizens | ${V.upperClass} | ${_percUpperClass}% `); + appendDiv(`Millionaires | ${V.topClass} | ${_percTopClass}%`); + appendDiv(`Slaves | ${V.ASlaves} | ${_percASlaves}%`); // <br> r = []; if (V.arcologies[0].FSSupremacistLawME === 1) { @@ -803,7 +805,7 @@ globalThis.arcmgmt = function() { _rentMultiplier *= 1 + (5 - V.baseDifficulty) / 20; _rents = Math.trunc((V.lowerClass * V.rent.lowerClass + V.middleClass * V.rent.middleClass + V.upperClass * V.rent.upperClass + V.topClass * V.rent.topClass) * _rentMultiplier / 25); if (!Number.isInteger(_rents)) { - App.UI.DOM.appendNewElement("div", el, `<span class="red">Error: rents is outside accepted range, please report this issue</span>`); + appendDiv(`<span class="red">Error: rents is outside accepted range, please report this issue</span>`); } else { cashX(_rents, "rents"); } @@ -1174,6 +1176,8 @@ globalThis.arcmgmt = function() { } } + App.Events.addNode(el, r); + if (V.secExpEnabled > 0) { App.UI.DOM.appendNewElement("p", el, App.UI.renderPassage("tradeReport")); } @@ -1182,12 +1186,13 @@ globalThis.arcmgmt = function() { el.append(schools()); } - // setAssistantPronouns; + if (V.assistant.market && V.assistant.market.limit > 0) { + r = []; let _popCap = menialPopCap(); let _menialSlaveValue = menialSlaveCost(); // <br> - r.push(`Your ''business assistant'' manages the menial slave market.`); + r.push(`Your <span class="bold">business assistant</span> manages the menial slave market.`); if (_menialSlaveValue <= 900 + V.assistant.market.aggressiveness) { /* BUY */ let _bulkMax = _popCap.value - V.menials - V.fuckdolls - V.menialBioreactors; if (_bulkMax <= 0) { @@ -1237,14 +1242,15 @@ globalThis.arcmgmt = function() { } else { r.push(`Prices are average, so${heM} does not make any significant moves.`); } + App.Events.addParagraph(el, r); } - // <br> - // <span id="food"> + const food = document.createElement("span"); + food.id = "food"; if (V.foodMarket > 0) { - // <<include "Food Report"; + food.append(App.UI.renderPassage("Food Report")); } - // </span> + el.append(food); } App.Events.addNode(el, r); return el; @@ -2224,4 +2230,9 @@ globalThis.arcmgmt = function() { } return el; } + function appendDiv(text) { + const div = document.createElement("div"); + $(div).append(text); + el.append(div); + } }; -- GitLab