diff --git a/src/endWeek/economics/arcmgmt.js b/src/endWeek/economics/arcmgmt.js index ca01371d6b230f4d9968953dd55dc6961c0e2669..ff816988146f249d8b6909eb160d7c75819a9c90 100644 --- a/src/endWeek/economics/arcmgmt.js +++ b/src/endWeek/economics/arcmgmt.js @@ -54,15 +54,19 @@ globalThis.arcmgmt = function() { More elite citizens require their own slaves and will cause the population of slaves to increase as they move in. FS and policies will impact how many slaves they desire and how productive they are. The PC's menials also compete for labor within the arcology. Slaves can now 'expire', speed depends on FS and policies. Default lifespan for menials is an average of ~4 years. */ V.oldACitizens = V.ACitizens; - let _FSScore = 0; /* FS progress for tourism*/ - let _slaveDemandU = 1; /* Changes to upperClass slave demand*/ - let _slaveDemandT = 1; /* Changes to topClass slave demand*/ - let _expirationFS = 0.005; /* changes to likelihood of slave death*/ - let _slaveProductivity = 0.8; /* changes to slave productivity*/ - let _lowerClass = 0; /* fixed amount of changes to lowerClass interest to move in*/ - let _lowerClassP = 1; /* scaling changes to lowerClass interest ("stacking bonus")*/ - let _welfareFS = 0.004; /* changes to likelihood of lowerClass getting enslaved*/ - let _middleClass = 0; /* see lowerClass examples for the rest of these*/ + let _FSScore = 0; /* FS progress for tourism */ + let _slaveDemandU = 1; /* Changes to upperClass slave demand */ + let _slaveDemandT = 1; /* Changes to topClass slave demand */ + let _expirationFS = 0.005; /* Changes to likelihood of slave death */ + let _expirationLC = 0.003; /* Changes to likelyhood of lowerClass death */ + let _expirationMC = 0.002; /* Changes to likelyhood of middleClass death */ + let _expirationUC = 0.001; /* Changes to likelyhood of upperClass death */ + let _expirationTC = 0.001; /* Changes to likelyhood of topClass death */ + let _slaveProductivity = 0.8; /* Changes to slave productivity*/ + let _lowerClass = 0; /* Fixed amount of changes to lowerClass interest to move in*/ + let _lowerClassP = 1; /* Scaling changes to lowerClass interest ("stacking bonus")*/ + let _welfareFS = 0.004; /* Changes to likelihood of lowerClass getting enslaved*/ + let _middleClass = 0; /* See lowerClass examples for the rest of these*/ let _middleClassP = 1; let _upperClass = 0; let _upperClassP = 1; @@ -76,11 +80,11 @@ globalThis.arcmgmt = function() { _middleClass += (schoolSubsidy) * 40; _middleClassP *= 1 + (schoolSubsidy) * 0.005; + appendDiv(`<br>`); slaveRetirement(); - - expiration(); - + el.append(expiration()); denseApartments(); + appendDiv(`<br>`); citizenToSlave(); @@ -1643,7 +1647,7 @@ globalThis.arcmgmt = function() { _enslaved += _intellectualDependencyEnslaved; r.push(`<span class="green">${_intellectualDependencyEnslaved} dumb immigrants</span> were enslaved for their own good.`); } - + V.lowerClass += _LCImmigration; if (_LCImmigration > 1) { r.push(`<span class="green">${_LCImmigration} lower class citizens</span> moved to your arcology.`); @@ -1702,7 +1706,7 @@ globalThis.arcmgmt = function() { } if (V.middleClass < _MCD) { let _MCImmigration = Math.trunc((_MCD - V.middleClass) * (0.3 * _terrain)) + 1 + App.SecExp.propagandaEffects("immigration").effect; - + V.middleClass += _MCImmigration; if (_MCImmigration > 1) { appendDiv(`<span class="green">${_MCImmigration} middle class citizens</span> moved to your arcology.`); @@ -1786,7 +1790,7 @@ globalThis.arcmgmt = function() { } if (V.topClass < _TCD) { let _TCImmigration = Math.trunc((_TCD - V.topClass) * (0.3 * _terrain)) + 1 + App.SecExp.propagandaEffects("immigration").effect; - + V.topClass += _TCImmigration; if (_TCImmigration > 1) { appendDiv(`<span class="green">${_TCImmigration} millionaires</span> moved to your arcology.`); /* Fat Cat? One-Percenter? */ @@ -1837,11 +1841,40 @@ globalThis.arcmgmt = function() { } /* I could bother with a single slave retirement message, but that's never going to get used*/ } - App.Events.addParagraph(el, r); + App.Events.addNode(el, r); } function expiration() { + const el = new DocumentFragment(); const r = []; + /* Citizen expiration */ + let z = []; + let ret = ""; + const _deathsLC = Math.trunc(V.lowerClass * _expirationLC); + const _deathsMC = Math.trunc(V.middleClass * _expirationMC); + const _deathsUC = Math.trunc(V.upperClass * _expirationUC); + const _deathsTC = Math.trunc(V.topClass * _expirationTC); + V.lowerClass -= _deathsLC; + V.middleClass -= _deathsMC; + V.upperClass -= _deathsUC; + V.lowerClass -= _deathsTC; + if (_deathsLC > 0) { + z.push(`<span class="red">${_deathsLC} lower class citizen(s)`); + } + if (_deathsMC > 0) { + z.push(`<span class="red">${_deathsMC} middle class citizen(s)`); + } + if (_deathsUC > 0) { + z.push(`<span class="red">${_deathsUC} upper class citizen(s)`); + } + if (_deathsTC > 0) { + z.push(`<span class="red">${_deathsTC} millionaire(s)`); + } + if (_deathsLC > 0|| _deathsMC > 0|| _deathsUC > 0 || _deathsTC > 0) { + ret += z.reduce(function(res, ch, i, arr) { return res + (i === arr.length - 1 ? ' and ' : ', ') + ch; }) + " passed away due to natural causes.</span><br>"; + r.push(ret); + } + /* Slave expiration*/ const _expirationPC = Math.trunc(V.menials * _expirationFS); const _expirationFD = Math.trunc(V.fuckdolls * _expirationFS); @@ -1852,11 +1885,11 @@ globalThis.arcmgmt = function() { V.menials -= _expirationPC; V.fuckdolls -= _expirationFD; V.menialBioreactors -= _expirationBR; - if (_expiration > 1) { + if (_expiration > 0) { if (_expirationFS <= 0.5) { - r.push(`<span class="red">${_expiration} slaves passed away</span> due to natural causes.`); + r.push(`<span class="red">${_expiration} slave(s) passed away</span> due to natural causes.`); } else { - r.push(`<span class="red">${_expiration} slaves died</span> due to the tough working conditions in your arcology.`); + r.push(`<span class="red">${_expiration} slave(s) died</span> due to the tough working conditions in your arcology.`); } if (_expirationPC > 1) { r.push(`Of which <span class="red">${_expirationPC} were yours.</span>`); @@ -1865,19 +1898,31 @@ globalThis.arcmgmt = function() { } } - App.Events.addParagraph(el, r); + App.Events.addNode(el, r); + return el; } function denseApartments() { /* increases lowerclass attraction based on number of dense apartments */ - V.building.findCells(cell => !(cell instanceof App.Arcology.Cell.Penthouse)) - .forEach(cell => { - if (cell instanceof App.Arcology.Cell.Apartment) { - if (cell.type === 3) { - _lowerClass += 40 + let _count = 0; + V.building.findCells(cell => !(cell instanceof App.Arcology.Cell.Penthouse)) + .forEach(cell => { + if (cell instanceof App.Arcology.Cell.Apartment) { + if (cell.type === 3) { + _count += 1; + _lowerClass += 40 + } } - } - }); + }); + if (_count > 9) { + appendDiv(`<span class="green">A great amount of lower class citizens</span> were attracted by the sectors filled with dense apartments.`) + } else if (_count > 5) { + appendDiv(`<span class="green">A large amount of lower class citizens</span> were attracted by your sprawling blocks of dense apartments.`) + } else if (_count > 2) { + appendDiv(`<span class="green">A moderate amount of lower class citizens</span> were attracted by your dense apartment complexes.`) + } else if (_count > 0) { + appendDiv(`<span class="green">A small amount of lower class citizens</span> were attracted by your dense apartments.`) + } } function getBanishRatio() {