lact_lib.qsrc 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083
  1. # lact_lib
  2. !! ---- new lactation string index array for all lactation functions ----------
  3. !! lactation['active'] = old "lactate" variable
  4. !! lactation['induced'] = old lactateinduced variable
  5. !! lactation['pc_aware'] = old pcs_knowsaboutlactation variable
  6. !! lactation['lactaterate'] = old lactaterate variable now in ml*1000
  7. !! lactation['breastmv'] = old lactatemv variable now in ml*1000 - current milk volume in breasts
  8. !! lactation['breastmm'] = old lactatemm variable now in ml*1000 - maximal milk volume
  9. !! lactation['prolactinlvl'] = old prolactinlvl variable
  10. !! lactation['milkedvolume'] = old milkedvolume variable
  11. !! lactation['lactmess'] = old lactatemess variable
  12. !! lactation['engorgement'] = old lact_engorgement variable. 1 = engorged breasts, 0 = not engorged.
  13. !! lactation['dailyoverdemand'] = old milkoverdemand variable
  14. !! lactation['nipgrowth'] = variable to count nipplegrowth with lactation start nipples will grow by 2 points.
  15. !! lactation['milkgrowday'] = old milkgrowday variable.
  16. !! lactation['breastdensitytype'] = variable to define breast type. 0 = not initialized, 1 = 17% gland tissue, 2 = 36% gland tissue, 3 = 55% gland tissue, 4 = 74% gland tissue, 5 = 93% gland tissue
  17. !! lactation['breastglandtissue'] = the amount of glandular tissue per breast
  18. !! lactation['alveoliexpandlvl'] = variable for alveoli expansion 0 = not expanded; 10 fully expanded.
  19. !! lactation['alveoliexpandlvl_change'] = change checking variable for alveoli expansion
  20. !! lactation['breastcount'] = how many breasts does sveta have? Usually should be set to 2 unless you want to amputate or go multibreast
  21. !! lactation['maturebreast'] = Did Svetas breast fully change during pregnancy yet? 0 = no, 1 = yes
  22. !! lactation['breastpumped'] = old breastpumped variable.
  23. !! lactation['max_sucktion_demand'] = old max_sucktion_demand variable. Used in milking function
  24. !! breastcounter = times the breasts have been milked/sucked/pumped
  25. !! lactation['max_nip_flow_rate'] = old max_nip_flow_rate variable. used in milking function
  26. !! lactation['suck_flow_rate'] = old suck_flow_rate variable. Used in milking function
  27. !! lactation['soreness_mod'] = old soreness_mod variable. Used in milking functions
  28. !! lactation['nip_flow_mod'] = old nip_flow_mod variable. Used in milking functions
  29. !! lactation['used_lactaterate'] = old lactaterate_use variable.
  30. !! lactation['nipple_cream_applied'] = old nipple_cream variable. Used in soreness_mod function
  31. !! lactation['lactaterate_per_min'] = old temp_lactaterate variable in get breast milking time function
  32. !! lactation['produced_milk'] = dummy used in milking function.
  33. !! ---- old variables ---------------------------------------------------------
  34. !! - These Variables still need to be replaced/removed or substituted. -
  35. !! energytomilkpump
  36. !! pump_stop_brake
  37. !! pumptime
  38. !! pumptime_left
  39. !! suck_until_pain = needs update
  40. !! temp_var = need to find ways to get rid of temp_var dump
  41. !! temp_var2 = need to find ways to get rid of temp_var dump
  42. !! This function is calculating Sveta''s mammary gland density and alveolicount and sets the breastcount which will be 2 naturally
  43. if $ARGS[0] = 'init_breasttissue':
  44. !! use func('lact_lib','init_breasttissue')
  45. !! getting the useable tissue
  46. lactation['useable_cupsize'] = pcs_mass['bust'] + bodyVars['bust_lact'] + bodyVars['bust_magic'] + bodyVars['bust_other'] - bodyVars['vofat']
  47. !! checking the variable. If it is greater 0, sveta has natural breast tissue to work with.
  48. !! else she has fake breasts or no breasts at all and no ability to lactate
  49. if lactation['useable_cupsize'] > 0:
  50. lactation['breasttissueinitiated'] = 1
  51. lactation['last_useable_cupsize'] = lactation['useable_cupsize']
  52. !! breast density type. Density of glands.
  53. !! 0 = not initialized, 1 = 17% gland tissue, 2 = 36% gland tissue, 3 = 55% gland tissue, 4 = 74% gland tissue, 5 = 93% gland tissue. This is based on studies I found on the internet.
  54. !! The logic behind the below is, when losing fat, breasts usually volunteer first. So the more bodyfat sveta has, the more she has in her breasts, and therefore the percentage of gland tissue goes down.
  55. !! Breasts cannot lose glandular tissue (if not cut out, yikes), therefore this will define the maximum they can shrink if fat is removed. At the moment this is done by pcs_mass['bust_gen']. The below will replace this in the future.
  56. !! pcs_mass['bust_gen'] is the breastsize that is given to Sveta by her parents. During puberty the breasts swell up to this size with mostly being fat tissue. Due to genetic variability and hormones, breasts will develop more or
  57. !! less mammary gland tissue during puberty. As the game starts after Svetas puberty, this is impossible to simulate. That is why I came up with the below part. It will calculate the breastdensity using Svetas body fat.
  58. !! During pregnancy most of the breast fat is getting replaced by conjuctive tissue and mammary glands. But the genetical breastsize also affects the total mammary gland growth. So for example, if Sveta is a chubby,
  59. !! and has D cups with a breastdensitytype of 1, and she looses weight, her breast will shrink down to B cups. If her pcs_mass['bust_gen'] is D, then she will grow D cups or bigger during pregnancy. But that is part of another function.
  60. lactation['breastcount'] = 2
  61. if lactation['breastdensitytype'] < 3:
  62. lactation['breastdensitytype'] = rand(3,5)
  63. lactation['lactlib_change'] = 1
  64. end
  65. if lactation['maturebreast'] > 0:
  66. lactation['breastdensitytype'] = 5
  67. lactation['breastdensitypercent'] = 93
  68. elseif lactation['breastdensitytype'] = 5:
  69. lactation['breastdensitypercent'] = 93
  70. elseif lactation['breastdensitytype'] = 4:
  71. lactation['breastdensitypercent'] = 74
  72. elseif lactation['breastdensitytype'] = 3:
  73. lactation['breastdensitypercent'] = 55
  74. end
  75. !! initiating breastglandtissue. the size is converted to ccm.
  76. lactation['breastglandtissue'] = (func('lact_lib','bsizetoccm', lactation['useable_cupsize'])*lactation['breastdensitypercent'])/100 + (lactation['preggrowth']/100)
  77. lactation['breastmm'] = (lactation['breastglandtissue']*(100 + (lactation['alveoliexpandlvl'] * 40)))*lactation['breastcount']
  78. !! getting the breast max milk storage. Please be aware that there is storage even if no lactation is happening. Factors 100 and 500 stand for flat glands and inflated glands.
  79. !! usually nature intented women to be able to breastfeed. depending on age and size, babys eat about 80ml to 150ml. if both breast make 80ml together, then we are fine. Even AA cups can do this.
  80. !! this is what the pregtime check is for. Making sure sveta would have been able to breastfeed. There is a jump to loop back.
  81. else
  82. !! when there is no tissue, set everything for zero. Note: the breasttissueinitiated variable is set to 0, so the function will always check if there is useable tissue available and then will create the glandtissue.
  83. lactation['breastcount'] = 0
  84. lactation['breasttissueinitiated'] = 0
  85. lactation['breastdensitypercent'] = 0
  86. lactation['breastmm'] = 0
  87. lactation['active'] = 0
  88. lactation['lactlib_change'] = 0
  89. lactation['alveoliexpandlvl'] = 0
  90. lactation['alveoliexpandlvl_change'] = 0
  91. end
  92. end
  93. if $ARGS[0] = 'bsizetoccm':
  94. !! function to calculate volume per one breast from npc bust size.
  95. !! Getting breast ccm per breast function based on the bra size chart in here https://en.wikipedia.org/wiki/Bra_size
  96. !! I tried to create a math polynom for this, but ended up with x^16 monsters and inaccurate numbers, so I am going this approach.
  97. !! This is the most accurate function I was able to make, and is doing the job really good. So please do not touch it.
  98. !! usage func('lact_lib','bsizetoccm', (pcs_mass['bust'] + bodyVars['bust_lact'] + bodyVars['bust_magic'] + bodyVars['bust_silicone']))
  99. if ARGS[1] < 0:
  100. result = 100
  101. elseif ARGS[1] <= 15:
  102. result = ((ARGS[1]*14)+100)
  103. elseif ARGS[1] <= 20:
  104. result = (((ARGS[1]-15)*16)+310)
  105. elseif ARGS[1] <= 25:
  106. result = (((ARGS[1]-20)*18)+390)
  107. elseif ARGS[1] <= 30:
  108. result = (((ARGS[1]-25)*22)+480)
  109. elseif ARGS[1] <= 35:
  110. result = (((ARGS[1]-30)*24)+590)
  111. elseif ARGS[1] <= 40:
  112. result = (((ARGS[1]-35)*28)+710)
  113. elseif ARGS[1] <= 45:
  114. result = (((ARGS[1]-40)*30)+850)
  115. elseif ARGS[1] <= 50:
  116. result = (((ARGS[1]-45)*36)+1000)
  117. elseif ARGS[1] <= 55:
  118. result = (((ARGS[1]-50)*38)+1180)
  119. elseif ARGS[1] <= 60:
  120. result = (((ARGS[1]-55)*42)+1370)
  121. elseif ARGS[1] <= 65:
  122. result = (((ARGS[1]-60)*46)+1580)
  123. elseif ARGS[1] <= 70:
  124. result = (((ARGS[1]-65)*50)+1810)
  125. elseif ARGS[1] <= 75:
  126. result = (((ARGS[1]-70)*56)+2060)
  127. elseif ARGS[1] <= 80:
  128. result = (((ARGS[1]-75)*60)+2340)
  129. elseif ARGS[1] <= 85:
  130. result = (((ARGS[1]-80)*72)+2640)
  131. elseif ARGS[1] > 85:
  132. result = (((ARGS[1]-85)*84)+3000)
  133. else
  134. result = 100
  135. end
  136. end
  137. if $ARGS[0] = 'bccmtosize':
  138. !! backwardsfunction of bsizetoccm. It just reverts breast ccm to "pcs_mass['bust'] + bodyVars['bust_lact'] + bodyVars['bust_magic'] + bodyVars['bust_silicone']"
  139. !! func('lact_lib','bccmtosize',lactation['breastccm'])
  140. if ARGS[1] < 0:
  141. result = 0
  142. elseif ARGS[1] <= 310:
  143. result = ((ARGS[1] - 100)/14)
  144. elseif ARGS[1] <= 390:
  145. result = (((ARGS[1] - 310)/16)+15)
  146. elseif ARGS[1] <= 480:
  147. result = (((ARGS[1] - 390)/18)+20)
  148. elseif ARGS[1] <= 590:
  149. result = (((ARGS[1] - 480)/22)+25)
  150. elseif ARGS[1] <= 710:
  151. result = (((ARGS[1] - 590)/24)+30)
  152. elseif ARGS[1] <= 850:
  153. result = (((ARGS[1] - 710)/28)+35)
  154. elseif ARGS[1] <= 1000:
  155. result = (((ARGS[1] - 850)/30)+40)
  156. elseif ARGS[1] <= 1180:
  157. result = (((ARGS[1] - 1000)/36)+45)
  158. elseif ARGS[1] <= 1370:
  159. result = (((ARGS[1] - 1180)/38)+50)
  160. elseif ARGS[1] <= 1580:
  161. result = (((ARGS[1] - 1370)/42)+55)
  162. elseif ARGS[1] <= 1810:
  163. result = (((ARGS[1] - 1580)/46)+60)
  164. elseif ARGS[1] <= 2060:
  165. result = (((ARGS[1] - 1810)/50)+65)
  166. elseif ARGS[1] <= 2340:
  167. result = (((ARGS[1] - 2060)/56)+70)
  168. elseif ARGS[1] <= 2640:
  169. result = (((ARGS[1] - 2340)/60)+75)
  170. elseif ARGS[1] <= 3000:
  171. result = (((ARGS[1] - 2640)/72)+80)
  172. elseif ARGS[1] > 3000:
  173. result = (((ARGS[1] - 3000)/84)+85)
  174. else
  175. result = 0
  176. end
  177. end
  178. !! This function is used for lactation based growth. It writes back to pcs_mass['bust'], bodyVars['bust_magic'].
  179. if $ARGS[0] = 'lactationBreastGrowth':
  180. if lactation['maturebreast'] = 1 and lactation['preggrowth'] > 0:
  181. !! lactation['lactlib_change'] = 1
  182. lactation['useable_cupsize'] = pcs_mass['bust'] + bodyVars['bust_lact'] + bodyVars['bust_magic'] - bodyVars['vofat']
  183. bodyVars['bust_lact'] += func('lact_lib','bccmtosize',(func('lact_lib','bsizetoccm', lactation['useable_cupsize']) + (lactation['preggrowth']/100))) + bodyVars['vofat'] - bodyVars['bust_magic'] - pcs_mass['bust'] - bodyVars['bust_lact']
  184. lactation['result'] = func('lact_lib','init_breasttissue')
  185. end
  186. if lactation['alveoliexpandlvl_change'] <> lactation['alveoliexpandlvl']:
  187. !! lactlib makes a change. we need to flag that, else checkExtBreastGrowth will go off and mess up everything.
  188. !! lactation['lactlib_change'] = 1
  189. if lactation['alveoliexpandlvl'] mod 3 = 0 and lactation['alveoliexpandlvl_change'] + 1 = lactation['alveoliexpandlvl']:
  190. bodyVars['bust_lact'] += 5
  191. '<b>Your breasts seem fuller.</b>'
  192. elseif lactation['alveoliexpandlvl_change'] mod 3 = 0 and lactation['alveoliexpandlvl'] + 1 = lactation['alveoliexpandlvl_change'] and lactation['alveoliexpandlvl_change'] > 0 and bodyVars['bust_lact'] >= 5:
  193. bodyVars['bust_lact'] -= 5
  194. '<b>Your breasts seem to be getting smaller.</b>'
  195. end
  196. lactation['alveoliexpandlvl_change'] = lactation['alveoliexpandlvl']
  197. end
  198. lactation['result'] = func('lact_lib','init_breasttissue')
  199. end
  200. !! Just a function used for debugging. Can be deleted if not needed anymore.
  201. if $ARGS[0] = 'show_breast_stat':
  202. !! func('lact_lib','show_breast_stat')
  203. 'lactation[''breastdensitytype''] = <<lactation[''breastdensitytype'']>>'
  204. 'lactation[''breastdensitypercent''] = <<lactation[''breastdensitypercent'']>>'
  205. 'lactation[''breastglandtissue'']] = <<lactation[''breastglandtissue'']>>'
  206. 'lactation[''maturebreast''] = <<lactation[''maturebreast'']>>'
  207. 'lactation[''alveolicount''] = <<lactation[''alveolicount'']>>'
  208. 'lactation[''prolactinlvl''] = <<lactation[''prolactinlvl'']>>'
  209. 'lactation[''dailyoverdemand''] = <<lactation[''dailyoverdemand'']>>'
  210. 'lactation[''alveoliexpandlvl''] = <<lactation[''alveoliexpandlvl'']>>'
  211. 'lactation[''alveoliexpandlvl_change''] = <<lactation[''alveoliexpandlvl_change'']>>'
  212. 'lactation[''active''] = <<lactation[''active'']>>'
  213. 'lactation[''lactaterate''] = <<lactation[''lactaterate'']>>'
  214. 'lactation[''breastmm''] = <<lactation[''breastmm'']>>'
  215. 'lactation[''breastmv''] = <<lactation[''breastmv'']>>'
  216. end
  217. !! milk production function
  218. if $ARGS[0] = 'prod_milk':
  219. !! function for Svetas milk production. Milk production will cost stamina, hydration, and hunger. this function is used in breastcycle
  220. !! I know, pretty complex for just making breast milk, but hey - life is complex :D
  221. !! func('lact_lib','prod_milk',milkamount)
  222. !! result = produced breast milk amount in ml*1000
  223. !! ARGS[1] = Requested milk production amount produced in ml*1000. Usually should be the lactaterate.
  224. !! If there was milk pumped or produced during the hour, this has to be substracted.
  225. if lactation['used_lactaterate'] > 0:
  226. lactation['prod_milk_req'] = (ARGS[1] - lactation['used_lactaterate'])
  227. lactation['used_lactaterate'] += ARGS[1]
  228. if lactation['used_lactaterate'] > lactation['lactaterate']: lactation['used_lactaterate'] = lactation['lactaterate']
  229. else
  230. lactation['prod_milk_req'] = ARGS[1]
  231. lactation['used_lactaterate'] += ARGS[1]
  232. if lactation['used_lactaterate'] > lactation['lactaterate']: lactation['used_lactaterate'] = lactation['lactaterate']
  233. end
  234. !! If Sveta has pcs_mass['body'] <= 15, she will not produce breast milk as she is basically starving and her body will shut down everything that is causing too much energy consumption.
  235. if lactation['active'] > 0 and pcs_mass['body'] > 15:
  236. !! checking how much hydration, stamina and hunger is needed to produce x amount of breast milk
  237. !! checking if enough stamina and hydra is available
  238. if (lactation['prod_milk_req']/10000) < pcs_stam and (lactation['prod_milk_req']/10000) < pcs_hydra:
  239. !! full requested milk amount can be produced. substracting from stamina, hydration energy.
  240. if (lactation['prod_milk_req']/10000) < 1:
  241. pcs_stam -= 1
  242. pcs_hydra -= 1
  243. else
  244. pcs_stam -= (lactation['prod_milk_req']/10000)
  245. pcs_hydra -= (lactation['prod_milk_req']/10000)
  246. end
  247. if pcs_stam < 1: pcs_stam = 1
  248. if pcs_hydra < 1: pcs_hydra = 1
  249. if (lactation['prod_milk_req']/9000) < pcs_energy:
  250. if (lactation['prod_milk_req']/9000) < 1:
  251. pcs_energy -= 1
  252. else
  253. pcs_energy -= (lactation['prod_milk_req']/9000)
  254. if pcs_energy < 1: pcs_energy = 1
  255. end
  256. result = lactation['prod_milk_req']
  257. else
  258. !! If energy is too low, milk will be produced but there is a chance that fat will shrink.
  259. pcs_energy = 1
  260. if fat > 0:
  261. if rand(0,100) > 95: fat -= 1
  262. end
  263. if pain['breasts'] < 20: pain['breasts'] += 1
  264. result = lactation['prod_milk_req']
  265. end
  266. elseif pcs_stam <= 0 or pcs_hydra <= 0:
  267. !! if sveta has not enough hydration or stamina, no milk is produced.
  268. result = 0
  269. else
  270. if (pcs_stam*10000) < (pcs_hydra*10000):
  271. lactation['prod_milk_temp_var'] = (pcs_stam*10000)
  272. pcs_stam = 1
  273. if (lactation['prod_milk_req']/10000) < pcs_hydra:
  274. pcs_hydra -= (lactation['prod_milk_req']/10000)
  275. else
  276. pcs_hydra = 1
  277. end
  278. else
  279. lactation['prod_milk_temp_var'] = (pcs_hydra*10000)
  280. pcs_hydra = 1
  281. if (lactation['prod_milk_req']/10000) < pcs_stam:
  282. pcs_stam -= (lactation['prod_milk_req']/10000)
  283. else
  284. pcs_stam = 1
  285. end
  286. end
  287. if (lactation['prod_milk_temp_var']/9000) < pcs_energy:
  288. if (lactation['prod_milk_temp_var']/9000) < 1:
  289. pcs_energy -= 1
  290. else
  291. pcs_energy -= (lactation['prod_milk_temp_var']/9000)
  292. if pcs_energy < 1: pcs_energy = 1
  293. end
  294. else
  295. !! If energy is too low, milk will be produced but there is a chance that pcs_mass['body'] will shrink.
  296. pcs_energy = 1
  297. if rand(0, 100) < 5: pcs_mass['body'] -= 1
  298. if pain['breasts'] < 20: pain['breasts'] += 1
  299. end
  300. if pcs_energy < 1: pcs_energy = 1
  301. if pcs_hydra < 1: pcs_hydra = 1
  302. if pcs_stam < 1: pcs_stam = 1
  303. result = lactation['prod_milk_temp_var']
  304. end
  305. else
  306. result = 0
  307. end
  308. end
  309. !! breast status messages - for use in stat_display. Explains itself basically.
  310. if $ARGS[0] = 'breast_stat_disp':
  311. !! breast status
  312. if lactation['active'] <= 0:
  313. if lactation['growthsoreness_on'] > 0: $stat_msg += '<BR><font color='+$fcolor+'Your breasts feel sore and swollen.</font><BR>'
  314. elseif lactation['active'] > 0 and lactation['pc_aware'] > 0:
  315. if lactation['engorgement'] > 0 and lactation['lactmess'] < 1:
  316. $stat_msg += '<BR><font color = orange>Your breasts are so full they hurt.</font><BR>'
  317. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 3 and $clothingworntype = 'nude':
  318. $stat_msg += '<BR><font color = red>Your breasts are so full they hurt and you can feel milk seeping out, causing you to have a little milk residue around your nipples.</font><BR>'
  319. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 6 and $clothingworntype = 'nude':
  320. $stat_msg += '<BR><font color = red>Your breasts are so full they hurt and you can feel your milk comming out causing you to have a lot of milk around your nipples.</font><BR>'
  321. elseif lactation['engorgement'] > 0 and lactation['lactmess'] >= 6 and $clothingworntype = 'nude':
  322. $stat_msg += '<BR><font color = red>Your breasts are so full they hurt and you can feel your milk spraying out. Your breasts covered with your breast milk.</font><BR>'
  323. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 3:
  324. $stat_msg += '<BR><font color = red>Your breasts are so full they hurt and you can feel milk seeping out, causing small wet spots on your top.</font><BR>'
  325. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 6:
  326. $stat_msg += '<BR><font color = red>Your breasts are so full they hurt and you can feel your milk comming out making visible wet circles on your top.</font><BR>'
  327. elseif lactation['engorgement'] > 0 and lactation['lactmess'] >= 6:
  328. $stat_msg += '<BR><font color = red>Your breasts are so full they hurt and you can feel your milk spraying out. Your top is drenched with your breast milk.</font><BR>'
  329. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']*9/10:
  330. $stat_msg += '<BR><font color='+$fcolor+'Your breasts are firm and full from your milk.</font><BR>'
  331. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']/2:
  332. $stat_msg += '<BR><font color='+$fcolor+'Your breasts are heavy with your milk.</font><BR>'
  333. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']/4:
  334. $stat_msg += '<BR><font color='+$fcolor+'Your breasts feel slightly heavy from the milk inside.</font><BR>'
  335. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > 0:
  336. $stat_msg += '<BR><font color='+$fcolor+'Your feel an easy pressure in your breasts from your milk.</font><BR>'
  337. end
  338. elseif lactation['active'] > 0 and lactation['pc_aware'] < 1:
  339. if lactation['engorgement'] > 0 and lactation['lactmess'] < 1:
  340. $stat_msg += '<BR><font color = orange>Your breasts hurt with pressure in them.</font><BR>'
  341. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 3 and $clothingworntype = 'nude':
  342. $stat_msg += '<BR><font color = red>Your breasts hurt and your nipples are wet.</font><BR>'
  343. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 6 and $clothingworntype = 'nude':
  344. $stat_msg += '<BR><font color = red>Your breasts hurt and they feel wet, some white liquid around your nipples.</font><BR>'
  345. elseif lactation['engorgement'] > 0 and lactation['lactmess'] >= 6 and $clothingworntype = 'nude':
  346. $stat_msg += '<BR><font color = red>Your breasts hurt and a white liquid is spraying out, covering your breasts.</font><BR>'
  347. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 3:
  348. $stat_msg += '<BR><font color = red>Your breasts hurt and your nipples tingle a little. There are small wet spots on your top.</font><BR>'
  349. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 6:
  350. $stat_msg += '<BR><font color = red>Your breasts hurt and your nipples tingle. There are visible wet circles on your top.</font><BR>'
  351. elseif lactation['engorgement'] > 0 and lactation['lactmess'] >= 6:
  352. $stat_msg += '<BR><font color = red>Your breasts hurt and your nipples tingle a lot. Your top is drenched with a warm liquid.</font><BR>'
  353. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']*9/10:
  354. $stat_msg += '<BR><font color='+$fcolor+'Your breasts feel firm and under pressure.</font><BR>'
  355. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']/2:
  356. $stat_msg += '<BR><font color='+$fcolor+'Your breasts feel heavy.</font><BR>'
  357. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']/4:
  358. $stat_msg += '<BR><font color='+$fcolor+'Your breasts feel slightly heavy.</font><BR>'
  359. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > 0:
  360. $stat_msg += '<BR><font color='+$fcolor+'Your feel an easy pressure in your breasts.</font><BR>'
  361. end
  362. end
  363. end
  364. if $ARGS[0] = 'breast_stat_icons':
  365. !! breast status icons
  366. if lactation['active'] <= 0 and lactation['growthsoreness_on'] > 0:
  367. $stat_lact_msg = 'Your breasts feel sore and swollen.'
  368. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_sore.png"></a></td>'
  369. elseif lactation['active'] > 0 and lactation['pc_aware'] > 0:
  370. if lactation['engorgement'] > 0 and lactation['lactmess'] < 1:
  371. $stat_lact_msg = 'Your breasts are so full they hurt.'
  372. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_100.png"></a></td>'
  373. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 3 and $clothingworntype = 'nude':
  374. $stat_lact_msg = 'Your breasts are so full they hurt and you can feel milk seeping out, causing you to have a little milk residue around your nipples.'
  375. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d50.png"></a></td>'
  376. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 6 and $clothingworntype = 'nude':
  377. $stat_lact_msg = 'Your breasts are so full they hurt and you can feel your milk comming out causing you to have a lot of milk around your nipples.'
  378. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d100.png"></a></td>'
  379. elseif lactation['engorgement'] > 0 and lactation['lactmess'] >= 6 and $clothingworntype = 'nude':
  380. $stat_lact_msg = 'Your breasts are so full they hurt and you can feel your milk spraying out. Your breasts covered with your breast milk.'
  381. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d100+.png"></a></td>'
  382. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 3:
  383. $stat_lact_msg = 'Your breasts are so full they hurt and you can feel milk seeping out, causing small wet spots on your top.'
  384. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d50.png"></a></td>'
  385. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 6:
  386. $stat_lact_msg = 'Your breasts are so full they hurt and you can feel your milk comming out making visible wet circles on your top.'
  387. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d100.png"></a></td>'
  388. elseif lactation['engorgement'] > 0 and lactation['lactmess'] >= 6:
  389. $stat_lact_msg = 'Your breasts are so full they hurt and you can feel your milk spraying out. Your top is drenched with your breast milk.'
  390. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d100+.png"></a></td>'
  391. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']*9/10:
  392. $stat_lact_msg = 'Your breasts are firm and full from your milk.'
  393. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_90.png"></a></td>'
  394. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']*3/4:
  395. $stat_lact_msg = 'Your breasts are very heavy with your milk.'
  396. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_75.png"></a></td>'
  397. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']/2:
  398. $stat_lact_msg = 'Your breasts are heavy with your milk.'
  399. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_50.png"></a></td>'
  400. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']/4:
  401. $stat_lact_msg = 'Your breasts feel slightly heavy from the milk inside.'
  402. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_25.png"></a></td>'
  403. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > 0:
  404. $stat_lact_msg = 'Your feel an easy pressure in your breasts from your milk.'
  405. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating.png"></a></td>'
  406. end
  407. elseif lactation['active'] > 0 and lactation['pc_aware'] < 1:
  408. if lactation['engorgement'] > 0 and lactation['lactmess'] < 1:
  409. $stat_lact_msg = 'Your breasts hurt with pressure in them.'
  410. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_100.png"></a></td>'
  411. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 3 and $clothingworntype = 'nude':
  412. $stat_lact_msg = 'Your breasts hurt and your nipples are wet.'
  413. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d50.png"></a></td>'
  414. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 6 and $clothingworntype = 'nude':
  415. $stat_lact_msg = 'Your breasts hurt and they feel wet, some white liquid around your nipples.'
  416. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d100.png"></a></td>'
  417. elseif lactation['engorgement'] > 0 and lactation['lactmess'] >= 6 and $clothingworntype = 'nude':
  418. $stat_lact_msg = 'Your breasts hurt and a white liquid is spraying out, covering your breasts.'
  419. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d100+.png"></a></td>'
  420. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 3:
  421. $stat_lact_msg = 'Your breasts hurt and your nipples tingle a little. There are small wet spots on your top.'
  422. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d50.png"></a></td>'
  423. elseif lactation['engorgement'] > 0 and lactation['lactmess'] < 6:
  424. $stat_lact_msg = 'Your breasts hurt and your nipples tingle. There are visible wet circles on your top.'
  425. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d100.png"></a></td>'
  426. elseif lactation['engorgement'] > 0 and lactation['lactmess'] >= 6:
  427. $stat_lact_msg = 'Your breasts hurt and your nipples tingle a lot. Your top is drenched with a warm liquid.'
  428. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_d100+.png"></a></td>'
  429. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']*9/10:
  430. $stat_lact_msg = 'Your breasts feel firm and under pressure.'
  431. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_90.png"></a></td>'
  432. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']*3/4:
  433. $stat_lact_msg = 'Your breasts feel very heavy.'
  434. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_75.png"></a></td>'
  435. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']/2:
  436. $stat_lact_msg = 'Your breasts feel heavy.'
  437. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_50.png"></a></td>'
  438. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > lactation['breastmm']/4:
  439. $stat_lact_msg = 'Your breasts feel slightly heavy.'
  440. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating_25.png"></a></td>'
  441. elseif lactation['engorgement'] < 1 and lactation['breastmv'] > 0:
  442. $stat_lact_msg = 'Your feel an easy pressure in your breasts.'
  443. $statusIconBarTab += '<td><a href="exec:msg $stat_lact_msg"><img title="<<$stat_lact_msg>>" height = <<set_siconht>> src="images/system/icons/status/lactating.png"></a></td>'
  444. end
  445. end
  446. end
  447. !! function for breast engorment, used in breastcycle
  448. if $ARGS[0] = 'breast_engorment':
  449. !! relatively easy. if the breasts get full, engorgement will happen.
  450. if lactation['breastmv'] >= lactation['breastmm']:
  451. temp_var = lactation['breastmv'] - lactation['breastmm']
  452. lactation['breastmv'] = lactation['breastmm']
  453. if temp_var < 1000 and temp_var > 0:
  454. lactation['engorgement'] = 0
  455. elseif temp_var < 3000 and temp_var >= 1000:
  456. lactation['engorgement'] = 1
  457. lactation['lactmess'] += 1
  458. elseif temp_var < 10000 and temp_var >= 3000:
  459. lactation['engorgement'] = 1
  460. lactation['lactmess'] += 2
  461. elseif temp_var >= 10000:
  462. lactation['engorgement'] = 1
  463. lactation['lactmess'] += 3
  464. end
  465. else
  466. lactation['engorgement'] = 0
  467. if lactation['lactmess'] > 1:
  468. lactation['lactmess'] -= 2
  469. if lactation['lactmess'] < 0: lactation['lactmess'] = 0
  470. end
  471. end
  472. if lactation['engorgement'] > 0 and pain['breasts'] < max(5, lactation['breastmm']/10000):
  473. tmp = max(0, rand(0, 6 - lactation['lactmess']))
  474. pain['breasts'] += tmp
  475. lactation['engorgement_pain'] += tmp
  476. killvar 'tmp'
  477. elseif lactation['engorgement'] = 0 and lactation['engorgement_pain'] > 0:
  478. pain['breasts'] -= lactation['engorgement_pain'] / 2
  479. lactation['engorgement_pain'] /= 2
  480. if pain['breasts'] < 0: pain['breasts'] = 0
  481. end
  482. end
  483. !! Lactation On/Off switch function
  484. !! Usage gs 'lact_lib','lact_switch'
  485. if $ARGS[0] = 'lact_switch':
  486. if lactation['active'] <= 0:
  487. gs 'lact_lib', 'lact_on'
  488. else
  489. gs 'lact_lib', 'lact_off'
  490. end
  491. end
  492. if $ARGS[0] = 'lact_on':
  493. if lactation['active'] <= 0:
  494. !! Sveta is not aware of the lactation yet. She will notice when playing with her breasts or applying pressure to them. Or during pumping or when she starts to leak.
  495. lactation['pc_aware'] = 0
  496. !! setting lactation to active
  497. lactation['active'] = 1
  498. !! setting breast maximum milk volume via function
  499. lactation['breastmm'] = (lactation['breastglandtissue']*(100 + (lactation['alveoliexpandlvl'] * 40)))*lactation['breastcount']
  500. !! resetting prolactinlvl so that the initial production rate is not too high
  501. if lactation['prolactinlvl'] < 200: lactation['prolactinlvl'] = 200
  502. !! setting the lactation rate. Warning! lactation rate is in ml*1000 now for higher accuracy.
  503. lactation['lactaterate'] = 1000*(lactation['prolactinlvl']/200)
  504. !! setting milk volume in breasts to 0. Will fill up with lactaterate in another part of the breastcycle
  505. lactation['breastmv'] = 0
  506. !! nipples will grow a bit with extended milk channels. If lactation stops, this will be substracted from the nipples again and nipples will shrink.
  507. lactation['nipgrowth'] += rand(5,10)
  508. pcs_nips += lactation['nipgrowth']
  509. if lactation['alveoliexpandlvl'] < 10: lactation['alveoliexpandlvl'] = 10
  510. if lactation['alveoliexpandlvl_change'] < 10: lactation['alveoliexpandlvl_change'] = 10
  511. lactation['milkprod_type'] = 1
  512. lactation['result'] = func('lact_lib','breastcycle')
  513. end
  514. end
  515. if $ARGS[0] = 'lact_off':
  516. if lactation['active'] > 0:
  517. !! If lactation is on, the stuff below will switch it off again.
  518. lactation['active'] = 0
  519. lactation['lactaterate'] = 0
  520. lactation['breastmv'] = 0
  521. lactation['alveoliexpandlvl'] = 0
  522. lactation['alveoliexpandlvl_change'] = 1
  523. lactation['prolactinlvl'] = 0
  524. if lactation['nipgrowth'] > 0 and lactation['nipgrowth'] <= 10: pcs_nips -= lactation['nipgrowth'] & lactation['nipgrowth'] = 0
  525. lactation['nipgrowth'] = 0
  526. lactation['result'] = func('lact_lib','breastcycle')
  527. end
  528. end
  529. !! new breast cycle function, replaced the monster lactation function in femcyc
  530. if $ARGS[0] = 'breastcycle':
  531. !!if lactation['breasttissueinitiated'] <= 0: lactation['result'] = func('lact_lib','init_breasttissue')
  532. lactation['result'] = func('lact_lib','init_breasttissue')
  533. !! usage func('lact_lib','breastcycle')
  534. !! if lactating or not, breasts will grow during pregnancy. This will only happen during first full pregnancy
  535. if pregchem => 2191 and lactation['maturebreast'] <= 0:
  536. !! breastgrowth 40ccm per breast.
  537. !! Checking pregchem last. It should not be smaller than 0.
  538. if lactation['pregchemlast'] <= 0:
  539. lactation['pregchemlast'] = 2191
  540. lactation['preggrowth'] = 0
  541. end
  542. if lactation['preggrowth'] <= 20000 and (pregchem - lactation['pregchemlast']) >= 0:
  543. lactation['preggrowth'] = (pregchem - 2191) * 9
  544. lactation['growthsoreness_on'] = 1
  545. if pain['breasts'] <= 20: pain['breasts'] = 20
  546. else
  547. lactation['growthsoreness_on'] = 0
  548. lactation['maturebreast'] = 1
  549. lactation['result'] = func('lact_lib','lactationBreastGrowth')
  550. lactation['preggrowth'] = 0
  551. end
  552. lactation['pregchemlast'] = pregchem
  553. elseif PregChem > 4383 and lactation['maturebreast'] > 0:
  554. !! pregnancy prolactinlvl rise
  555. if lactation['prolactinlvl'] < 200 and lactation['active'] <= 0:
  556. if rand(0,100) > 25:
  557. lactation['prolactinlvl'] +=1
  558. end
  559. end
  560. end
  561. !! checking for prolactin and if svetas breasts were worked (e.g. breast stimulation via massage, pumps, by mouth, or whatever)
  562. if lactation['active'] <= 0:
  563. !! prolactinlvl calculation. If sveta never was pregnant, prolactinlvl will grow slower
  564. if lactation['milkgrowday'] < daystart:
  565. if (lactation['dailyoverdemand']/200) <= 0 and lactation['dailyoverdemand'] > 0:
  566. lactation['prolactinlvl'] += 1
  567. elseif (lactation['dailyoverdemand']/200) >= 10 and lactation['maturebreast'] <= 0:
  568. lactation['prolactinlvl'] += 10
  569. elseif (lactation['dailyoverdemand']/200) >= 50 and lactation['maturebreast'] > 0:
  570. lactation['prolactinlvl'] += 50
  571. else
  572. if lactation['prolactinlvl'] > 0 and pregchem < 2191:
  573. if ((lactation['prolactinlvl']/2) + (lactation['prolactinlvl']/5) - (lactation['prolactinlvl']/8)) < 1:
  574. lactation['prolactinlvl'] -= 1
  575. else
  576. lactation['prolactinlvl'] -= ((lactation['prolactinlvl']/2) + (lactation['prolactinlvl']/5) - (lactation['prolactinlvl']/8))
  577. end
  578. end
  579. end
  580. end
  581. if lactation['prolactinlvl'] > 200: lactation['prolactinlvl'] = 200
  582. !! expand level cannot be over 5
  583. if lactation['alveoliexpandlvl'] > 10: lactation['alveoliexpandlvl'] = 10
  584. !! Breast growth due to mammarygland expansion. Happens if prolactin level is high enough and will cause breastsoreness.
  585. !! If prolactinlvl lowers, milkglands will shrink again.
  586. if lactation['milkgrowday'] < daystart and lactation['prolactinlvl'] > 100 and lactation['alveoliexpandlvl'] < 10:
  587. lactation['alveoliexpandlvl_change'] = lactation['alveoliexpandlvl']
  588. lactation['alveoliexpandlvl'] += 1
  589. lactation['growthsoreness_on'] = 1
  590. if pain['breasts'] <= 20: pain['breasts'] = 20
  591. elseif lactation['milkgrowday'] < daystart and lactation['prolactinlvl'] < 100 and lactation['prolactinlvl'] > 0 and lactation['alveoliexpandlvl'] > 0:
  592. lactation['alveoliexpandlvl_change'] = lactation['alveoliexpandlvl']
  593. lactation['alveoliexpandlvl'] -= 1
  594. lactation['growthsoreness_on'] = 1
  595. if pain['breasts'] <= 20: pain['breasts'] = 20
  596. end
  597. !! If sveta meets alveoliexpandlvl 10 and her prolactinlvl is between random 200 and 250, her lactation will set in, will not switch if only lactating. This is happening during induction or during pregnancy
  598. if rand(1,50) + lactation['prolactinlvl'] >= rand(200,250) and lactation['alveoliexpandlvl'] >= 10 and lactation['active'] = 0:
  599. lactation['result'] = func('lact_lib','lact_switch')
  600. end
  601. else
  602. !! things that happen when Sveta is lactating lactation['active'] > 1
  603. if lactation['milkprod_type'] = 1 and lactation['caplactaterate'] <= 0: lactation['caplactaterate'] = 4
  604. if lactation['milkgrowday'] < daystart:
  605. !! Lactation rate growth. The higher the lactationrate is, the slower it will grow. I have not found a study on this, so this is pure asumption and common sense.
  606. !! funny parabelfunction for the lactrategrowth > 65 - ((1/1466)*((lactrate-304)*(lactrate-304)))
  607. lactation['prolactinlvl'] += (lactation['dailyoverdemand']/10000)
  608. if lactation['dailyoverdemand'] > 0 and lactation['breastpumped'] >= 0 and lactation['lactaterate'] ! 0:
  609. !! adding cap
  610. if (lactation['breastmm'] / lactation['lactaterate']) > lactation['caplactaterate']:
  611. lactation['max_lactrate_growth'] = (65 - ((((lactation['lactaterate']/1000) - 304)*((lactation['lactaterate']/1000) - 304))/1466))*1000
  612. if lactation['max_lactrate_growth'] < ((10*lactation['prolactinlvl'])/2) and lactation['max_lactrate_growth'] >= 1000:
  613. lactation['lactaterate'] += lactation['max_lactrate_growth']
  614. elseif lactation['max_lactrate_growth'] < ((10*lactation['prolactinlvl'])/2) and lactation['max_lactrate_growth'] < 1000:
  615. lactation['lactaterate'] += 1000
  616. else
  617. lactation['lactaterate'] += (10*lactation['prolactinlvl'])/2
  618. end
  619. elseif (lactation['breastmm'] / lactation['lactaterate']) <> lactation['caplactaterate']:
  620. !! lactation rate is dropping with below function.
  621. lactation['lactaterate'] = max(0, lactation['lactaterate'] - (lactation['lactaterate']/2) + (lactation['lactaterate']/5) - (lactation['lactaterate']/8))
  622. !! shrink nipples
  623. if lactation['nipgrowth'] > lactation['useable_cupsize']*3/2:
  624. tmp = max(0, rand(-5, lactation['breastmm']/100000))
  625. pcs_nips -= tmp
  626. lactation['nipgrowth'] -= tmp
  627. killvar 'tmp'
  628. end
  629. end
  630. lactation['prolactinlvl'] = 100
  631. elseif lactation['dailyoverdemand'] <= 0 and lactation['breastpumped'] > 0:
  632. !! If there was no milk overdemand, sveta will keep her lactationrate level.
  633. lactation['prolactinlvl'] = 100
  634. lactation['dailyoverdemand'] = 0
  635. lactation['breastpumped'] = 0
  636. else
  637. !! If there was no demand at all, svetas lactation rate will drop. Weaning off will take 7-10 days usually. If there is no engorgment happening, it will take longer (up to 30 days)
  638. lactation['dailyoverdemand'] = 0
  639. lactation['breastpumped'] = 0
  640. if lactation['lactaterate'] > 0:
  641. !! lactation rate is dropping with below function.
  642. lactation['prolactinlvl'] = 100
  643. if ((lactation['lactaterate']/2) + (lactation['lactaterate']/5) - (lactation['lactaterate']/8)) < 10:
  644. lactation['lactaterate'] -= 1
  645. else
  646. lactation['lactaterate'] = (lactation['lactaterate'] - (lactation['lactaterate']/2) + (lactation['lactaterate']/5) - (lactation['lactaterate']/8))
  647. end
  648. elseif lactation['lactaterate'] <= 0 and pregchem >= 4383:
  649. !! during pregnancy lactation is not switched off. Svetas breasts will always produce a bit off milk
  650. lactation['lactaterate'] = 10
  651. elseif lactation['lactaterate'] <= 0:
  652. !! switching off lactation production and making sure prolactin is dropping. Nipples shrink too. There are some changes that are permanent, especially during pregnancy.
  653. lactation['result'] = func('lact_lib','lact_switch')
  654. end
  655. end
  656. end
  657. !! Filling milk into svetas breast every hour and checking for breastengorgement
  658. if lactation['breastmv'] < lactation['breastmm'] and lactation['lactaterate'] >= 500 and lactation['milkprod_type'] = 1:
  659. lactation['breastmv'] += func('lact_lib','prod_milk',lactation['lactaterate'])
  660. !! nipples are growing if Sveta keeps pumping milk
  661. if lactation['nipgrowth'] < lactation['useable_cupsize']*2:
  662. tmp = max(0, rand(-10, lactation['breastmm']/100000))
  663. pcs_nips += tmp
  664. lactation['nipgrowth'] += tmp
  665. killvar 'tmp'
  666. end
  667. elseif lactation['breastmv'] < lactation['breastmm'] and lactation['lactaterate'] >= 500 and lactation['milkprod_type'] = 0:
  668. lactation['breastmv'] += lactation['lactaterate']
  669. if lactation['breastmv'] > lactation['breastmm']: lactation['breastmv'] = lactation['breastmm']
  670. end
  671. !! Reset used_lactaterate, so milk can be produced again.
  672. lactation['used_lactaterate'] = 0
  673. lactation['result'] = func('lact_lib','breast_engorment')
  674. end
  675. if lactation['milkgrowday'] < daystart:
  676. lactation['result'] = func('lact_lib','lactationBreastGrowth')
  677. lactation['dailyoverdemand'] = 0
  678. lactation['milkgrowday'] = daystart
  679. end
  680. end
  681. !! Used for switching off all lactation related content
  682. if $ARGS[0] = 'lactate_optout':
  683. !! usage 1: func('lact_lib','lactate_optout')
  684. !! usage 2: gs 'lact_lib','lactate_optout'
  685. if lactation['active'] > 0:
  686. lactation['result'] = func('lact_lib','lact_switch')
  687. end
  688. lactation['active'] = 0
  689. lactation['prolactinlvl'] = 0
  690. lactation['lactmess'] = 0
  691. lactation['engorgement'] = 0
  692. lactation['breastmv'] = 0
  693. lactation['breastmm'] = 0
  694. lactation['lactaterate'] = 0
  695. lactation['dailyoverdemand'] = 0
  696. end
  697. !! get suckflow rate function
  698. if $ARGS[0] = 'get_suckflowrate':
  699. !! lactation['suck_flow_rate'] = func('lact_lib','get_suckflowrate', sucktion_type)
  700. !! The suck flow rate is the demand that is applied to Svetas breasts per minute. Be it breast massaging, direct nipple sucking or the simple use of a breast pump.
  701. !! ARGS[1] = sucktion_type: the type of suction. adult_mouth [0], child_mouth [1], baby_mouth [2], manual_breastpump [3] , electric_breastpump [4], hand_expressing [5], cow milker [6], weak baby_mouth [7], stimulation during sex/sex play [8]
  702. !! what type of sucktion is happening? different sucktion can cause a different demand of breast milk.
  703. !! Result is base rate of sucktion 10ml/minute x 1000. So if the sucktion rate is 10ml/min then suck_flow_rate = 10000.
  704. !! increased caps
  705. if ARGS[1] = 0:
  706. !! 'adult sucking'
  707. result = 17000
  708. elseif ARGS[1] = 1:
  709. !! 'child sucking'
  710. result = 11000
  711. elseif ARGS[1] = 2:
  712. !! 'baby sucking'
  713. result = 8000
  714. elseif ARGS[1] = 3:
  715. !! 'manual_breastpump sucking'
  716. result = 40000
  717. elseif ARGS[1] = 4:
  718. !! 'electric_breastpump sucking'
  719. result = 100000
  720. elseif ARGS[1] = 5:
  721. !! 'hand expression'
  722. result = 20000
  723. elseif ARGS[1] = 6:
  724. !! 'cow milker sucking'
  725. result = 160000
  726. elseif ARGS[1] = 7:
  727. !! 'weak baby sucking'
  728. result = 5000
  729. elseif ARGS[1] = 8:
  730. !! 'manual stimulation during sex/sex play'
  731. result = 15000
  732. else
  733. !! 'suck flow else branch'
  734. result = 10000
  735. end
  736. end
  737. !! get max nipple flow rate function
  738. if $ARGS[0] = 'get_maxnipflowrate':
  739. !! lactation['max_nip_flow_rate'] = func('lact_lib','get_maxnipflowrate')
  740. !! How much milk can be sucked out through svetas nipples per minute.
  741. !! Result is base rate is 10ml/minute x 1000.
  742. !! Calculating the nip flow mod. The more svetas breasts were worked/sucked, the more milk can go through her nipples. Max cap is at 9000 (9ml/min).
  743. !! increased the cap 10 times
  744. if breastcounter > 0:
  745. lactation['nip_flow_mod'] += breastcounter * 500
  746. breastcounter = 0
  747. end
  748. !! IT IS OVER 90000!
  749. if lactation['nip_flow_mod'] > 90000: lactation['nip_flow_mod'] = 90000
  750. !! linear growth for the nip flowrate
  751. if pcs_nips > 0:
  752. result = ((1000*pcs_nips) + 8000 + lactation['nip_flow_mod'])
  753. else
  754. result = (8000 + lactation['nip_flow_mod'])
  755. end
  756. end
  757. !! get mood modification
  758. if $ARGS[0] = 'get_moodmod':
  759. !! during breastfeeding or pumping or whatever, svetas mood can be pushed up.
  760. !! pcs_mood += func('lact_lib','get_maxnipflowrate', sucktion type, sucktion time)
  761. !! ARGS[1] = sucktion_type: the type of suction. adult_mouth [0], child_mouth [1], baby_mouth [2], manual_breastpump [3] , electric_breastpump [4], hand_expressing [5], cow milker [6], weak baby_mouth [7], stimulation during sex/sex play [8]
  762. !! Result = additional mood
  763. if ARGS[1] = 0:
  764. !! 'adult sucking'
  765. lactation['moodmod'] = ARGS[2]/8
  766. elseif ARGS[1] = 1:
  767. !! 'child sucking'
  768. lactation['moodmod'] = ARGS[2]/2
  769. elseif ARGS[1] = 2:
  770. !! 'baby sucking'
  771. lactation['moodmod'] = ARGS[2]
  772. elseif ARGS[1] = 7:
  773. !! 'weak baby sucking'
  774. lactation['moodmod'] = ARGS[2]
  775. else
  776. lactation['moodmod'] = 0
  777. end
  778. if lactation['active'] <= 0: lactation['moodmod'] = (lactation['moodmod']/2)
  779. if (lactation['moodmod'] + pcs_mood) > 100:
  780. result = (100 - pcs_mood)
  781. else
  782. result = lactation['moodmod']
  783. end
  784. end
  785. !! get soreness_mod
  786. !! probably needs a tweak
  787. if $ARGS[0] = 'get_sorenessmod':
  788. !! lactation['soreness_mod'] = func('lact_lib','get_sorenessmod')
  789. if lactation['nipple_cream_applied'] > 0:
  790. lactation['nipple_cream_applied'] = 0
  791. if lactation['dailyoverdemand'] = 0:
  792. result = rand(10,30)
  793. elseif lactation['dailyoverdemand'] <= (lactation['breastmm'] / 2):
  794. result = rand(5,15)
  795. elseif lactation['dailyoverdemand'] <= lactation['breastmm']:
  796. result = rand(4,8)
  797. else
  798. result = rand(3,5)
  799. end
  800. else
  801. if lactation['dailyoverdemand'] = 0:
  802. result = rand(5,10)
  803. elseif lactation['dailyoverdemand'] <= (lactation['breastmm'] / 2):
  804. result = rand(3,6)
  805. elseif lactation['dailyoverdemand'] <= lactation['breastmm']:
  806. result = rand(2,4)
  807. else
  808. result = rand(1,3)
  809. end
  810. end
  811. end
  812. !! get breastmilktime function
  813. if $ARGS[0] = '$get_breastmilk_time':
  814. !! func('lact_lib','$get_breastmilk_time', sucktion_type, milk_demand)
  815. !! ARGS[1] = sucktion_type: the type of suction. adult_mouth [0], child_mouth [1], baby_mouth [2], manual_breastpump [3] , electric_breastpump [4], hand_expressing [5], cow milker [6], weak baby_mouth [7], stimulation during sex/sex play [8]
  816. !! ARGS[2] = milk_demand: how much milk is demanded. Warning: Should be ml and not in ml*10 for ease of use. :D
  817. !! result = Time in Minutes
  818. !! Usage: breastmilktimetoget = func('lact_lib','$get_breastmilk_time', 2, 150)
  819. !! This function is just calculating the amount of time needed to get a specific amount of milk from svetas breasts. It is not pumping milk from her or changes anything else.
  820. !! If you want to milk sveta, use get_breastmilk.
  821. if lactation['active'] > 0:
  822. !! suck_flow_rate initialized Base Rate of sucking is 10ml/minute x 1000.
  823. lactation['suck_flow_rate'] = func('lact_lib','get_suckflowrate', ARGS[1])
  824. !! max nip flow rate initialized
  825. lactation['max_nip_flow_rate'] = func('lact_lib','get_maxnipflowrate')
  826. !! getting temp lactaterate
  827. if (lactation['lactaterate']/60) < 1 and lactation['lactaterate'] > 0:
  828. lactation['lactaterate_per_min'] = 1
  829. else
  830. lactation['lactaterate_per_min'] = lactation['lactaterate']/60
  831. end
  832. !! resetting lactation['milk_time_output'] to 0
  833. lactation['milk_time_output'] = 0
  834. !! getting breast milking time
  835. if lactation['breastmv'] >= (ARGS[2]*1000):
  836. if lactation['max_nip_flow_rate'] <= lactation['suck_flow_rate']:
  837. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['max_nip_flow_rate']
  838. else
  839. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['suck_flow_rate']
  840. end
  841. result = lactation['milk_time_output']
  842. elseif lactation['breastmv'] > 0 and lactation['breastmv'] < (ARGS[2]*1000):
  843. if lactation['max_nip_flow_rate'] <= lactation['suck_flow_rate']:
  844. lactation['milk_time_output'] = lactation['breastmv']/lactation['max_nip_flow_rate']
  845. temp_var2 = (ARGS[2]*1000) - lactation['breastmv']
  846. if lactation['max_nip_flow_rate'] <= lactation['lactaterate_per_min']:
  847. lactation['milk_time_output'] += temp_var2/lactation['max_nip_flow_rate']
  848. else
  849. lactation['milk_time_output'] += temp_var2/lactation['lactaterate_per_min']
  850. end
  851. else
  852. lactation['milk_time_output'] = lactation['breastmv']/lactation['suck_flow_rate']
  853. temp_var2 = (ARGS[2]*1000) - lactation['breastmv']
  854. if lactation['suck_flow_rate'] <= lactation['lactaterate_per_min']:
  855. lactation['milk_time_output'] += temp_var2/lactation['suck_flow_rate']
  856. else
  857. lactation['milk_time_output'] += temp_var2/lactation['lactaterate_per_min']
  858. end
  859. end
  860. result = lactation['milk_time_output']
  861. elseif lactation['breastmv'] <=0:
  862. if lactation['max_nip_flow_rate'] <= lactation['suck_flow_rate']:
  863. if lactation['max_nip_flow_rate'] <= lactation['lactaterate_per_min']:
  864. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['max_nip_flow_rate']
  865. else
  866. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['lactaterate_per_min']
  867. end
  868. else
  869. if lactation['suck_flow_rate'] <= lactation['lactaterate_per_min']:
  870. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['suck_flow_rate']
  871. else
  872. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['lactaterate_per_min']
  873. end
  874. end
  875. result = lactation['milk_time_output']
  876. else
  877. result = 0
  878. end
  879. else
  880. result = 0
  881. end
  882. end
  883. if $ARGS[0] = '$get_breastmilk':
  884. !! func('lact_lib','$get_breastmilk', sucktion_type, sucktion_time)
  885. !! ARGS[1] = sucktion_type: the type of suction. adult_mouth [0], child_mouth [1], baby_mouth [2], manual_breastpump [3] , electric_breastpump [4], hand_expressing [5], cow milker [6], weak baby_mouth [7], stimulation during sex/sex play [8]
  886. !! ARGS[2] = sucktion_time: how many minutes the sucking/pumping takes place
  887. !! Usage: breastmilkvolume = func('lact_lib','$get_breastmilk', 4, 20)
  888. !! result = Milk in ml*10
  889. !! Sveta, someone or something tries to milk Svetas breasts, so the daily variable breastpumped is switched on. This is used for the breastcycle/femcycle. If this is not switched on, possible changes like prolactinlvl etc go down.
  890. lactation['breastpumped'] = 1
  891. !! suck_flow_rate initialized Base Rate of sucking is 10ml/minute.
  892. lactation['suck_flow_rate'] = func('lact_lib','get_suckflowrate', ARGS[1])
  893. !! max nip flow rate initialized
  894. lactation['max_nip_flow_rate'] = func('lact_lib','get_maxnipflowrate')
  895. !! will there be a mood change?
  896. pcs_mood += func('lact_lib','get_maxnipflowrate',ARGS[1],ARGS[2])
  897. !! get soreness that will result from pumping/sucking/massaging
  898. lactation['soreness_mod'] = func('lact_lib','get_sorenessmod')
  899. !! If Sveta is not lactating we still need to do some actions. This is handled in here. Nipple pain + breast pain are applied as well as stamina is used.
  900. if lactation['active']<= 0:
  901. if lactation['dailyoverdemand'] <= 0: lactation['dailyoverdemand'] = 0
  902. pump_stop_brake = 0
  903. !! This is how much milk demand is applied to the breasts. In this function it is needed to calculate the nipple pain and breast pain.
  904. lactation['max_sucktion_demand'] = lactation['suck_flow_rate']*ARGS[2]
  905. if pain['nipples'] <= 60:
  906. suck_until_pain = (((60 - pain['nipples'])*lactation['soreness_mod'])*10000)/lactation['suck_flow_rate']
  907. end
  908. temp_var = pain['nipples'] + lactation['max_sucktion_demand']/(lactation['soreness_mod']*10000)
  909. if temp_var > 60:
  910. pain['nipples'] = 65
  911. pump_stop_brake = 1
  912. pumptime = suck_until_pain
  913. lactation['max_sucktion_demand'] = lactation['suck_flow_rate']*pumptime
  914. else
  915. pumptime = ARGS[2]
  916. pain['nipples'] += lactation['max_sucktion_demand']/(lactation['soreness_mod']*10000)
  917. end
  918. temp_var = pain['breasts'] + lactation['max_sucktion_demand']/10000
  919. if temp_var > 20:
  920. pain['breasts'] = 25
  921. else
  922. pain['breasts'] += lactation['max_sucktion_demand']/10000
  923. end
  924. !! Pumping breasts is exhausting even if no milk comes. Pumping will impact the stamina of Sveta if she is not lactating.
  925. temp_var = pcs_stam - (lactation['max_sucktion_demand']/30000)
  926. if temp_var < 0:
  927. pcs_stam = 0
  928. !! energy usage flag on.
  929. energytomilkpump = 1
  930. gs 'sweat', 'add', pumptime/30
  931. else
  932. pcs_stam -= lactation['max_sucktion_demand']/30000
  933. gs 'sweat', 'add', pumptime/30
  934. !! energy usage flag on.
  935. energytomilkpump = 1
  936. end
  937. if pumptime < 10:
  938. breastcounter += 1
  939. else
  940. breastcounter += pumptime/10
  941. end
  942. lactation['dailyoverdemand'] += lactation['max_sucktion_demand']
  943. func('lact_lib','breast_engorment')
  944. result = 0
  945. elseif lactation['active'] > 0:
  946. !! How much milk demand is applied to the breasts.
  947. lactation['max_sucktion_demand'] = lactation['suck_flow_rate']*ARGS[2]
  948. !! We want to know if we can just suck out what is already stored or if additional milk production is needed to go through the whole pumping/sucking.
  949. !! If we only need 20ml from a 100ml storage, we would only substract 20ml, leaving 80ml inside the breasts.
  950. !! Also lets make sure we start at zero from the stuff we get from Sveta.
  951. lactation['get_bm_milkedvolume'] = 0
  952. !! Case: Enough milk in Svetas breasts, covering the demand
  953. if lactation['breastmv'] >= lactation['max_sucktion_demand']:
  954. !! Checking if svetas nipple flow is enough to serve the demand. If yes - get the demand; If no - get what she is able to give us.
  955. !! we still should not be able to give more milk than we can for that time, so commenting "if"
  956. if lactation['max_nip_flow_rate'] >= lactation['suck_flow_rate']:
  957. lactation['get_bm_milkedvolume'] = lactation['max_sucktion_demand']
  958. lactation['breastmv'] -= lactation['max_sucktion_demand']
  959. else
  960. lactation['get_bm_milkedvolume'] = lactation['max_nip_flow_rate']*ARGS[2]
  961. lactation['breastmv'] -= lactation['get_bm_milkedvolume']
  962. end
  963. pumptime = ARGS[2]
  964. !! Case: Not enough milk in Svetas breasts.
  965. elseif lactation['breastmv'] < lactation['max_sucktion_demand']:
  966. !! We have two sub cases in this one. Sveta has no lactation['breastmv'] and Sveta has not enough lactation['breastmv']. This means she has to produce more milk, but first we need to know how much is needed.
  967. !! temp_var will be the amount of milk Sveta has to produce to serve the demand. pump time left is the time left after lactation['breastmv'] is drained.
  968. if lactation['breastmv'] <= 0:
  969. temp_var = lactation['max_sucktion_demand']
  970. pumptime_left = ARGS[2]
  971. else
  972. temp_var = lactation['max_sucktion_demand'] - lactation['breastmv']
  973. if lactation['max_nip_flow_rate'] >= lactation['suck_flow_rate']:
  974. pumptime_left = ARGS[2] - (lactation['breastmv']/lactation['suck_flow_rate'])
  975. else
  976. pumptime_left = ARGS[2] - (lactation['breastmv']/lactation['max_nip_flow_rate'])
  977. end
  978. end
  979. !! Next check is for cases when not only there is less milk than demanded, but also not enough max_nip_flow_rate
  980. if pumptime_left > 0:
  981. pumptime = ARGS[2] - pumptime_left + 1
  982. !! time to add the pumped lactation['breastmv'] to the milkedvolume and empty lactation['breastmv'].
  983. lactation['get_bm_milkedvolume'] += lactation['breastmv']
  984. lactation['breastmv'] = 0
  985. else
  986. pumptime_left = 0
  987. pumptime = ARGS[2]
  988. lactation['get_bm_milkedvolume'] += lactation['max_nip_flow_rate'] * ARGS[2]
  989. lactation['breastmv'] -= lactation['max_nip_flow_rate'] * ARGS[2]
  990. end
  991. !! Now we check if sveta was able to make it or not. If not we have milk overdemand which will be used in femcycle to make her produce more milk next day.
  992. !! if temp_var > lactation['get_bm_milkedvolume']: lactation['dailyoverdemand'] += (temp_var - lactation['get_bm_milkedvolume'])
  993. !! as we stop pumping when there is no more milk lets just add 1 minute of pumping for overdemand
  994. if lactation['max_nip_flow_rate'] >= lactation['suck_flow_rate']:
  995. if temp_var > lactation['get_bm_milkedvolume']: lactation['dailyoverdemand'] += (lactation['suck_flow_rate'] * pumptime - lactation['get_bm_milkedvolume'])
  996. else
  997. if temp_var > lactation['get_bm_milkedvolume']: lactation['dailyoverdemand'] += (lactation['max_nip_flow_rate'] * pumptime - lactation['get_bm_milkedvolume'])
  998. end
  999. !! Here we have nipple and breastpain. The idea is - if there is more suction than the nipples can take more pain is applied. If the breasts make less milk then demanded pain to the breasts is applied.
  1000. !! Else - there will only be nipple pain.
  1001. if lactation['max_nip_flow_rate'] < lactation['suck_flow_rate']:
  1002. temp_var = pain['nipples'] + ((lactation['suck_flow_rate'] - lactation['max_nip_flow_rate']) * pumptime)/(lactation['soreness_mod'] * 10000)
  1003. if temp_var >= 60:
  1004. pain['nipples'] = 65
  1005. elseif temp_var <= 0:
  1006. pain['nipples'] += 1
  1007. else
  1008. pain['nipples'] += ((lactation['suck_flow_rate'] - lactation['max_nip_flow_rate']) * pumptime)/(lactation['soreness_mod'] * 10000)
  1009. end
  1010. else
  1011. if (pumptime + 1) < 10:
  1012. pain['nipples'] += 1
  1013. else
  1014. pain['nipples'] += ((pumptime + 1)/10)
  1015. end
  1016. end
  1017. if lactation['max_nip_flow_rate'] >= lactation['suck_flow_rate']:
  1018. if lactation['suck_flow_rate'] > (lactation['lactaterate']/60):
  1019. temp_var = pain['breasts'] + ((lactation['suck_flow_rate']-(lactation['lactaterate']/60)) * pumptime)/(lactation['soreness_mod'] * 10000)
  1020. if temp_var > 20:
  1021. pain['breasts'] = 20
  1022. else
  1023. pain['breasts'] += ((lactation['suck_flow_rate']-(lactation['lactaterate']/60)) * pumptime)/(lactation['soreness_mod'] * 10000)
  1024. end
  1025. end
  1026. else
  1027. if lactation['max_nip_flow_rate'] > (lactation['lactaterate']/60):
  1028. temp_var = pain['breasts'] + ((lactation['max_nip_flow_rate'] - (lactation['lactaterate']/60)) * pumptime)/(lactation['soreness_mod'] * 10000)
  1029. if temp_var > 20:
  1030. pain['breasts'] = 20
  1031. else
  1032. pain['breasts'] += ((lactation['max_nip_flow_rate'] - (lactation['lactaterate']/60)) * pumptime)/(lactation['soreness_mod'] * 10000)
  1033. end
  1034. end
  1035. end
  1036. end
  1037. if pumptime < 10:
  1038. breastcounter += 1
  1039. else
  1040. breastcounter += pumptime/10
  1041. end
  1042. !! checking for engorgement
  1043. func('lact_lib','breast_engorment')
  1044. !! Done - Result is the milked volume.
  1045. result = lactation['get_bm_milkedvolume']
  1046. end
  1047. end
  1048. --- lact_lib ---------------------------------