From 1d6049cef70cff23fae4b3b5d399e50a2baf13e1 Mon Sep 17 00:00:00 2001 From: pregmodfan <pregmodfan@cock.li> Date: Tue, 20 Mar 2018 21:09:20 +0200 Subject: [PATCH] Pregnancy fixes (pregType, readyOva, clinic, RA). --- slave variables documentation - Pregmod.txt | 4 ++++ src/js/wombJS.tw | 4 ++++ src/pregmod/incubatorReport.tw | 12 ++++++------ src/uncategorized/clinicReport.tw | 2 +- src/utility/miscWidgets.tw | 3 +++ src/utility/raWidgets.tw | 8 ++++---- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/slave variables documentation - Pregmod.txt b/slave variables documentation - Pregmod.txt index 58409da91dc..0d62847e0ce 100644 --- a/slave variables documentation - Pregmod.txt +++ b/slave variables documentation - Pregmod.txt @@ -1242,6 +1242,10 @@ pregType: Number of children. Warning! Should be not changed after initial impregnantion setup. See Pregnancy Control section for more. +readyOva: + +Number of ready to be impregnated ovas (override normal cases), default - 0. For delayed impregnantions with multiples. Used one time on next call of the SetPregType widget. After SetPregType use it to override .pregType, it set back to 0 automatically. + broodmother has the slave been turned into a broodmother diff --git a/src/js/wombJS.tw b/src/js/wombJS.tw index fca33e0d73f..a6fc9594541 100644 --- a/src/js/wombJS.tw +++ b/src/js/wombJS.tw @@ -42,6 +42,10 @@ window.WombInit = function(actor) //Init womb system. actor.broodmotherFetuses = 0; } + if ( typeof actor.readyOva != "number" ) + { + actor.readyOva = 0; + } if (actor.womb.length == 0 && actor.pregType != 0 && actor.broodmother == 0) //backward compatibility setup. Fully accurate for normal pregnancy only. { diff --git a/src/pregmod/incubatorReport.tw b/src/pregmod/incubatorReport.tw index 43d9542b475..8ad8ea08b74 100644 --- a/src/pregmod/incubatorReport.tw +++ b/src/pregmod/incubatorReport.tw @@ -218,9 +218,9 @@ <<if $tanks[_inc].ovaries == 1>> <<set $tanks[_inc].pubertyXX = 1>> <<if $seeHyperPreg == 1>> - <<set $tanks[_inc].pregType = random(25,45)>> + <<set $tanks[_inc].readyOva = random(25,45)>> <<else>> - <<set $tanks[_inc].pregType = random(3,8)>> + <<set $tanks[_inc].readyOva = random(3,8)>> <</if>> <<if $incubatorUpgradeSpeed == 52>> <<if $tanks[_inc].boobs < 8000>> @@ -342,9 +342,9 @@ <<if $tanks[_inc].ovaries == 1>> <<set $tanks[_inc].pubertyXX = 1>> <<if $seeHyperPreg == 1>> - <<set $tanks[_inc].pregType = random(15,25)>> + <<set $tanks[_inc].readyOva = random(15,25)>> <<else>> - <<set $tanks[_inc].pregType = random(2,6)>> + <<set $tanks[_inc].readyOva = random(2,6)>> <</if>> <<if $incubatorUpgradeSpeed == 52>> <<if $tanks[_inc].boobs < 4000>> @@ -466,9 +466,9 @@ <<if $tanks[_inc].ovaries == 1>> <<set $tanks[_inc].pubertyXX = 1>> <<if $seeHyperPreg == 1>> - <<set $tanks[_inc].pregType = random(10,15)>> + <<set $tanks[_inc].readyOva = random(10,15)>> <<else>> - <<set $tanks[_inc].pregType = random(2,4)>> + <<set $tanks[_inc].readyOva = random(2,4)>> <</if>> <<if $incubatorUpgradeSpeed == 52>> <<if $tanks[_inc].boobs < 2000>> diff --git a/src/uncategorized/clinicReport.tw b/src/uncategorized/clinicReport.tw index ca26c4d59e2..44ec5e6c270 100644 --- a/src/uncategorized/clinicReport.tw +++ b/src/uncategorized/clinicReport.tw @@ -180,7 +180,7 @@ <<else>> <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 10>> <</if>> - <<if $slaves[$i].preg >= 31 && $slaves[$i].pregControl == "speed up">> + <<if $slaves[$i].preg >= 35 && $slaves[$i].pregControl == "speed up">> <<set $slaves[$i].pregControl = "none">> ''@@.pink;$slaves[$i].slaveName's@@'' child is ready to pop out of her womb, ''@@.yellow;her course of rapid gestation agents is finished''. <</if>> diff --git a/src/utility/miscWidgets.tw b/src/utility/miscWidgets.tw index 647748af6f8..a23a4c2d821 100644 --- a/src/utility/miscWidgets.tw +++ b/src/utility/miscWidgets.tw @@ -2361,6 +2361,9 @@ This experience */ <<widget "SetPregType">> /* 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. */ <<if $args[0].broodmother < 1>> /* Broodmothers should be not processed here. Necessary now.*/ + <<if (def $args[0].readyOva) && $args[0].readyOva > 0 >> + <<set $args[0].pregType = $args[0].readyOva, $args[0].readyOva = 0>> /* just single override; for delayed impregnation cases */ + <</if>> <<if $args[0].ID == -1>> <<if $PC.birthMaster > 0>> /* Predisposed to twins */ <<if $PC.fertDrugs == 1>> diff --git a/src/utility/raWidgets.tw b/src/utility/raWidgets.tw index 6df784d53cc..0eab42727b0 100644 --- a/src/utility/raWidgets.tw +++ b/src/utility/raWidgets.tw @@ -4216,16 +4216,16 @@ Your brand design is ''$brandDesign.'' <</if>> <<if $args[0].pregKnown == 1 && _combinedRule.pregSpeed != "nds" && $args[0].breedingMark != 1 && $args[0].indentureRestrictions < 1 && $args[0].broodmother == 0>> - <<if _combinedRule.pregSpeed == "slow" && $args[0].preg < 31>> + <<if _combinedRule.pregSpeed == "slow" && $args[0].preg < 35>> <<set $args[0].pregControl = "slow gestation">> <br>$args[0].slaveName is pregnant, so she has been put on the gestation slowing agents. - <<elseif _combinedRule.pregSpeed == "fast" && $args[0].preg < 31 && $args[0].health > -50>> + <<elseif _combinedRule.pregSpeed == "fast" && $args[0].preg < 35 && $args[0].health > -50>> <<set $args[0].pregControl = "speed up">> <br>$args[0].slaveName is pregnant, so she has been put on rapid gestation agents. CAUTION! Can be dangerous. Clinic supervision is recommended. - <<elseif _combinedRule.pregSpeed == "suppress" && $args[0].preg > 30 && $args[0].health > -50>> + <<elseif _combinedRule.pregSpeed == "suppress" && $args[0].preg > 34 && $args[0].health > -50>> <<set $args[0].pregControl = "labor supressors">> <br>$args[0].slaveName is ready to birth, so she has been put on labor suppressing agents. - <<elseif _combinedRule.pregSpeed == "stimulate" && $args[0].preg >= 31 && $args[0].health > -50>> + <<elseif _combinedRule.pregSpeed == "stimulate" && $args[0].preg >= 37 && $args[0].health > -50>> <<set $args[0].labor = 1,$args[0].induce = 1,$birthee = 1>> <br>$args[0].slaveName is ready to birth, so her labor has been stimulated. <<elseif _combinedRule.pregSpeed == "fast" && $args[0].pregControl == "speed up" && $args[0].health <= -50>> -- GitLab