diff --git a/devNotes/VersionChangeLog-Premod+LoliMod.txt b/devNotes/VersionChangeLog-Premod+LoliMod.txt index b28d952ecb2242372a7c533fa24873b35945e414..bfd2e24358d91ae1911073bcbcc0b9bbbda22eea 100644 --- a/devNotes/VersionChangeLog-Premod+LoliMod.txt +++ b/devNotes/VersionChangeLog-Premod+LoliMod.txt @@ -2,8 +2,20 @@ 0.10.7.0/1 +3/23/2018 + + 407.1 + -fixes severe issues with customized slave trade + *Requires backwards compatibility - no exceptions + 3/22/2018 + 407 + -spelling fixes + -decreased memory usage, apparently signifigantly + -added setPregType(), but not implemented it yet + *Severe issues with customized slave trade. If you are not using it, DO NOT USE THIS VERSION. + 406 -minor fixes -major fixes and overhauling to autosurgery and to the RA diff --git a/devNotes/twine JS b/devNotes/twine JS index 16466ce233127863e05eb719b14d1a7712cd8bc8..ba1e7feb5adecf13390fefa47e6ec87d97ac6421 100644 --- a/devNotes/twine JS +++ b/devNotes/twine JS @@ -1312,6 +1312,79 @@ window.bellyAdjective = function(slave) { } } +/* calculates and returns expected ovum count during conception*/ +window.setPregType == function(actor) { + /* IMHO rework is posssible. Can be more interesting to play, if this code will take in account more body conditions - age, fat, food, hormone levels, etc. */ + + var ovum = 1; + var fertilityStack = 0; // adds an increasing bonus roll for stacked fertility drugs + + if(actor.broodmother < 1) { /* Broodmothers should be not processed here. Necessary now.*/ + if(typeof actor.readyOva == "number" && actor.readyOva != 0) { + ovum = actor.readyOva; /*just single override; for delayed impregnation cases */ + } else if(actor.ID == -1) { + if(actor.birthMaster > 0) { // Predisposed to twins + if(actor.fertDrugs == 1) { + ovum += jsEither(1, 1, 2, 2, 2, 2, 3, 3); + } else { + ovum += jsEither(0, 0, 0, 1, 1, 1, 1, 1, 1, 2); + } + if(actor.forcedFertDrugs > 0) { + ovum += jsEither(1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4); + } + } else { + if(actor.fertDrugs == 1) { + ovum += jsEither(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3); + } else { + ovum += jsEither(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + } + if(actor.forcedFertDrugs > 0) { + ovum += jsEither(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4); + } + } + } else if(actor.pregType == 0) { + ovum += jsEither(0, 0, 0, 0, 0, 0, 0, 0, 0, 1); //base chance for twins + if(actor.hormones == 2) { + ovum += jsEither(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2); + fertilityStack++; + } + if(actor.hormoneBalance >= 400) { + ovum += jsEither(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3); + fertilityStack++; + } + if(State.variables.masterSuitePregnancyFertilitySupplements == 1 && ((actor.assignment == "serve in the master suite" || actor.assignment == "be your Concubine"))) { + ovum += jsEither(0, 0, 0, 1, 1, 2, 2, 2, 3, 3); + fertilityStack++; + fertilityStack++; + } + if(actor.drugs == "super fertility drugs") { + ovum += jsEither(1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5); + fertilityStack++; + fertilityStack++; + fertilityStack++; + fertilityStack++; + fertilityStack++; + } else if(actor.drugs == "fertility drugs") { + ovum += jsEither(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3); + fertilityStack++; + } + if(State.variable.seeHyperPreg == 1) { + if(actor.drugs == "super fertility drugs") { + ovum += jsRandom(0, fertilityStack*2); + } else { + ovum += jsRandom(0, fertilityStack); + } + } else { + ovum += jsRandom(0, fertilityStack); + if(ovum > 12) { + ovum = jsRandom(6,12); + } + } + } + return ovum; + } +} + /*:: RA Selector JS [script]*/ window.growAdvSelector = function(slave, rule) { @@ -3601,6 +3674,15 @@ window.hashPush = function hashPush(obj, ...rest) { }); }; +window.weightedArray2HashMap = function weightedArray2HashMap(arr) { + const obj = {}; + arr.forEach(item => { + if (obj[item] === undefined) obj[item] = 1; + else obj[item] += 1; + }) + return obj; +}; + /*:: EventSelectionJS [script]*/ window.generateRandomEventPoolStandard = function(eventSlave) { diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 9ee3b2735ef8aedbbad196b544e923d5cb2c275f..e52a50a9ab2396d35f5bddb8adf64eac46b05000 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with thi <<set $returnTo = "init", $nextButton = "Continue", $nextLink = "Alpha disclaimer">> <<unset $releaseID>> -<<set $ver = "0.10.7", $releaseID = 1021>> -<<if ndef $releaseID>><<set $releaseID = 1021>><</if>> +<<set $ver = "0.10.7", $releaseID = 1022>> +<<if ndef $releaseID>><<set $releaseID = 1022>><</if>> /* This needs to be broken down into individual files that can be added to StoryInit instead. */ diff --git a/src/js/pregJS.tw b/src/js/pregJS.tw index bc319c2cdce7f4e325fe5bfd39b30285ce5929a6..06b6429fc6b884bbc008b258d0e520c8d6e17dbb 100644 --- a/src/js/pregJS.tw +++ b/src/js/pregJS.tw @@ -59,4 +59,77 @@ window.bellyAdjective = function(slave) { } else { return ''; } +} + +/* calculates and returns expected ovum count during conception*/ +window.setPregType == function(actor) { + /* IMHO rework is posssible. Can be more interesting to play, if this code will take in account more body conditions - age, fat, food, hormone levels, etc. */ + + var ovum = 1; + var fertilityStack = 0; // adds an increasing bonus roll for stacked fertility drugs + + if(actor.broodmother < 1) { /* Broodmothers should be not processed here. Necessary now.*/ + if(typeof actor.readyOva == "number" && actor.readyOva != 0) { + ovum = actor.readyOva; /*just single override; for delayed impregnation cases */ + } else if(actor.ID == -1) { + if(actor.birthMaster > 0) { // Predisposed to twins + if(actor.fertDrugs == 1) { + ovum += jsEither(1, 1, 2, 2, 2, 2, 3, 3); + } else { + ovum += jsEither(0, 0, 0, 1, 1, 1, 1, 1, 1, 2); + } + if(actor.forcedFertDrugs > 0) { + ovum += jsEither(1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4); + } + } else { + if(actor.fertDrugs == 1) { + ovum += jsEither(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3); + } else { + ovum += jsEither(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + } + if(actor.forcedFertDrugs > 0) { + ovum += jsEither(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4); + } + } + } else if(actor.pregType == 0) { + ovum += jsEither(0, 0, 0, 0, 0, 0, 0, 0, 0, 1); //base chance for twins + if(actor.hormones == 2) { + ovum += jsEither(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2); + fertilityStack++; + } + if(actor.hormoneBalance >= 400) { + ovum += jsEither(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3); + fertilityStack++; + } + if(State.variables.masterSuitePregnancyFertilitySupplements == 1 && ((actor.assignment == "serve in the master suite" || actor.assignment == "be your Concubine"))) { + ovum += jsEither(0, 0, 0, 1, 1, 2, 2, 2, 3, 3); + fertilityStack++; + fertilityStack++; + } + if(actor.drugs == "super fertility drugs") { + ovum += jsEither(1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5); + fertilityStack++; + fertilityStack++; + fertilityStack++; + fertilityStack++; + fertilityStack++; + } else if(actor.drugs == "fertility drugs") { + ovum += jsEither(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3); + fertilityStack++; + } + if(State.variable.seeHyperPreg == 1) { + if(actor.drugs == "super fertility drugs") { + ovum += jsRandom(0, fertilityStack*2); + } else { + ovum += jsRandom(0, fertilityStack); + } + } else { + ovum += jsRandom(0, fertilityStack); + if(ovum > 12) { + ovum = jsRandom(6,12); + } + } + } + return ovum; + } } \ No newline at end of file diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index f45851c7c2e89c1ba5f13debc405043c51245341..1e1f355dc9aea47aca0b1f8bc014506d636ebccc 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -2,6 +2,10 @@ <<set $nextButton = "Continue", $nextLink = "Main", $returnTo = "Main">> +<<if $releaseID == 2021 || $releaseID == 2020 || $releaseID == 2019>> + <<set $releaseID = 2022>> +<</if>> + <<if Array.isArray($nationalities)>> <<set $nationalities = weightedArray2HashMap($nationalities)>> <</if>> diff --git a/src/uncategorized/main.tw b/src/uncategorized/main.tw index aba97642869a2ee91977942abed2efa683ed2016..410ad482f0d1348ff2eb420b91684f1d3696aa68 100644 --- a/src/uncategorized/main.tw +++ b/src/uncategorized/main.tw @@ -3,7 +3,9 @@ <<unset $Flag>> <<resetAssignmentFilter>> <<if $releaseID >= 1000 || $ver.includes("0.9") || $ver.includes("0.8") || $ver.includes("0.7") || $ver.includes("0.6")>> - <<if $releaseID >= 1019>> + <<if $releaseID >= 1022>> + <<elseif $releaseID >= 1019>> + ''@@.red;INCOMPATIBILITY WARNING:@@'' your saved game was created using version $ver build $releaseID. Due to a major change to nationality weighting, you must run backwards comaptiblity. <<else>> ''@@.red;INCOMPATIBLE SAVE WARNING:@@'' your saved game was created using version $ver build $releaseID. Please select New Game Plus from the Options menu or start a new game. <br><br>