Jump to content

TTJ BasePregChanceFixes [XCL] 1.0.0


2 Screenshots

About This File

Have you ever been on a Kannagi, Empress, or Denial pill while simultaneously using MooMe-Rx for some reason? No? Just me? Whatever - I was testing Pharm Inc drugs and happened to be on a Kannagi and noticed that my pregnancy chance was getting crazy - it went well over 200%. There is theoretically no limit to how high it could go. What's happening is a weird interaction of missing code in BR Pills, a missed else in the base game, and a Pharm Inc pregnancy boost (plus Pharm Inc could be using a more appropriate passage tag to implement that boost).

 

Here's how it works: $base_preg_chance is set and modified in "calculate pregnancy chance" which runs (at a minimum) when you take a pill or it expires or a new day dawns. It does a bunch of if/else-ifs (with no final else!) to assign an initial value to $base_preg_chance based on the pill taken, then has this:
($passage_tags:"preg_chance")
which allows mod writers to hook in their own passages tagged [preg_chance] to set initial values to the pills they create. So, if you have a pill that doesn't do that, the initial value is never set (because of the missing final else).

 

BR Pill Mod has [preg_chance] tagged passages for Continue and Resistance Plus, but is missing them for Kannagi, Empress, and Denial. When you take one of the latter set, you will inherit whatever previous $base_preg_chance you had instead of resetting it.

 

Then some Pharm Inc drugs have an effect on $base_preg_chance, also using the [preg_chance] tag. However, instead of setting an initial value, they add to it. But if the initial value is never set, the value can just go up and up, getting an additional 50 for MooMe-Rx, 100 for MooMe-OD, and 10 for Stallion each time "calculate pregnancy chance" runs. So if you are on a Kannagi and MooMe-Rx for a few days your pregnancy chance will get ridiculously high. One other issue - because it's using the [preg_chance] tag, there is no way to control whether these additions run before or after any BR Pill Mod initial value setting, so if you are on Continue and MooMe-Rx you might get the bonus one day but not the next. I think "pregnancy chance Pharm" should be modified to use the [fertility_perc] tag instead because it also runs in "calculate pregnancy chance" but after the [preg_chance] tags have run.

 

Anyway, this mod solves these issues by adding defaults to the base game "calculate pregnancy chance"; supplying the missing [preg_chance] passages for Kannagi, Empress, and Denial in BR Pill Mod; and changing Pharm Inc's "pregnancy chance Pharm" to use the [fertility_perc] tag.

 

The screenshots show a day after taking an Empress pill and a MooMo-Rx at night, running "calculate pregnancy chance" a few times, and the resulting percentage pregnancy chance in the morning (which isn't the $base_preg_chance but depends on it) - first one unfixed, second one with this mod.

Edited by tabletopjoe
changed some verbiage in the "About This File" to correctly describe what the mod is doing ("base pregnancy chance"->"calculate pregnancy chance"). No change to the file.



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use