diff --git a/devNotes/VersionChangeLog-Premod+LoliMod.txt b/devNotes/VersionChangeLog-Premod+LoliMod.txt index 4cd82a849033d423a681066299dfb19659f4de33..bec69cdab9b4300fed24557172bb46ad0da95404 100644 --- a/devNotes/VersionChangeLog-Premod+LoliMod.txt +++ b/devNotes/VersionChangeLog-Premod+LoliMod.txt @@ -10,6 +10,7 @@ Pregmod -tail socket cybernetics port and tails -fertility diet no longer blocked by chastity -RA can now apply contraceptives to postpartum slaves + -RA can now manage basic abortions -fixes 0.10.7.1-2.1.x diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 03d24df789bdae9be49ef48e99aa51119a907151..7051d51e59ca5aa5ae521c06eba74bfa60021a99 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -30,6 +30,8 @@ window.DefaultRules = (function() { ProcessBellyImplant(slave, rule); if (isFertile(slave) || slave.pregWeek < 0) ProcessContraceptives(slave, rule); + if (slave.preg > 0 && slave.pregKnown == 1 && slave.broodmother == 0) + ProcessAbortions(slave, rule); ProcessOtherDrugs(slave, rule); ProcessAssetGrowthDrugs(slave, rule); ProcessEnema(slave, rule); @@ -1023,6 +1025,82 @@ window.DefaultRules = (function() { } } } + + /** @param {App.Entity.SlaveState} slave */ + function ProcessAbortions(slave, rule) { + if ((rule.abortion !== undefined) && (rule.abortion !== "no default setting")) { + if (rule.abortion === "all") { + + if (slave.preg < 4 || (slave.fetish === "mindbroken" || slave.fuckdoll != 0)) { + r += `<br>${slave.slaveName}'s pregnancy has been terminated.`; + } else { + r += `<br>${slave.slaveName}'s pregnancy has been terminated; `; + if (slave.sexualFlaw === "breeder") { + r += `it broke her mind.`; + slave.fetish = "mindbroken", slave.behavioralQuirk = "none", slave.behavioralFlaw = "none", slave.sexualQuirk = "none", slave.sexualFlaw = "none", slave.devotion = 0, slave.trust = 0; + } else if (slave.devotion < -50) { + r += `she did not handle it well.`; + slave.trust -= 10, slave.devotion -= 25; + } else if (slave.devotion < -20) { + r += `she did not handle it well.`; + slave.trust -= 10, slave.devotion -= 10; + } else if (slave.fetish === "pregnancy") { + r += `she did not handle it well.`; + var fetishModifier = (slave.fetishStrength / 2); + slave.devotion -= (1 * fetishModifier), (slave.trust -= 1 * fetishModifier); + } else if (slave.devotion <= 20) { + r += `she did not handle it well.`; + slave.trust -= 10, slave.devotion -= 5; + } else if (slave.devotion <= 50) { + r += `she did not handle it well.`; + slave.trust -= 10; + } else { + r += `it had little mental effect.`; + } + } + + if (lastPregRule(slave, V.defaultRules)) { slave.preg = -1; } else { slave.preg = 0; } + V.reservedChildren = FetusGlobalReserveCount("incubator"); + V.reservedChildrenNursery = FetusGlobalReserveCount("nursery"); + slave.pregType = 0, slave.pregSource = 0, slave.pregKnown = 0, slave.pregWeek = -2; + WombFlush(slave); + } else if (rule.abortion === "male") { + if (slave.preg < 4) { + var WL = slave.womb.length; + for (var index = 0; index < WL; index++) { + if (slave.womb[index].genetics.gender === "XY") { + WombRemoveFetus(slave, index); + index--; + WL--; + } + } + if (WL === 0) { + slave.pregType = 0, slave.pregSource = 0, slave.pregKnown = 0, slave.pregWeek = -2; + WombFlush(slave); + } + r += `<br>${slave.slaveName}'s male fetuses have been terminated.`; + } + } else if (rule.abortion === "female") { + if (slave.preg < 4) { + var WL = slave.womb.length; + for (var index = 0; index < WL; index++) { + if (slave.womb[index].genetics.gender === "XX") { + WombRemoveFetus(slave, index); + index--; + WL--; + } + } + if (WL === 0) { + slave.pregType = 0, slave.pregSource = 0, slave.pregKnown = 0, slave.pregWeek = -2; + WombFlush(slave); + + } + r += `<br>${slave.slaveName}'s female fetuses have been terminated.`; + } + } + SetBellySize(slave); + } + } /** @param {App.Entity.SlaveState} slave */ function ProcessAssetGrowthDrugs(slave, rule) { diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 4d5ea25dc89c9050cc7d8c989fba105ba48f5475..9566b01f61a7b23d2869694cfeed7a72ddcc295f 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -278,6 +278,7 @@ window.emptyDefaultRule = function emptyDefaultRule() { XX: "no default setting", gelding: "no default setting", preg: "no default setting", + abortion: "no default setting", growth_boobs: "no default setting", growth_butt: "no default setting", growth_lips: "no default setting", diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 786b37d15cbdf6a91f7e959ab765496a08286ca0..e93119c962c5bcab798e6d82efb42772f944e17f 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -938,6 +938,7 @@ window.rulesAssistantOptions = (function() { this.appendChild(new CurrativesList()); this.appendChild(new AphrodisiacList()); this.appendChild(new ContraceptiveList()); + this.appendChild(new AbortionList()); if (V.pregSpeedControl) this.appendChild(new PregDrugsList()); this.appendChild(new FemaleHormonesList()); @@ -1648,6 +1649,21 @@ window.rulesAssistantOptions = (function() { } } + class AbortionList extends List { + constructor() { + const pairs = [ + ["No default setting", "no default setting"], + ["Abort all", "all"], + ]; + if (V.pregnancyMonitoringUpgrade === 1 && V.geneticMappingUpgrade === 1) + pairs.push(["Abort boys", "male"]); + pairs.push(["Abort girls", "female"]); + super("Pregnancy termination", pairs); + this.setValue(current_rule.set.abortion); + this.onchange = (value) => current_rule.set.abortion = value; + } + } + class PregDrugsList extends List { constructor() { const pairs = [ diff --git a/src/npc/abort.tw b/src/npc/abort.tw index 2ae1ee1ed3c5c2598d7b52fee212ea512da1522f..6974d0a89475fcc66d4537929a827a272900e1d6 100644 --- a/src/npc/abort.tw +++ b/src/npc/abort.tw @@ -3,31 +3,37 @@ <<set $nextButton = "Back", $nextLink = "Slave Interact">> <<run clearSummaryCache($activeSlave)>> -The remote surgery makes aborting a pregnancy quick and efficient. $activeSlave.slaveName is -<<if ($activeSlave.fuckdoll > 0) || ($activeSlave.fetish == "mindbroken")>> - completely unmoved by the development. -<<elseif $activeSlave.sexualFlaw == "breeder">> - @@.red;fundamentally broken.@@ $His entire concept of self and sexuality was wrapped up in the life growing within $him, and now it is gone. - <<set $activeSlave.fetish = "mindbroken", $activeSlave.behavioralQuirk = "none", $activeSlave.behavioralFlaw = "none", $activeSlave.sexualQuirk = "none", $activeSlave.sexualFlaw = "none", $activeSlave.devotion = 0, $activeSlave.trust = 0>> -<<elseif $activeSlave.devotion < -50>> - @@.mediumorchid;filled with violent, consuming hatred.@@ Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it and views you as its killer. $He is @@.gold;terrified of your power@@ over $his body. - <<set $activeSlave.trust -= 10, $activeSlave.devotion -= 25>> -<<elseif $activeSlave.devotion < -20>> - @@.mediumorchid;afflicted by desperate, inconsolable sobbing.@@ Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it. $He is @@.gold;terrified of your power@@ over $his body. - <<set $activeSlave.trust -= 10, $activeSlave.devotion -= 10>> -<<elseif $activeSlave.fetish == "pregnancy">> - @@.mediumorchid;filled with a deep sorrow.@@ To a pregnancy fetishist, having a pregnancy end like this hurts far worse than birth ever would. $He is @@.gold;terrified of a repeat performance.@@ - <<set _fetishModifier = $activeSlave.fetishStrength/2>> - <<set $activeSlave.devotion -= 1*_fetishModifier, $activeSlave.trust -= 1*_fetishModifier>> -<<elseif $activeSlave.devotion <= 20>> - @@.mediumorchid;consumed by muted weeping and enduring sorrow.@@ Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it. $He is @@.gold;terrified of your power@@ over $his body. - <<set $activeSlave.trust -= 10, $activeSlave.devotion -= 5>> -<<elseif $activeSlave.devotion <= 50>> - dully obedient. $He has been broken to slave life so thoroughly that even this is neither surprising nor affecting. $He is @@.gold;terrified of your power@@ over $his body. - <<set $activeSlave.trust -= 10>> +The remote surgery makes aborting a pregnancy quick and efficient. + +<<if $activeSlave.preg < 4>> + It was so early in $his pregnancy that the potential mental effects are deminished. <<else>> - @@.hotpink;pleased by this stark development,@@ since $he is so attentive to your will. $He also expects $he'll be able to fuck better now. - <<set $activeSlave.devotion += 4>> + $activeSlave.slaveName is + <<if ($activeSlave.fuckdoll > 0) || ($activeSlave.fetish == "mindbroken")>> + completely unmoved by the development. + <<elseif $activeSlave.sexualFlaw == "breeder">> + @@.red;fundamentally broken.@@ $His entire concept of self and sexuality was wrapped up in the life growing within $him, and now it is gone. + <<set $activeSlave.fetish = "mindbroken", $activeSlave.behavioralQuirk = "none", $activeSlave.behavioralFlaw = "none", $activeSlave.sexualQuirk = "none", $activeSlave.sexualFlaw = "none", $activeSlave.devotion = 0, $activeSlave.trust = 0>> + <<elseif $activeSlave.devotion < -50>> + @@.mediumorchid;filled with violent, consuming hatred.@@ Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it and views you as its killer. $He is @@.gold;terrified of your power@@ over $his body. + <<set $activeSlave.trust -= 10, $activeSlave.devotion -= 25>> + <<elseif $activeSlave.devotion < -20>> + @@.mediumorchid;afflicted by desperate, inconsolable sobbing.@@ Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it. $He is @@.gold;terrified of your power@@ over $his body. + <<set $activeSlave.trust -= 10, $activeSlave.devotion -= 10>> + <<elseif $activeSlave.fetish == "pregnancy">> + @@.mediumorchid;filled with a deep sorrow.@@ To a pregnancy fetishist, having a pregnancy end like this hurts far worse than birth ever would. $He is @@.gold;terrified of a repeat performance.@@ + <<set _fetishModifier = $activeSlave.fetishStrength/2>> + <<set $activeSlave.devotion -= 1*_fetishModifier, $activeSlave.trust -= 1*_fetishModifier>> + <<elseif $activeSlave.devotion <= 20>> + @@.mediumorchid;consumed by muted weeping and enduring sorrow.@@ Even though $he knew $his baby was destined for a slave orphanage, it seems $he cared for it. $He is @@.gold;terrified of your power@@ over $his body. + <<set $activeSlave.trust -= 10, $activeSlave.devotion -= 5>> + <<elseif $activeSlave.devotion <= 50>> + dully obedient. $He has been broken to slave life so thoroughly that even this is neither surprising nor affecting. $He is @@.gold;terrified of your power@@ over $his body. + <<set $activeSlave.trust -= 10>> + <<else>> + @@.hotpink;pleased by this stark development,@@ since $he is so attentive to your will. $He also expects $he'll be able to fuck better now. + <<set $activeSlave.devotion += 4>> + <</if>> <</if>> <<if lastPregRule($activeSlave,$defaultRules)>><<set $activeSlave.preg = -1>><<else>><<set $activeSlave.preg = 0>><</if>>