1
0

femcyc.qsrc 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. # femcyc
  2. !! important values for pillcon
  3. !!at 7000 pillcon sveta will begin slowing down the build up of hormone to release eggs - see cyc1
  4. !!at 20000 pillcon sveta will very rarely even build up hormone to release eggs but its random so it can still happen anyways - see cyc1 and cyc2
  5. !!at 26000 pillcon sveta only has a 1/400 chance of even releasing an egg at all even if she does build up enough hormone - see cyc2
  6. !!at 38000 pillcon sveta no longer has periods at all and cannot get pregnant anymore -- see cyc3
  7. !! I have to initialize the variables somewhere, maybe in preCUST?
  8. if Luth_Max = 0: LutH_Max = rand(312,360) & !! 13-15 days including ovulation
  9. if Foch_Max = 0: FocH_Max = rand(312,360) & !! 13-15 days including menstruation
  10. if $ARGS[0] = '':
  11. !{Hourly reduction in semen potency}
  12. !{First it sets the array index to the first index, then it checks to be sure the array tracking the age is less than 144 hours. If it is 144 hours old, it kills that index, which should shift the index up. If it is less than 144 hours old, it sets a current potency drop. The drop is 2x or 3x regularly, but during ovulation it is only 1x, to represent the better environment from fertile cervical mucus.}
  13. !{144 hours was selected due to that being approximately the maximum amount of time sperm is viable in the womb (120 would be more accurate, but there is leeway). PLEASE DO NOT CHANGE IT.}
  14. !{The potency drop may seem small in game-time, but is meant to be a reasonable approximation to real life. Avoid unprotected sex within 5 days of ovulation if you want to mitigate your risk.}
  15. !{the 'rcntorgzm' variable is set to determine whether Sveta has orgasmed within the last hour. If she has, a small potency boost for the guys she has slept with in that hour.}
  16. if rcntorgzm = 1:
  17. if rcntorgzmtmp = 1: rcntorgzm = 0 & rcntorgzmtmp = 0
  18. if rcntorgzmtmp = 0: rcntorgzmtmp = 1
  19. end
  20. cumarr_idx = 0
  21. :cumarrloop
  22. if cumarr_idx < arrsize('$cumarrnam'):
  23. if cumarrcpt[cumarr_idx] > 0 and cumarrage[cumarr_idx] < 144:
  24. if rcntorgzm = 1 and cumarrcpt[cumarr_idx] < cumarrppt[cumarr_idx] and cumarrage[cumarr_idx] < 1: cumarrcpt[cumarr_idx] += cumarrppt[cumarr_idx] / 12
  25. cumpdrop = cumarrcpt[cumarr_idx] / (144 - cumarrage[cumarr_idx])
  26. if cycle ! 2: cumpdrop += cumpdrop * rand(0, 2)
  27. cumarrcpt[cumarr_idx] -= cumpdrop
  28. if cumarrcpt[cumarr_idx] <= 0:
  29. gs 'cum_cleanup', 'cleanwomb', cumarr_idx
  30. else
  31. cumarrage[cumarr_idx] += 1
  32. cumarr_idx += 1
  33. end
  34. else
  35. gs 'cum_cleanup', 'cleanwomb', cumarr_idx
  36. end
  37. jump 'cumarrloop'
  38. end
  39. !!Succubus absorption of sperm in womb
  40. if succubusflag = 1:
  41. if arrsize('cumarrppt') > 0:
  42. succycletmp = 0
  43. :sucvagabs
  44. if cumarrdel[succycletmp] = 0:
  45. if cumarrcpt[succycletmp] > 10000:
  46. sexnutrition += 30 * succublvl
  47. succubxp += 3
  48. elseif cumarrcpt[succycletmp] < 3000 and cumarrcpt[succycletmp] > 1000:
  49. sexnutrition += 5 * succublvl
  50. succubxp += 2
  51. elseif cumarrcpt[succycletmp] =< 1000:
  52. sexnutrition += succublvl
  53. else
  54. sexnutrition += 25 * succublvl
  55. succubxp += 3
  56. end
  57. gs 'cum_cleanup', 'cleanwomb', succycletmp
  58. sucabscum = 1
  59. else
  60. succycletmp += 1
  61. end
  62. if succycletmp < arrsize('cumarrppt'): jump 'sucvagabs'
  63. end
  64. killvar 'succycletmp'
  65. end
  66. cumarrtemp = 0
  67. cumcondslip = 0
  68. cumcondslip_aware = 0
  69. if arrsize('sparrvol') > 0:
  70. :cumspaloop
  71. !!Succubus absorption for internal locations other than womb
  72. if succubusflag = 1:
  73. if sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  74. sexnutrition += 25*succublvl
  75. succubxp += 3
  76. sucabscum = 1
  77. if sparrvol[cumarrtemp] > 0: sparrvol[cumarrtemp] = 0
  78. end
  79. end
  80. !!{if sparrloc[cumarrtemp] = 0 or sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  81. sexnutrition += 30*succublvl
  82. sparrvol[cumarrtemp] -= 30*succublvl
  83. if sparrvol[cumarrtemp] < 0: sexnutrition += sparrvol[cumarrtemp] & sparrvol[cumarrtemp] = 0
  84. end}
  85. !!{ Process spatter until it has volume or is too old in vagina. }
  86. if sparrvol[cumarrtemp] > 0 or (sparrloc[cumarrtemp] = 0 and sparrage[cumarrtemp] < 10):
  87. sparrtmpv = arrsize('$cumarrnam')
  88. if sparrloc[cumarrtemp] = 17:
  89. sparrtmpv = arrpos('cumarrcnt',sparrcnt[cumarrtemp])
  90. if sparrtmpv >= 0:
  91. !!'Found guy id <<sparrtmpv>>'
  92. if sparrage[cumarrtemp] < 4:
  93. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/5
  94. elseif sparrage[cumarrtemp] < 10:
  95. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/30
  96. end
  97. end
  98. elseif sparrloc[cumarrtemp] = 0:
  99. sparrtmpv = arrpos('cumarrcnt',sparrcnt[cumarrtemp])
  100. if sparrtmpv >= 0:
  101. !!'Found guy id' & sparrtmpv
  102. if sparrage[cumarrtemp] < 4:
  103. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/40
  104. elseif sparrage[cumarrtemp] < 10:
  105. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/60
  106. end
  107. end
  108. elseif sparrslc[cumarrtemp] = 1 and sparrage < 5:
  109. if sparrloc[cumarrtemp] = 1:
  110. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  111. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  112. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  113. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  114. cumarrdel[sparrtmpv] = 1
  115. cumarrkno[sparrtmpv] = -1
  116. cumarrcon[sparrtmpv] = 0
  117. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  118. end
  119. elseif sparrslc[cumarrtemp] = 3 and sparrage < 5:
  120. if sparrloc[cumarrtemp] = 2:
  121. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  122. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  123. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  124. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  125. cumarrdel[sparrtmpv] = 3
  126. cumarrkno[sparrtmpv] = -1
  127. cumarrcon[sparrtmpv] = 0
  128. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  129. elseif sparrloc[cumarrtemp] = 4:
  130. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  131. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  132. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  133. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  134. cumarrdel[sparrtmpv] = 2
  135. cumarrkno[sparrtmpv] = -1
  136. cumarrcon[sparrtmpv] = 0
  137. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  138. end
  139. elseif sparrslc[cumarrtemp] = 5 and sparrage < 5:
  140. if sparrloc[cumarrtemp] = 3:
  141. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  142. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  143. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  144. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  145. cumarrdel[sparrtmpv] = 2
  146. cumarrkno[sparrtmpv] = -1
  147. cumarrcon[sparrtmpv] = 0
  148. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  149. elseif sparrloc[cumarrtemp] = 5:
  150. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  151. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  152. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  153. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  154. cumarrdel[sparrtmpv] = 3
  155. cumarrkno[sparrtmpv] = -1
  156. cumarrcon[sparrtmpv] = 0
  157. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  158. elseif sparrloc[cumarrtemp] = 6:
  159. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  160. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  161. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  162. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  163. cumarrdel[sparrtmpv] = 3
  164. cumarrkno[sparrtmpv] = -1
  165. cumarrcon[sparrtmpv] = 0
  166. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  167. end
  168. end
  169. if sparrloc[cumarrtemp] = 0 or sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  170. sparrvol[cumarrtemp] -= sparrage[cumarrtemp]/2
  171. if sparrvol[cumarrtemp] < 0:sparrvol[cumarrtemp] = 0
  172. end
  173. if sparrloc[cumarrtemp] = 0 and cumsumvag > 60: sparrslc[cumarrtemp] = 1
  174. if sparrloc[cumarrtemp] = 3 and cumsumass > 60: sparrslc[cumarrtemp] = 1
  175. if sparrloc[cumarrtemp] = 17:
  176. cumcondslip += 1
  177. if sparridt[cumarrtemp] >= 0:
  178. cumcondslip_aware = 1
  179. end
  180. if sparrage[cumarrtemp] > 48:
  181. cumcondslip_aware = 1
  182. if pcs_health > 100: pcs_health -= rand(3,sparrage[cumarrtemp] - 45)
  183. '<br><b><font color="red">You feel nauseous.</font></b>'
  184. end
  185. end
  186. if sparrloc[cumarrtemp] ! 0 and sparrloc[cumarrtemp] ! 3 and sparrloc[cumarrtemp] ! 12 and isprok = 0 and sparrage < 5: sparrslc[cumarrtemp] += 1
  187. sparrage[cumarrtemp] += 1
  188. cumarrtemp += 1
  189. ctemp[0] += sparrvol[cumarrtemp]
  190. if sparrloc[cumarrtemp] = 0: ctemp[1] += sparrvol[cumarrtemp]
  191. if sparrloc[cumarrtemp] = 3: ctemp[2] += sparrvol[cumarrtemp]
  192. else
  193. gs 'cum_cleanup', 'cleandeposit', cumarrtemp
  194. end
  195. if cumarrtemp < arrsize('sparrvol'): jump 'cumspaloop'
  196. cumsumbod = ctemp[0]
  197. cumsumvag = ctemp[1]
  198. cumsumass = ctemp[2]
  199. KILLVAR 'ctemp'
  200. end
  201. !! Breastcycle. Every breast related change with lactation happens in here.
  202. if cheat_NoLactation > 0:
  203. gs 'lact_lib','lactate_optout'
  204. else
  205. gs 'lact_lib','breastcycle'
  206. end
  207. if cycle <= 0:
  208. gs 'femcyc', 'cyc0'
  209. elseif cycle = 1:
  210. gs 'femcyc', 'cyc1'
  211. elseif cycle = 2:
  212. gs 'femcyc', 'cyc2'
  213. elseif cycle = 3:
  214. gs 'femcyc', 'cyc3'
  215. elseif cycle = 4:
  216. gs 'femcyc', 'cyc4'
  217. elseif cycle = 5:
  218. gs 'femcyc', 'preg'
  219. end
  220. dynamic $d_cycreport_update
  221. end
  222. !{Menstruation to Follicular. Verifies that the cycle is in the bloody phase. It then checks to see if you are done bleeding. If you are, it starts the Follicular phase. There is a small chance your follcular phase will be anywhere from a day to 3 days short, done by the random release of a boosted EggRH. Otherwise, it just starts it clean.}
  223. if $ARGS[0] = 'cyc0':
  224. if mesec <= 0:
  225. lastmens = daystart
  226. cycle = 1
  227. mesec = 0
  228. if rand(0,1000) = 1000:
  229. EggRH = rand(20,80)
  230. else
  231. EggRH = 0
  232. end
  233. FocH += EggRH
  234. else
  235. mesec -= 1
  236. FocH += 1
  237. end
  238. end
  239. !{Follicular to Ovulation. It checks to see if you are on the Follicular phase. If you are, it checks to see if you are ready to ovulate. If you arent, it increases your ovulation ticker by 1, then gives a random chance to increase it again. Then it checks to see if you have ovarian problems, and if you do, decreases your ovulation ticker. When all that is done, it checks to see if you have any birth control chemical, and if its above a certain amount, it reduces your ovulation ticker.}
  240. if $ARGS[0] = 'cyc1':
  241. FertEgg = 0
  242. if FocH <= FocH_Max:
  243. if pillcon <= 7000: EggRH += 1
  244. if rand(0,9) = 0: EggRH += 1
  245. FocH += 1
  246. temprand = rand(0,9) - sterileov + tempovbonus
  247. if temprand < 0:
  248. EggRH -= 1
  249. elseif temprand > 9:
  250. EggRH += 1
  251. end
  252. else
  253. !! the setting of the max_time can be here although it can be changed in the future
  254. LutH_Max = rand(312,360) & !! 13-15 days including ovulation
  255. !{If you are ready to ovulate, it creates a chance to double ovulate. That chance is increased by your age. Then it does the same for a triple ovulation. Then it sets the ovulation tag, ovulation hour count, and begins a ticker for the life of the eggs.}
  256. Temprand = rand(0,20)
  257. Temprand += age/15
  258. Temprand -= pillcon/1000
  259. if temprand > 20:
  260. EggRH += 205
  261. Temprand = rand(0,20)
  262. Temprand += age/15
  263. if temprand > 20: EggRH += 410
  264. end
  265. FocH = 0
  266. lastovulation = daystart
  267. Ovulate = 24 + rand(0,20)
  268. cycle = 2
  269. ferteggage = 0
  270. end
  271. end
  272. !!{Fertilization.}
  273. if $ARGS[0] = 'cyc2':
  274. can_sz = arrsize('$cumarrnam')
  275. if Ovulate > 0 and can_sz > 0 and UnfertEgg > 0:
  276. KILLVAR 'cumtime'
  277. KILLVAR 'cumfthname'
  278. KILLVAR '$wombpotfath'
  279. $cumfthname[0] = 'unknown'
  280. cumtime[0] = 0
  281. can_idx = 0
  282. cum_total = 0
  283. !!{Compute array of unique fathers known to PC and another two arrays of unique total fathers and their individual sperm totals from all entries in cumarrcpt for that father. Also tally all cum present.}
  284. :FatherCumAnalyze
  285. !! If the current DNA is new (no occurence in the womb array), it is added to the end of $wombDNA array, and added the amount of cum to the end of cumamount array.
  286. !! If exists, just increase the amount of cum in the womb.
  287. !! $wombDNA: sperm in womb potent enough to cause pregnancy
  288. !! wombAmount: how potent is the sperm of a guy
  289. !! $wombName: the name of the NPC
  290. y = arrsize('$wombDNA')
  291. if arrpos('$wombDNA',$npc_dna[$cumarrnam[can_idx]]) = -1:
  292. !! New guy, create place for him at the end of the array, storing his DNA, sperm amount and name
  293. $wombDNA[y] = $npc_dna[$cumarrnam[can_idx]]
  294. wombAmount[y] = cumarrcpt[can_idx]
  295. $wombName[y] = $cumarrnam[can_idx]
  296. else
  297. !! This DNA is in the womb, but does it belong to the same guy?
  298. x = 0
  299. z = 0
  300. :LocalizeLoop
  301. if $wombDNA[x] = $npc_dna[$cumarrnam[can_idx]] and $wombName[x] = $cumarrnam[can_idx]: wombAmount[x] += cumarrcpt[can_idx] & z = 1
  302. if z = 0 and x < (y - 1):x += 1 & jump 'LocalizeLoop'
  303. killvar 'x'
  304. if z = 0:
  305. !! Since the DNA and the stored name does not match at the same time, it means this is a twin situation where the twin is not in array, so put him in
  306. $wombDNA[y] = $npc_dna[$cumarrnam[can_idx]]
  307. $wombName[y] = $cumarrnam[can_idx]
  308. wombAmount[y] = cumarrcpt[can_idx]
  309. end
  310. killvar 'z'
  311. end
  312. killvar 'y'
  313. if cumarrkno[can_idx] = 1 and arrpos('$wombpotfath', $cumarrnam[can_idx]) < 0:$wombpotfath[arrsize('$wombpotfath')] = $cumarrnam[can_idx]
  314. !! If the guy is a known/possible element (PC know about the sex, it was actual sex, condom/pill was not used or condom was broken, etc.), he can be considered as father.
  315. if instr('14570',str(cumarrcon[can_idx])) > 0 and cumarrdel[can_idx] = 0 and cumarrkno[can_idx] >= 0:
  316. !! If guy is recorded already, increase his cumtime, else record him for the first time.
  317. if arrpos('$cumfthname', $cumarrnam[can_idx]) = -1:
  318. $cumfthname[arrsize('$cumfthname')] = $cumarrnam[can_idx]
  319. cumtime[arrsize('$cumfthname')] = 1
  320. else
  321. cumtime[arrpos('$cumfthname', $cumarrnam[can_idx])] += 1
  322. end
  323. end
  324. cum_total += cumarrcpt[can_idx]
  325. if can_idx < can_sz:can_idx += 1 & jump 'FatherCumAnalyze'
  326. !! setting the default believed father if there is no difficult choice or there is no choice
  327. if arrsize('$cumfthname') = 2 and cumtime[0] = 0:
  328. $wombpotfath[0] = $cumfthname[1]
  329. elseif arrsize('$cumfthname') = 1:
  330. $wombpotfath[0] = $cumfthname[0]
  331. end
  332. !!{Create lotto of potential fathers based on each potential fathers sperm as a percentage of the total. The higher percentage of sperm from a given father, the more lotto entries he will have.}
  333. KILLVAR '$cumfathlotto'
  334. cfw_idx = 0
  335. cfw_sz = arrsize('wombAmount')
  336. :FathLottoLoop
  337. if cfw_idx < cfw_sz:
  338. cfl_ct = (wombAmount[cfw_idx] * 100) / cum_total
  339. if cfl_ct < 1: cfl_ct = 1
  340. cfl_idx = arrsize('$cumfathlotto')
  341. :FathLottoAdd
  342. if cfl_ct > 0:
  343. $cumfathlotto[cfl_idx] = $wombName[cfw_idx]
  344. $cumfatherDNA[cfl_idx] = $wombDNA[cfw_idx]
  345. cfl_idx += 1
  346. cfl_ct -= 1
  347. jump 'FathLottoAdd'
  348. end
  349. cfw_idx += 1
  350. jump 'FathLottoLoop'
  351. end
  352. killvar '$wombDNA'
  353. killvar '$wombName'
  354. killvar 'wombAmount'
  355. cfl_sz = arrsize('$cumfathlotto')
  356. egg_idx = 0
  357. egg_sz = UnfertEgg
  358. if cheat_NoPregnancy = 1:egg_idx = egg_sz
  359. :FertLoop
  360. if egg_idx < egg_sz:
  361. !!{fert_thresh is the chance this specific egg is fertilized. Its modified by being on the pill, being sterilized, the brood curse, and so on. If it computes to less than the cum total calculated above, the egg is fertilized by a father randomly drawn from the lotto array.}
  362. fert_thresh = rand(1,250000)
  363. if pillcon < 0: pillcon = 0
  364. !!fert_thresh += pillcon
  365. if steriletu = 1: fert_thresh += fert_thresh*30
  366. if fert_thresh > 0 and broodcurse > 0: fert_thresh = fert_thresh / 2
  367. if fert_thresh <= cum_total:
  368. lotto_idx = rand(0, cfl_sz-1)
  369. UnfertEgg -= 1
  370. FertEgg += 1
  371. nextbaby = arrsize('$ChildFath')
  372. polkid[nextbaby] = rand(0, 1)
  373. $kidname[nextbaby] = 'unborn'
  374. kidage[nextbaby] = 0
  375. daykid[nextbaby] = 0
  376. monthkid[nextbaby] = 0
  377. yearkid[nextbaby] = 0
  378. Babyptype[nextbaby] = 0
  379. $kid_dna[nextbaby] = func('DNA', 'generate', $pcs_dna, $npc_dna[$cumfathlotto[lotto_idx]])
  380. $ChildFath[nextbaby] = $cumfathlotto[lotto_idx]
  381. $ChildFathDNA[nextbaby] = $cumfatherDNA[lotto_idx]
  382. if arrsize('$wombpotfath') = 1:
  383. $ChildThFath[nextbaby] = $wombpotfath[0]
  384. else
  385. $ChildThFath[nextbaby] = 'unknown'
  386. end
  387. hairkid[nextbaby] = rand(0, 3)
  388. eyeskid[nextbaby] = rand(0, 3)
  389. ChildConType[nextbaby] = cumarrcon[nextbaby]
  390. if fertegg > 1:
  391. $childtype[nextbaby] = 'fraternal twin'
  392. $childtype[nextbaby-1] = 'fraternal twin'
  393. else
  394. $childtype[nextbaby] = ''
  395. end
  396. end
  397. egg_idx += 1
  398. jump 'FertLoop'
  399. end
  400. killvar 'temp'
  401. tempovbonus = 0
  402. end
  403. !!{Ovulation to Luteal. It checks to see if you are on the ovulation cycle. If you are, it checks you for your pillcon. If it is high enough, no egg is released. Under high concentrations of pill chemical, ovulation ticks away quicker. Otherwise, it checks to see if your ovulation hormone is high enough, and if it is it gives you an egg and drops a good chunk down on your ovulation hormone. if its still high, it drops another egg. Then it checks your ovulation hours. If its down to 0, it starts the Luteal phase. Otherwise, it adds an hour to the egg age and reduces the ovulation window by an hour.}
  404. if pillcon > 26000 and rand(0,400) ! 0: EggRH = 0
  405. :OviLoop
  406. If EggRH > ((UnfertEgg + FertEgg) * 150):
  407. UnfertEgg += 1
  408. EggRH -= (200 * UnfertEgg)
  409. jump 'OviLoop'
  410. end
  411. If ovulate <= 0:
  412. cycle = 3
  413. UnfertEgg = 0
  414. end
  415. if fertegg = 1 and ferteggage < 330:
  416. if rand(0,(2000 - age*20)) = 0:
  417. fertegg += 1
  418. nextbaby = arrsize('$ChildFath')
  419. polkid[nextbaby] = polkid[nextbaby-1]
  420. $kidname[nextbaby] = 'unborn'
  421. kidage[nextbaby] = 0
  422. daykid[nextbaby] = 0
  423. monthkid[nextbaby] = 0
  424. yearkid[nextbaby] = 0
  425. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  426. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  427. $ChildFathDNA[nextbaby] = $ChildFathDNA[nextbaby-1]
  428. $kid_dna[nextbaby] = $kid_dna[nextbaby-1]
  429. hairkid[nextbaby] = hairkid[nextbaby-1]
  430. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  431. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  432. $childtype[nextbaby] = 'identical twin'
  433. $childtype[nextbaby-1] = 'identical twin'
  434. end
  435. end
  436. ferteggage += 1
  437. Ovulate -= 1
  438. LutH += 1
  439. end
  440. !{Luteal to Menstration or Pregnancy. First it verifies this is the Luteal phase. Then it adds an hour to the age of the eggs. Then if there is a fertized egg, it rolls a random chance. if the egg age is low, it checks for risk of an entopic pregnancy. This is increased with older age and if you have a tubal ligation sterilization.}
  441. !{If there is an ectopic pregnancy, it sets the first unborn baby in the array to this. Ectopic pregnancies occur when the fertilized egg implants "too early" after fertlization (and therefore in the fallopian tube). The risk is higher with age, but this is also a common complication with certain forms of birth control, notably tubal ligation. Each egg could be different. It then removes the fertilized egg, adds an embryo, Then it adds some pregnancy hormone if you arent already pregnant, and calls you officially pregnant.}
  442. !{Otherwise, it adds your womb sterility factor to the imp_rand. Then it checks if your imp_rand crosses a threshold for implantation. Younger women implant easier. It then sets the next baby to the next unimplanted baby in your kid array. It registers the kid as a normal pregnancy, removes a fertilized egg and adds an embryo. Then it adds some pregnancy hormone if you arent already pregnant, and calls you officially pregnant.}
  443. if $ARGS[0] = 'cyc3':
  444. if fertegg = 1 and ferteggage < 330:
  445. if rand(0,(2000 - age*20)) = 0:
  446. fertegg += 1
  447. nextbaby = arrsize('$ChildFath')
  448. polkid[nextbaby] = polkid[nextbaby-1]
  449. $kidname[nextbaby] = 'unborn'
  450. kidage[nextbaby] = 0
  451. daykid[nextbaby] = 0
  452. monthkid[nextbaby] = 0
  453. yearkid[nextbaby] = 0
  454. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  455. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  456. $ChildFathDNA[nextbaby] = $ChildFathDNA[nextbaby-1]
  457. $kid_dna[nextbaby] = $kid_dna[nextbaby-1]
  458. hairkid[nextbaby] = hairkid[nextbaby-1]
  459. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  460. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  461. $childtype[nextbaby] = 'identical twin'
  462. $childtype[nextbaby-1] = 'identical twin'
  463. end
  464. end
  465. ferteggage += 1
  466. implant_idx = 0
  467. implant_sz = arrsize('Babyptype')
  468. :implant_loop
  469. if implant_idx < implant_sz:
  470. if Babyptype[implant_idx] = 0:
  471. imp_rand = rand(0,120000)
  472. if ferteggage < 120 and broodcurse <= 0:
  473. imp_rand += 170
  474. imp_rand -= age * 10
  475. if steriletu = 1: imp_rand -= 200
  476. if imp_rand <= 0:
  477. Babyptype[implant_idx] = 2
  478. FertEgg -= 1
  479. babyembryo += 1
  480. PregChem = rand(10,30)
  481. if preg = 0: preg = 1
  482. implant_day = daystart
  483. implant_hour = hour
  484. end
  485. else
  486. imp_rand += sterilewb
  487. imp_rand -= tempwbbonus
  488. if broodcurse > 0 and ferteggage >= 120: imp_rand = 0
  489. if imp_rand <= (1200 - (age * 7)):
  490. Babyptype[implant_idx] = 1
  491. FertEgg -= 1
  492. babyembryo += 1
  493. PregChem = rand(10,30)
  494. if preg = 0: preg = 1
  495. implant_day = daystart
  496. implant_hour = hour
  497. end
  498. tempwbbonus = 0
  499. end
  500. end
  501. implant_idx += 1
  502. jump 'implant_loop'
  503. end
  504. !!{Then, it progresses the Luteal phase. It checks to see if you are pregnant. If you are, it ends the cycle and sets preg if your Luteal hormone is at the max as well as cleans out any unimplanted eggs. Otherwise, it just progresses pregnancy chemical and Luteal Hormone. If you arent pregnant, it checks your Luteal hormone. If its at the maximum, it adds 3-5 days of bleeding, clears out your unimplanted eggs, and clears out your Luteal hormone, or ends your cycle if you are past your menopausal age. Otherwise it will just progress the Luteal hormone.}
  505. if LutH > LutH_Max:
  506. rej_idx = 0
  507. rej_sz = arrsize('Babyptype')
  508. :lutcycloop
  509. if rej_idx < rej_sz:
  510. if Babyptype[rej_idx] = 0:
  511. KILLVAR 'polkid',tempbabyi
  512. KILLVAR '$kidname',tempbabyi
  513. KILLVAR 'kidage',tempbabyi
  514. KILLVAR 'daykid',tempbabyi
  515. KILLVAR 'monthkid',tempbabyi
  516. KILLVAR 'yearkid',tempbabyi
  517. KILLVAR 'Babyptype',tempbabyi
  518. KILLVAR '$ChildFath',tempbabyi
  519. KILLVAR '$ChildThFath',tempbabyi
  520. KILLVAR 'hairkid',tempbabyi
  521. KILLVAR 'eyeskid',tempbabyi
  522. KILLVAR 'cumarrcon',tempbabyi
  523. FertEgg -= 1
  524. end
  525. rej_idx += 1
  526. jump 'lutcycloop'
  527. end
  528. LutH = 0
  529. if preg = 1:
  530. cycle = 5
  531. elseif menoage <= age:
  532. KILLVAR '$wombpotfath'
  533. killvar '$cumfthname'
  534. killvar '$cumfthusedname'
  535. killvar 'cumtime'
  536. cycle = 6
  537. else
  538. KILLVAR '$wombpotfath'
  539. killvar '$cumfthname'
  540. killvar '$cumfthusedname'
  541. killvar 'cumtime'
  542. !! the setting of the max_time can be here although it can be changed in the future
  543. FocH_Max = rand(312,360) & !! 13-15 days including menstruation
  544. temprand = rand(0,10)
  545. if pillcon >= 38000 or rand(1,24) = 1:
  546. EggRH = 0
  547. cycle = 1
  548. mesec = 0
  549. else
  550. cycle = 0
  551. killvar 'abortionbirthdate'
  552. if cyccustom = 1: daylastperiod = daystart
  553. firstmens = daystart
  554. temprand = rand(0,10)
  555. if temprand = 0 and pillcon < 10000:
  556. mesec = rand(104,136) & !! 120
  557. elseif temprand < 9 and pillcon < 15000:
  558. mesec = rand(76,104) & !! 96
  559. elseif pillcon < 20000:
  560. mesec = rand(52,76) & !! 72
  561. else
  562. mesec = rand(44,52) & !! 48
  563. end
  564. end
  565. end
  566. else
  567. if preg = 1:PregChem += 1+pregspeedcheat
  568. if rand(0,100) < 100: LutH += 1
  569. end
  570. end
  571. !{Recovery to Follicular. It checks to see if you are in the recovery phase after a pregnancy. If you are, it checks to see if you still have recovery hormone. If you dont, it sets you into the follicular phase with a chance of a boosted Egg releasing hormone. Otherwise it decreases your recovery hormone with a chance to decrease it twice.}
  572. if $ARGS[0] = 'cyc4':
  573. if RecovH <= 0:
  574. cycle = 1
  575. if cyccustom = 1:
  576. knowpregloss = 0
  577. knowpregrecover = 0
  578. end
  579. if rand(0,1000) = 1000:
  580. EggRH = rand(20,80)
  581. else
  582. EggRH = 0
  583. end
  584. FocH = EggRH
  585. else
  586. RecovH -= 1
  587. if rand(0,10) = 0: RecovH -= 1
  588. end
  589. end
  590. !{Pregnancy Progression. It checks to see if you are in the pregnancy phase of a cycle. If you are, it progresses your pregnancy chemical. Then it gives a fluxuation of possible due dates. If you cross the due date threshold, you enter labor, marked by preg = 2. Other milestones will also be placed in here, including body deformations. Right now this is mostly an empty placeholder.}
  591. if $ARGS[0] = 'preg':
  592. if fertegg = 1 and ferteggage < 330:
  593. if rand(0,(2000 - age*20)) = 0:
  594. babyembryo += 1
  595. PregChem += rand(10,30)
  596. nextbaby = arrsize('$ChildFath')
  597. polkid[nextbaby] = polkid[nextbaby-1]
  598. $kidname[nextbaby] = 'unborn'
  599. kidage[nextbaby] = 0
  600. daykid[nextbaby] = 0
  601. monthkid[nextbaby] = 0
  602. yearkid[nextbaby] = 0
  603. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  604. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  605. hairkid[nextbaby] = hairkid[nextbaby-1]
  606. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  607. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  608. $childtype[nextbaby] = 'identical twin'
  609. $childtype[nextbaby-1] = 'identical twin'
  610. end
  611. end
  612. PregChem += (1+pregspeedcheat)
  613. temprand = rand(-400,800)
  614. temprand -= (babyembryo-1)*588
  615. if PregChem > 6573 + temprand and preg ! 2:
  616. 'A sharp pain pierces your abdomen, and you feel something flow down your legs. Your water has broken!'
  617. !! switch on lactation if not already active.
  618. if lactation['active'] < 1: func('lact_lib','lact_switch')
  619. $cycreport_txt = 'In labour'
  620. arrmodtmp =arrsize('$ChildFath')
  621. arrmodtmp -= (babyembryo+1)
  622. :babyfinalpreploop
  623. if arrmodtmp < arrsize('$ChildFath') and daykid[arrmodtmp] = 0:
  624. daykid[arrmodtmp] = 42
  625. $ChildThFath[arrmodtmp] = $wombthfath
  626. arrmodtmp += 1
  627. jump 'babyfinalpreploop'
  628. end
  629. KILLVAR '$wombpotfath'
  630. KILLVAR '$wombthfath'
  631. preg = 2
  632. pregminut = totminut + 1440
  633. if babyembryo > 1:
  634. 'Your babies are coming...'
  635. else
  636. 'Your baby is coming...'
  637. end
  638. if PregChem < 3885:
  639. 'Way too early!'
  640. elseif PregChem < 5229:
  641. 'Very early!'
  642. elseif PregChem < 6069:
  643. 'Early.'
  644. elseif PregChem > 6959:
  645. 'Late.'
  646. elseif PregChem > 7245:
  647. 'Very Late!'
  648. end
  649. 'You need to get to a clinic.'
  650. end
  651. if PregChem > 2203:
  652. if pregchem > 2853 or kid > 0:
  653. if rand(0,7) = 0: dynamic $d_pregmovement
  654. else
  655. if rand(0,500) = 0: dynamic $d_pregmovement
  656. end
  657. end
  658. end
  659. --- femcyc ---------------------------------