diff --git a/src/004-base/arcologyBuilding.js b/src/004-base/arcologyBuilding.js index 9e33f19ae7f51c11ad9e5ce3f2fd61e0c259b51b..1d399872ecd6458c15d3498fe256564107261df7 100644 --- a/src/004-base/arcologyBuilding.js +++ b/src/004-base/arcologyBuilding.js @@ -81,7 +81,7 @@ App.Arcology.Cell.BaseCell = class extends App.Entity.Serializable { scene.classList.add("scene-intro"); scene.append(this._setting()); if (this.canBeSold()) { - scene.append(ownership(this)); + scene.append(' ', ownership(this)); } fragment.append(scene); diff --git a/src/js/assayJS.js b/src/js/assayJS.js index 34e4eda562a87888275b6eca01bd0b4ecc5b6d50..9c07ebfdeda557f3c78123bd360830774027fe4c 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -1907,6 +1907,24 @@ globalThis.retirementReady = function(slave) { return false; }; +/** marks some weeks of time passage for a slave, counting birthdays and invoking aging if game settings require it + * @param {App.Entity.SlaveState} slave + * @param {number} [weeks=1] + */ +globalThis.ageSlaveWeeks = function(slave, weeks=1) { + if (V.seeAge !== 0) { // birthdays enabled + for (let i = 0; i < weeks; ++i) { + slave.birthWeek++; + if (slave.birthWeek >= 52) { + slave.birthWeek = 0; + if (V.seeAge === 1) { // actual aging enabled + ageSlave(slave); + } + } + } + } +}; + /** advances the age of a slave by one year, incurring all aging side effects * @param {App.Entity.SlaveState} slave * @param {boolean} [forceDevelopment=false] diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw index c0b9df4b7a38ddfa6240a8ede43f4014d7668a26..52b080ce98944d9ba398a2d0852689a58410d8b8 100644 --- a/src/uncategorized/nextWeek.tw +++ b/src/uncategorized/nextWeek.tw @@ -112,13 +112,7 @@ <<if def $slaves[_i].curBabies>> <<run delete $slaves[_i].curBabies>> <</if>> - <<if $seeAge != 0>> - <<set $slaves[_i].birthWeek++>> - <<if $slaves[_i].birthWeek >= 52>> - <<set $slaves[_i].birthWeek = 0>> - <<run ageSlave($slaves[_i])>> - <</if>> - <</if>> + <<run ageSlaveWeeks($slaves[_i])>> <<if $slaves[_i].indenture > 0>> <<set $slaves[_i].indenture -= 1>> <</if>> diff --git a/src/uncategorized/pCoupAttempt.tw b/src/uncategorized/pCoupAttempt.tw index 91c108978c94b6f4b1a250b7bf72abf70ef9ea9b..1b4a812c7d0b2a03415056ce8ff1313050ac859b 100644 --- a/src/uncategorized/pCoupAttempt.tw +++ b/src/uncategorized/pCoupAttempt.tw @@ -21,16 +21,7 @@ <<set $traitor.hLength += _weeks>> <</if>> <</if>> - <<if $seeAge != 0>> - <<for _weeks > 0>> - <<set $traitor.birthWeek++>> - <<if $traitor.birthWeek >= 52>> - <<set $traitor.birthWeek = 0>> - <<run ageSlave($traitor)>> - <</if>> - <<set _weeks-->> - <</for>> - <</if>> + <<run ageSlaveWeeks($traitor, _weeks)>> <</if>> <<set _doubleAgent = ["agent", "trapper"].includes($traitorType) ? 1 : 0>> diff --git a/src/uncategorized/pCoupBetrayal.tw b/src/uncategorized/pCoupBetrayal.tw index 9d7efefcfcb226e3acc043c0cc982dd856270c3b..4b388663b06e1c4762eec16285d530e433f06ec1 100644 --- a/src/uncategorized/pCoupBetrayal.tw +++ b/src/uncategorized/pCoupBetrayal.tw @@ -20,16 +20,7 @@ <<set $traitor.hLength += _weeks>> <</if>> <</if>> -<<if $seeAge != 0>> - <<for _weeks > 0>> - <<set $traitor.birthWeek++>> - <<if $traitor.birthWeek >= 52>> - <<set $traitor.birthWeek = 0>> - <<run ageSlave($traitor)>> - <</if>> - <<set _weeks-->> - <</for>> -<</if>> +<<run ageSlaveWeeks($traitor, _weeks)>> You are awakened in the middle of the night by a jolt that shakes the entire arcology, accompanied by a distant boom. It is followed by the wail of the arcology's alarm systems, and then finally by a faint crackle that grows to a constant chatter of gunfire. You rush to the video feeds to see what is going on. The Daughters of Liberty have not only succeeded in locking down your arcology with them outside of it, but have effectively cornered themselves against it. A PMC group has their retreat cut off and is steadily bleeding their numbers. It is a rather short, if not spectacular, battle. diff --git a/src/uncategorized/pTraitorMessage.tw b/src/uncategorized/pTraitorMessage.tw index e3bbedb530dcf3e7b0fcc3a2292171f438945483..2bf1f42e6129852967ac666f1cc6d7bd642f4426 100644 --- a/src/uncategorized/pTraitorMessage.tw +++ b/src/uncategorized/pTraitorMessage.tw @@ -44,16 +44,7 @@ <<set $traitor.hLength += _weeks>> <</if>> <</if>> -<<if $seeAge != 0>> - <<for _weeks > 0>> - <<set $traitor.birthWeek++>> - <<if $traitor.birthWeek >= 52>> - <<set $traitor.birthWeek = 0>> - <<run ageSlave($traitor)>> - <</if>> - <<set _weeks-->> - <</for>> -<</if>> +<<run ageSlaveWeeks($traitor, _weeks)>> The month after freeing $traitor.slaveName, you receive another message from the Daughters of Liberty. This one contains a video. It shows $traitor.slaveName sitting quietly at a table<<if _wasPreg != _isPreg>>, no longer clearly pregnant<</if>>, wearing comfortable clothes and eating a nice meal. <<if $traitorType == "agent">> diff --git a/src/uncategorized/reBoomerang.tw b/src/uncategorized/reBoomerang.tw index f974b0fdf0484b2d1108a08c585801115e3c54c4..b852cc6d38012d8d04fa5513b73f1229b84ae4c5 100644 --- a/src/uncategorized/reBoomerang.tw +++ b/src/uncategorized/reBoomerang.tw @@ -46,16 +46,7 @@ brings up the relevant feeds. There's a naked body crumpled pathetically against <<set $activeSlave.hLength += _weeks>> <</if>> <</if>> -<<if $seeAge != 0>> - <<for _weeks > 0>> - <<set $activeSlave.birthWeek++>> - <<if $activeSlave.birthWeek >= 52>> - <<set $activeSlave.birthWeek = 0>> - <<run ageSlave($activeSlave)>> - <</if>> - <<set _weeks-->> - <</for>> -<</if>> +<<run ageSlaveWeeks($activeSlave, _weeks)>> <<switch _buyer>> <<case "buttbreaker">>