diff --git a/js/rulesAssistant/conditionEvaluation.js b/js/rulesAssistant/conditionEvaluation.js index ff4027c6ffa1deea680e65b33094b05a8eb7feba..82d7dfc6976184bcd37d5678def1fe6b7f0817e3 100644 --- a/js/rulesAssistant/conditionEvaluation.js +++ b/js/rulesAssistant/conditionEvaluation.js @@ -235,6 +235,10 @@ App.RA.Activation.populateGetters = function() { name: "Is Fertile?", description: "Whether or not the slave is fertile.", val: c => isFertile(c.slave) }); + gm.addBoolean("isvirile", { + name: "Is Virile?", description: "Whether or not the slave is virile, has fertile sperm.", + val: c => isVirile(c.slave) + }); gm.addBoolean("isamputee", { name: "Is Amputee?", description: "Whether or not the slave has no limbs.", val: c => isAmputee(c.slave) diff --git a/src/js/utilsPC.js b/src/js/utilsPC.js index 2a3eb99e4361bfb83fcf58247d6e4206335adbf7..d8d5823ace14dce6b321513aff31c8d45f57e1ba 100644 --- a/src/js/utilsPC.js +++ b/src/js/utilsPC.js @@ -1057,3 +1057,81 @@ globalThis.PCCareerCategory = function(career = V.PC.career) { console.log(`"${career}" not found in App.Data.player.career`); return career; }; + +/** Returns warning text for the player being penetrated and also warns about loosing virginities. + * @param {string} [holes = "vaginal first"] (vaginal | anal | both | either | vaginal first) + * @param {boolean} [escape = false] (true | false) is there a way to escape the penetration or it is unavoidable + * @returns {string} + */ +globalThis.PCPenetrationWarning = function(holes = "vaginal first", escape = false) { + let targets = []; + let virgins = []; + let result = ""; + let action = escape ? "can" : "will"; + if (holes === "vaginal" || holes === "both" || holes === "either" || holes === "vaginal first") { + if (V.PC.vagina >= 0) { + targets.push("vagina"); + if (V.PC.vagina === 0) { + virgins.push("vaginal"); + } + } + } + if (holes === "anal" || holes === "both" || holes === "either" || (holes === "vaginal firts" && targets.length === 0)) { + if (V.PC.anus >= 0) { + targets.push("anus"); + if (V.PC.vagina === 0) { + virgins.push("anal"); + } + } + } + if (targets.length === 0) { + return result; + } else if (targets.length === 2) { + if (holes === "either") { + result = `This option ${action} penetrate your vagina or anus.`; + } else { + result = `This option ${action} penetrate your vagina and anus.`; + } + } else { + result = `This option ${action} penetrate your ${targets[0]}.`; + } + if (virgins.length === 0) { + return result; + } else if (virgins.length === 2) { + if (holes === "either") { + result = `<span class="warning">This option ${action} take your vaginal or anal virginities.</span>`; + } else { + result = `<span class="warning">This option ${action} take your vaginal and anal virginities.</span>`; + } + } else { + result = `span class="warning">This option ${action} take your ${virgins[0]} virginity.</span>`; + } + return result; +} + +/** Returns "true" if the player can be receptive to penetration, even if the sexualOpenness policy is not adopted. This function should only be used to offer options to the player, it does not imply true willingness. + * @param {any} [penetrator = null] If a slave is passed as an argument, it also takes into account if slave.toyHole is "dick". + * @returns {boolean} +*/ +globalThis.isPlayerReceptive = function(penetrator = null) { + if (penetrator && penetrator.toyHole && penetrator.toyHole === "dick") { // if argument is passed, it is a slave and toyHole is dick + return true; + } else if (V.policies.sexualOpenness === 1) { + return true; + } else if (V.PC.drugs.includes("fertility") || V.PC.diet.includes("fertility") || V.PC.refreshment.includes("fertility")) { + return true; // PC wants to be pregnant, even if not fertile + } else if (V.slaves.filter(s => s.toyHole = "dick").length * 4 > V.slaves.filter(s => s.dick > 0).length || V.slaves.filter(s => s.toyHole = "dick").length * 10 > V.slaves.length) { + return true; // at least 25% of the slaves with penises or 10% of all the slaves have dick as toyHole + } else if (V.PC.counter.anal * 2 > V.week) { + return true; // player is used to anal penetration + /** } else if (V.PC.counter.vaginal * 2 V.week) { + return true; // vaginal isn't only increased by penetration, but it's also increased by tribbing and cunnilingus */ + } else if (isPlayerLusting() && (V.PC.anus > 0 || V.PC.vagina > 0)) { + return true; // player needs sex and has some penetrative experience + } else if (V.PC.preg > V.PC.pregData.normalBirth / 2 && V.PC.pregMood === 2) { + return true; // player's pregnancy increases libido + } else if (isFertile(V.PC) && V.PC.forcedFertDrugs > 0) { + return true; // forcedFertDrugs influence the behavior of the player, who unconsciously wants to be fertilized + } + return false; +} \ No newline at end of file