From c54262c90e27b51b4f69fc45cc98e2294363c3a9 Mon Sep 17 00:00:00 2001 From: Pregmodder <pregmodder@gmail.com> Date: Fri, 29 Dec 2017 00:51:03 -0500 Subject: [PATCH] costs optimization, some cleanup and fixes. --- devNotes/VersionChangeLog-Premod+LoliMod.txt | 9 +- devNotes/twine JS | 70 +++++----- src/js/economyJS.tw | 70 +++++----- src/uncategorized/buildingWidgets.tw | 2 +- src/uncategorized/costs.tw | 67 ++++------ src/uncategorized/costsReport.tw | 130 ++++++------------- src/uncategorized/endWeek.tw | 37 ++---- src/uncategorized/nextWeek.tw | 4 +- src/uncategorized/storyCaption.tw | 2 +- src/uncategorized/subordinateTargeting.tw | 12 +- 10 files changed, 160 insertions(+), 243 deletions(-) diff --git a/devNotes/VersionChangeLog-Premod+LoliMod.txt b/devNotes/VersionChangeLog-Premod+LoliMod.txt index d590b25acc5..8c1ef9df974 100644 --- a/devNotes/VersionChangeLog-Premod+LoliMod.txt +++ b/devNotes/VersionChangeLog-Premod+LoliMod.txt @@ -1,6 +1,13 @@ Pregmod - 0.10.7.0/1 +0.10.7.0/1 + +12/29/17 + + 240 + -living rules cost optimization + -code cleanup + -fixed minor bugs involving the BG's room 12/28/17 diff --git a/devNotes/twine JS b/devNotes/twine JS index 2f67418644e..330d25ec917 100644 --- a/devNotes/twine JS +++ b/devNotes/twine JS @@ -2218,23 +2218,32 @@ window.getSlaveCost = function(s) { var drugsCost = State.variables.drugsCost; // Living expenses - if((s.assignment === Job.DAIRY && State.variables.dairyRestraintsSetting >= 2) || (s.assignment === Job.ARCADE)) { + switch(s.assignment) { + case Job.ARCADE: cost += rulesCost * .75; - } else if(s.assignment === Job.MADAM) { - cost += rulesCost * 2; - } else if(s.assignment === Job.BROTHEL) { + break; + case Job.DAIRY: + if($State.variables.dairyRestraintsSetting >= 2) { + cost += rulesCost * .75; + } else if(s.livingRules == LivingRule.NORMAL) { + cost += rulesCost * 1.5; + } else if(State.variables.dairyDecoration === 'Degradationist') { + cost += rulesCost * .90; + } else { + cost += rulesCost; + } + break; + case Job.BROTHEL: if(s.livingRules == LivingRule.NORMAL) { cost += rulesCost * 1.5; } else { cost += rulesCost; } - } else if(s.assignment === Job.DJ) { - cost += rulesCost * 2; - } else if(s.assignment === Job.CLUB) { + break; + case Job.SCHOOL: case Job.CLUB: cost += rulesCost * 1.5; - } else if(s.assignment === Job.NURSE) { - cost += rulesCost * 2; - } else if(s.assignment === Job.CLINIC) { + break; + case Job.CLINIC: if(s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * 2; } else if(s.livingRules == LivingRule.NORMAL) { @@ -2242,17 +2251,8 @@ window.getSlaveCost = function(s) { } else { cost += rulesCost; } - } else if(s.assignment === Job.WARDEN) { - cost += rulesCost * 2; - } else if(s.assignment === Job.JAIL) { - if(s.livingRules == LivingRule.NORMAL) { - cost += rulesCost * 1.25; - } else { - cost += rulesCost * .90; - } - } else if(s.assignment === Job.ATTEND) { - cost += rulesCost * 2; - } else if(s.assignment === Job.SPA) { + break; + case Job.SPA: if(s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * 1.75; } else if(s.livingRules == LivingRule.NORMAL) { @@ -2260,9 +2260,8 @@ window.getSlaveCost = function(s) { } else { cost += rulesCost; } - } else if(s.assignment === Job.STEWARD) { - cost += rulesCost * 2; - } else if(s.assignment === Job.SERVER) { + break; + case Job.SERVER: if(s.livingRules == LivingRule.NORMAL) { cost += rulesCost * 1.5; } else { @@ -2272,23 +2271,19 @@ window.getSlaveCost = function(s) { cost += rulesCost; } } - } else if(s.assignment === Job.MILKMAID) { - cost += rulesCost * 2; - } else if(s.assignment === Job.DAIRY) { + break; + case Job.JAIL: if(s.livingRules == LivingRule.NORMAL) { - cost += rulesCost * 1.5; + cost += rulesCost * 1.25; } else { - if(State.variables.dairyDecoration === 'Degradationist') { - cost += rulesCost * .90; - } else { - cost += rulesCost; - } + cost += rulesCost * .90; } - } else if(s.assignment === Job.TEACHER) { + break; + case Job.MADAM: case Job.DJ: case Job.NURSE: case Job.WARDEN: + case Job.ATTEND: case Job.STEWARD: case Job.MILKMAID: case Job.TEACHER: cost += rulesCost * 2; - } else if(s.assignment === Job.SCHOOL) { - cost += rulesCost * 1.5; - } else { + break; + default: if(s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * (s.relationship >= 4 ? 3 : 4); } else if(s.livingRules == LivingRule.NORMAL) { @@ -2296,6 +2291,7 @@ window.getSlaveCost = function(s) { } else { cost += rulesCost; } + break; } // Food diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw index 1d21c4ad7ba..fecc4b2200b 100644 --- a/src/js/economyJS.tw +++ b/src/js/economyJS.tw @@ -324,23 +324,32 @@ window.getSlaveCost = function(s) { var drugsCost = State.variables.drugsCost; // Living expenses - if((s.assignment === Job.DAIRY && State.variables.dairyRestraintsSetting >= 2) || (s.assignment === Job.ARCADE)) { + switch(s.assignment) { + case Job.ARCADE: cost += rulesCost * .75; - } else if(s.assignment === Job.MADAM) { - cost += rulesCost * 2; - } else if(s.assignment === Job.BROTHEL) { + break; + case Job.DAIRY: + if($State.variables.dairyRestraintsSetting >= 2) { + cost += rulesCost * .75; + } else if(s.livingRules == LivingRule.NORMAL) { + cost += rulesCost * 1.5; + } else if(State.variables.dairyDecoration === 'Degradationist') { + cost += rulesCost * .90; + } else { + cost += rulesCost; + } + break; + case Job.BROTHEL: if(s.livingRules == LivingRule.NORMAL) { cost += rulesCost * 1.5; } else { cost += rulesCost; } - } else if(s.assignment === Job.DJ) { - cost += rulesCost * 2; - } else if(s.assignment === Job.CLUB) { + break; + case Job.SCHOOL: case Job.CLUB: cost += rulesCost * 1.5; - } else if(s.assignment === Job.NURSE) { - cost += rulesCost * 2; - } else if(s.assignment === Job.CLINIC) { + break; + case Job.CLINIC: if(s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * 2; } else if(s.livingRules == LivingRule.NORMAL) { @@ -348,17 +357,8 @@ window.getSlaveCost = function(s) { } else { cost += rulesCost; } - } else if(s.assignment === Job.WARDEN) { - cost += rulesCost * 2; - } else if(s.assignment === Job.JAIL) { - if(s.livingRules == LivingRule.NORMAL) { - cost += rulesCost * 1.25; - } else { - cost += rulesCost * .90; - } - } else if(s.assignment === Job.ATTEND) { - cost += rulesCost * 2; - } else if(s.assignment === Job.SPA) { + break; + case Job.SPA: if(s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * 1.75; } else if(s.livingRules == LivingRule.NORMAL) { @@ -366,9 +366,8 @@ window.getSlaveCost = function(s) { } else { cost += rulesCost; } - } else if(s.assignment === Job.STEWARD) { - cost += rulesCost * 2; - } else if(s.assignment === Job.SERVER) { + break; + case Job.SERVER: if(s.livingRules == LivingRule.NORMAL) { cost += rulesCost * 1.5; } else { @@ -378,23 +377,19 @@ window.getSlaveCost = function(s) { cost += rulesCost; } } - } else if(s.assignment === Job.MILKMAID) { - cost += rulesCost * 2; - } else if(s.assignment === Job.DAIRY) { + break; + case Job.JAIL: if(s.livingRules == LivingRule.NORMAL) { - cost += rulesCost * 1.5; + cost += rulesCost * 1.25; } else { - if(State.variables.dairyDecoration === 'Degradationist') { - cost += rulesCost * .90; - } else { - cost += rulesCost; - } + cost += rulesCost * .90; } - } else if(s.assignment === Job.TEACHER) { + break; + case Job.MADAM: case Job.DJ: case Job.NURSE: case Job.WARDEN: + case Job.ATTEND: case Job.STEWARD: case Job.MILKMAID: case Job.TEACHER: cost += rulesCost * 2; - } else if(s.assignment === Job.SCHOOL) { - cost += rulesCost * 1.5; - } else { + break; + default: if(s.livingRules === LivingRule.LUXURIOUS) { cost += rulesCost * (s.relationship >= 4 ? 3 : 4); } else if(s.livingRules == LivingRule.NORMAL) { @@ -402,6 +397,7 @@ window.getSlaveCost = function(s) { } else { cost += rulesCost; } + break; } // Food diff --git a/src/uncategorized/buildingWidgets.tw b/src/uncategorized/buildingWidgets.tw index 61849a6e999..dbf06caee15 100644 --- a/src/uncategorized/buildingWidgets.tw +++ b/src/uncategorized/buildingWidgets.tw @@ -137,7 +137,7 @@ if(!Macro.has('sectorblock')) { <br> <<if $masterSuite>>[[Suite|Master Suite]] ($masterSuiteSlaves/$masterSuite<<if $Concubine>>, C<</if>>)<</if>> <<if $HGSuite>>[[HG Suite|Head Girl Suite]] <<if $HeadGirl == 1>>(HG) <<elseif $HGSuiteSlaves == 2>> (HG and roommate)<</if>> <</if>> - <<if $dojo>>[[BG Dojo|BG Select]] <<if $Bodyguard != 0>>(BG) <<else>> (0)<</if>> <</if>> + <<if $dojo > 1>>[[Armory|BG Select]] <<if $Bodyguard != 0>>(BG)<</if>> <</if>> <<if $servantsQuarters>>[[Quarters|Servants' Quarters]] ($servantsQuartersSlaves/$servantsQuarters<<if $Stewardess>>, L<</if>>)<</if>> <<if $spa>>[[Spa]] ($spaSlaves/$spa<<if $Attendant>>, L<</if>>)<</if>> <<if $clinic>>[[Clinic]] ($clinicSlaves/$clinic<<if $Nurse>>, L<</if>>)<</if>> diff --git a/src/uncategorized/costs.tw b/src/uncategorized/costs.tw index 3693604e95e..b978f2e6eb6 100644 --- a/src/uncategorized/costs.tw +++ b/src/uncategorized/costs.tw @@ -94,23 +94,28 @@ <<for $i = 0; $i < $slaves.length; $i++>> -<<if ($slaves[$i].assignment == "work in the dairy" && $dairyRestraintsSetting >= 2) || ($slaves[$i].assignment == "be confined in the arcade")>> +<<switch $slaves[$i].assignment>> +<<case "be confined in the arcade">> <<set $costs += ($rulesCost*.75)>> -<<elseif ($slaves[$i].assignment == "be the Madam")>> - <<set $costs += ($rulesCost*2)>> -<<elseif ($slaves[$i].assignment == "work in the brothel")>> +<<case "work in the dairy">> + <<if $dairyRestraintsSetting >= 2>> + <<set $costs += ($rulesCost*.75)>> + <<elseif $slaves[$i].livingRules == "normal">> + <<set $costs += ($rulesCost*1.5)>> + <<elseif $dairyDecoration == "Degradationist">> + <<set $costs += ($rulesCost*.9)>> + <<else>> + <<set $costs += $rulesCost>> + <</if>> +<<case "work in the brothel">> <<if $slaves[$i].livingRules == "normal">> <<set $costs += ($rulesCost*1.5)>> <<else>> <<set $costs += $rulesCost>> <</if>> -<<elseif ($slaves[$i].assignment == "be the DJ")>> - <<set $costs += ($rulesCost*2)>> -<<elseif ($slaves[$i].assignment == "serve in the club")>> +<<case "serve in the club" "learn in the schoolroom">> <<set $costs += ($rulesCost*1.5)>> -<<elseif ($slaves[$i].assignment == "be the Nurse")>> - <<set $costs += ($rulesCost*2)>> -<<elseif ($slaves[$i].assignment == "get treatment in the clinic")>> +<<case "get treatment in the clinic">> <<if $slaves[$i].livingRules == "luxurious">> <<set $costs += ($rulesCost*2)>> <<elseif $slaves[$i].livingRules == "normal">> @@ -118,17 +123,7 @@ <<else>> <<set $costs += $rulesCost>> <</if>> -<<elseif ($slaves[$i].assignment == "be the Wardeness")>> - <<set $costs += ($rulesCost*2)>> -<<elseif ($slaves[$i].assignment == "be confined in the cellblock")>> - <<if $slaves[$i].livingRules == "normal">> - <<set $costs += ($rulesCost*1.25)>> - <<else>> - <<set $costs += ($rulesCost*.9)>> - <</if>> -<<elseif ($slaves[$i].assignment == "be the Attendant")>> - <<set $costs += ($rulesCost*2)>> -<<elseif ($slaves[$i].assignment == "rest in the spa")>> +<<case "rest in the spa">> <<if $slaves[$i].livingRules == "luxurious">> <<set $costs += ($rulesCost*1.75)>> <<elseif $slaves[$i].livingRules == "normal">> @@ -136,13 +131,7 @@ <<else>> <<set $costs += $rulesCost>> <</if>> -<<elseif ($slaves[$i].assignment == "be the Schoolteacher")>> - <<set $costs += ($rulesCost*2)>> -<<elseif ($slaves[$i].assignment == "learn in the schoolroom")>> - <<set $costs += ($rulesCost*1.5)>> -<<elseif ($slaves[$i].assignment == "be the Stewardess")>> - <<set $costs += ($rulesCost*2)>> -<<elseif ($slaves[$i].assignment == "be a servant")>> +<<case "be a servant">> <<if $slaves[$i].livingRules == "normal">> <<set $costs += ($rulesCost*1.5)>> <<else>> @@ -152,31 +141,27 @@ <<set $costs += $rulesCost>> <</if>> <</if>> -<<elseif ($slaves[$i].assignment == "be the Milkmaid")>> - <<set $costs += ($rulesCost*2)>> -<<elseif ($slaves[$i].assignment == "work in the dairy")>> +<<case "be confined in the cellblock">> <<if $slaves[$i].livingRules == "normal">> - <<set $costs += ($rulesCost*1.5)>> + <<set $costs += ($rulesCost*1.25)>> <<else>> - <<if $dairyDecoration == "Degradationist">> - <<set $costs += ($rulesCost*.9)>> - <<else>> - <<set $costs += $rulesCost>> - <</if>> + <<set $costs += ($rulesCost*.9)>> <</if>> -<<else>> +<<case "be the Madam" "be the DJ" "be the Nurse" "be the Wardeness" "be the Attendant" "be the Schoolteacher" "be the Stewardess" "be the Milkmaid">> + <<set $costs += ($rulesCost*2)>> +<<default>> <<if $slaves[$i].livingRules == "luxurious">> <<if $slaves[$i].relationship >= 4>> - <<set $costs += ($rulesCost*3)>> + <<set $costs += ($rulesCost*3)>> <<else>> - <<set $costs += ($rulesCost*4)>> + <<set $costs += ($rulesCost*4)>> <</if>> <<elseif $slaves[$i].livingRules == "normal">> <<set $costs += ($rulesCost*2)>> <<else>> <<set $costs += $rulesCost>> <</if>> -<</if>> +<</switch>> <<set $costs += $foodCost*4>> <<switch $slaves[$i].diet>> diff --git a/src/uncategorized/costsReport.tw b/src/uncategorized/costsReport.tw index 3aabbd285d2..1491a2c22ff 100644 --- a/src/uncategorized/costsReport.tw +++ b/src/uncategorized/costsReport.tw @@ -234,120 +234,76 @@ trainer fees: <<print cashFormat(_cost)>> <<for $i = 0; $i < $slaves.length; $i++>> <<set $individualCosts = 0>> ''$slaves[$i].slaveName'': - <<if ($slaves[$i].assignment == "work in the dairy" && $dairyRestraintsSetting >= 2) || ($slaves[$i].assignment == "be confined in the arcade")>> - <br> Living expenses: <<print cashFormat(($rulesCost*.75))>> - <<set $individualCosts += ($rulesCost*.75)>> - <<elseif ($slaves[$i].assignment == "be the Madam")>> - <br> Living expenses: <<print cashFormat(($rulesCost*2))>> - <<set $individualCosts += ($rulesCost*2)>> - <<elseif ($slaves[$i].assignment == "be the DJ")>> - <br> Living expenses: <<print cashFormat(($rulesCost*2))>> - <<set $individualCosts += ($rulesCost*2)>> - <<elseif ($slaves[$i].assignment == "be the Nurse")>> - <br> Living expenses: <<print cashFormat(($rulesCost*2))>> - <<set $individualCosts += ($rulesCost*2)>> - <<elseif ($slaves[$i].assignment == "be the Wardeness")>> - <br> Living expenses: <<print cashFormat(($rulesCost*2))>> - <<set $individualCosts += ($rulesCost*2)>> - <<elseif ($slaves[$i].assignment == "be the Attendant")>> - <br> Living expenses: ¤<<print ($rulesCost*2)>> - <<set $individualCosts += ($rulesCost*2)>> - <<elseif ($slaves[$i].assignment == "be the Schoolteacher")>> - <br> Living expenses: ¤<<print ($rulesCost*2)>> - <<set $individualCosts += ($rulesCost*2)>> - <<elseif ($slaves[$i].assignment == "be the Stewardess")>> - <br> Living expenses: ¤<<print ($rulesCost*2)>> - <<set $individualCosts += ($rulesCost*2)>> - <<elseif ($slaves[$i].assignment == "be the Milkmaid")>> - <br> Living expenses: ¤<<print ($rulesCost*2)>> - <<set $individualCosts += ($rulesCost*2)>> - <<elseif ($slaves[$i].assignment == "serve in the club")>> - <br> Living expenses: <<print cashFormat(($rulesCost*1.5))>> - <<set $individualCosts += ($rulesCost*1.5)>> - <<elseif ($slaves[$i].assignment == "work in the brothel")>> + <<switch $slaves[$i].assignment>> + <<case "be confined in the arcade">> + <<set _livingExpense = ($rulesCost*.75)>> + <<case "work in the dairy">> + <<if $dairyRestraintsSetting >= 2>> + <<set _livingExpense = ($rulesCost*.75)>> + <<elseif $slaves[$i].livingRules == "normal">> + <<set _livingExpense = ($rulesCost*1.5)>> + <<elseif $dairyDecoration == "Degradationist">> + <<set _livingExpense = ($rulesCost*.9)>> + <<else>> + <<set _livingExpense = $rulesCost>> + <</if>> + <<case "work in the brothel">> <<if $slaves[$i].livingRules == "normal">> - <br> Living expenses: <<print cashFormat(($rulesCost*1.5))>> - <<set $individualCosts += ($rulesCost*1.5)>> + <<set _livingExpense = ($rulesCost*1.5)>> <<else>> - <br> Living expenses: <<print cashFormat($rulesCost)>> - <<set $individualCosts += $rulesCost>> + <<set _livingExpense = $rulesCost>> <</if>> - <<elseif ($slaves[$i].assignment == "get treatment in the clinic")>> + <<case "serve in the club" "learn in the schoolroom">> + <<set _livingExpense = ($rulesCost*1.5)>> + <<case "get treatment in the clinic">> <<if $slaves[$i].livingRules == "luxurious">> - <br> Living expenses: <<print cashFormat(($rulesCost*2))>> - <<set $individualCosts += ($rulesCost*2)>> + <<set _livingExpense = ($rulesCost*2)>> <<elseif $slaves[$i].livingRules == "normal">> - <br> Living expenses: <<print cashFormat(($rulesCost*1.5))>> - <<set $individualCosts += ($rulesCost*1.5)>> - <<else>> - <br> Living expenses: <<print cashFormat($rulesCost)>> - <<set $individualCosts += $rulesCost>> - <</if>> - <<elseif ($slaves[$i].assignment == "be confined in the cellblock")>> - <<if $slaves[$i].livingRules == "normal">> - <br> Living expenses: <<print cashFormat(($rulesCost*1.25))>> - <<set $individualCosts += ($rulesCost*1.25)>> + <<set _livingExpense = ($rulesCost*1.5)>> <<else>> - <br> Living expenses: <<print cashFormat(($rulesCost*.9))>> - <<set $individualCosts += ($rulesCost*.9)>> + <<set _livingExpense = $rulesCost>> <</if>> - <<elseif ($slaves[$i].assignment == "rest in the spa")>> + <<case "rest in the spa">> <<if $slaves[$i].livingRules == "luxurious">> - <br> Living expenses: ¤<<print ($rulesCost*1.75)>> - <<set $individualCosts += ($rulesCost*1.75)>> + <<set _livingExpense = ($rulesCost*1.75)>> <<elseif $slaves[$i].livingRules == "normal">> - <br> Living expenses: ¤<<print ($rulesCost*1.5)>> - <<set $individualCosts += ($rulesCost*1.5)>> + <<set _livingExpense = ($rulesCost*1.5)>> <<else>> - <br> Living expenses: ¤<<print $rulesCost>> - <<set $individualCosts += $rulesCost>> + <<set _livingExpense = $rulesCost>> <</if>> - <<elseif ($slaves[$i].assignment == "learn in the schoolroom")>> - <br> Living expenses: <<print cashFormat(($rulesCost*1.5))>> - <<set $individualCosts += ($rulesCost*1.5)>> - <<elseif ($slaves[$i].assignment == "be a servant")>> + <<case "be a servant">> <<if $slaves[$i].livingRules == "normal">> - <br> Living expenses: <<print cashFormat(($rulesCost*1.5))>> - <<set $individualCosts += ($rulesCost*1.5)>> + <<set _livingExpense = ($rulesCost*1.5)>> <<else>> <<if $servantsQuartersDecoration == "Degradationist">> - <br> Living expenses: <<print cashFormat($rulesCost*.90)>> - <<set $individualCosts += ($rulesCost*.90)>> + <<set _livingExpense = ($rulesCost*.9)>> <<else>> - <br> Living expenses: <<print cashFormat($rulesCost)>> - <<set $individualCosts += $rulesCost>> + <<set _livingExpense = $rulesCost>> <</if>> <</if>> - <<elseif ($slaves[$i].assignment == "work in the dairy")>> + <<case "be confined in the cellblock">> <<if $slaves[$i].livingRules == "normal">> - <br> Living expenses: <<print cashFormat(($rulesCost*1.5))>> - <<set $individualCosts += ($rulesCost*1.5)>> + <<set _livingExpense = ($rulesCost*1.25)>> <<else>> - <<if $dairyDecoration == "Degradationist">> - <br> Living expenses: <<print cashFormat($rulesCost*.90)>> - <<set $individualCosts += ($rulesCost*.90)>> - <<else>> - <br> Living expenses: <<print cashFormat($rulesCost)>> - <<set $individualCosts += $rulesCost>> - <</if>> + <<set _livingExpense = ($rulesCost*.9)>> <</if>> - <<else>> + <<case "be the Madam" "be the DJ" "be the Nurse" "be the Wardeness" "be the Attendant" "be the Schoolteacher" "be the Stewardess" "be the Milkmaid">> + <<set _livingExpense = ($rulesCost*2)>> + <<default>> <<if $slaves[$i].livingRules == "luxurious">> <<if $slaves[$i].relationship >= 4>> - <br> Living expenses: <<print cashFormat(($rulesCost*3))>> - <<set $individualCosts += ($rulesCost*3)>> + <<set _livingExpense = ($rulesCost*3)>> <<else>> - <br> Living expenses: <<print cashFormat(($rulesCost*4))>> - <<set $individualCosts += ($rulesCost*4)>> + <<set _livingExpense = ($rulesCost*4)>> <</if>> <<elseif $slaves[$i].livingRules == "normal">> - <br> Living expenses: <<print cashFormat(($rulesCost*2))>> - <<set $individualCosts += ($rulesCost*2)>> + <<set _livingExpense = ($rulesCost*2)>> <<else>> - <br> Living expenses: <<print cashFormat(($rulesCost))>> - <<set $individualCosts += $rulesCost>> + <<set _livingExpense = $rulesCost>> <</if>> - <</if>> + <</switch>> + <br> Living expenses: <<print cashFormat(_livingExpense)>> + <<set $individualCosts += _livingExpense>> <br> Basic slave food cost: <<print cashFormat($foodCost*4)>> <<set $individualCosts += $foodCost*4>> diff --git a/src/uncategorized/endWeek.tw b/src/uncategorized/endWeek.tw index 7664b73d4be..7dbb924234f 100644 --- a/src/uncategorized/endWeek.tw +++ b/src/uncategorized/endWeek.tw @@ -1,47 +1,27 @@ :: End Week [nobr] -<<set $gingering = 0>> - -<<set $oralUseWeight = 5>> -<<set $vaginalUseWeight = 5>> -<<set $analUseWeight = 5>> -<<set $mammaryUseWeight = 1>> -<<set $penetrativeUseWeight = 1>> +<<set $gingering = 0, $oralUseWeight = 5, $vaginalUseWeight = 5, $analUseWeight = 5, $mammaryUseWeight = 1, $penetrativeUseWeight = 1, $inflatedSlavesMilk = 0, $inflatedSlavesCum = 0, $subSlaves = 0>> <<if $OralEncouragement == 1>> - <<set $oralUseWeight += 2>> - <<set $vaginalUseWeight -= 1>> - <<set $analUseWeight -= 1>> + <<set $oralUseWeight += 2, $vaginalUseWeight -= 1, $analUseWeight -= 1>> <<elseif $VaginalEncouragement == 1>> - <<set $oralUseWeight -= 1>> - <<set $vaginalUseWeight += 2>> - <<set $analUseWeight -= 1>> + <<set $oralUseWeight -= 1, $vaginalUseWeight += 2, $analUseWeight -= 1>> <<elseif $AnalEncouragement == 1>> - <<set $oralUseWeight -= 1>> - <<set $vaginalUseWeight -= 1>> - <<set $analUseWeight += 2>> + <<set $oralUseWeight -= 1, $vaginalUseWeight -= 1, $analUseWeight += 2>> <</if>> <<if $OralDiscouragement == 1>> - <<set $oralUseWeight -= 2>> - <<set $vaginalUseWeight += 1>> - <<set $analUseWeight += 1>> + <<set $oralUseWeight -= 2, $vaginalUseWeight += 1 , $analUseWeight += 1>> <</if>> <<if $VaginalDiscouragement == 1>> - <<set $oralUseWeight += 1>> - <<set $vaginalUseWeight -= 2>> - <<set $analUseWeight += 1>> + <<set $oralUseWeight += 1, $vaginalUseWeight -= 2, $analUseWeight += 1>> <</if>> <<if $AnalDiscouragement == 1>> - <<set $oralUseWeight += 1>> - <<set $vaginalUseWeight += 1>> - <<set $analUseWeight -= 2>> + <<set $oralUseWeight += 1, $vaginalUseWeight += 1, $analUseWeight -= 2>> <</if>> <<if $sexualOpeness == 1>> <<set $penetrativeUseWeight++>> <</if>> -<<set $inflatedSlavesMilk = 0>> -<<set $inflatedSlavesCum = 0>> <<for _i = 0; _i < $slaves.length; _i++>> <<if $slaves[_i].inflationMethod == 1 || $slaves[_i].inflationMethod == 2>> <<if $slaves[_i].inflationType == "milk">> @@ -50,6 +30,9 @@ <<set $inflatedSlavesCum++>> <</if>> <</if>> + <<if $slaves[_i].subTarget == 0>> + <<set $subSlaves++ + <</if>> <</for>> <<if $organs.length > 0>> diff --git a/src/uncategorized/nextWeek.tw b/src/uncategorized/nextWeek.tw index 7255b017249..bb22bd0e541 100644 --- a/src/uncategorized/nextWeek.tw +++ b/src/uncategorized/nextWeek.tw @@ -236,7 +236,7 @@ <<if $boomerangWeeks>><<set $boomerangWeeks++>><</if>> -<<set $coursed = 0, $eventDescription = 0, $manuallyRetired = 0, $pitFought = 0, $preOwnedViewed = 0, $prestigeAuctioned = 0, $repGain = 0, $shelterSlave = 0, $shelterSlaveBought = 0, $slaveMarketLimit = 10 + ($rep / 1000), $slavesSeen = 0, $slavesSacrificedThisWeek = 0>> +<<set $coursed = 0, $eventDescription = 0, $manuallyRetired = 0, $pitFought = 0, $preOwnedViewed = 0, $prestigeAuctioned = 0, $repGain = 0, $shelterSlave = 0, $shelterSlaveBought = 0, $slaveMarketLimit = 10 + ($rep / 1000), $slavesSeen = 0, $slavesSacrificedThisWeek = 0, $subSlaves = 0>> /% These are variables that either should be made into _temp vars or should be Zeroed out once done with them instead of here. This can also interfere with debugging or hide NaN's as zeroing things out would clear a NaN. Also could stop from NaN's getting worse? %/ /% Integer and float variables. No real need to zero them out but doesn't hurt to have them in a known state, though this might mask variables NaN'ing out. Takes up the least amount of Memory besides a "" string. %/ @@ -246,7 +246,7 @@ <<set $events = [], $RESSevent = [], $RESSTRevent = [], $RETSevent = [], $RECIevent = [], $RecETSevent = [], $REFIevent = [], $REFSevent = [], $PESSevent = [], $PETSevent = [], $FSAcquisitionEvents = [], $FSNonconformistEvents = [], $qualifiedNicknames = [], $REAnalCowgirlSubIDs = [], $REButtholeCheckinIDs = [], $recruit = [], $RETasteTestSubIDs = [], $devotedSlaves = [], $rebelSlaves = [], $REBoobCollisionSubIDs = [], $REIfYouEnjoyItSubIDs = [], $RESadisticDescriptionSubIDs = [], $REShowerForceSubIDs = [], $RESimpleAssaultIDs = [], $RECockmilkInterceptionIDs = [], $REInterslaveBeggingIDs = [], $bedSlaves = [], $qualifiedFS = []>> /% Slave Objects using 0 instead of null. Second most memory eaten up. %/ -<<set $activeSlave = 0, $displaySlave = 0, $domSlave = 0, $eventSlave = 0, $RERelationshipSlave = 0, $slaveWithoutBonuses = 0, $subSlave = 0, $milfSlave = 0, $milkTap = 0, $relation = 0>> +<<set $activeSlave = 0, $domSlave = 0, $eventSlave = 0, $RERelationshipSlave = 0, $slaveWithoutBonuses = 0, $subSlave = 0, $milfSlave = 0, $milkTap = 0, $relation = 0>> /% Slave Objects that never get zeroed so null them here. Second most memory eaten up. %/ <<set $assayedSlave = null, $beforeGingering = null, $mother = null, $daughter = null, $devMother = null, $devDaughter = null, $alphaTwin = null, $betaTwin = null, $youngerSister = null, $olderSister = null, $recruiterMother = null, $recruiterSister = null, $sibling = null, $recruiterSlave = null>> diff --git a/src/uncategorized/storyCaption.tw b/src/uncategorized/storyCaption.tw index 6f4c141b8b5..46b5a7f490a 100644 --- a/src/uncategorized/storyCaption.tw +++ b/src/uncategorized/storyCaption.tw @@ -397,7 +397,7 @@ <</if>> <</if>> <</if>> - <<if ($dojo)>> + <<if ($dojo > 1)>> <br>[[Armory|BG Select]] <<if $Bodyguard != 0>> (BG) diff --git a/src/uncategorized/subordinateTargeting.tw b/src/uncategorized/subordinateTargeting.tw index 374687dff1a..0f9348633f7 100644 --- a/src/uncategorized/subordinateTargeting.tw +++ b/src/uncategorized/subordinateTargeting.tw @@ -2,18 +2,13 @@ <<set $nextButton = "Back", $nextLink = "Slave Interact">> -<<set $displaySlave = $activeSlave>> - <<if $activeSlave.subTarget == $activeSlave.ID>> <<set $activeSlave.subTarget = 0>> <</if>> -<<for _i = 0;_i < $slaves.length;_i++>> -<<if $activeSlave.subTarget == $slaves[_i].ID>> +<<set _st = $slaves.findIndex(function(s) { return s.ID == $activeSlave.subTarget; })>> +<<if _st != -1>> $activeSlave.slaveName will submit to ''__@@.pink;$slaves[_i].slaveName@@__'' this week. - <<break>> -<</if>> -<</for>> -<<if $activeSlave.subTarget == 0>> +<<else>> $activeSlave.slaveName has not been given to any particular slave, so she will have to offer herself to everyone this week. <<set $activeSlave.subTarget = 0>> <</if>> @@ -23,6 +18,5 @@ <br><br>[[None|Subordinate Targeting][$activeSlave.subTarget = 0]] -<<set $activeSlave = $displaySlave>> <<assignJob $activeSlave "be a subordinate slave">> -- GitLab