Skip to content
Snippets Groups Projects
Commit 336f6306 authored by svornost's avatar svornost
Browse files

Use array.find instead of a twinescript loop to simplify the incubator organ list.

parent d8567d97
No related branches found
No related tags found
1 merge request!5806Remove dead stuff
......@@ -70,53 +70,26 @@ Organ Production
<</if>>
<<if $incubatorSlaves > 0>>
<<for _x = 0; _x < $incubatorOrgans.length; _x++>>
<<for _w = 0; _w < $incubatorSlaves; _w++>>
<<if $tanks[_w].ID == $incubatorOrgans[_x].ID>>
<br>
$tanks[_w].slaveName's $incubatorOrgans[_x].type,
<<if $incubatorOrgans[_x].weeksToCompletion <= 0>>
ready to be implanted as soon as $he exits the incubator.
<<else>>
<<if $organFarmUpgrade == 1>>
<<print $incubatorOrgans[_x].weeksToCompletion>>
<<elseif $organFarmUpgrade == 2>>
<<print Math.ceil($incubatorOrgans[_x].weeksToCompletion/2)>>
<<elseif $organFarmUpgrade == 3>>
<<print Math.ceil($incubatorOrgans[_x].weeksToCompletion/4)>>
<</if>> weeks from completion.
<</if>>
<<break>>
<</if>>
<</for>>
<</for>>
<br>
<</if>>
/* TODO: potentially allow organs to be implanted into children in the nursery
<<set _NL = $NurseryiIDs.length>>
<<if _NL > 0>>
<<for _x = 0; _x < $nurseryOrgans.length; _x++>>
<<for _w = 0; _w < _NL; _w++>>
<<if $cribs[_w].ID == $nurseryOrgans[_x].ID>>
<br>
$cribs[_w].slaveName's $nurseryOrgans[_x].type,
<<if $nurseryOrgans[_x].weeksToCompletion <= 0>>
ready to be implanted as soon as $he exits the nursery.
<<else>>
<<if $organFarmUpgrade == 1>>
<<print $nurseryOrgans[_x].weeksToCompletion>>
<<elseif $organFarmUpgrade == 2>>
<<print Math.ceil($nurseryOrgans[_x].weeksToCompletion/2)>>
<<elseif $organFarmUpgrade == 3>>
<<print Math.ceil($nurseryOrgans[_x].weeksToCompletion/4)>>
<</if>> weeks from completion.
<</if>>
<<break>>
<<set _tank = $tanks.find((t) => t.ID === $incubatorOrgans[_x].ID)>>
<<if def _tank>>
<br>
_tank.slaveName's $incubatorOrgans[_x].type,
<<if $incubatorOrgans[_x].weeksToCompletion <= 0>>
ready to be implanted as soon as $he exits the incubator.
<<else>>
<<if $organFarmUpgrade == 1>>
<<print $incubatorOrgans[_x].weeksToCompletion>>
<<elseif $organFarmUpgrade == 2>>
<<print Math.ceil($incubatorOrgans[_x].weeksToCompletion/2)>>
<<elseif $organFarmUpgrade == 3>>
<<print Math.ceil($incubatorOrgans[_x].weeksToCompletion/4)>>
<</if>> weeks from completion.
<</if>>
<</for>>
<</if>>
<</for>>
<br>
<</if>>
*/
/* TODO: potentially allow organs to be implanted into children in the nursery */
<<if $completedOrgans.length > 0>>
<br>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment