diff --git a/devNotes/clothing hair and accessory passages.txt b/devNotes/clothing hair and accessory passages.txt index b44269a74e7bd055f5f2a3c9f802f67acf0f9a01..49459fdabff2e5d6d9feeac4e715bbac9a5f927a 100644 --- a/devNotes/clothing hair and accessory passages.txt +++ b/devNotes/clothing hair and accessory passages.txt @@ -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 diff --git a/src/interaction/main/mainLinks.js b/src/interaction/main/mainLinks.js index 25dce5a5cae6a3f3e4fa1fd1386a825414c2c1c6..beb5e84d1faa78f240aa3ebacedc528a6a040172 100644 --- a/src/interaction/main/mainLinks.js +++ b/src/interaction/main/mainLinks.js @@ -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>`; diff --git a/src/utility/descriptionWidgets.tw b/src/utility/descriptionWidgets.tw index bb34bda797a64c05b44a754d1f022939d16b1452..33cd90b3cc57ab20d34f47c3791ecec64802f7ce 100644 --- a/src/utility/descriptionWidgets.tw +++ b/src/utility/descriptionWidgets.tw @@ -1,5 +1,75 @@ :: 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>>