diff --git a/src/uncategorized/pRivalInitiation.tw b/src/uncategorized/pRivalInitiation.tw index 8333e4fc24abb97559340a39fd0605e270b575f1..48fe81be160ed0f31bdddabfbf44ae0df85970a0 100644 --- a/src/uncategorized/pRivalInitiation.tw +++ b/src/uncategorized/pRivalInitiation.tw @@ -3,7 +3,7 @@ <<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "Scheduled Event", $rivalOwner = 0, $rivalOwnerEnslaved = 1>> <<if $hostageRescued == 1>><<set $nextButton = "See to the hostage", $returnTo = "P hostage acquisition">><</if>> -<<set $activeSlave = $slaves.find(function(s) { return s.ID == $rivalID; })>> +<<set $activeSlave = getSlave($rivalID)>> <<set $rivalID = 0>> <<if ndef $activeSlave>> /* rival slave is gone */ @@ -27,9 +27,7 @@ This is a special week, the week of your victory. <<EventNameLink $activeSlave>> <<replace "#result">> $slaves[0].slaveName leads her out into the arcology's largest atrium, forces her to her knees, and in full view of the whole arcology, orally rapes someone who was until this week a slaveowner herself. Behind her, $slaves[1].slaveName is standing ready for her turn, and all your other slaves are behind. Public opinion is divided; the precedent is universally agreed to be bad, but the punishment is generally thought to be terrible and deserved. Your slaves, however, are almost insufferably @@.hotpink;pleased with you@@ for forcing $activeSlave.slaveName, whom they still view as a slaveowner, to pleasure them. <<set $activeSlave.oralCount += $slaves.length*2, $oralTotal += $slaves.length*2>> - <<for $i = 0; $i < $slaves.length; $i++>> - <<set $slaves[$i].devotion += 10>> - <</for>> + <<run $slaves.forEach(function(s) { s.devotion += 10; })>> <</replace>> <</link>> <<if $activeSlave.anus == 0>> diff --git a/src/uncategorized/pSchoolSuggestion.tw b/src/uncategorized/pSchoolSuggestion.tw index d14a858fac85ddcbe0cbe706cc639aba7a6f7949..26537192329290f75a20d05a7b0591ba892f5c70 100644 --- a/src/uncategorized/pSchoolSuggestion.tw +++ b/src/uncategorized/pSchoolSuggestion.tw @@ -28,7 +28,7 @@ An older woman standing across from him sniffs. "St. Claver's knows how to do bo The unusually competent young heiress standing next to him snickers. "If you're going to bring up refinement, um, hello, the Futanari Sisters. I have four futas in my apartment having sex with each other right now. How do I know? Because they're always having sex with each other. They never stop." Her eyes take on a faraway look and she pauses. "Um, haha, I know what I'm doing later." <</if>> <br><br> -"If you like them soft and mellow, you got to go with The Cattle Ranch," a buff man blurts loudly while slamming down his emtpy mug. "I've got a pair of 'em for my bedroom; they are so loving after a good milking. Taste good too." His drinking budy retorts, "Too much work is what they are. They might as well be animals with how they act.<<if $seePreg == 0>> In addition, hope you like pregnant pussies cause you need to keep them gravid or their milk dries up.<</if>>" +"If you like them soft and mellow, you got to go with The Cattle Ranch," a buff man blurts loudly while slamming down his empty mug. "I've got a pair of 'em for my bedroom; they are so loving after a good milking. Taste good too." His drinking buddy retorts, "Too much work is what they are. They might as well be animals with how they act.<<if $seePreg == 0>> In addition, hope you like pregnant pussies cause you need to keep them gravid or their milk dries up.<</if>>" <br><br> "I see good taste is scarce within this walls" suddenly stated a young man previously quiet in his corner. "I say quality and strength is where the game should be played and there's nothing better than the girls from the Hippolyta Academy. <br><br> diff --git a/src/uncategorized/ptWorkaround.tw b/src/uncategorized/ptWorkaround.tw index 94509f65810f757196a5fab41dc313df8f42782a..6ec5f0a668b7beb9e266ec8e980ff3d00ba779ec 100644 --- a/src/uncategorized/ptWorkaround.tw +++ b/src/uncategorized/ptWorkaround.tw @@ -1127,8 +1127,8 @@ <<if $activeSlave.ID == $slaves[$i].ID>> <<set $slaves[$i] = $activeSlave>> <<else>> - <<set _I = $slaves.findIndex(function(s) { return $activeSlave.ID == s.ID; })>> - <<if _I != -1>> + <<set _I = $slaveIndices[$activeSlave.ID]>> + <<if def _I>> <<set $slaves[_I] = $activeSlave>> <</if>> <</if>> diff --git a/src/uncategorized/reLegendaryBalls.tw b/src/uncategorized/reLegendaryBalls.tw index c17472753a6187da11caddf02daa07941951e74a..476daa560bd237df68bfe703d068e2baea1467c5 100644 --- a/src/uncategorized/reLegendaryBalls.tw +++ b/src/uncategorized/reLegendaryBalls.tw @@ -1,6 +1,6 @@ :: RE legendary balls [nobr] -<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? $slaves.find(function(s) { return s.ID == $legendaryBallsID; }) : $eventSlave>> +<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? getSlave($legendaryBallsID) : $eventSlave>> <<if (ndef $activeSlave)>> /* not found - reset variable and stop event */ <<set $legendaryBallsID = 0>> diff --git a/src/uncategorized/reLegendaryCow.tw b/src/uncategorized/reLegendaryCow.tw index cbddb092fb83bc471f32434cf41549783cf13c69..45a9b46cd48dabd6aaacb850ae11e5f014f036e1 100644 --- a/src/uncategorized/reLegendaryCow.tw +++ b/src/uncategorized/reLegendaryCow.tw @@ -1,6 +1,6 @@ :: RE legendary cow [nobr] -<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? $slaves.find(function(s) { return s.ID == $legendaryCowID; }) : $eventSlave>> +<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? getSlave($legendaryCowID) : $eventSlave>> <<if (ndef $activeSlave)>> /* not found - reset variable and stop event */ <<set $legendaryCowID = 0>> diff --git a/src/uncategorized/reLegendaryEntertainer.tw b/src/uncategorized/reLegendaryEntertainer.tw index 04b69e8ec4943b7fe0bf445aee123bc6e2d1ebed..641ea80634f18e887851b2619a625341e435320d 100644 --- a/src/uncategorized/reLegendaryEntertainer.tw +++ b/src/uncategorized/reLegendaryEntertainer.tw @@ -1,6 +1,6 @@ :: RE legendary entertainer [nobr] -<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? $slaves.find(function(s) { return s.ID == $legendaryEntertainerID; }) : $eventSlave>> +<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? getSlave($legendaryEntertainerID) : $eventSlave>> <<if (ndef $activeSlave)>> /* not found - reset variable and stop event */ <<set $legendaryEntertainerID = 0>> diff --git a/src/uncategorized/reLegendaryWhore.tw b/src/uncategorized/reLegendaryWhore.tw index 4b2d9283b8f38234fce33cbb963e8af8c9f9cc0d..76abc2c057e9e12688bb9056b94285f7ecfa8d93 100644 --- a/src/uncategorized/reLegendaryWhore.tw +++ b/src/uncategorized/reLegendaryWhore.tw @@ -1,6 +1,6 @@ :: RE legendary whore [nobr] -<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? $slaves.find(function(s) { return s.ID == $legendaryWhoreID; }) : $eventSlave>> +<<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "RIE Eligibility Check", $activeSlave = ($legendaryFacility == 1) ? getSlave($legendaryWhoreID) : $eventSlave>> <<if (ndef $activeSlave)>> /* not found - reset variable and stop event */ <<set $legendaryWhoreID = 0>> diff --git a/src/uncategorized/reMalefactor.tw b/src/uncategorized/reMalefactor.tw index 7073e492f5e4dcab18db981329b4d6ed4910f533..873366659c0eac9b501be1873042c17bbbc413d2 100644 --- a/src/uncategorized/reMalefactor.tw +++ b/src/uncategorized/reMalefactor.tw @@ -363,7 +363,7 @@ <<elseif $malefactor == "whore">> You complete the legalities and biometric scanning quickly and cautiously. The condemned resists installation in $dairyName with energy born of desperation. The public @@.green;accepts@@ this as an appropriate punishment, especially when you release footage of the criminal's <<if ($dairyPregSetting > 1) && ($activeSlave.vagina > 0)>>discomfort as her well-traveled pussy adapts to industrial reproduction<<elseif $dairyStimulatorsSetting > 1>>discomfort as her well-traveled anus adapts to accommodate rectal dildo hydration<<else>>breasts as they are roughly milked<</if>>. <<elseif $malefactor == "rapist">> - You complete the legalities and biometric scanning quickly and cautiously. The condemned resists installation in $dairyName with energy born of desperation. The public @@.green;accepts@@ this as an appropriate punishment, especially when you release footage of the rapists's <<if $dairyStimulatorsSetting > 1>>agony as her anus adapts to accommodate rectal dildo hydration<<else>>newly growing breasts as they are roughly milked<</if>>. + You complete the legalities and biometric scanning quickly and cautiously. The condemned resists installation in $dairyName with energy born of desperation. The public @@.green;accepts@@ this as an appropriate punishment, especially when you release footage of the rapist's <<if $dairyStimulatorsSetting > 1>>agony as her anus adapts to accommodate rectal dildo hydration<<else>>newly growing breasts as they are roughly milked<</if>>. <<else>> You complete the legalities and biometric scanning quickly and cautiously. The condemned resists installation in $dairyName with energy born of desperation. The public @@.green;accepts@@ this as an appropriate punishment, especially when you release footage of the criminal's <<if ($dairyPregSetting > 1) && ($activeSlave.vagina > 0)>>discomfort as her pussy adapts to industrial reproduction<<elseif $dairyStimulatorsSetting > 1>>discomfort as her anus adapts to accommodate rectal dildo hydration<<else>>breasts as they are roughly milked<</if>>, together with a report on the likely productivity of such a fit body capable of withstanding the stress of high throughput. <</if>> diff --git a/src/uncategorized/reMilfTourist.tw b/src/uncategorized/reMilfTourist.tw index 8118e99d8b4316821439151732fac820c717b12f..3660ecbd841e53f3582fec626fd4a9b4e2534bdb 100644 --- a/src/uncategorized/reMilfTourist.tw +++ b/src/uncategorized/reMilfTourist.tw @@ -4,7 +4,7 @@ <<Enunciate $milfSlave>> -<<set _milfed = $slaves.findIndex(function(s) { return s.ID == $milfSlave.ID; })>> +<<set _milfed = $slaveIndices[$milfSlave.ID]>> <<set $activeSlaveOneTimeMinAge = 36>> <<set $activeSlaveOneTimeMaxAge = 42>> diff --git a/src/uncategorized/reRelationshipAdvice.tw b/src/uncategorized/reRelationshipAdvice.tw index ed2bc6975ef2dc5a9007a3c63865bd2ee0aef43b..c5d0e67e1ae48825e0a507c0aea200f7a9cc1c9a 100644 --- a/src/uncategorized/reRelationshipAdvice.tw +++ b/src/uncategorized/reRelationshipAdvice.tw @@ -3,11 +3,8 @@ <<set $nextButton = "Continue", $nextLink = "AS Dump", $returnTo = "Next Week", $activeSlave = $eventSlave>> <<Enunciate $activeSlave>> -<<for _i = 0; _i < $slaves.length; _i++>> - <<if $slaves[_i].ID == $activeSlave.relationshipTarget>> - <<set $subSlave = $slaves[_i]>> - <</if>> -<</for>> +<<set _i = $slaveIndices[$activeSlave.relationshipTarget]>> +<<set $subSlave = $slaves[_i]>> <<EventNameLink $activeSlave>> is standing for an inspection. She's a good girl, and is cooperating, but she seems preoccupied. After ignoring it for a while, you give in to curiosity and flatly ask her what's going on. "I'm <<s>>orry, <<Master>>," she <<if SlaveStatsChecker.checkForLisp($activeSlave)>>lisp<<else>>mutter<</if>>s, biting her lip. "It'<<s>> $subSlave.slaveName." She hesitates, so you prompt her, asking if she's having trouble with her @@ -40,13 +37,8 @@ She nods her head quickly, still staring at her feet. She shuts her eyes tight a <<set $activeSlave.devotion -= 5>> <<set $activeSlave.relationship = 0>> <<set $activeSlave.relationshipTarget = 0>> - <<for _i = 0; _i < $slaves.length; _i++>> - <<if $slaves[_i].ID == $subSlave.ID>> - <<set $slaves[_i].relationship = 0>> - <<set $slaves[_i].relationshipTarget = 0>> - <<break>> - <</if>> - <</for>> + <<set $slaves[_i].relationship = 0>> + <<set $slaves[_i].relationshipTarget = 0>> <</replace>> <</link>> <br><<link "Build her confidence">> @@ -74,12 +66,7 @@ She nods her head quickly, still staring at her feet. She shuts her eyes tight a <<set $activeSlave.devotion += 5>> <<set $activeSlave.relationship += 1>> - <<for _i = 0; _i < $slaves.length; _i++>> - <<if $slaves[_i].ID == $subSlave.ID>> - <<set $slaves[_i].relationship += 1>> - <<break>> - <</if>> - <</for>> + <<set $slaves[_i].relationship += 1>> <</replace>> <</link>> <br><<link "Bring the other girl in">> @@ -148,12 +135,7 @@ She nods her head quickly, still staring at her feet. She shuts her eyes tight a <<set $activeSlave.trust += 10>> <<set $activeSlave.relationship += 1>> - <<for _i = 0; _i < $slaves.length; _i++>> - <<if $slaves[_i].ID == $subSlave.ID>> - <<set $slaves[_i].relationship += 1>> - <<break>> - <</if>> - <</for>> + <<set $slaves[_i].relationship += 1>> <</replace>> <</link>> </span> diff --git a/src/uncategorized/reRelativeRecruiter.tw b/src/uncategorized/reRelativeRecruiter.tw index 35a3d87062725491d5ae1f11e1c91f07baa535fa..10972065e5fa0e2d215250705b7fe3df4bc00efa 100644 --- a/src/uncategorized/reRelativeRecruiter.tw +++ b/src/uncategorized/reRelativeRecruiter.tw @@ -4,7 +4,7 @@ <<if $familyTesting == 1>> -<<set $eventSlave = $slaves.find(function(s) { return s.ID == $recruiterSlave.ID; })>> +<<set $eventSlave = getSlave($recruiterSlave.ID)>> <<set $activeSlave = clone($genePool.find(function(o) { return o && o.ID == $eventSlave.ID; }))>> /* 000-250-006 */ @@ -747,7 +747,7 @@ You look up the _relationType. She costs <<print cashFormat($slaveCost)>>, a bar <<else>> /* vanilla */ -<<set $i = $slaves.findIndex(function(o) { return o.ID == $recruiterSlave.ID; })>> +<<set $i = $slaveIndices[$recruiterSlave.ID]>> <<set $j = $genePool.findIndex(function(o) { return o.ID == $slaves[$i].ID; })>> <<set $eventSlave = $slaves[$i]>> diff --git a/src/uncategorized/reShelterInspection.tw b/src/uncategorized/reShelterInspection.tw index d93d3102b9f8585893c69807b2b3d4d4944362ab..2befd98350000d2af1dff21ffdbebc3a062796ed 100644 --- a/src/uncategorized/reShelterInspection.tw +++ b/src/uncategorized/reShelterInspection.tw @@ -33,7 +33,7 @@ <<set $activeSlave.sexualQuirk = either("apathetic", "idealistic")>> <<set $seed = $shelterGirlsIDs.random()>> -<<set $subSlave = $slaves.find(function(s) { return s.ID == $seed; })>> +<<set $subSlave = getSlave($seed)>> /* * this check is currently unnecessary but if in the future the shelter girl IDs list is changed to updated only when acquiring shelter girls, this should be enabled * diff --git a/src/uncategorized/reShowerPunishment.tw b/src/uncategorized/reShowerPunishment.tw index ea0820d1ff2d121147c3a3a2bacfccb5ca3eb538..03f544ff3c19057c73fed8db5def9b197590a1ba 100644 --- a/src/uncategorized/reShowerPunishment.tw +++ b/src/uncategorized/reShowerPunishment.tw @@ -49,14 +49,10 @@ $activeSlave.slaveName is being very thorough. When you first appeared, she was $activeSlave.slaveName stays in the shower to clean herself, so $HeadGirl.slaveName exits to see you watching the denouement. She @@.hotpink;smiles,@@ murmuring a greeting, and hurries over to give you a peck on the cheek, leaning in as best she can to keep her moist body away from your suit. "Thi<<s>> i<<s>> the life, <<Master>>," she whispers. <<set $activeSlave.oralCount += 1>> <<set $oralTotal += 1>> - <<for $i = 0; $i < $slaves.length; $i++>> - <<if $slaves[$i].ID == $HeadGirl.ID>> - <<set $slaves[$i].devotion += 4>> - <<set $slaves[$i].penetrativeCount += 1>> - <<set $penetrativeTotal += 1>> - <<break>> - <</if>> - <</for>> + <<set $i = $slaveIndices[$HeadGirl.ID]>> + <<set $slaves[$i].devotion += 4>> + <<set $slaves[$i].penetrativeCount += 1>> + <<set $penetrativeTotal += 1>> <</nobr>> <</replace>> <</link>> @@ -80,13 +76,9 @@ $activeSlave.slaveName is being very thorough. When you first appeared, she was <<set $activeSlave.oralCount += 1>> <<set $oralTotal += 1>> <<set $activeSlave.trust += 4>> - <<for $i = 0; $i < $slaves.length; $i++>> - <<if $slaves[$i].ID == $HeadGirl.ID>> - <<set $slaves[$i].penetrativeCount += 1>> - <<set $penetrativeTotal += 1>> - <<break>> - <</if>> - <</for>> + <<set $i = $slaveIndices[$HeadGirl.ID]>> + <<set $slaves[$i].penetrativeCount += 1>> + <<set $penetrativeTotal += 1>> <</nobr>> <</replace>> <</link>> @@ -111,13 +103,9 @@ $activeSlave.slaveName is being very thorough. When you first appeared, she was <<set $activeSlave.oralCount += 1>> <<set $oralTotal += 1>> <<set $activeSlave.devotion += 4>> - <<for $i = 0; $i < $slaves.length; $i++>> - <<if $slaves[$i].ID == $HeadGirl.ID>> - <<set $slaves[$i].oralCount += 1>> - <<set $oralTotal += 1>> - <<break>> - <</if>> - <</for>> + <<set $i = $slaveIndices[$HeadGirl.ID]>> + <<set $slaves[$i].oralCount += 1>> + <<set $oralTotal += 1>> <</nobr>> <</replace>> <</link>> diff --git a/src/uncategorized/reSlaveMarriage.tw b/src/uncategorized/reSlaveMarriage.tw index 6f4fbaccf3fceb9e7a1670008457373cb58d0ced..6f53e82479925945fe806ffeb67819139199eba3 100644 --- a/src/uncategorized/reSlaveMarriage.tw +++ b/src/uncategorized/reSlaveMarriage.tw @@ -10,11 +10,7 @@ <</if>> <<if $brideSlave == 0>> - <<for $i = 0; $i < $slaves.length; $i++>> - <<if $groomSlave.relationshipTarget == $slaves[$i].ID>> - <<set $brideSlave = $slaves[$i]>> - <</if>> - <</for>> + <<set $brideSlave = getSlave($groomSlave.relationshipTarget)>> <</if>> <<Enunciate $groomSlave>> <</nobr>>\ @@ -38,18 +34,8 @@ <<set $groomSlave.relationship = 5>> <<set $brideSlave.relationship = 5>> <<set $oralTotal += 2>> - <<for $i = 0; $i < $slaves.length; $i++>> - <<if $brideSlave.ID == $slaves[$i].ID>> - <<set $slaves[$i] = $brideSlave>> - <<break>> - <</if>> - <</for>> - <<for $i = 0; $i < $slaves.length; $i++>> - <<if $groomSlave.ID == $slaves[$i].ID>> - <<set $slaves[$i] = $groomSlave>> - <<break>> - <</if>> - <</for>> + <<set $slaves[$slaveIndices[$brideSlave.ID]] = $brideSlave>> + <<set $slaves[$slaveIndices[$groomSlave.ID]] = $groomSlave>> <</replace>> <</link>> <br><<link "No">> diff --git a/src/uncategorized/rename.tw b/src/uncategorized/rename.tw index 473d48093954d2d752bf0d4ec3ba3f596883bc84..7b76964abd7889f98af1fb2c194c1d61e7f09341 100644 --- a/src/uncategorized/rename.tw +++ b/src/uncategorized/rename.tw @@ -74,21 +74,16 @@ /* Wife's surname reaction */ <<if $oldSurname != $activeSlave.slaveSurname>> <<if $activeSlave.relationship >= 5>> - <<for _i = 0; _i < $slaves.length; _i++>> - <<if $activeSlave.relationshipTarget == $slaves[_i].ID>> - <<if $slaves[_i].slaveSurname>> - <<if $activeSlave.slaveSurname == $slaves[_i].slaveSurname>> - She's touched that she now shares a surname with her wife $slaves[_i].slaveName $slaves[_i].slaveSurname, and is @@.mediumaquamarine;more confident than ever@@ that you intend to keep them together in marital bliss. - <<set $activeSlave.trust += 5>> - <<break>> - <<elseif $oldSurname == $slaves[_i].slaveSurname>> - She's concerned that she no longer shares a surname her wife $slaves[_i].slaveName $slaves[_i].slaveSurname, and is @@.gold;very worried@@ that you might be considering splitting them up. - <<set $activeSlave.trust -= 5>> - <<break>> - <</if>> - <</if>> + <<set _i = $slaveIndices[$activeSlave.relationshipTarget]>> + <<if $slaves[_i].slaveSurname>> + <<if $activeSlave.slaveSurname == $slaves[_i].slaveSurname>> + She's touched that she now shares a surname with her wife $slaves[_i].slaveName $slaves[_i].slaveSurname, and is @@.mediumaquamarine;more confident than ever@@ that you intend to keep them together in marital bliss. + <<set $activeSlave.trust += 5>> + <<elseif $oldSurname == $slaves[_i].slaveSurname>> + She's concerned that she no longer shares a surname her wife $slaves[_i].slaveName $slaves[_i].slaveSurname, and is @@.gold;very worried@@ that you might be considering splitting them up. + <<set $activeSlave.trust -= 5>> + <</if>> <</if>> - <</for>> <</if>> <</if>>