From fdc8c512506bcfe06a141262d4c2677fd62b1c2d Mon Sep 17 00:00:00 2001 From: indf24 <109249146+indf24@users.noreply.github.com> Date: Tue, 19 Mar 2024 10:42:17 +0000 Subject: [PATCH] Added the surgeries execution --- src/js/rulesAssistantOptions.js | 12 ++++++------ src/js/rulesAutosurgery.js | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index b94d2c2ce43..e498f9f840b 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -1689,8 +1689,8 @@ App.RA.options = (function() { this.appendChild(new SemenSurgeryList()); this.appendChild(new VasectomyList()); } - this.appendChild(new OvariesImplantsSurgeryList()); - this.appendChild(new OvariesImplantsAllowReplacing()); + this.appendChild(new OvaryImplantSurgeryList()); + this.appendChild(new OvaryImplantAllowReplacing()); this.appendChild(new CosmeticSurgeryList()); this.appendChild(new LipSurgeryList()); this.appendChild(new ButtSurgeryList()); @@ -3928,12 +3928,12 @@ App.RA.options = (function() { } } - class OvariesImplantsSurgeryList extends RadioSelector { + class OvaryImplantSurgeryList extends RadioSelector { constructor() { const items = [ ["none", 0], - ["fertility", "fertility"], - ["sympathy", "sympathy"] + ["fertility", 1], + ["sympathy", 2] ]; super("Ovaries implants type", items, true); this.setValue(current_rule.set.surgery.ovaImplant); @@ -3941,7 +3941,7 @@ App.RA.options = (function() { } } - class OvariesImplantsAllowReplacing extends BooleanSwitch { + class OvaryImplantAllowReplacing extends BooleanSwitch { constructor() { super(`Replace other types of ovaries implants`); diff --git a/src/js/rulesAutosurgery.js b/src/js/rulesAutosurgery.js index bf49b659c6f..473050dc073 100644 --- a/src/js/rulesAutosurgery.js +++ b/src/js/rulesAutosurgery.js @@ -356,6 +356,28 @@ globalThis.rulesAutosurgery = (function() { commitProcedure("undo vasectomy", s => { s.vasectomy = 0; }); } + if (slave.ovaries === 1 || slave.mpreg === 1) { + if (thisSurgery.ovaImplant === 2 && V.sympatheticOvaries === 1) { + if (slave.ovaImplant === 0) { + commitProcedure(`surgery to link ${his} ovaries via implant`, s => { s.ovaImplant = "sympathy"; }); + } else if (slave.ovaImplant === "fertility" && thisSurgery.ovaImplantAllowReplacing) { + commitProcedure(`surgery to remove the fertility implants and link ${his} ovaries via implant`, s => { s.ovaImplant = "sympathy"; }, 20); + } + } else if (thisSurgery.ovaImplant === 1 && V.fertilityImplant === 1) { + if (slave.ovaImplant === 0) { + commitProcedure(`surgery to attach fertility implants to ${his} ovaries`, s => { s.ovaImplant = "fertility"; }); + } else if (slave.ovaImplant === "sympathy" && thisSurgery.ovaImplantAllowReplacing) { + commitProcedure(`surgery to unlink ${his} ovaries and attach fertility implants`, s => { s.ovaImplant = "fertility"; }, 20); + } + } else if (thisSurgery.ovaImplant === 0 && slave.ovaImplant !== 0) { + if (slave.ovaImplant === "sympathy") { + commitProcedure(`surgery to unlink ${his} ovaries`, s => { s.ovaImplant = 0; }); + } else if (slave.ovaImplant === "fertility") { + commitProcedure(`surgery to remove the fertility implants from ${his} ovaries`, s => { s.ovaImplant = 0; }); + } + } + } + if (slave.faceImplant <= 15 && slave.face <= 95 && thisSurgery.cosmetic > 0) { commitProcedure("a nicer face", () => { if (slave.faceShape === "masculine") { slave.faceShape = "androgynous"; } -- GitLab