1
0

femcyc.qsrc 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956
  1. # femcyc
  2. !!
  3. !! THIS IS A CORE FILE TO GAME MECHANICS. Please edit CAREFULLY, and leave as many comments as possible!!
  4. !!
  5. !!------------------------------------------------------------------------------------------------------------
  6. !! femcyc documentation
  7. !!------------------------------------------------------------------------------------------------------------
  8. !!
  9. !! The femcyc functions try to reproduce a realistic mentruation cycle as well as the proper
  10. !! pregnancy of Sveta and the mostly realistic semen absorption/decay cycle.
  11. !! The below will explain every variable in use as well as every function and the general construct.
  12. !! The femcyc is a highly complex and confusing collection of calculations. So if you do not understand
  13. !! it, it is best to leave it alone.
  14. !!
  15. !!------------------------------------------------------------------------------------------------------------
  16. !!
  17. !! $ChildFath : array for names of the childs biological father
  18. !! $ChildFathDNA : array for the DNA of the childs father
  19. !! $ChildThFath : array for the names of the childs believed father (can be different from the biological father)
  20. !! $childtype : child type. single child, fraternal twin, identical twin ...
  21. !! $cumfthname : the name of the father if sveta is sure
  22. !! $cycreport_txt : Text for the current menstruation cycle. e.g. In labour.
  23. !! $d_cycreport_update : Dynamic variable to update cycle report
  24. !! $d_pregmovement : Dynamic variable for kid movement
  25. !! $kid_dna : DNA of the baby/kid
  26. !! $kidname : Name of the baby/kid
  27. !! $npc_dna : npc DNA
  28. !! $pcs_dna : Svetas DNA
  29. !! $wombDNA : sperm in womb potent enough to cause pregnancy
  30. !! $wombName : the name of the NPC
  31. !! $wombpotfath : the name of the potential father, if sveta is not sure
  32. !! arrmodtmp : temp array used in pregnancy progression
  33. !! babyembryo : used during implant phase. if the fertegg successfully nests, babyembryo is +1. BabyEmbryo is for how many unborn babies are inside Sveta.
  34. !! Babyptype : pregnancy type of unborn babies. they might be unimplanted 0, healthy 1, or Ectopic 2.
  35. !! broodcurse : some modifier for fertility - brood curse
  36. !! can_idx : candidate index - the index for the possible father
  37. !! can_sz : has array size of cumarrnam[], used to check if there is cum in the womb.
  38. !! cfl_ct : cum father lotto counter. used in a loop
  39. !! cfl_idx : cum father lotto index. used as index for arrays.
  40. !! cfl_sz : cum father lotto size. used for the size of the array
  41. !! cfw_idx : used for the sperm lotto. Index for the father
  42. !! cfw_sz : used for the sperm lotto. amount of semen in womb
  43. !! ChildConType : Contraceptives used during conception. e.g. condom slipped off or sveta was on a pill.
  44. !! ctemp : temporay array for cum ammount
  45. !! cum_total : how many amounts of cum are in svetas womb
  46. !! cumarr_idx : cum array index, used to identify how much cum is stored in the cum arrays
  47. !! cumarrtemp : another temp var for cum arrays
  48. !! cumcondslip : Introduced in Cum_Manage.qsrc. Did the condom slip off?
  49. !! cumcondslip_aware : is Sveta aware it slipped?
  50. !! cumfatherDNA[] : used to figure out the DNA of the father in the sperm lotto
  51. !! cumfathlotto[] : used to figure out the name of the father in the sperm lotto
  52. !! cumpdrop : used for calculation of drop in cum current potential
  53. !! cumsumass : sum of cum on ass
  54. !! cumsumbod : sum of cum on body
  55. !! cumsumvag : sum of cum on vagina
  56. !! cumtime[] : array to store how many times someone came in Sveta. More cumtime means more possibility to be the father.
  57. !! cyccustom : custom cycle flag variable. Either 0 or 1. Activates custom cycle reports during pregnancy.
  58. !! cycle : current state of svetas cycle, can be 0 to 5. 0 to 4 are usual mentruation cycles including fertilization. 5 is for the status 'pregnant'.
  59. !! daykid : Birthday of the baby/kid
  60. !! daylastperiod : daylastperiod is for Svetas knowledge on when she began her last period
  61. !! egg_idx : egg index. There could be more than one egg in Svetas womb, so the eggs have an index
  62. !! egg_sz : var to store amount of unfertilized eggs
  63. !! EggRH : The egg release counter. The level of egg release that Sveta has for her ovulation event. 150 generates a single egg, higher amounts might release more.
  64. !! eyeskid : Eye color of the child
  65. !! fert_thresh : the threshold of an egg to be fertilized. Modified by being on contraceptives and negative factors.
  66. !! FertEgg : How many unimplanted eggs Sveta has in her. These are possible babies, but they die 330 hours after ovulation if they do not implant.
  67. !! ferteggage : fertile egg age. used to check age of the egg (in hours). Time since the ovulation event. They last 330 and die if not implanted.
  68. !! firstmens : The first day that Sveta bled during her last cycle. this is different than daylastperiod because this is the actual date, while daylastperiod is when Svetlana remembers it being.
  69. !! FocH : FocH is for how many hours of Foccular cycle Sveta has gone through in her current fertility cycle. Focular starts at the end of her Luteal and contains the bleeding period in Svetkas cycle.
  70. !! FocH_Max : maximum Follicular time (in hours)
  71. !! hairkid : Hair color of the child
  72. !! imp_rand : randomizer variable used during egg implantation phase
  73. !! implant_day : day the egg was implanted
  74. !! implant_hour : hour the egg was implanted
  75. !! implant_idx : implant index used for array indexing, used in implantation phase
  76. !! implant_sz : implant array size, used in implantation phase
  77. !! isprok : used for menstruation bleeding flagging. can be 0 or 1.
  78. !! kid : Kid counter variable
  79. !! kidage : Age of the baby/child
  80. !! knowpregloss : knowpregloss is for Svetas knowledge that she lost a baby. 1 is for an abortion, 2 is for a miscarrage.
  81. !! knowpregrecover : knowpregrecover is for Svetas knowledge that she just gave birth.
  82. !! lactation[] : The lactation array. More on that in lact_lib
  83. !! lastmens : timestamp of last menstruation. The last day that Sveta bled during her last cycle.
  84. !! lastovulation : used to store the last ovulation date
  85. !! lotto_idx : lotto index. Used to randomly pick a sperm.
  86. !! LutH : How many hours of Luteal cycle Sveta has gone through in her current fertility cycle.
  87. !! LutH_Max : maximum Luteal time (in hours)
  88. !! menoage : The age Svetas will be when she goes through menopause.
  89. !! mesec : variable for menstruation. How many hours of bleeding Sveta has left in her current fertility cycle.
  90. !! monthkid : birth month of the kid
  91. !! nextbaby : index for babies.
  92. !! Ovulate : Ovulate is the amount of hours remaining in Svetas ovulation period of her current fertility cycle.
  93. !! pillcon : variable for contraceptive pills to prevent pregnancy. More on that below.
  94. !! polkid : Sex of the baby/kid. 0 = female, 1 = male
  95. !! preg : Pregnancy flag. 0 = not pregnant, 1 = pregnant, 2 = delivery
  96. !! PregChem : Progress of the pregnancy in hours.
  97. !! pregminut : total minutes + 1440 minutes. The time Sveta has from the first uterine contraction to labour. Usually Sveta dies during labour if this time is surpassed.
  98. !! pregspeedcheat : Cheat variable for faster pregnancies.
  99. !! rcntorgzm : determine wether Sveta had an orgasm withhin the last hour or not (1 or 0)
  100. !! rcntorgzmtmp : temp variable to rewrite to rcntorgzm
  101. !! RecovH : Recovery counter in hours. RecovH is the amount of recover hours before Svetas fertility cycle resets after having a baby.
  102. !! rej_idx : egg rejection array index. used during luteal phase to loop through any eggs not implanted.
  103. !! rej_sz : egg rejection array size. used during luteal phase to loop through any eggs not implanted.
  104. !! sexnutrition : succubus sex nutrition
  105. !! sparrtmpv : temp var for spatter arrays for temporary array index tracking
  106. !! sterileov : sterile ovulation. used for negative effects on ovulation.
  107. !! steriletu : sterilized through tubal ligation procedure. Usually smaller than 0 when sterile.
  108. !! sterilewb : sterile womb. Womb damage. Used for negative impact in the womb.
  109. !! sucabscum : was cum absorbed by succubus? (1 or 0)
  110. !! succublvl : succubus level (obviously)
  111. !! succubusflag : used for succubus story arc. If Sveta is a succubus, the sperm will be absorbed
  112. !! succubxp : succubus experience
  113. !! succycletmp : succubus cycle temp var. Used during sperm absorption function.
  114. !! tempbabyi : temp var for baby variable removal.
  115. !! tempovbonus : temp var for ovulation bonus. Fertility bonus.
  116. !! temprand : used as temp var for randomizer
  117. !! tempwbbonus : temp variable for womb bonus during egg implant function
  118. !! totminut : total minutes variable, used by various functions
  119. !! UnfertEgg : UnfertEgg is how many unfertilized eggs Sveta has in her for fertilization during her Ovulation period. Unfertilized eggs are removed at the end of her Ovulation period.
  120. !! wombAmount : how potent is the sperm of a guy
  121. !! x : used as temp for a loop
  122. !! y : used as temp for a loop
  123. !! yearkid : Birth year of the baby/kid
  124. !! z : used as temp for a loop
  125. !!
  126. !! Cum Array indices (taken from Cum_Manage.qsrc):
  127. !!
  128. !! cumarrnam : Sperm Owner
  129. !! cumarrppt : Sperm Potential Potency (max sperm delivery)
  130. !! cumarrcpt : Sperm Current Potency (current amount of sperm)
  131. !! cumarrdel : Sperm "Delivery" (method of *VAGINAL ONLY* acquisition)
  132. !! cumarrcon : Contraception typ used
  133. !! cumarrage : Sperm age in hours
  134. !! cumarrkno : Did you know/realize who did it?
  135. !! cumarrcnt : Unique identifier of the exact which time the MC has had this sperm incident occur.
  136. !!
  137. !! Spatter Array indices (taken from Cum_Manage.qsrc):
  138. !!
  139. !! sparrloc : Location of the sperm, as per cumarrdel
  140. !! sparrnam : Spatter Owner
  141. !! sparrppt : Spatter Potential Potency (Used to increase potency if you don't clean yourself out)
  142. !! sparridt : Did you know/realize who did it?
  143. !! sparrvol : Volume of the spatter. 40 is average.
  144. !! sparrslc : Spread status of the spatter. High volume can spread the contaminant from it's starting place.
  145. !! sparrcnt : Unique identifier of the exact which time the MC has had this spatter incident occur.
  146. !!
  147. !! Values of 'cumarrdel' as defined by the cum_arr (taken from Cum_Manage.qsrc):
  148. !!
  149. !! cumarrdel = 0 : 'Vaginal intercourse'
  150. !! cumarrdel = 1 : 'From spatter on labia'
  151. !! cumarrdel = 2 : 'From the anal area'
  152. !! cumarrdel = 3 : 'From sperm on clothing'
  153. !! cumarrdel = 4 : 'From sperm on fingers'
  154. !! cumarrdel = 5 : 'From sperm on wipes'
  155. !! cumarrdel = 6 : 'Unknown'
  156. !!
  157. !! Values of 'cumarrcon' as defined by the cum_arr (taken from Cum_Manage.qsrc):
  158. !!
  159. !! cumarrcon = 0: 'No contraception used'
  160. !! cumarrcon = 1: 'You lied about being on the pill'
  161. !! cumarrcon = 2: 'You were on the pill'
  162. !! cumarrcon = 3: 'You used a condom'
  163. !! cumarrcon = 4: 'The condom broke'
  164. !! cumarrcon = 5: 'The condom slipped off inside you'
  165. !! cumarrcon = 6: 'The condom was sabotaged by someone else'
  166. !! cumarrcon = 7: 'You sabotaged the condom'
  167. !! cumarrcon = 8: 'Precum had sperm in it'
  168. !! cumarrcon = 9: 'You believe are sterile'
  169. !!
  170. !! Values of 'cumarrkno' as defined by the cum_arr (taken from Cum_Manage.qsrc):
  171. !!
  172. !! cumarrkno = -2 : 'You were unaware there was sperm in you'
  173. !! cumarrkno = -1 : 'You do not think that any sperm has gotten into you'
  174. !! cumarrkno = 0 : 'You know somebody got sperm in you, but you don''t know that person'
  175. !! cumarrkno = 1 : 'You know who got sperm in you'
  176. !!
  177. !! Setting for no STD checks
  178. !!
  179. !! cumnostd = 1 : No risk of STD, resets at end of file so must be used for all related cum_management calls
  180. !!
  181. !! 0 = 'In your Vagina'
  182. !! 1 = 'On your labia'
  183. !! 2 = 'On your panties over your vagina'
  184. !! 3 = 'In your anus'
  185. !! 4 = 'On your butt'
  186. !! 5 = 'On your panties over your butt'
  187. !! 6 = 'On your clothes in your groin area'
  188. !! 7 = 'On your clothes'
  189. !! 8 = 'On your back'
  190. !! 9 = 'On your legs'
  191. !! 10 = 'On your arms'
  192. !! 11 = 'On your face'
  193. !! 12 = 'Inside your mouth'
  194. !! 13 = 'On your hands'
  195. !! 14 = 'On your stomach'
  196. !! 15 = 'On your breasts'
  197. !! 16 = 'In your hair'
  198. !! 17 = 'In a condom in your vagina'
  199. !!------------------------------------------------------------------------------------------------------------
  200. !! important values for pillcon
  201. !!------------------------------------------------------------------------------------------------------------
  202. !! at 7000 pillcon sveta will begin slowing down the build up of hormone to release eggs - see cyc1
  203. !! 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
  204. !! 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
  205. !! at 38000 pillcon sveta no longer has periods at all and cannot get pregnant anymore -- see cyc3
  206. !!------------------------------------------------------------------------------------------------------------
  207. !! Functions
  208. !!------------------------------------------------------------------------------------------------------------
  209. !! Default :
  210. !! - Hourly reduction in semen potency and semen absorption.
  211. !! - Hourly call for the breastcycle, managing lactation and changes in the breasts.
  212. !! - Hourly call of Svetas cycle via cycle variable.
  213. !!
  214. !! cyc0:
  215. !! - Handles actions from Menstruation to Follicular.
  216. !!
  217. !! cyc1:
  218. !! - Handles actions from Follicular to Ovulation.
  219. !!
  220. !! cyc2:
  221. !! - Handles actions for the Fertilization.
  222. !!
  223. !! cyc3:
  224. !! - handles actions from Luteal to Menstration or Pregnancy.
  225. !!
  226. !! cyc4:
  227. !! - handles actions from (post pregnancy) Recovery to Follicular..
  228. !!
  229. !! preg:
  230. !! - handles actions for the Pregnancy Progression.
  231. !!------------------------------------------------------------------------------------------------------------
  232. !! I have to initialize the variables somewhere, maybe in preCUST?
  233. if Luth_Max = 0: LutH_Max = rand(312,360) & !! 13-15 days including ovulation
  234. if Foch_Max = 0: FocH_Max = rand(312,360) & !! 13-15 days including menstruation
  235. if $ARGS[0] = '':
  236. !! calling the variable error handler, fixing variables here.
  237. gs 'femcyc', 'femcyc_errhdl'
  238. !{Hourly reduction in semen potency}
  239. !{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.}
  240. !{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.}
  241. !{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.}
  242. !{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.}
  243. if rcntorgzm = 1:
  244. if rcntorgzmtmp = 1: rcntorgzm = 0 & rcntorgzmtmp = 0
  245. if rcntorgzmtmp = 0: rcntorgzmtmp = 1
  246. end
  247. cumarr_idx = 0
  248. :cumarrloop
  249. if cumarr_idx < arrsize('$cumarrnam'):
  250. if cumarrcpt[cumarr_idx] > 0 and cumarrage[cumarr_idx] < 144:
  251. if rcntorgzm = 1 and cumarrcpt[cumarr_idx] < cumarrppt[cumarr_idx] and cumarrage[cumarr_idx] < 1: cumarrcpt[cumarr_idx] += cumarrppt[cumarr_idx] / 12
  252. cumpdrop = cumarrcpt[cumarr_idx] / (144 - cumarrage[cumarr_idx])
  253. if cycle ! 2: cumpdrop += cumpdrop * rand(0, 2)
  254. cumarrcpt[cumarr_idx] -= cumpdrop
  255. if cumarrcpt[cumarr_idx] <= 0:
  256. gs 'cum_cleanup', 'cleanwomb', cumarr_idx
  257. else
  258. cumarrage[cumarr_idx] += 1
  259. cumarr_idx += 1
  260. end
  261. else
  262. gs 'cum_cleanup', 'cleanwomb', cumarr_idx
  263. end
  264. jump 'cumarrloop'
  265. end
  266. !!Succubus absorption of sperm in womb
  267. if succubusflag = 1:
  268. if arrsize('cumarrppt') > 0:
  269. succycletmp = 0
  270. :sucvagabs
  271. if cumarrdel[succycletmp] = 0:
  272. if cumarrcpt[succycletmp] > 10000:
  273. sexnutrition += 30 * succublvl
  274. succubxp += 3
  275. elseif cumarrcpt[succycletmp] < 3000 and cumarrcpt[succycletmp] > 1000:
  276. sexnutrition += 5 * succublvl
  277. succubxp += 2
  278. elseif cumarrcpt[succycletmp] =< 1000:
  279. sexnutrition += succublvl
  280. else
  281. sexnutrition += 25 * succublvl
  282. succubxp += 3
  283. end
  284. gs 'cum_cleanup', 'cleanwomb', succycletmp
  285. sucabscum = 1
  286. else
  287. succycletmp += 1
  288. end
  289. if succycletmp < arrsize('cumarrppt'): jump 'sucvagabs'
  290. end
  291. killvar 'succycletmp'
  292. end
  293. cumarrtemp = 0
  294. cumcondslip = 0
  295. cumcondslip_aware = 0
  296. if arrsize('sparrvol') > 0:
  297. :cumspaloop
  298. !!Succubus absorption for internal locations other than womb
  299. if succubusflag = 1:
  300. if sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  301. sexnutrition += 25*succublvl
  302. succubxp += 3
  303. sucabscum = 1
  304. if sparrvol[cumarrtemp] > 0: sparrvol[cumarrtemp] = 0
  305. end
  306. end
  307. !!{if sparrloc[cumarrtemp] = 0 or sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  308. sexnutrition += 30*succublvl
  309. sparrvol[cumarrtemp] -= 30*succublvl
  310. if sparrvol[cumarrtemp] < 0: sexnutrition += sparrvol[cumarrtemp] & sparrvol[cumarrtemp] = 0
  311. end}
  312. !!{ Process spatter until it has volume or is too old in vagina. }
  313. if sparrvol[cumarrtemp] > 0 or (sparrloc[cumarrtemp] = 0 and sparrage[cumarrtemp] < 10):
  314. sparrtmpv = arrsize('$cumarrnam')
  315. if sparrloc[cumarrtemp] = 17:
  316. sparrtmpv = arrpos('cumarrcnt',sparrcnt[cumarrtemp])
  317. if sparrtmpv >= 0:
  318. !!'Found guy id <<sparrtmpv>>'
  319. if sparrage[cumarrtemp] < 4:
  320. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/5
  321. elseif sparrage[cumarrtemp] < 10:
  322. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/30
  323. end
  324. end
  325. elseif sparrloc[cumarrtemp] = 0:
  326. sparrtmpv = arrpos('cumarrcnt',sparrcnt[cumarrtemp])
  327. if sparrtmpv >= 0:
  328. !!'Found guy id' & sparrtmpv
  329. if sparrage[cumarrtemp] < 4:
  330. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/40
  331. elseif sparrage[cumarrtemp] < 10:
  332. cumarrcpt[sparrtmpv] += sparrppt[cumarrtemp]/60
  333. end
  334. end
  335. elseif sparrslc[cumarrtemp] = 1 and sparrage < 5:
  336. if sparrloc[cumarrtemp] = 1:
  337. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  338. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  339. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  340. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  341. cumarrdel[sparrtmpv] = 1
  342. cumarrkno[sparrtmpv] = -1
  343. cumarrcon[sparrtmpv] = 0
  344. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  345. end
  346. elseif sparrslc[cumarrtemp] = 3 and sparrage < 5:
  347. if sparrloc[cumarrtemp] = 2:
  348. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  349. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  350. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  351. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  352. cumarrdel[sparrtmpv] = 3
  353. cumarrkno[sparrtmpv] = -1
  354. cumarrcon[sparrtmpv] = 0
  355. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  356. elseif sparrloc[cumarrtemp] = 4:
  357. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  358. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  359. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  360. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  361. cumarrdel[sparrtmpv] = 2
  362. cumarrkno[sparrtmpv] = -1
  363. cumarrcon[sparrtmpv] = 0
  364. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  365. end
  366. elseif sparrslc[cumarrtemp] = 5 and sparrage < 5:
  367. if sparrloc[cumarrtemp] = 3:
  368. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  369. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  370. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  371. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  372. cumarrdel[sparrtmpv] = 2
  373. cumarrkno[sparrtmpv] = -1
  374. cumarrcon[sparrtmpv] = 0
  375. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  376. elseif sparrloc[cumarrtemp] = 5:
  377. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  378. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  379. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  380. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  381. cumarrdel[sparrtmpv] = 3
  382. cumarrkno[sparrtmpv] = -1
  383. cumarrcon[sparrtmpv] = 0
  384. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  385. elseif sparrloc[cumarrtemp] = 6:
  386. cumarrcpt[sparrtmpv] = sparrppt[cumarrtemp]*sparrvol[cumarrtemp]/sparrage[cumarrtemp]/1000
  387. cumarrppt[sparrtmpv] = sparrppt[cumarrtemp]
  388. $cumarrnam[sparrtmpv] = $sparrnam[cumarrtemp]
  389. cumarrage[sparrtmpv] = sparrage[cumarrtemp]
  390. cumarrdel[sparrtmpv] = 3
  391. cumarrkno[sparrtmpv] = -1
  392. cumarrcon[sparrtmpv] = 0
  393. cumarrcnt[sparrtmpv] = sparrcnt[cumarrtemp]
  394. end
  395. end
  396. if sparrloc[cumarrtemp] = 0 or sparrloc[cumarrtemp] = 3 or sparrloc[cumarrtemp] = 12:
  397. sparrvol[cumarrtemp] -= sparrage[cumarrtemp]/2
  398. if sparrvol[cumarrtemp] < 0:sparrvol[cumarrtemp] = 0
  399. end
  400. if sparrloc[cumarrtemp] = 0 and cumsumvag > 60: sparrslc[cumarrtemp] = 1
  401. if sparrloc[cumarrtemp] = 3 and cumsumass > 60: sparrslc[cumarrtemp] = 1
  402. if sparrloc[cumarrtemp] = 17:
  403. cumcondslip += 1
  404. if sparridt[cumarrtemp] >= 0:
  405. cumcondslip_aware = 1
  406. end
  407. if sparrage[cumarrtemp] > 48:
  408. cumcondslip_aware = 1
  409. if pcs_health > 100: pcs_health -= rand(3,sparrage[cumarrtemp] - 45)
  410. '<br><b><font color="red">You feel nauseous.</font></b>'
  411. end
  412. end
  413. if sparrloc[cumarrtemp] ! 0 and sparrloc[cumarrtemp] ! 3 and sparrloc[cumarrtemp] ! 12 and isprok = 0 and sparrage < 5: sparrslc[cumarrtemp] += 1
  414. sparrage[cumarrtemp] += 1
  415. cumarrtemp += 1
  416. ctemp[0] += sparrvol[cumarrtemp]
  417. if sparrloc[cumarrtemp] = 0: ctemp[1] += sparrvol[cumarrtemp]
  418. if sparrloc[cumarrtemp] = 3: ctemp[2] += sparrvol[cumarrtemp]
  419. else
  420. gs 'cum_cleanup', 'cleandeposit', cumarrtemp
  421. end
  422. if cumarrtemp < arrsize('sparrvol'): jump 'cumspaloop'
  423. cumsumbod = ctemp[0]
  424. cumsumvag = ctemp[1]
  425. cumsumass = ctemp[2]
  426. killvar 'ctemp'
  427. end
  428. !! Breastcycle. Every breast related change with lactation happens in here.
  429. if cheat_NoLactation > 0:
  430. gs 'lact_lib','lactate_optout'
  431. else
  432. gs 'lact_lib','breastcycle'
  433. end
  434. if cycle <= 0:
  435. gs 'femcyc', 'cyc0'
  436. elseif cycle = 1:
  437. gs 'femcyc', 'cyc1'
  438. elseif cycle = 2:
  439. gs 'femcyc', 'cyc2'
  440. elseif cycle = 3:
  441. gs 'femcyc', 'cyc3'
  442. elseif cycle = 4:
  443. gs 'femcyc', 'cyc4'
  444. elseif cycle = 5:
  445. gs 'femcyc', 'preg'
  446. end
  447. dynamic $d_cycreport_update
  448. end
  449. !{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.}
  450. if $ARGS[0] = 'cyc0':
  451. if mesec <= 0:
  452. lastmens = daystart
  453. cycle = 1
  454. mesec = 0
  455. if rand(0,1000) = 1000:
  456. EggRH = rand(20,80)
  457. else
  458. EggRH = 0
  459. end
  460. FocH += EggRH
  461. else
  462. mesec -= 1
  463. FocH += 1
  464. end
  465. end
  466. !{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.}
  467. if $ARGS[0] = 'cyc1':
  468. FertEgg = 0
  469. if FocH <= FocH_Max:
  470. if pillcon <= 7000: EggRH += 1
  471. if rand(0,9) = 0: EggRH += 1
  472. FocH += 1
  473. temprand = rand(0,9) - sterileov + tempovbonus
  474. if temprand < 0:
  475. EggRH -= 1
  476. elseif temprand > 9:
  477. EggRH += 1
  478. end
  479. else
  480. !! the setting of the max_time can be here although it can be changed in the future
  481. LutH_Max = rand(312,360) & !! 13-15 days including ovulation
  482. !{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.}
  483. temprand = rand(0,20)
  484. temprand += age/15
  485. temprand -= pillcon/1000
  486. if temprand > 20:
  487. EggRH += 205
  488. temprand = rand(0,20)
  489. temprand += age/15
  490. if temprand > 20: EggRH += 410
  491. end
  492. FocH = 0
  493. lastovulation = daystart
  494. Ovulate = 24 + rand(0,20)
  495. cycle = 2
  496. ferteggage = 0
  497. end
  498. end
  499. !!{Fertilization.}
  500. if $ARGS[0] = 'cyc2':
  501. can_sz = arrsize('$cumarrnam')
  502. if Ovulate > 0 and can_sz > 0 and UnfertEgg > 0:
  503. killvar 'cumtime'
  504. killvar 'cumfthname'
  505. killvar '$wombpotfath'
  506. $cumfthname[0] = 'unknown'
  507. cumtime[0] = 0
  508. can_idx = 0
  509. cum_total = 0
  510. !!{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.}
  511. :FatherCumAnalyze
  512. !! 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.
  513. !! If exists, just increase the amount of cum in the womb.
  514. !! $wombDNA: sperm in womb potent enough to cause pregnancy
  515. !! wombAmount: how potent is the sperm of a guy
  516. !! $wombName: the name of the NPC
  517. y = arrsize('$wombDNA')
  518. if arrpos('$wombDNA',$npc_dna[$cumarrnam[can_idx]]) = -1:
  519. !! New guy, create place for him at the end of the array, storing his DNA, sperm amount and name
  520. $wombDNA[y] = $npc_dna[$cumarrnam[can_idx]]
  521. wombAmount[y] = cumarrcpt[can_idx]
  522. $wombName[y] = $cumarrnam[can_idx]
  523. else
  524. !! This DNA is in the womb, but does it belong to the same guy?
  525. x = 0
  526. z = 0
  527. :LocalizeLoop
  528. if $wombDNA[x] = $npc_dna[$cumarrnam[can_idx]] and $wombName[x] = $cumarrnam[can_idx]: wombAmount[x] += cumarrcpt[can_idx] & z = 1
  529. if z = 0 and x < (y - 1):x += 1 & jump 'LocalizeLoop'
  530. killvar 'x'
  531. if z = 0:
  532. !! 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
  533. $wombDNA[y] = $npc_dna[$cumarrnam[can_idx]]
  534. $wombName[y] = $cumarrnam[can_idx]
  535. wombAmount[y] = cumarrcpt[can_idx]
  536. end
  537. killvar 'z'
  538. end
  539. killvar 'y'
  540. if cumarrkno[can_idx] = 1 and arrpos('$wombpotfath', $cumarrnam[can_idx]) < 0:$wombpotfath[arrsize('$wombpotfath')] = $cumarrnam[can_idx]
  541. !! 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.
  542. if instr('14570',str(cumarrcon[can_idx])) > 0 and cumarrdel[can_idx] = 0 and cumarrkno[can_idx] >= 0:
  543. !! If guy is recorded already, increase his cumtime, else record him for the first time.
  544. if arrpos('$cumfthname', $cumarrnam[can_idx]) = -1:
  545. $cumfthname[arrsize('$cumfthname')] = $cumarrnam[can_idx]
  546. cumtime[arrsize('$cumfthname')] = 1
  547. else
  548. cumtime[arrpos('$cumfthname', $cumarrnam[can_idx])] += 1
  549. end
  550. end
  551. cum_total += cumarrcpt[can_idx]
  552. if can_idx < can_sz:can_idx += 1 & jump 'FatherCumAnalyze'
  553. !! setting the default believed father if there is no difficult choice or there is no choice
  554. if arrsize('$cumfthname') = 2 and cumtime[0] = 0:
  555. $wombpotfath[0] = $cumfthname[1]
  556. elseif arrsize('$cumfthname') = 1:
  557. $wombpotfath[0] = $cumfthname[0]
  558. end
  559. !!{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.}
  560. killvar '$cumfathlotto'
  561. cfw_idx = 0
  562. cfw_sz = arrsize('wombAmount')
  563. :FathLottoLoop
  564. if cfw_idx < cfw_sz:
  565. cfl_ct = (wombAmount[cfw_idx] * 100) / cum_total
  566. if cfl_ct < 1: cfl_ct = 1
  567. cfl_idx = arrsize('$cumfathlotto')
  568. :FathLottoAdd
  569. if cfl_ct > 0:
  570. $cumfathlotto[cfl_idx] = $wombName[cfw_idx]
  571. $cumfatherDNA[cfl_idx] = $wombDNA[cfw_idx]
  572. cfl_idx += 1
  573. cfl_ct -= 1
  574. jump 'FathLottoAdd'
  575. end
  576. cfw_idx += 1
  577. jump 'FathLottoLoop'
  578. end
  579. killvar '$wombDNA'
  580. killvar '$wombName'
  581. killvar 'wombAmount'
  582. cfl_sz = arrsize('$cumfathlotto')
  583. egg_idx = 0
  584. egg_sz = UnfertEgg
  585. if cheat_NoPregnancy = 1:egg_idx = egg_sz
  586. :FertLoop
  587. if egg_idx < egg_sz:
  588. !!{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.}
  589. fert_thresh = rand(1,250000)
  590. if pillcon < 0: pillcon = 0
  591. !!fert_thresh += pillcon
  592. if steriletu = 1: fert_thresh += fert_thresh*30
  593. if fert_thresh > 0 and broodcurse > 0: fert_thresh = fert_thresh / 2
  594. if fert_thresh <= cum_total:
  595. lotto_idx = rand(0, cfl_sz-1)
  596. UnfertEgg -= 1
  597. FertEgg += 1
  598. nextbaby = arrsize('$ChildFath')
  599. polkid[nextbaby] = rand(0, 1)
  600. $kidname[nextbaby] = 'unborn'
  601. kidage[nextbaby] = 0
  602. daykid[nextbaby] = 0
  603. monthkid[nextbaby] = 0
  604. yearkid[nextbaby] = 0
  605. Babyptype[nextbaby] = 0
  606. $kid_dna[nextbaby] = func('DNA', 'generate', $pcs_dna, $npc_dna[$cumfathlotto[lotto_idx]])
  607. $ChildFath[nextbaby] = $cumfathlotto[lotto_idx]
  608. $ChildFathDNA[nextbaby] = $cumfatherDNA[lotto_idx]
  609. if arrsize('$wombpotfath') = 1:
  610. $ChildThFath[nextbaby] = $wombpotfath[0]
  611. else
  612. $ChildThFath[nextbaby] = 'unknown'
  613. end
  614. hairkid[nextbaby] = rand(0, 3)
  615. eyeskid[nextbaby] = rand(0, 3)
  616. ChildConType[nextbaby] = cumarrcon[nextbaby]
  617. if FertEgg > 1:
  618. $childtype[nextbaby] = 'fraternal twin'
  619. $childtype[nextbaby-1] = 'fraternal twin'
  620. else
  621. $childtype[nextbaby] = ''
  622. end
  623. end
  624. egg_idx += 1
  625. jump 'FertLoop'
  626. end
  627. killvar 'temp'
  628. tempovbonus = 0
  629. end
  630. !!{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.}
  631. if pillcon > 26000 and rand(0,400) ! 0: EggRH = 0
  632. :OviLoop
  633. if EggRH > ((UnfertEgg + FertEgg) * 150):
  634. UnfertEgg += 1
  635. EggRH -= (200 * UnfertEgg)
  636. jump 'OviLoop'
  637. end
  638. If ovulate <= 0:
  639. cycle = 3
  640. UnfertEgg = 0
  641. end
  642. if FertEgg = 1 and ferteggage < 330:
  643. if rand(0,(2000 - age*20)) = 0:
  644. FertEgg += 1
  645. nextbaby = arrsize('$ChildFath')
  646. polkid[nextbaby] = polkid[nextbaby-1]
  647. $kidname[nextbaby] = 'unborn'
  648. kidage[nextbaby] = 0
  649. daykid[nextbaby] = 0
  650. monthkid[nextbaby] = 0
  651. yearkid[nextbaby] = 0
  652. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  653. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  654. $ChildFathDNA[nextbaby] = $ChildFathDNA[nextbaby-1]
  655. $kid_dna[nextbaby] = $kid_dna[nextbaby-1]
  656. hairkid[nextbaby] = hairkid[nextbaby-1]
  657. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  658. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  659. $childtype[nextbaby] = 'identical twin'
  660. $childtype[nextbaby-1] = 'identical twin'
  661. end
  662. end
  663. ferteggage += 1
  664. Ovulate -= 1
  665. LutH += 1
  666. end
  667. !{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.}
  668. !{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.}
  669. !{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.}
  670. if $ARGS[0] = 'cyc3':
  671. if FertEgg = 1 and ferteggage < 330:
  672. if rand(0,(2000 - age*20)) = 0:
  673. FertEgg += 1
  674. nextbaby = arrsize('$ChildFath')
  675. polkid[nextbaby] = polkid[nextbaby-1]
  676. $kidname[nextbaby] = 'unborn'
  677. kidage[nextbaby] = 0
  678. daykid[nextbaby] = 0
  679. monthkid[nextbaby] = 0
  680. yearkid[nextbaby] = 0
  681. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  682. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  683. $ChildFathDNA[nextbaby] = $ChildFathDNA[nextbaby-1]
  684. $kid_dna[nextbaby] = $kid_dna[nextbaby-1]
  685. hairkid[nextbaby] = hairkid[nextbaby-1]
  686. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  687. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  688. $childtype[nextbaby] = 'identical twin'
  689. $childtype[nextbaby-1] = 'identical twin'
  690. end
  691. end
  692. ferteggage += 1
  693. implant_idx = 0
  694. implant_sz = arrsize('Babyptype')
  695. :implant_loop
  696. if implant_idx < implant_sz:
  697. if Babyptype[implant_idx] = 0:
  698. imp_rand = rand(0,120000)
  699. if ferteggage < 120 and broodcurse <= 0:
  700. imp_rand += 170
  701. imp_rand -= age * 10
  702. if steriletu = 1: imp_rand -= 200
  703. if imp_rand <= 0:
  704. Babyptype[implant_idx] = 2
  705. FertEgg -= 1
  706. babyembryo += 1
  707. PregChem = rand(10,30)
  708. if preg = 0: preg = 1
  709. implant_day = daystart
  710. implant_hour = hour
  711. end
  712. else
  713. imp_rand += sterilewb
  714. imp_rand -= tempwbbonus
  715. if broodcurse > 0 and ferteggage >= 120: imp_rand = 0
  716. if imp_rand <= (1200 - (age * 7)):
  717. Babyptype[implant_idx] = 1
  718. FertEgg -= 1
  719. babyembryo += 1
  720. PregChem = rand(10,30)
  721. if preg = 0: preg = 1
  722. implant_day = daystart
  723. implant_hour = hour
  724. end
  725. tempwbbonus = 0
  726. end
  727. end
  728. implant_idx += 1
  729. jump 'implant_loop'
  730. end
  731. !!{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.}
  732. if LutH > LutH_Max:
  733. rej_idx = 0
  734. rej_sz = arrsize('Babyptype')
  735. :lutcycloop
  736. if rej_idx < rej_sz:
  737. if Babyptype[rej_idx] = 0:
  738. killvar 'polkid',tempbabyi
  739. killvar '$kidname',tempbabyi
  740. killvar 'kidage',tempbabyi
  741. killvar 'daykid',tempbabyi
  742. killvar 'monthkid',tempbabyi
  743. killvar 'yearkid',tempbabyi
  744. killvar 'Babyptype',tempbabyi
  745. killvar '$ChildFath',tempbabyi
  746. killvar '$ChildThFath',tempbabyi
  747. killvar 'hairkid',tempbabyi
  748. killvar 'eyeskid',tempbabyi
  749. killvar 'cumarrcon',tempbabyi
  750. FertEgg -= 1
  751. end
  752. rej_idx += 1
  753. jump 'lutcycloop'
  754. end
  755. LutH = 0
  756. if preg = 1:
  757. cycle = 5
  758. elseif menoage <= age:
  759. killvar '$wombpotfath'
  760. killvar '$cumfthname'
  761. killvar '$cumfthusedname'
  762. killvar 'cumtime'
  763. cycle = 6
  764. else
  765. killvar '$wombpotfath'
  766. killvar '$cumfthname'
  767. killvar '$cumfthusedname'
  768. killvar 'cumtime'
  769. !! the setting of the max_time can be here although it can be changed in the future
  770. FocH_Max = rand(312,360) & !! 13-15 days including menstruation
  771. temprand = rand(0,10)
  772. if pillcon >= 38000 or rand(1,24) = 1:
  773. EggRH = 0
  774. cycle = 1
  775. mesec = 0
  776. else
  777. cycle = 0
  778. killvar 'abortionbirthdate'
  779. if cyccustom = 1: daylastperiod = daystart
  780. firstmens = daystart
  781. temprand = rand(0,10)
  782. if temprand = 0 and pillcon < 10000:
  783. mesec = rand(104,136) & !! 120
  784. elseif temprand < 9 and pillcon < 15000:
  785. mesec = rand(76,104) & !! 96
  786. elseif pillcon < 20000:
  787. mesec = rand(52,76) & !! 72
  788. else
  789. mesec = rand(44,52) & !! 48
  790. end
  791. end
  792. end
  793. else
  794. if preg = 1:PregChem += 1 + pregspeedcheat
  795. if rand(0,100) < 100: LutH += 1
  796. end
  797. end
  798. !{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.}
  799. if $ARGS[0] = 'cyc4':
  800. if RecovH <= 0:
  801. cycle = 1
  802. if cyccustom = 1:
  803. knowpregloss = 0
  804. knowpregrecover = 0
  805. end
  806. if rand(0,1000) = 1000:
  807. EggRH = rand(20,80)
  808. else
  809. EggRH = 0
  810. end
  811. FocH = EggRH
  812. else
  813. RecovH -= 1
  814. if rand(0,10) = 0: RecovH -= 1
  815. end
  816. end
  817. !{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.}
  818. if $ARGS[0] = 'preg':
  819. if FertEgg = 1 and ferteggage < 330:
  820. if rand(0,(2000 - age*20)) = 0:
  821. babyembryo += 1
  822. PregChem += rand(10,30)
  823. nextbaby = arrsize('$ChildFath')
  824. polkid[nextbaby] = polkid[nextbaby-1]
  825. $kidname[nextbaby] = 'unborn'
  826. kidage[nextbaby] = 0
  827. daykid[nextbaby] = 0
  828. monthkid[nextbaby] = 0
  829. yearkid[nextbaby] = 0
  830. Babyptype[nextbaby] = Babyptype[nextbaby-1]
  831. $ChildFath[nextbaby] = $ChildFath[nextbaby-1]
  832. hairkid[nextbaby] = hairkid[nextbaby-1]
  833. eyeskid[nextbaby] = eyeskid[nextbaby-1]
  834. cumarrcon[nextbaby] = cumarrcon[nextbaby-1]
  835. $childtype[nextbaby] = 'identical twin'
  836. $childtype[nextbaby-1] = 'identical twin'
  837. end
  838. end
  839. PregChem += (1+pregspeedcheat)
  840. temprand = rand(-400,800)
  841. temprand -= (babyembryo-1)*588
  842. if PregChem > 6573 + temprand and preg ! 2:
  843. 'A sharp pain pierces your abdomen, and you feel something flow down your legs. Your water has broken!'
  844. !! switch on lactation if not already active.
  845. if lactation['active'] < 1: func('lact_lib','lact_switch')
  846. $cycreport_txt = 'In labour'
  847. arrmodtmp = arrsize('$ChildFath')
  848. arrmodtmp -= (babyembryo+1)
  849. :babyfinalpreploop
  850. if arrmodtmp < arrsize('$ChildFath') and daykid[arrmodtmp] = 0:
  851. daykid[arrmodtmp] = 42
  852. $ChildThFath[arrmodtmp] = $wombthfath
  853. arrmodtmp += 1
  854. jump 'babyfinalpreploop'
  855. end
  856. killvar '$wombpotfath'
  857. killvar '$wombthfath'
  858. preg = 2
  859. pregminut = totminut + 1440
  860. if babyembryo > 1:
  861. 'Your babies are coming...'
  862. else
  863. 'Your baby is coming...'
  864. end
  865. if PregChem < 3885:
  866. 'Way too early!'
  867. elseif PregChem < 5229:
  868. 'Very early!'
  869. elseif PregChem < 6069:
  870. 'Early.'
  871. elseif PregChem > 6959:
  872. 'Late.'
  873. elseif PregChem > 7245:
  874. 'Very late!'
  875. end
  876. 'You need to get to a clinic.'
  877. end
  878. if PregChem > 2203:
  879. if PregChem > 2853 or kid > 0:
  880. if rand(0,7) = 0: dynamic $d_pregmovement
  881. else
  882. if rand(0,500) = 0: dynamic $d_pregmovement
  883. end
  884. end
  885. end
  886. !! Variable error handler for femcyc. Checking if variables are out of range and resets them.
  887. if $ARGS[0] = 'femcyc_errhdl':
  888. if cycle < 0 or cycle > 6: cycle = 0
  889. if rcntorgzmtmp < 0 or rcntorgzmtmp > 1: rcntorgzmtmp = 0
  890. if rcntorgzm < 0 or rcntorgzm > 1: rcntorgzm = 0
  891. if PregChem < 0: PregChem = 0
  892. if preg < 0 or preg > 2: preg = 0
  893. if ferteggage < 0: ferteggage = 0
  894. if EggRH < 0: EggRH = 0
  895. if FocH < 0: FocH = 0
  896. if FertEgg < 0: FertEgg = 0
  897. end
  898. --- femcyc ---------------------------------