Skip to content
Snippets Groups Projects
Commit b9d824c4 authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'pregmod-dev' into 'pregmod-master'

Revised knockMeUp() function

See merge request pregmodfan/fc-pregmod!11268
parents a28994cd 155ebb7b
No related branches found
No related tags found
1 merge request!11268Revised knockMeUp() function
Pipeline #56923 passed
...@@ -1325,6 +1325,15 @@ App.Data.resetOnNGPlus = { ...@@ -1325,6 +1325,15 @@ App.Data.resetOnNGPlus = {
cost: 0, // How much you have to spend until she forgives you cost: 0, // How much you have to spend until she forgives you
}, },
/* Unethical Doctor */
pExoticSurgery: {
state: 0, // controls introduction and which halves you've met
fakePreg: 0, // is the female half teasing a male player?
cooldown: 0, // weeks until usable
visits: 0, // how many times you've given them money
clones: [], // you're starting to get boring, good thing I can fix that
},
diversePronouns: 0, diversePronouns: 0,
/* Weather effect on economy */ /* Weather effect on economy */
......
...@@ -469,6 +469,87 @@ globalThis.knockMeUp = function(target, chance, hole, fatherID) { ...@@ -469,6 +469,87 @@ globalThis.knockMeUp = function(target, chance, hole, fatherID) {
return r; return r;
}; };
/** Attempt to get an actor pregnant with another actor's child.
* Assumes that sperm is at the point of meeting the egg, so check penetrative ability outside of this.
* Technically deprecates canImpreg() and canFemImpreg().
* @param {App.Entity.SlaveState | App.Entity.PlayerState} mother is the actor attempting to become pregnant.
* @param {number} chance is the % chance to conceive.
* @param {0|1|2} hole control's the hole involved (0 - vagina, 1 - ass, 2 - both).
* @param {App.Entity.SlaveState | App.Entity.PlayerState} father is the actor doing the impregnating.
* @returns {string} Returns "${He} has become pregnant." if relevant
*/
globalThis.tryKnockMeUp = function(mother, chance, hole, father) {
let r = ``;
if (V.seePreg !== 0) {
if (canBreed(mother, father)) {
if (mother.geneMods.progenitor === 1) {
chance += 20;
}
if (father.geneMods.aggressiveSperm === 1) {
chance += 75;
}
if (father.geneticQuirks.potent === 2) {
chance *= 1.5;
}
if (V.reproductionFormula) {
if (mother.ID !== -1) {
chance += 10;
}
if (father.ID !== -1) {
chance += 10;
}
}
if (!isVirile(father) || !isFertile(mother) || (V.seeIncest === 0 && areRelated(mother, father))) {
chance = -10000;
}
if (mother.preg === -1) {
chance -= 350; // Allows making sperm so potent that they can overpower contraceptives. Shouldn't be possible at this value, but why stop a player from tweaking this if it's their thing?
}
if (mother.eggType !== father.ballType) { // Special case for fantasy races to create half-breeds.
chance -= 20;
}
if (random(0, 99) < chance) {
if (mother.mpreg === hole || hole === 2) {
if (mother.pregWeek <= 0) {
mother.preg = 1;
mother.pregSource = father.ID;
if (mother.ID !== -1) {
mother.pregWeek = 1;
}
}
mother.pregType = setPregType(mother);
WombImpregnate(mother, mother.pregType, father.ID, 1);
if (V.menstruation === 1) {
//
} else {
mother.pregKnown = 1;
if (mother.ID === -1) {
/* r += "<span class="lime">You have gotten pregnant.</span>"; */
} else {
const {him} = getPronouns(mother);
if (father.ID === -1) {
r += `<span class="lime">You have gotten ${him} pregnant.</span>`;
} else {
r += `<span class="lime">${father.slaveName} has gotten ${him} pregnant.</span>`;
}
}
if (mother.geneticQuirks.superfetation === 2 && mother.womb.length > 0) {
if (V.seeHyperPreg === 1) {
mother.fertPeak = 1;
} else {
mother.fertPeak = 4;
}
}
}
}
}
}
}
return r;
};
globalThis.getIncubatorReserved = function( /* slaves */ ) { globalThis.getIncubatorReserved = function( /* slaves */ ) {
return FetusGlobalReserveCount("incubator"); return FetusGlobalReserveCount("incubator");
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment