Skip to content
Snippets Groups Projects
Commit 507e025e authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'pregmod-dev' into 'pregmod-master'

Hacky mainList fix for organ/limb loops

See merge request pregmodfan/fc-pregmod!4069
parents 7dec8560 40bdb976
No related branches found
No related tags found
No related merge requests found
......@@ -38,8 +38,8 @@ Clothes:
wardrobeUse.tw
slaveSummaryWidgets.tw
rulesAssistantOptions.tw
toyChest.tw
useGuard.tw
toyChest.js
useGuard.js
birthWidgets.tw
peConcubineInterview.tw
PESS.tw
......
......@@ -126,11 +126,12 @@ App.UI.View.MainLinks = function() {
}
}
/* cycle through slaves, for each slave cycle through completed organs and track how many are of the interrogated slave (and if organs have a slaves to be implanted on) */
/* cycle through slaves, for each slave cycle through completed organs and track how many are of the interrogated slave (and if organs have a slaves to be implanted on)
if (V.completedOrgans.length > 0) {
let validOrgans = 0;
for (let dwj = 0; dwj < sl; dwj++) {
/* the original code has a <<capture>>, not sure if we need one here */
/* the original code has a <<capture>>, not sure if we need one here
let slaveOrgans = 0;
for (let dwk = 0; dwk < cl; dwk++) {
if ((V.completedOrgans[dwk] !== 0) && (V.completedOrgans[dwk].ID === V.slaves[dwk].ID)) {
......@@ -138,7 +139,7 @@ App.UI.View.MainLinks = function() {
validOrgans++;
}
}
/* if the interrogated slave has one or more organs ready: */
/* if the interrogated slave has one or more organs ready:
if (slaveOrgans > 0) {
r += `<br><span class=yellow>The fabricator has completed `;
if (slaveOrgans > 1) {
......@@ -158,7 +159,7 @@ App.UI.View.MainLinks = function() {
}
}
/* if the check returns true it means there are organs without slaves associated to. I think this was the purpose of the _validHost check in the original code */
/* if the check returns true it means there are organs without slaves associated to. I think this was the purpose of the _validHost check in the original code
if (validOrgans < cl) {
let sl;
for (let dwl = 0; dwl < cl; dwl++) {
......@@ -202,7 +203,8 @@ App.UI.View.MainLinks = function() {
} else if (V.limbsCompleted > 0) {
r += `<br>[[Attach|Multiple Organ Implant]] <span class=yellow>all sets of limbs that are ready to be attached.</span>`;
}
r += `<br>`;
*/
r += `<<MainLinks>><br>`;
if (V.slaveCostFactor > 1.05) {
r += `<span class=yellow>There is a bull market for slaves; the price of slaves is very high.</span>`;
......
:: description widgets [widget nobr]
<<widget "MainLinks">>
/* cycle through slaves, for each slave cycle through completed organs and track how many are of the interrogated slave (and if organs have a slaves to be implanted on) */
<<if $completedOrgans.length > 0>>
<<set _validOrgans = 0>>
<<for _dwi = 0; _dwi < $slaves.length; _dwi++>>
<<capture _dwi>>
<<set _slaveOrgans = 0>>
<<for _dwj = 0; _dwj < $completedOrgans.length; _dwj++>>
<<if ($completedOrgans[_dwj] != 0) && ($completedOrgans[_dwj].ID == $slaves[_dwi].ID)>>
<<set _slaveOrgans++>>
<<set _validOrgans++>>
<</if>>
<</for>>
/* if the interrogated slave has one or more organs ready: */
<<if _slaveOrgans > 0>>
<br>@@.yellow;The fabricator has completed <<if _slaveOrgans > 1>><<print _slaveOrgans>> organs<<else>>an organ<</if>> for@@
<<link "<<print $slaves[_dwi].slaveName>>">>
<<set $activeSlave = $slaves[_dwi]>>
<<goto "Slave Interact">>
<</link>>
, @@.yellow; which <<if _slaveOrgans > 1>>are<<else>>is<</if>> ready to be implanted.@@
<</if>>
<</capture>>
<</for>>
/* if the check returns true it means there are organs without slaves associated to. I think this was the purpose of the _validHost check in the original code */
<<if _validOrgans < $completedOrgans.length>>
<<for _dwj = 0; _dwj < $completedOrgans.length; _dwj++>>
<<set _isValid = 0>>
<<for _dwi = 0; _dwi < $slaves.length; _dwi++>>
<<if ($completedOrgans[_dwj] != 0) && ($completedOrgans[_dwj].ID == $slaves[_dwi].ID)>>
<<set _isValid = 1>>
<</if>>
<</for>>
/* if there is no associated slave delete the organ, should there be a notification for the player, here? */
<<if _isValid == 0>>
<<set $completedOrgans.deleteAt(_dwj)>>
<</if>>
<</for>>
<</if>>
<</if>>
<<if $limbsCompleted > 0>>
<<for _dwj = 0; _dwj < $limbs.length; _dwj++>>
<<set _validHost = 0>>
<<for _dwi = 0; _dwi < $slaves.length; _dwi++>>
<<set _Slave = $slaves[_dwi]>>
<<if ($limbs[_dwj] != 0) && ($limbs[_dwj].ID == _Slave.ID)>>
<<set _validHost = 1>>
<<if ($limbs[_dwj].weeksToCompletion <= 0)>>
<br>@@.yellow;The facility has completed a set of limbs for@@ <span id="name"><<print "[[SlaveFullName(_Slave)|Slave Interact][$activeSlave = $slaves[" + _dwi + "]]]">></span>, @@.yellow; which is ready to be attached.@@
<</if>>
<</if>>
<</for>>
<<if _validHost == 0>>
<<set _dump = $limbs.deleteAt(_dwj), _dwj-->>
<</if>>
<</for>>
<</if>>
<<if ($completedOrgans.length > 0) && ($limbsCompleted > 0)>>
<br>[[Implant and Attach|Multiple Organ Implant]] @@.yellow;all organs and limbs that are ready.@@
<<elseif ($completedOrgans.length > 0)>>
<br>[[Implant|Multiple Organ Implant]] @@.yellow;all organs that are ready for implantation.@@
<<elseif ($limbsCompleted > 0)>>
<br>[[Attach|Multiple Organ Implant]] @@.yellow;all sets of limbs that are ready to be attached.@@
<</if>>
<</widget>>
<<widget "FlowerDesc">>
<<if $activeSlave.dick > 0 && $activeSlave.balls == 0>>
......
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