diff --git a/src/cheats/mod_EditNeighborArcologyCheat.tw b/src/cheats/mod_EditNeighborArcologyCheat.tw index b4903162a27617c78d1962945a63e5439f3ba785..ea9afda1f12433455f8a05d4e3367c6218a72f6d 100644 --- a/src/cheats/mod_EditNeighborArcologyCheat.tw +++ b/src/cheats/mod_EditNeighborArcologyCheat.tw @@ -35,11 +35,7 @@ <</if>> <br> -<<set $averageProsperity = 0, _seed = 0>> -<<for _eca = 0; _eca < $arcologies.length; _eca++>> - <<set $averageProsperity += $arcologies[_eca].prosperity, _seed++>> -<</for>> -<<set $averageProsperity = $averageProsperity/_seed>> +<<set $averageProsperity = _.mean($arcologies.map((a) => a.prosperity))>> <<for $i = 1; $i < $arcologies.length; $i++>> <<if $arcologies[$i].direction != 0>> diff --git a/src/uncategorized/neighborInteract.tw b/src/uncategorized/neighborInteract.tw index 1a927112f3e16534a4c331b6b3dc73dce18c5dea..bb7620634a9b9da24df2792d3b006453bfc4356e 100644 --- a/src/uncategorized/neighborInteract.tw +++ b/src/uncategorized/neighborInteract.tw @@ -1,12 +1,6 @@ :: Neighbor Interact [nobr jump-to-safe jump-from-safe] -<<set $averageProsperity = 0>> -<<set _neighboringArcologyCount = 0>> -<<for $i = 0; $i < $arcologies.length; $i++>> - <<set $averageProsperity += $arcologies[$i].prosperity>> - <<set _neighboringArcologyCount += 1>> -<</for>> -<<set $averageProsperity = $averageProsperity/_neighboringArcologyCount>> +<<set $averageProsperity = _.mean($arcologies.map((a) => a.prosperity))>> <<if $cheatMode == 1>> [[Cheat Edit Neighboring Arcologies|MOD_Edit Neighbor Arcology Cheat]]<br><br>