1
0

lact_lib.qsrc 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070
  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. if $ARGS[0] = 'lact_switch':
  485. !! Usage func('lact_lib','lact_switch')
  486. if lactation['active'] <= 0:
  487. !! 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.
  488. lactation['pc_aware'] = 0
  489. !! setting lactation to active
  490. lactation['active'] = 1
  491. !! setting breast maximum milk volume via function
  492. lactation['breastmm'] = (lactation['breastglandtissue']*(100 + (lactation['alveoliexpandlvl'] * 40)))*lactation['breastcount']
  493. !! resetting prolactinlvl so that the initial production rate is not too high
  494. if lactation['prolactinlvl'] < 200: lactation['prolactinlvl'] = 200
  495. !! setting the lactation rate. Warning! lactation rate is in ml*1000 now for higher accuracy.
  496. lactation['lactaterate'] = 1000*(lactation['prolactinlvl']/200)
  497. !! setting milk volume in breasts to 0. Will fill up with lactaterate in another part of the breastcycle
  498. lactation['breastmv'] = 0
  499. !! nipples will grow a bit with extended milk channels. If lactation stops, this will be substracted from the nipples again and nipples will shrink.
  500. lactation['nipgrowth'] += rand(5,10)
  501. pcs_nips += lactation['nipgrowth']
  502. if lactation['alveoliexpandlvl'] < 10: lactation['alveoliexpandlvl'] = 10
  503. if lactation['alveoliexpandlvl_change'] < 10: lactation['alveoliexpandlvl_change'] = 10
  504. lactation['milkprod_type'] = 1
  505. else
  506. !! If lactation is on, the stuff below will switch it off again.
  507. lactation['active'] = 0
  508. lactation['lactaterate'] = 0
  509. lactation['breastmv'] = 0
  510. lactation['alveoliexpandlvl'] = 0
  511. lactation['alveoliexpandlvl_change'] = 1
  512. lactation['prolactinlvl'] = 0
  513. if lactation['nipgrowth'] > 0 and lactation['nipgrowth'] <= 10: pcs_nips -= lactation['nipgrowth'] & lactation['nipgrowth'] = 0
  514. lactation['nipgrowth'] = 0
  515. end
  516. !! Always trigger the breastcycle after breast change, or the changes to svetas breasts will not happen.
  517. lactation['result'] = func('lact_lib','breastcycle')
  518. end
  519. !! new breast cycle function, replaced the monster lactation function in femcyc
  520. if $ARGS[0] = 'breastcycle':
  521. !!if lactation['breasttissueinitiated'] <= 0: lactation['result'] = func('lact_lib','init_breasttissue')
  522. lactation['result'] = func('lact_lib','init_breasttissue')
  523. !! usage func('lact_lib','breastcycle')
  524. !! if lactating or not, breasts will grow during pregnancy. This will only happen during first full pregnancy
  525. if pregchem => 2191 and lactation['maturebreast'] <= 0:
  526. !! breastgrowth 40ccm per breast.
  527. !! Checking pregchem last. It should not be smaller than 0.
  528. if lactation['pregchemlast'] <= 0:
  529. lactation['pregchemlast'] = 2191
  530. lactation['preggrowth'] = 0
  531. end
  532. if lactation['preggrowth'] <= 20000 and (pregchem - lactation['pregchemlast']) >= 0:
  533. lactation['preggrowth'] = (pregchem - 2191) * 9
  534. lactation['growthsoreness_on'] = 1
  535. if pain['breasts'] <= 20: pain['breasts'] = 20
  536. else
  537. lactation['growthsoreness_on'] = 0
  538. lactation['maturebreast'] = 1
  539. lactation['result'] = func('lact_lib','lactationBreastGrowth')
  540. lactation['preggrowth'] = 0
  541. end
  542. lactation['pregchemlast'] = pregchem
  543. elseif PregChem > 4383 and lactation['maturebreast'] > 0:
  544. !! pregnancy prolactinlvl rise
  545. if lactation['prolactinlvl'] < 200 and lactation['active'] <= 0:
  546. if rand(0,100) > 25:
  547. lactation['prolactinlvl'] +=1
  548. end
  549. end
  550. end
  551. !! checking for prolactin and if svetas breasts were worked (e.g. breast stimulation via massage, pumps, by mouth, or whatever)
  552. if lactation['active'] <= 0:
  553. !! prolactinlvl calculation. If sveta never was pregnant, prolactinlvl will grow slower
  554. if lactation['milkgrowday'] < daystart:
  555. if (lactation['dailyoverdemand']/200) <= 0 and lactation['dailyoverdemand'] > 0:
  556. lactation['prolactinlvl'] += 1
  557. elseif (lactation['dailyoverdemand']/200) >= 10 and lactation['maturebreast'] <= 0:
  558. lactation['prolactinlvl'] += 10
  559. elseif (lactation['dailyoverdemand']/200) >= 50 and lactation['maturebreast'] > 0:
  560. lactation['prolactinlvl'] += 50
  561. else
  562. if lactation['prolactinlvl'] > 0 and pregchem < 2191:
  563. if ((lactation['prolactinlvl']/2) + (lactation['prolactinlvl']/5) - (lactation['prolactinlvl']/8)) < 1:
  564. lactation['prolactinlvl'] -= 1
  565. else
  566. lactation['prolactinlvl'] -= ((lactation['prolactinlvl']/2) + (lactation['prolactinlvl']/5) - (lactation['prolactinlvl']/8))
  567. end
  568. end
  569. end
  570. end
  571. if lactation['prolactinlvl'] > 200: lactation['prolactinlvl'] = 200
  572. !! expand level cannot be over 5
  573. if lactation['alveoliexpandlvl'] > 10: lactation['alveoliexpandlvl'] = 10
  574. !! Breast growth due to mammarygland expansion. Happens if prolactin level is high enough and will cause breastsoreness.
  575. !! If prolactinlvl lowers, milkglands will shrink again.
  576. if lactation['milkgrowday'] < daystart and lactation['prolactinlvl'] > 100 and lactation['alveoliexpandlvl'] < 10:
  577. lactation['alveoliexpandlvl_change'] = lactation['alveoliexpandlvl']
  578. lactation['alveoliexpandlvl'] += 1
  579. lactation['growthsoreness_on'] = 1
  580. if pain['breasts'] <= 20: pain['breasts'] = 20
  581. elseif lactation['milkgrowday'] < daystart and lactation['prolactinlvl'] < 100 and lactation['prolactinlvl'] > 0 and lactation['alveoliexpandlvl'] > 0:
  582. lactation['alveoliexpandlvl_change'] = lactation['alveoliexpandlvl']
  583. lactation['alveoliexpandlvl'] -= 1
  584. lactation['growthsoreness_on'] = 1
  585. if pain['breasts'] <= 20: pain['breasts'] = 20
  586. end
  587. !! 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
  588. if rand(1,50) + lactation['prolactinlvl'] >= rand(200,250) and lactation['alveoliexpandlvl'] >= 10 and lactation['active'] = 0:
  589. lactation['result'] = func('lact_lib','lact_switch')
  590. end
  591. else
  592. !! things that happen when Sveta is lactating lactation['active'] > 1
  593. if lactation['milkprod_type'] = 1 and lactation['caplactaterate'] <= 0: lactation['caplactaterate'] = 4
  594. if lactation['milkgrowday'] < daystart:
  595. !! 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.
  596. !! funny parabelfunction for the lactrategrowth > 65 - ((1/1466)*((lactrate-304)*(lactrate-304)))
  597. lactation['prolactinlvl'] += (lactation['dailyoverdemand']/10000)
  598. if lactation['dailyoverdemand'] > 0 and lactation['breastpumped'] >= 0 and lactation['lactaterate'] ! 0:
  599. !! adding cap
  600. if (lactation['breastmm'] / lactation['lactaterate']) > lactation['caplactaterate']:
  601. lactation['max_lactrate_growth'] = (65 - ((((lactation['lactaterate']/1000) - 304)*((lactation['lactaterate']/1000) - 304))/1466))*1000
  602. if lactation['max_lactrate_growth'] < ((10*lactation['prolactinlvl'])/2) and lactation['max_lactrate_growth'] >= 1000:
  603. lactation['lactaterate'] += lactation['max_lactrate_growth']
  604. elseif lactation['max_lactrate_growth'] < ((10*lactation['prolactinlvl'])/2) and lactation['max_lactrate_growth'] < 1000:
  605. lactation['lactaterate'] += 1000
  606. else
  607. lactation['lactaterate'] += (10*lactation['prolactinlvl'])/2
  608. end
  609. elseif (lactation['breastmm'] / lactation['lactaterate']) <> lactation['caplactaterate']:
  610. !! lactation rate is dropping with below function.
  611. lactation['lactaterate'] = max(0, lactation['lactaterate'] - (lactation['lactaterate']/2) + (lactation['lactaterate']/5) - (lactation['lactaterate']/8))
  612. !! shrink nipples
  613. if lactation['nipgrowth'] > lactation['useable_cupsize']*3/2:
  614. tmp = max(0, rand(-5, lactation['breastmm']/100000))
  615. pcs_nips -= tmp
  616. lactation['nipgrowth'] -= tmp
  617. killvar 'tmp'
  618. end
  619. end
  620. lactation['prolactinlvl'] = 100
  621. elseif lactation['dailyoverdemand'] <= 0 and lactation['breastpumped'] > 0:
  622. !! If there was no milk overdemand, sveta will keep her lactationrate level.
  623. lactation['prolactinlvl'] = 100
  624. lactation['dailyoverdemand'] = 0
  625. lactation['breastpumped'] = 0
  626. else
  627. !! 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)
  628. lactation['dailyoverdemand'] = 0
  629. lactation['breastpumped'] = 0
  630. if lactation['lactaterate'] > 0:
  631. !! lactation rate is dropping with below function.
  632. lactation['prolactinlvl'] = 100
  633. if ((lactation['lactaterate']/2) + (lactation['lactaterate']/5) - (lactation['lactaterate']/8)) < 10:
  634. lactation['lactaterate'] -= 1
  635. else
  636. lactation['lactaterate'] = (lactation['lactaterate'] - (lactation['lactaterate']/2) + (lactation['lactaterate']/5) - (lactation['lactaterate']/8))
  637. end
  638. elseif lactation['lactaterate'] <= 0 and pregchem >= 4383:
  639. !! during pregnancy lactation is not switched off. Svetas breasts will always produce a bit off milk
  640. lactation['lactaterate'] = 10
  641. elseif lactation['lactaterate'] <= 0:
  642. !! switching off lactation production and making sure prolactin is dropping. Nipples shrink too. There are some changes that are permanent, especially during pregnancy.
  643. lactation['result'] = func('lact_lib','lact_switch')
  644. end
  645. end
  646. end
  647. !! Filling milk into svetas breast every hour and checking for breastengorgement
  648. if lactation['breastmv'] < lactation['breastmm'] and lactation['lactaterate'] >= 500 and lactation['milkprod_type'] = 1:
  649. lactation['breastmv'] += func('lact_lib','prod_milk',lactation['lactaterate'])
  650. !! nipples are growing if Sveta keeps pumping milk
  651. if lactation['nipgrowth'] < lactation['useable_cupsize']*2:
  652. tmp = max(0, rand(-10, lactation['breastmm']/100000))
  653. pcs_nips += tmp
  654. lactation['nipgrowth'] += tmp
  655. killvar 'tmp'
  656. end
  657. elseif lactation['breastmv'] < lactation['breastmm'] and lactation['lactaterate'] >= 500 and lactation['milkprod_type'] = 0:
  658. lactation['breastmv'] += lactation['lactaterate']
  659. if lactation['breastmv'] > lactation['breastmm']: lactation['breastmv'] = lactation['breastmm']
  660. end
  661. !! Reset used_lactaterate, so milk can be produced again.
  662. lactation['used_lactaterate'] = 0
  663. lactation['result'] = func('lact_lib','breast_engorment')
  664. end
  665. if lactation['milkgrowday'] < daystart:
  666. lactation['result'] = func('lact_lib','lactationBreastGrowth')
  667. lactation['dailyoverdemand'] = 0
  668. lactation['milkgrowday'] = daystart
  669. end
  670. end
  671. !! Used for switching off all lactation related content
  672. if $ARGS[0] = 'lactate_optout':
  673. !! usage 1: func('lact_lib','lactate_optout')
  674. !! usage 2: gs 'lact_lib','lactate_optout'
  675. if lactation['active'] > 0:
  676. lactation['result'] = func('lact_lib','lact_switch')
  677. end
  678. lactation['active'] = 0
  679. lactation['prolactinlvl'] = 0
  680. lactation['lactmess'] = 0
  681. lactation['engorgement'] = 0
  682. lactation['breastmv'] = 0
  683. lactation['breastmm'] = 0
  684. lactation['lactaterate'] = 0
  685. lactation['dailyoverdemand'] = 0
  686. end
  687. !! get suckflow rate function
  688. if $ARGS[0] = 'get_suckflowrate':
  689. !! lactation['suck_flow_rate'] = func('lact_lib','get_suckflowrate', sucktion_type)
  690. !! 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.
  691. !! 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]
  692. !! what type of sucktion is happening? different sucktion can cause a different demand of breast milk.
  693. !! Result is base rate of sucktion 10ml/minute x 1000. So if the sucktion rate is 10ml/min then suck_flow_rate = 10000.
  694. !! increased caps
  695. if ARGS[1] = 0:
  696. !! 'adult sucking'
  697. result = 17000
  698. elseif ARGS[1] = 1:
  699. !! 'child sucking'
  700. result = 11000
  701. elseif ARGS[1] = 2:
  702. !! 'baby sucking'
  703. result = 8000
  704. elseif ARGS[1] = 3:
  705. !! 'manual_breastpump sucking'
  706. result = 40000
  707. elseif ARGS[1] = 4:
  708. !! 'electric_breastpump sucking'
  709. result = 100000
  710. elseif ARGS[1] = 5:
  711. !! 'hand expression'
  712. result = 20000
  713. elseif ARGS[1] = 6:
  714. !! 'cow milker sucking'
  715. result = 160000
  716. elseif ARGS[1] = 7:
  717. !! 'weak baby sucking'
  718. result = 5000
  719. elseif ARGS[1] = 8:
  720. !! 'manual stimulation during sex/sex play'
  721. result = 15000
  722. else
  723. !! 'suck flow else branch'
  724. result = 10000
  725. end
  726. end
  727. !! get max nipple flow rate function
  728. if $ARGS[0] = 'get_maxnipflowrate':
  729. !! lactation['max_nip_flow_rate'] = func('lact_lib','get_maxnipflowrate')
  730. !! How much milk can be sucked out through svetas nipples per minute.
  731. !! Result is base rate is 10ml/minute x 1000.
  732. !! 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).
  733. !! increased the cap 10 times
  734. if breastcounter > 0:
  735. lactation['nip_flow_mod'] += breastcounter * 500
  736. breastcounter = 0
  737. end
  738. !! IT IS OVER 90000!
  739. if lactation['nip_flow_mod'] > 90000: lactation['nip_flow_mod'] = 90000
  740. !! linear growth for the nip flowrate
  741. if pcs_nips > 0:
  742. result = ((1000*pcs_nips) + 8000 + lactation['nip_flow_mod'])
  743. else
  744. result = (8000 + lactation['nip_flow_mod'])
  745. end
  746. end
  747. !! get mood modification
  748. if $ARGS[0] = 'get_moodmod':
  749. !! during breastfeeding or pumping or whatever, svetas mood can be pushed up.
  750. !! pcs_mood += func('lact_lib','get_maxnipflowrate', sucktion type, sucktion time)
  751. !! 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]
  752. !! Result = additional mood
  753. if ARGS[1] = 0:
  754. !! 'adult sucking'
  755. lactation['moodmod'] = ARGS[2]/8
  756. elseif ARGS[1] = 1:
  757. !! 'child sucking'
  758. lactation['moodmod'] = ARGS[2]/2
  759. elseif ARGS[1] = 2:
  760. !! 'baby sucking'
  761. lactation['moodmod'] = ARGS[2]
  762. elseif ARGS[1] = 7:
  763. !! 'weak baby sucking'
  764. lactation['moodmod'] = ARGS[2]
  765. else
  766. lactation['moodmod'] = 0
  767. end
  768. if lactation['active'] <= 0: lactation['moodmod'] = (lactation['moodmod']/2)
  769. if (lactation['moodmod'] + pcs_mood) > 100:
  770. result = (100 - pcs_mood)
  771. else
  772. result = lactation['moodmod']
  773. end
  774. end
  775. !! get soreness_mod
  776. !! probably needs a tweak
  777. if $ARGS[0] = 'get_sorenessmod':
  778. !! lactation['soreness_mod'] = func('lact_lib','get_sorenessmod')
  779. if lactation['nipple_cream_applied'] > 0:
  780. lactation['nipple_cream_applied'] = 0
  781. if lactation['dailyoverdemand'] = 0:
  782. result = rand(10,30)
  783. elseif lactation['dailyoverdemand'] <= (lactation['breastmm'] / 2):
  784. result = rand(5,15)
  785. elseif lactation['dailyoverdemand'] <= lactation['breastmm']:
  786. result = rand(4,8)
  787. else
  788. result = rand(3,5)
  789. end
  790. else
  791. if lactation['dailyoverdemand'] = 0:
  792. result = rand(5,10)
  793. elseif lactation['dailyoverdemand'] <= (lactation['breastmm'] / 2):
  794. result = rand(3,6)
  795. elseif lactation['dailyoverdemand'] <= lactation['breastmm']:
  796. result = rand(2,4)
  797. else
  798. result = rand(1,3)
  799. end
  800. end
  801. end
  802. !! get breastmilktime function
  803. if $ARGS[0] = '$get_breastmilk_time':
  804. !! func('lact_lib','$get_breastmilk_time', sucktion_type, milk_demand)
  805. !! 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]
  806. !! ARGS[2] = milk_demand: how much milk is demanded. Warning: Should be ml and not in ml*10 for ease of use. :D
  807. !! result = Time in Minutes
  808. !! Usage: breastmilktimetoget = func('lact_lib','$get_breastmilk_time', 2, 150)
  809. !! 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.
  810. !! If you want to milk sveta, use get_breastmilk.
  811. if lactation['active'] > 0:
  812. !! suck_flow_rate initialized Base Rate of sucking is 10ml/minute x 1000.
  813. lactation['suck_flow_rate'] = func('lact_lib','get_suckflowrate', ARGS[1])
  814. !! max nip flow rate initialized
  815. lactation['max_nip_flow_rate'] = func('lact_lib','get_maxnipflowrate')
  816. !! getting temp lactaterate
  817. if (lactation['lactaterate']/60) < 1 and lactation['lactaterate'] > 0:
  818. lactation['lactaterate_per_min'] = 1
  819. else
  820. lactation['lactaterate_per_min'] = lactation['lactaterate']/60
  821. end
  822. !! resetting lactation['milk_time_output'] to 0
  823. lactation['milk_time_output'] = 0
  824. !! getting breast milking time
  825. if lactation['breastmv'] >= (ARGS[2]*1000):
  826. if lactation['max_nip_flow_rate'] <= lactation['suck_flow_rate']:
  827. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['max_nip_flow_rate']
  828. else
  829. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['suck_flow_rate']
  830. end
  831. result = lactation['milk_time_output']
  832. elseif lactation['breastmv'] > 0 and lactation['breastmv'] < (ARGS[2]*1000):
  833. if lactation['max_nip_flow_rate'] <= lactation['suck_flow_rate']:
  834. lactation['milk_time_output'] = lactation['breastmv']/lactation['max_nip_flow_rate']
  835. temp_var2 = (ARGS[2]*1000) - lactation['breastmv']
  836. if lactation['max_nip_flow_rate'] <= lactation['lactaterate_per_min']:
  837. lactation['milk_time_output'] += temp_var2/lactation['max_nip_flow_rate']
  838. else
  839. lactation['milk_time_output'] += temp_var2/lactation['lactaterate_per_min']
  840. end
  841. else
  842. lactation['milk_time_output'] = lactation['breastmv']/lactation['suck_flow_rate']
  843. temp_var2 = (ARGS[2]*1000) - lactation['breastmv']
  844. if lactation['suck_flow_rate'] <= lactation['lactaterate_per_min']:
  845. lactation['milk_time_output'] += temp_var2/lactation['suck_flow_rate']
  846. else
  847. lactation['milk_time_output'] += temp_var2/lactation['lactaterate_per_min']
  848. end
  849. end
  850. result = lactation['milk_time_output']
  851. elseif lactation['breastmv'] <=0:
  852. if lactation['max_nip_flow_rate'] <= lactation['suck_flow_rate']:
  853. if lactation['max_nip_flow_rate'] <= lactation['lactaterate_per_min']:
  854. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['max_nip_flow_rate']
  855. else
  856. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['lactaterate_per_min']
  857. end
  858. else
  859. if lactation['suck_flow_rate'] <= lactation['lactaterate_per_min']:
  860. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['suck_flow_rate']
  861. else
  862. lactation['milk_time_output'] = (ARGS[2]*1000)/lactation['lactaterate_per_min']
  863. end
  864. end
  865. result = lactation['milk_time_output']
  866. else
  867. result = 0
  868. end
  869. else
  870. result = 0
  871. end
  872. end
  873. if $ARGS[0] = '$get_breastmilk':
  874. !! func('lact_lib','$get_breastmilk', sucktion_type, sucktion_time)
  875. !! 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]
  876. !! ARGS[2] = sucktion_time: how many minutes the sucking/pumping takes place
  877. !! Usage: breastmilkvolume = func('lact_lib','$get_breastmilk', 4, 20)
  878. !! result = Milk in ml*10
  879. !! 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.
  880. lactation['breastpumped'] = 1
  881. !! suck_flow_rate initialized Base Rate of sucking is 10ml/minute.
  882. lactation['suck_flow_rate'] = func('lact_lib','get_suckflowrate', ARGS[1])
  883. !! max nip flow rate initialized
  884. lactation['max_nip_flow_rate'] = func('lact_lib','get_maxnipflowrate')
  885. !! will there be a mood change?
  886. pcs_mood += func('lact_lib','get_maxnipflowrate',ARGS[1],ARGS[2])
  887. !! get soreness that will result from pumping/sucking/massaging
  888. lactation['soreness_mod'] = func('lact_lib','get_sorenessmod')
  889. !! 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.
  890. if lactation['active']<= 0:
  891. if lactation['dailyoverdemand'] <= 0: lactation['dailyoverdemand'] = 0
  892. pump_stop_brake = 0
  893. !! 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.
  894. lactation['max_sucktion_demand'] = lactation['suck_flow_rate']*ARGS[2]
  895. if pain['nipples'] <= 60:
  896. suck_until_pain = (((60 - pain['nipples'])*lactation['soreness_mod'])*10000)/lactation['suck_flow_rate']
  897. end
  898. temp_var = pain['nipples'] + lactation['max_sucktion_demand']/(lactation['soreness_mod']*10000)
  899. if temp_var > 60:
  900. pain['nipples'] = 65
  901. pump_stop_brake = 1
  902. pumptime = suck_until_pain
  903. lactation['max_sucktion_demand'] = lactation['suck_flow_rate']*pumptime
  904. else
  905. pumptime = ARGS[2]
  906. pain['nipples'] += lactation['max_sucktion_demand']/(lactation['soreness_mod']*10000)
  907. end
  908. temp_var = pain['breasts'] + lactation['max_sucktion_demand']/10000
  909. if temp_var > 20:
  910. pain['breasts'] = 25
  911. else
  912. pain['breasts'] += lactation['max_sucktion_demand']/10000
  913. end
  914. !! Pumping breasts is exhausting even if no milk comes. Pumping will impact the stamina of Sveta if she is not lactating.
  915. temp_var = pcs_stam - (lactation['max_sucktion_demand']/30000)
  916. if temp_var < 0:
  917. pcs_stam = 0
  918. !! energy usage flag on.
  919. energytomilkpump = 1
  920. gs 'sweat', 'add', pumptime/30
  921. else
  922. pcs_stam -= lactation['max_sucktion_demand']/30000
  923. gs 'sweat', 'add', pumptime/30
  924. !! energy usage flag on.
  925. energytomilkpump = 1
  926. end
  927. if pumptime < 10:
  928. breastcounter += 1
  929. else
  930. breastcounter += pumptime/10
  931. end
  932. lactation['dailyoverdemand'] += lactation['max_sucktion_demand']
  933. func('lact_lib','breast_engorment')
  934. result = 0
  935. elseif lactation['active'] > 0:
  936. !! How much milk demand is applied to the breasts.
  937. lactation['max_sucktion_demand'] = lactation['suck_flow_rate']*ARGS[2]
  938. !! 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.
  939. !! If we only need 20ml from a 100ml storage, we would only substract 20ml, leaving 80ml inside the breasts.
  940. !! Also lets make sure we start at zero from the stuff we get from Sveta.
  941. lactation['get_bm_milkedvolume'] = 0
  942. !! Case: Enough milk in Svetas breasts, covering the demand
  943. if lactation['breastmv'] >= lactation['max_sucktion_demand']:
  944. !! 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.
  945. !! we still should not be able to give more milk than we can for that time, so commenting "if"
  946. if lactation['max_nip_flow_rate'] >= lactation['suck_flow_rate']:
  947. lactation['get_bm_milkedvolume'] = lactation['max_sucktion_demand']
  948. lactation['breastmv'] -= lactation['max_sucktion_demand']
  949. else
  950. lactation['get_bm_milkedvolume'] = lactation['max_nip_flow_rate']*ARGS[2]
  951. lactation['breastmv'] -= lactation['get_bm_milkedvolume']
  952. end
  953. pumptime = ARGS[2]
  954. !! Case: Not enough milk in Svetas breasts.
  955. elseif lactation['breastmv'] < lactation['max_sucktion_demand']:
  956. !! 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.
  957. !! 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.
  958. if lactation['breastmv'] <= 0:
  959. temp_var = lactation['max_sucktion_demand']
  960. pumptime_left = ARGS[2]
  961. else
  962. temp_var = lactation['max_sucktion_demand'] - lactation['breastmv']
  963. if lactation['max_nip_flow_rate'] >= lactation['suck_flow_rate']:
  964. pumptime_left = ARGS[2] - (lactation['breastmv']/lactation['suck_flow_rate'])
  965. else
  966. pumptime_left = ARGS[2] - (lactation['breastmv']/lactation['max_nip_flow_rate'])
  967. end
  968. end
  969. !! Next check is for cases when not only there is less milk than demanded, but also not enough max_nip_flow_rate
  970. if pumptime_left > 0:
  971. pumptime = ARGS[2] - pumptime_left + 1
  972. !! time to add the pumped lactation['breastmv'] to the milkedvolume and empty lactation['breastmv'].
  973. lactation['get_bm_milkedvolume'] += lactation['breastmv']
  974. lactation['breastmv'] = 0
  975. else
  976. pumptime_left = 0
  977. pumptime = ARGS[2]
  978. lactation['get_bm_milkedvolume'] += lactation['max_nip_flow_rate'] * ARGS[2]
  979. lactation['breastmv'] -= lactation['max_nip_flow_rate'] * ARGS[2]
  980. end
  981. !! 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.
  982. !! if temp_var > lactation['get_bm_milkedvolume']: lactation['dailyoverdemand'] += (temp_var - lactation['get_bm_milkedvolume'])
  983. !! as we stop pumping when there is no more milk lets just add 1 minute of pumping for overdemand
  984. if lactation['max_nip_flow_rate'] >= lactation['suck_flow_rate']:
  985. if temp_var > lactation['get_bm_milkedvolume']: lactation['dailyoverdemand'] += (lactation['suck_flow_rate'] * pumptime - lactation['get_bm_milkedvolume'])
  986. else
  987. if temp_var > lactation['get_bm_milkedvolume']: lactation['dailyoverdemand'] += (lactation['max_nip_flow_rate'] * pumptime - lactation['get_bm_milkedvolume'])
  988. end
  989. !! 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.
  990. !! Else - there will only be nipple pain.
  991. if lactation['max_nip_flow_rate'] < lactation['suck_flow_rate']:
  992. temp_var = pain['nipples'] + ((lactation['suck_flow_rate'] - lactation['max_nip_flow_rate']) * pumptime)/(lactation['soreness_mod'] * 10000)
  993. if temp_var >= 60:
  994. pain['nipples'] = 65
  995. elseif temp_var <= 0:
  996. pain['nipples'] += 1
  997. else
  998. pain['nipples'] += ((lactation['suck_flow_rate'] - lactation['max_nip_flow_rate']) * pumptime)/(lactation['soreness_mod'] * 10000)
  999. end
  1000. else
  1001. if (pumptime + 1) < 10:
  1002. pain['nipples'] += 1
  1003. else
  1004. pain['nipples'] += ((pumptime + 1)/10)
  1005. end
  1006. end
  1007. if lactation['max_nip_flow_rate'] >= lactation['suck_flow_rate']:
  1008. if lactation['suck_flow_rate'] > (lactation['lactaterate']/60):
  1009. temp_var = pain['breasts'] + ((lactation['suck_flow_rate']-(lactation['lactaterate']/60)) * pumptime)/(lactation['soreness_mod'] * 10000)
  1010. if temp_var > 20:
  1011. pain['breasts'] = 20
  1012. else
  1013. pain['breasts'] += ((lactation['suck_flow_rate']-(lactation['lactaterate']/60)) * pumptime)/(lactation['soreness_mod'] * 10000)
  1014. end
  1015. end
  1016. else
  1017. if lactation['max_nip_flow_rate'] > (lactation['lactaterate']/60):
  1018. temp_var = pain['breasts'] + ((lactation['max_nip_flow_rate'] - (lactation['lactaterate']/60)) * pumptime)/(lactation['soreness_mod'] * 10000)
  1019. if temp_var > 20:
  1020. pain['breasts'] = 20
  1021. else
  1022. pain['breasts'] += ((lactation['max_nip_flow_rate'] - (lactation['lactaterate']/60)) * pumptime)/(lactation['soreness_mod'] * 10000)
  1023. end
  1024. end
  1025. end
  1026. end
  1027. if pumptime < 10:
  1028. breastcounter += 1
  1029. else
  1030. breastcounter += pumptime/10
  1031. end
  1032. !! checking for engorgement
  1033. func('lact_lib','breast_engorment')
  1034. !! Done - Result is the milked volume.
  1035. result = lactation['get_bm_milkedvolume']
  1036. end
  1037. end
  1038. --- lact_lib ---------------------------------