femcyc.qsrc 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946
  1. # femcyc
  2. !! I have to initialize the variables somewhere, maybe in preCUST?
  3. if Luth_Max = 0: LutH_Max = rand(312,360) & !! 13-15 days including ovulation
  4. if Foch_Max = 0: FocH_Max = rand(312,360) & !! 13-15 days including menstruation
  5. if $ARGS[0] = '':
  6. !{Hourly reduction in semen potency}
  7. !{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.}
  8. !{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.}
  9. !{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.}
  10. !{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.}
  11. if rcntorgzm = 1:
  12. if rcntorgzmtmp = 1: rcntorgzm = 0 & rcntorgzmtmp = 0
  13. if rcntorgzmtmp = 0: rcntorgzmtmp = 1
  14. end
  15. cumarr_idx = 0
  16. :cumarrloop
  17. if cumarr_idx < arrsize('$cumarrnam'):
  18. if cumarrcpt[cumarr_idx] > 0 and cumarrage[cumarr_idx] < 144:
  19. if rcntorgzm = 1 and cumarrcpt[cumarr_idx] < cumarrppt[cumarr_idx] and cumarrage[cumarr_idx] < 1: cumarrcpt[cumarr_idx] += cumarrppt[cumarr_idx] / 12
  20. cumpdrop = cumarrcpt[cumarr_idx] / (144 - cumarrage[cumarr_idx])
  21. if cycle ! 2: cumpdrop += cumpdrop * rand(0, 2)
  22. cumarrcpt[cumarr_idx] -= cumpdrop
  23. if cumarrcpt[cumarr_idx] <= 0:
  24. gs 'cum_cleanup', 'cleanwomb', cumarr_idx
  25. else
  26. cumarrage[cumarr_idx] += 1
  27. cumarr_idx += 1
  28. end
  29. else
  30. gs 'cum_cleanup', 'cleanwomb', cumarr_idx
  31. end
  32. jump 'cumarrloop'
  33. end
  34. !!Succubus absorption of sperm in womb
  35. if succubusflag = 1:
  36. if arrsize('cumarrppt') > 0:
  37. succycletmp = 0
  38. :sucvagabs
  39. if cumarrdel[succycletmp] = 0:
  40. if cumarrcpt[succycletmp] > 10000:
  41. sexnutrition += 30 * succublvl
  42. succubxp += 3
  43. elseif cumarrcpt[succycletmp] < 3000 and cumarrcpt[succycletmp] > 1000:
  44. sexnutrition += 5 * succublvl
  45. succubxp += 2
  46. elseif cumarrcpt[succycletmp] =< 1000:
  47. sexnutrition += succublvl
  48. else
  49. sexnutrition += 25 * succublvl
  50. succubxp += 3
  51. end
  52. gs 'cum_cleanup', 'cleanwomb', succycletmp
  53. sucabscum = 1
  54. else
  55. succycletmp += 1
  56. end
  57. if succycletmp < arrsize('cumarrppt'): jump 'sucvagabs'
  58. end
  59. killvar 'succycletmp'
  60. end
  61. cumarrtemp = 0
  62. cumcondslip = 0
  63. cumcondslip_aware = 0
  64. if arrsize('sparrvol') > 0:
  65. :cumspaloop
  66. !!Succubus absorption for internal locations other than womb
  67. if succubusflag = 1:
  68. if sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  69. sexnutrition += 25*succublvl
  70. succubxp += 3
  71. sucabscum = 1
  72. if sparrvol[cumarrtemp] > 0: sparrvol[cumarrtemp] = 0
  73. end
  74. end
  75. !!{if sparrloc[cumarrtemp] = 0 or sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  76. sexnutrition += 30*succublvl
  77. sparrvol[cumarrtemp] -= 30*succublvl
  78. if sparrvol[cumarrtemp] < 0: sexnutrition += sparrvol[cumarrtemp] & sparrvol[cumarrtemp] = 0
  79. end}
  80. !!{ Process spatter until it has volume or is too old in vagina. }
  81. if sparrvol[cumarrtemp] > 0 or (sparrloc[cumarrtemp] = 0 and sparrage[cumarrtemp] < 10):
  82. sparrtmpv = arrsize('$cumarrnam')
  83. if sparrloc[cumarrtemp] = 17:
  84. sparrtmpv = arrpos('cumarrcnt',sparrcnt[cumarrtemp])
  85. if sparrtmpv >= 0:
  86. !!'Found guy id <<sparrtmpv>>'
  87. if sparrage[cumarrtemp] < 4:
  88. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/5
  89. elseif sparrage[cumarrtemp] < 10:
  90. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/30
  91. end
  92. end
  93. elseif sparrloc[cumarrtemp] = 0:
  94. sparrtmpv = arrpos('cumarrcnt',sparrcnt[cumarrtemp])
  95. if sparrtmpv >= 0:
  96. !!'Found guy id' & sparrtmpv
  97. if sparrage[cumarrtemp] < 4:
  98. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/40
  99. elseif sparrage[cumarrtemp] < 10:
  100. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/60
  101. end
  102. end
  103. elseif sparrslc[cumarrtemp] = 1 and sparrage < 5:
  104. if sparrloc[cumarrtemp] = 1:
  105. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  106. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  107. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  108. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  109. cumarrdel[sparrtmpv] = 1
  110. cumarrkno[sparrtmpv] = -1
  111. cumarrcon[sparrtmpv] = 0
  112. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  113. end
  114. elseif sparrslc[cumarrtemp] = 3 and sparrage < 5:
  115. if sparrloc[cumarrtemp] = 2:
  116. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  117. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  118. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  119. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  120. cumarrdel[sparrtmpv] = 3
  121. cumarrkno[sparrtmpv] = -1
  122. cumarrcon[sparrtmpv] = 0
  123. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  124. elseif sparrloc[cumarrtemp] = 4:
  125. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  126. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  127. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  128. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  129. cumarrdel[sparrtmpv] = 2
  130. cumarrkno[sparrtmpv] = -1
  131. cumarrcon[sparrtmpv] = 0
  132. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  133. end
  134. elseif sparrslc[cumarrtemp] = 5 and sparrage < 5:
  135. if sparrloc[cumarrtemp] = 3:
  136. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  137. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  138. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  139. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  140. cumarrdel[sparrtmpv] = 2
  141. cumarrkno[sparrtmpv] = -1
  142. cumarrcon[sparrtmpv] = 0
  143. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  144. elseif sparrloc[cumarrtemp] = 5:
  145. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  146. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  147. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  148. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  149. cumarrdel[sparrtmpv] = 3
  150. cumarrkno[sparrtmpv] = -1
  151. cumarrcon[sparrtmpv] = 0
  152. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  153. elseif sparrloc[cumarrtemp] = 6:
  154. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  155. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  156. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  157. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  158. cumarrdel[sparrtmpv] = 3
  159. cumarrkno[sparrtmpv] = -1
  160. cumarrcon[sparrtmpv] = 0
  161. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  162. end
  163. end
  164. if sparrloc[cumarrtemp] = 0 or sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  165. sparrvol[cumarrtemp] -= sparrage[cumarrtemp]/2
  166. if sparrvol[cumarrtemp] < 0:sparrvol[cumarrtemp] = 0
  167. end
  168. if sparrloc[cumarrtemp] = 0 and cumsumvag > 60: sparrslc[cumarrtemp] = 1
  169. if sparrloc[cumarrtemp] = 3 and cumsumass > 60: sparrslc[cumarrtemp] = 1
  170. if sparrloc[cumarrtemp] = 17:
  171. cumcondslip += 1
  172. if sparridt[cumarrtemp] >= 0:
  173. cumcondslip_aware = 1
  174. end
  175. if sparrage[cumarrtemp] > 48:
  176. cumcondslip_aware = 1
  177. pcs_health -= rand(3,sparrage[cumarrtemp] - 45)
  178. '<br><b><font color="red">You feel nauseous.</font></b>'
  179. end
  180. end
  181. if sparrloc[cumarrtemp] ! 0 and sparrloc[cumarrtemp] ! 3 and sparrloc[cumarrtemp] ! 12 and isprok = 0 and sparrage < 5: sparrslc[cumarrtemp] += 1
  182. sparrage[cumarrtemp] += 1
  183. cumarrtemp += 1
  184. ctemp[0] += sparrvol[cumarrtemp]
  185. if sparrloc[cumarrtemp] = 0: ctemp[1] += sparrvol[cumarrtemp]
  186. if sparrloc[cumarrtemp] = 3: ctemp[2] += sparrvol[cumarrtemp]
  187. else
  188. gs 'cum_cleanup', 'cleandeposit', cumarrtemp
  189. end
  190. if cumarrtemp < arrsize('sparrvol'): jump 'cumspaloop'
  191. cumsumbod = ctemp[0]
  192. cumsumvag = ctemp[1]
  193. cumsumass = ctemp[2]
  194. KILLVAR 'ctemp'
  195. end
  196. !! new milkgrowday function.
  197. !! Not lactating yet, but there was milkdemand, meaning someone worked your nipples and breasts.
  198. if lactate = 0 and milkoverdemand >= 0 and prolactinlvl >= 0:
  199. if milkgrowday < daystart:
  200. prolactinlvl += milkoverdemand/200
  201. !! as long as your tits are not over 11 growth will happen to them. If you do not pump or no pregnancy happens, no growth will happen.
  202. if milkoverdemand = 0 and pregchem = 0 and tits < 11:
  203. temp_var = prolactinlvl - 10
  204. if temp_var < 0:
  205. prolactinlvl = 0
  206. end
  207. !! if prolactinlvl is sinking too much, the aveoli will deflate and thus the breasts growth is reverted. This only counts for induced lactation. If natural lactation occurs breasts will shrink a bit too, but stay bigger in total.
  208. if prolactinlvl < 75 and total_milkinduce_growth > 0:
  209. nbsize -= total_milkinduce_growth
  210. prolactinlvl -= 10
  211. total_milkinduce_growth = 0
  212. else
  213. prolactinlvl -= 10
  214. end
  215. milkoverdemand = 0
  216. milkgrowday = daystart
  217. elseif milkoverdemand > 0 and pregchem = 0 and tits < 11:
  218. !! inducing without ever being pregnant
  219. if prolactinlvl > 75 and kid <= 0:
  220. if total_milkinduce_growth < 8:
  221. total_milkinduce_growth += 1 + pumpinggrowth
  222. nbsize += 1 + pumpinggrowth
  223. pumpinggrowth = 0
  224. else
  225. pumpinggrowth = 0
  226. end
  227. !! inducing after being pregnant
  228. elseif prolactinlvl > 75 and kid > 0:
  229. if total_milkinduce_growth < (total_preg_growth/2):
  230. total_milkinduce_growth += 1 + pumpinggrowth
  231. nbsize += 1 + pumpinggrowth
  232. pumpinggrowth = 0
  233. end
  234. end
  235. milkoverdemand = 0
  236. elseif milkoverdemand >= 0 and pregchem > 0 and tits < 11:
  237. if prolactinlvl > 75 and pregchem < 3000 and kid <= 0:
  238. if total_milkinduce_growth < 8:
  239. total_milkinduce_growth += 1 + pumpinggrowth
  240. nbsize += 1 + pumpinggrowth
  241. pumpinggrowth = 0
  242. else
  243. pumpinggrowth = 0
  244. end
  245. !! first breast growth with first pregnancy
  246. elseif prolactinlvl >= 75 and pregchem >= 2000 and pregchem < 3000 and kid <= 0:
  247. if rand(0,100) > 55:
  248. first_preg_growth += 1
  249. total_preg_growth += 1
  250. if total_preg_growth > total_milkinduce_growth: nbsize += 1
  251. end
  252. !! there is little chance your breast grow additional sizes if you have more kids.
  253. elseif prolactinlvl >= 75 and pregchem >= 2000 and pregchem < 3000 and kid > 0:
  254. if first_preg_growth > total_preg_growth:
  255. total_preg_growth += 1
  256. if total_preg_growth > total_milkinduce_growth: nbsize += 1
  257. else
  258. if rand(0,100) > 95:
  259. total_preg_growth += 1
  260. if total_preg_growth > total_milkinduce_growth: nbsize += 1
  261. end
  262. end
  263. !! inducing after being pregnant
  264. elseif prolactinlvl > 75 and pregchem =< 3000 and kid > 0:
  265. if total_milkinduce_growth < (total_preg_growth/2):
  266. total_milkinduce_growth += 1 + pumpinggrowth
  267. nbsize += 1 + pumpinggrowth
  268. pumpinggrowth = 0
  269. end
  270. end
  271. milkoverdemand = 0
  272. milkgrowday = daystart
  273. end
  274. milkgrowday = daystart
  275. else
  276. milkgrowday = daystart
  277. end
  278. elseif lactate > 0 and milkoverdemand => 0 and prolactinlvl >= 0:
  279. lactatemm = func('lact_lib','$calc_lactatemm')
  280. !! checking if induced or not and if girl went through pregnancy already.
  281. if lactateinduced > 0 and kid <= 0:
  282. if milkgrowday < daystart:
  283. !! first breast growth with first pregnancy
  284. if prolactinlvl >= 75 and pregchem >= 2000 and pregchem < 3000 and kid <= 0:
  285. if rand(0,100) > 55:
  286. first_preg_growth += 1
  287. total_preg_growth += 1
  288. if total_preg_growth > total_milkinduce_growth: nbsize += 1
  289. end
  290. end
  291. if lactatemm > lactatemv and salo > 11:
  292. lactatemv += lactaterate
  293. temp_var = lactaterate/100
  294. if temp_var <= 0: temp_var = 1
  295. pcs_energy -= temp_var
  296. if lactatemv > lactatemm: lactatemv = lactatemm
  297. end
  298. if milkoverdemand > 0 and breastpumped > 0:
  299. !! lactationrate growing, so you make more milk the more demand there was in the day before.
  300. temp_var = prolactinlvl + milkoverdemand/20
  301. if temp_var > 120:
  302. prolactinlvl += milkoverdemand/20
  303. !! uppon reaching a specific limit, the lactationrate will grow slower. Human body limits etc... you know
  304. if lactaterate > 3500:
  305. lactaterate += 5*(prolactinlvl/200)
  306. elseif lactaterate > 6000:
  307. lactaterate += prolactinlvl/200
  308. else
  309. lactaterate += 10*(prolactinlvl/200)
  310. end
  311. prolactinlvl = 100
  312. else
  313. prolactinlvl = 100
  314. end
  315. 'Your breasts tingle a bit more from milkproduction.'
  316. elseif milkoverdemand = 0 and breastpumped > 0:
  317. prolactinlvl = 100
  318. elseif milkoverdemand = 0 and breastpumped = 0:
  319. if lactaterate > 0 and pregchem >=0:
  320. temp_var = lactaterate/4
  321. if temp_var < 1:temp_var = 0
  322. lactaterate = temp_var
  323. 'Your breasts tingle a little less from milkproduction.'
  324. elseif lactaterate = 0 and pregchem < 1000:
  325. lactate = 0
  326. lactateinduced = 0
  327. nbsize -= total_milkinduce_growth
  328. 'You notice that you stopped lactating.'
  329. elseif lactaterate = 0 and pregchem >= 1000:
  330. lactaterate = 1
  331. else
  332. lactaterate = 0
  333. end
  334. end
  335. milkgrowday = daystart
  336. milkoverdemand = 0
  337. breastpumped = 0
  338. else
  339. milkgrowday = daystart
  340. if lactatemm >= lactatemv and salo > 11:
  341. lactatemv += lactaterate
  342. if lactatemv > lactatemm:
  343. lactatemv = lactatemm
  344. lact_engorgement += 1
  345. if lact_engorgement > 2: lactatemess += 1
  346. end
  347. end
  348. end
  349. milkgrowday = daystart
  350. else
  351. if milkgrowday < daystart:
  352. if lactatemm > lactatemv and salo > 11:
  353. lactatemv += lactaterate
  354. temp_var = lactaterate/100
  355. if temp_var <= 0: temp_var = 1
  356. pcs_energy -= temp_var
  357. if lactatemv > lactatemm: lactatemv = lactatemm
  358. end
  359. if milkoverdemand > 0 and breastpumped > 0:
  360. !! lactationrate growing, so you make more milk the more demand there was in the day before.
  361. temp_var = prolactinlvl + milkoverdemand/10
  362. if temp_var > rand(150,200):
  363. prolactinlvl += milkoverdemand/20
  364. !! uppon reaching a specific limit, the lactationrate will grow slower. Human body limits etc... you know :D
  365. if lactaterate > 3500:
  366. lactaterate += 5*(prolactinlvl/200)
  367. elseif lactaterate > 6000:
  368. lactaterate += prolactinlvl/200
  369. else
  370. lactaterate += 10*(prolactinlvl/200)
  371. end
  372. prolactinlvl = 100
  373. else
  374. prolactinlvl = 100
  375. end
  376. 'Your breasts tingle a bit more from milkproduction.'
  377. elseif milkoverdemand = 0 and breastpumped > 0:
  378. prolactinlvl = 100
  379. else
  380. if lactaterate > 0 and pregchem >= 0:
  381. temp_var = lactaterate/8
  382. if temp_var < 1:temp_var = 0
  383. lactaterate = temp_var
  384. milkoverdemand = 0
  385. 'Your breasts tingle a little less from milkproduction.'
  386. elseif lactaterate = 0 and pregchem < 1000:
  387. lactate = 0
  388. lactateinduced = 0
  389. if total_milkinduce_growth > 0: nbsize -= total_milkinduce_growth
  390. if total_preg_growth > 0:
  391. nbsize -= total_preg_growth
  392. nbsize += first_preg_growth/2
  393. end
  394. total_milkinduce_growth = 0
  395. milkoverdemand = 0
  396. 'You stopped lactating.'
  397. elseif lactaterate = 0 and pregchem >= 1000:
  398. lactaterate = 1
  399. else
  400. lactaterate = 0
  401. end
  402. end
  403. milkgrowday = daystart
  404. milkoverdemand = 0
  405. breastpumped = 0
  406. else
  407. milkgrowday = daystart
  408. if lactatemm >= lactatemv and salo > 11:
  409. lactatemv += lactaterate
  410. if lactatemv > lactatemm:
  411. lactatemv = lactatemm
  412. lact_engorgement += 1
  413. if lact_engorgement > 2: lactatemess += 1
  414. end
  415. end
  416. end
  417. milkgrowday = daystart
  418. end
  419. milkgrowday = daystart
  420. end
  421. if cycle <= 0:
  422. gs 'femcyc', 'cyc0'
  423. elseif cycle = 1:
  424. gs 'femcyc', 'cyc1'
  425. elseif cycle = 2:
  426. gs 'femcyc', 'cyc2'
  427. elseif cycle = 3:
  428. gs 'femcyc', 'cyc3'
  429. elseif cycle = 4:
  430. gs 'femcyc', 'cyc4'
  431. elseif cycle = 5:
  432. gs 'femcyc', 'preg'
  433. end
  434. dynamic $d_cycreport_update
  435. end
  436. !{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.}
  437. if $ARGS[0] = 'cyc0':
  438. if mesec <= 0:
  439. lastmens = daystart
  440. cycle = 1
  441. mesec = 0
  442. if rand(0,1000) = 1000:
  443. EggRH = rand(20,80)
  444. else
  445. EggRH = 0
  446. end
  447. FocH += EggRH
  448. else
  449. mesec -= 1
  450. FocH += 1
  451. end
  452. end
  453. !{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.}
  454. if $ARGS[0] = 'cyc1':
  455. FertEgg = 0
  456. if FocH <= FocH_Max:
  457. if pillcon <= 7000: EggRH += 1
  458. if rand(0,9) = 0: EggRH += 1
  459. FocH += 1
  460. temprand = rand(0,9) - sterileov + tempovbonus
  461. if temprand < 0:
  462. EggRH -= 1
  463. elseif temprand > 9:
  464. EggRH += 1
  465. end
  466. else
  467. !! the setting of the max_time can be here although it can be changed in the future
  468. LutH_Max = rand(312,360) & !! 13-15 days including ovulation
  469. !{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.}
  470. Temprand = rand(0,20)
  471. Temprand += age/15
  472. Temprand -= pillcon/1000
  473. if temprand > 20:
  474. EggRH += 205
  475. Temprand = rand(0,20)
  476. Temprand += age/15
  477. if temprand > 20: EggRH += 410
  478. end
  479. FocH = 0
  480. Ovulate = 24 + rand(0,20)
  481. cycle = 2
  482. ferteggage = 0
  483. end
  484. end
  485. !!{Fertilization.}
  486. if $ARGS[0] = 'cyc2':
  487. can_sz = arrsize('$cumarrnam')
  488. if Ovulate > 0 and can_sz > 0 and UnfertEgg > 0:
  489. KILLVAR 'cumtime'
  490. KILLVAR 'cumfthname'
  491. KILLVAR '$wombpotfath'
  492. $cumfthname[0] = 'unknown'
  493. cumtime[0] = 0
  494. can_idx = 0
  495. cum_total = 0
  496. !!{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.}
  497. :FatherCumAnalyze
  498. !! 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.
  499. !! If exists, just increase the amount of cum in the womb.
  500. !! $wombDNA: sperm in womb potent enough to cause pregnancy
  501. !! wombAmount: how potent is the sperm of a guy
  502. !! $wombName: the name of the NPC
  503. y = arrsize('$wombDNA')
  504. if arrpos('$wombDNA',$npc_dna[$cumarrnam[can_idx]]) = -1:
  505. !! New guy, create place for him at the end of the array, storing his DNA, sperm amount and name
  506. $wombDNA[y] = $npc_dna[$cumarrnam[can_idx]]
  507. wombAmount[y] = cumarrcpt[can_idx]
  508. $wombName[y] = $cumarrnam[can_idx]
  509. else
  510. !! This DNA is in the womb, but does it belong to the same guy?
  511. x = 0
  512. z = 0
  513. :LocalizeLoop
  514. if $wombDNA[x] = $npc_dna[$cumarrnam[can_idx]] and $wombName[x] = $cumarrnam[can_idx]: wombAmount[x] += cumarrcpt[can_idx] & z = 1
  515. if z = 0 and x < (y - 1):x += 1 & jump 'LocalizeLoop'
  516. killvar 'x'
  517. if z = 0:
  518. !! 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
  519. $wombDNA[y] = $npc_dna[$cumarrnam[can_idx]]
  520. $wombName[y] = $cumarrnam[can_idx]
  521. wombAmount[y] = cumarrcpt[can_idx]
  522. end
  523. killvar 'z'
  524. end
  525. killvar 'y'
  526. if cumarrkno[can_idx] = 1 and arrpos('$wombpotfath', $cumarrnam[can_idx]) < 0:$wombpotfath[arrsize('$wombpotfath')] = $cumarrnam[can_idx]
  527. !! 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.
  528. if instr('14570',str(cumarrcon[can_idx])) > 0 and cumarrdel[can_idx] = 0 and cumarrkno[can_idx] >= 0:
  529. !! If guy is recorded already, increase his cumtime, else record him for the first time.
  530. if arrpos('$cumfthname', $cumarrnam[can_idx]) = -1:
  531. $cumfthname[arrsize('$cumfthname')] = $cumarrnam[can_idx]
  532. cumtime[arrsize('$cumfthname')] = 1
  533. else
  534. cumtime[arrpos('$cumfthname', $cumarrnam[can_idx])] += 1
  535. end
  536. end
  537. cum_total += cumarrcpt[can_idx]
  538. if can_idx < can_sz:can_idx += 1 & jump 'FatherCumAnalyze'
  539. !! setting the default believed father if there is no difficult choice or there is no choice
  540. if arrsize('$cumfthname') = 2 and cumtime[0] = 0:
  541. $wombpotfath[0] = $cumfthname[1]
  542. elseif arrsize('$cumfthname') = 1:
  543. $wombpotfath[0] = $cumfthname[0]
  544. end
  545. !!{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.}
  546. KILLVAR '$cumfathlotto'
  547. cfw_idx = 0
  548. cfw_sz = arrsize('wombAmount')
  549. :FathLottoLoop
  550. if cfw_idx < cfw_sz:
  551. cfl_ct = (wombAmount[cfw_idx] * 100) / cum_total
  552. if cfl_ct < 1: cfl_ct = 1
  553. cfl_idx = arrsize('$cumfathlotto')
  554. :FathLottoAdd
  555. if cfl_ct > 0:
  556. $cumfathlotto[cfl_idx] = $wombName[cfw_idx]
  557. $cumfatherDNA[cfl_idx] = $wombDNA[cfw_idx]
  558. cfl_idx += 1
  559. cfl_ct -= 1
  560. jump 'FathLottoAdd'
  561. end
  562. cfw_idx += 1
  563. jump 'FathLottoLoop'
  564. end
  565. killvar '$wombDNA'
  566. killvar '$wombName'
  567. killvar 'wombAmount'
  568. cfl_sz = arrsize('$cumfathlotto')
  569. egg_idx = 0
  570. egg_sz = UnfertEgg
  571. if cheat_NoPregnancy = 1:egg_idx = egg_sz
  572. :FertLoop
  573. if egg_idx < egg_sz:
  574. !!{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.}
  575. fert_thresh = rand(1,250000)
  576. if pillcon < 0: pillcon = 0
  577. !!fert_thresh += pillcon
  578. if steriletu = 1: fert_thresh += fert_thresh*30
  579. if fert_thresh > 0 and broodcurse > 0: fert_thresh = fert_thresh / 2
  580. if fert_thresh <= cum_total:
  581. lotto_idx = rand(0, cfl_sz-1)
  582. UnfertEgg -= 1
  583. FertEgg += 1
  584. nextbaby = arrsize('$ChildFath')
  585. polkid[nextbaby] = rand(0, 1)
  586. $kidname[nextbaby] = 'unborn'
  587. kidage[nextbaby] = 0
  588. daykid[nextbaby] = 0
  589. monthkid[nextbaby] = 0
  590. yearkid[nextbaby] = 0
  591. Babyptype[nextbaby] = 0
  592. $kid_dna[nextbaby] = func('DNA', 'generate', $pcs_dna, $npc_dna[$cumfathlotto[lotto_idx]])
  593. $ChildFath[nextbaby] = $cumfathlotto[lotto_idx]
  594. $ChildFathDNA[nextbaby] = $cumfatherDNA[lotto_idx]
  595. if arrsize('$wombpotfath') = 1:
  596. $ChildThFath[nextbaby] = $wombpotfath[0]
  597. else
  598. $ChildThFath[nextbaby] = 'unknown'
  599. end
  600. hairkid[nextbaby] = rand(0, 3)
  601. eyeskid[nextbaby] = rand(0, 3)
  602. ChildConType[nextbaby] = cumarrcon[nextbaby]
  603. if fertegg > 1:
  604. $childtype[nextbaby] = 'paternal twin'
  605. $childtype[nextbaby-1] = 'paternal twin'
  606. else
  607. $childtype[nextbaby] = ''
  608. end
  609. end
  610. egg_idx += 1
  611. jump 'FertLoop'
  612. end
  613. killvar 'temp'
  614. tempovbonus = 0
  615. end
  616. !!{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.}
  617. if pillcon > 26000 and rand(0,400) ! 0: EggRH = 0
  618. :OviLoop
  619. If EggRH > ((UnfertEgg + FertEgg) * 150):
  620. UnfertEgg += 1
  621. EggRH -= (200 * UnfertEgg)
  622. jump 'OviLoop'
  623. end
  624. If ovulate <= 0:
  625. cycle = 3
  626. UnfertEgg = 0
  627. end
  628. if fertegg = 1 and ferteggage < 330:
  629. if rand(0,(2000 - age*20)) = 0:
  630. fertegg += 1
  631. nextbaby = arrsize('$ChildFath')
  632. polkid[nextbaby] = polkid[nextbaby-1]
  633. $kidname[nextbaby] = 'unborn'
  634. kidage[nextbaby] = 0
  635. daykid[nextbaby] = 0
  636. monthkid[nextbaby] = 0
  637. yearkid[nextbaby] = 0
  638. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  639. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  640. $ChildFathDNA[nextbaby] = $ChildFathDNA[nextbaby-1]
  641. $kid_dna[nextbaby] = $kid_dna[nextbaby-1]
  642. hairkid[nextbaby] = hairkid[nextbaby-1]
  643. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  644. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  645. $childtype[nextbaby] = 'identical twin'
  646. $childtype[nextbaby-1] = 'identical twin'
  647. end
  648. end
  649. ferteggage += 1
  650. Ovulate -= 1
  651. LutH += 1
  652. end
  653. !{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.}
  654. !{If there is a 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.}
  655. !{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.}
  656. if $ARGS[0] = 'cyc3':
  657. if fertegg = 1 and ferteggage < 330:
  658. if rand(0,(2000 - age*20)) = 0:
  659. fertegg += 1
  660. nextbaby = arrsize('$ChildFath')
  661. polkid[nextbaby] = polkid[nextbaby-1]
  662. $kidname[nextbaby] = 'unborn'
  663. kidage[nextbaby] = 0
  664. daykid[nextbaby] = 0
  665. monthkid[nextbaby] = 0
  666. yearkid[nextbaby] = 0
  667. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  668. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  669. $ChildFathDNA[nextbaby] = $ChildFathDNA[nextbaby-1]
  670. $kid_dna[nextbaby] = $kid_dna[nextbaby-1]
  671. hairkid[nextbaby] = hairkid[nextbaby-1]
  672. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  673. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  674. $childtype[nextbaby] = 'identical twin'
  675. $childtype[nextbaby-1] = 'identical twin'
  676. end
  677. end
  678. ferteggage += 1
  679. implant_idx = 0
  680. implant_sz = arrsize('Babyptype')
  681. :implant_loop
  682. if implant_idx < implant_sz:
  683. if Babyptype[implant_idx] = 0:
  684. imp_rand = rand(0,120000)
  685. if ferteggage < 120 and broodcurse <= 0:
  686. imp_rand += 170
  687. imp_rand -= age * 10
  688. if steriletu = 1: imp_rand -= 200
  689. if imp_rand <= 0:
  690. Babyptype[implant_idx] = 2
  691. FertEgg -= 1
  692. babyembryo += 1
  693. PregChem = rand(10,30)
  694. if preg = 0: preg = 1
  695. implant_day = daystart
  696. implant_hour = hour
  697. end
  698. else
  699. imp_rand += sterilewb
  700. imp_rand -= tempwbbonus
  701. if broodcurse > 0 and ferteggage >= 120: imp_rand = 0
  702. if imp_rand <= (1200 - (age * 7)):
  703. Babyptype[implant_idx] = 1
  704. FertEgg -= 1
  705. babyembryo += 1
  706. PregChem = rand(10,30)
  707. if preg = 0: preg = 1
  708. implant_day = daystart
  709. implant_hour = hour
  710. end
  711. tempwbbonus = 0
  712. end
  713. end
  714. implant_idx += 1
  715. jump 'implant_loop'
  716. end
  717. !!{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.}
  718. if LutH > LutH_Max:
  719. rej_idx = 0
  720. rej_sz = arrsize('Babyptype')
  721. :lutcycloop
  722. if rej_idx < rej_sz:
  723. if Babyptype[rej_idx] = 0:
  724. KILLVAR 'polkid',tempbabyi
  725. KILLVAR '$kidname',tempbabyi
  726. KILLVAR 'kidage',tempbabyi
  727. KILLVAR 'daykid',tempbabyi
  728. KILLVAR 'monthkid',tempbabyi
  729. KILLVAR 'yearkid',tempbabyi
  730. KILLVAR 'Babyptype',tempbabyi
  731. KILLVAR '$ChildFath',tempbabyi
  732. KILLVAR '$ChildThFath',tempbabyi
  733. KILLVAR 'hairkid',tempbabyi
  734. KILLVAR 'eyeskid',tempbabyi
  735. KILLVAR 'cumarrcon',tempbabyi
  736. FertEgg -= 1
  737. end
  738. rej_idx += 1
  739. jump 'lutcycloop'
  740. end
  741. LutH = 0
  742. if preg = 1:
  743. cycle = 5
  744. elseif menoage <= age:
  745. KILLVAR '$wombpotfath'
  746. killvar '$cumfthname'
  747. killvar '$cumfthusedname'
  748. killvar 'cumtime'
  749. cycle = 6
  750. else
  751. KILLVAR '$wombpotfath'
  752. killvar '$cumfthname'
  753. killvar '$cumfthusedname'
  754. killvar 'cumtime'
  755. !! the setting of the max_time can be here although it can be changed in the future
  756. FocH_Max = rand(312,360) & !! 13-15 days including menstruation
  757. temprand = rand(0,10)
  758. if pillcon >= 38000 or rand(1,24) = 1:
  759. EggRH = 0
  760. cycle = 1
  761. mesec = 0
  762. else
  763. cycle = 0
  764. killvar 'abortionbirthdate'
  765. if cyccustom = 1: daylastperiod = daystart
  766. firstmens = daystart
  767. temprand = rand(0,10)
  768. if temprand = 0 and pillcon < 10000:
  769. mesec = rand(104,136) & !! 120
  770. elseif temprand < 9 and pillcon < 15000:
  771. mesec = rand(76,104) & !! 96
  772. elseif pillcon < 20000:
  773. mesec = rand(52,76) & !! 72
  774. else
  775. mesec = rand(44,52) & !! 48
  776. end
  777. end
  778. end
  779. else
  780. if preg = 1:PregChem += 1+pregspeedcheat
  781. if rand(0,100) < 100: LutH += 1
  782. end
  783. end
  784. !{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.}
  785. if $ARGS[0] = 'cyc4':
  786. if RecovH <= 0:
  787. cycle = 1
  788. if cyccustom = 1:
  789. knowpregloss = 0
  790. knowpregrecover = 0
  791. end
  792. if rand(0,1000) = 1000:
  793. EggRH = rand(20,80)
  794. else
  795. EggRH = 0
  796. end
  797. FocH = EggRH
  798. else
  799. RecovH -= 1
  800. if rand(0,10) = 0: RecovH -= 1
  801. end
  802. end
  803. !{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.}
  804. if $ARGS[0] = 'preg':
  805. if fertegg = 1 and ferteggage < 330:
  806. if rand(0,(2000 - age*20)) = 0:
  807. babyembryo += 1
  808. PregChem += rand(10,30)
  809. nextbaby = arrsize('$ChildFath')
  810. polkid[nextbaby] = polkid[nextbaby-1]
  811. $kidname[nextbaby] = 'unborn'
  812. kidage[nextbaby] = 0
  813. daykid[nextbaby] = 0
  814. monthkid[nextbaby] = 0
  815. yearkid[nextbaby] = 0
  816. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  817. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  818. hairkid[nextbaby] = hairkid[nextbaby-1]
  819. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  820. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  821. $childtype[nextbaby] = 'identical twin'
  822. $childtype[nextbaby-1] = 'identical twin'
  823. end
  824. end
  825. PregChem += (1+pregspeedcheat)
  826. temprand = rand(-400,800)
  827. temprand -= (babyembryo-1)*588
  828. if PregChem > 6573 + temprand and preg ! 2:
  829. 'A sharp pain pierces your abdomen, and you feel something flow down your legs. Your water has broken!'
  830. $cycreport_txt = 'In labour'
  831. arrmodtmp =arrsize('$ChildFath')
  832. arrmodtmp -= (babyembryo+1)
  833. :babyfinalpreploop
  834. if arrmodtmp < arrsize('$ChildFath') and daykid[arrmodtmp] = 0:
  835. daykid[arrmodtmp] = 42
  836. $ChildThFath[arrmodtmp] = $wombthfath
  837. arrmodtmp += 1
  838. jump 'babyfinalpreploop'
  839. end
  840. KILLVAR '$wombpotfath'
  841. KILLVAR '$wombthfath'
  842. preg = 2
  843. pregminut = totminut + 1440
  844. if babyembryo > 1:
  845. 'Your babies are coming...'
  846. else
  847. 'Your baby is coming...'
  848. end
  849. if PregChem < 3885:
  850. 'Way too early!'
  851. elseif PregChem < 5229:
  852. 'Very early!'
  853. elseif PregChem < 6069:
  854. 'Early.'
  855. elseif PregChem > 6959:
  856. 'Late.'
  857. elseif PregChem > 7245:
  858. 'Very Late!'
  859. end
  860. 'You need to get to a clinic.'
  861. end
  862. if PregChem > 3887:
  863. if lactate <= 0:
  864. 'You begin lactating'
  865. lactate = 1
  866. lactatemv = 0
  867. lactatemm = func('lact_lib','$calc_lactatemm')
  868. lacaterate = 10
  869. prolactinlvl = 150
  870. else
  871. if lactate < 1: lactate = 1
  872. end
  873. end
  874. if PregChem > 1000:
  875. if prolactinlvl < 100 and lactate <= 0:
  876. if rand(0,100) > 50:
  877. prolactinlvl +=1
  878. end
  879. end
  880. end
  881. if PregChem > 2203:
  882. if pregchem > 2853 or kid > 0:
  883. if rand(0,7) = 0: dynamic $d_pregmovement
  884. else
  885. if rand(0,500) = 0: dynamic $d_pregmovement
  886. end
  887. end
  888. end
  889. --- femcyc ---------------------------------