lact_lib.qsrc 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. # lact_lib
  2. if $ARGS[0] = '$get_bfat_tissue':
  3. !! func('lact_lib', 'get_bfattissue', npc_nbsize, npc_lactatemm)
  4. !! function to get breast fat tissue amount. Can be used for NPC as well as PC.
  5. !! ARGS[1] = npc_nbsize - the natural bust size of the NPC/PC.
  6. !! ARGS[2] = npc_lactatemm - he lactatemm of the NPC/PC.
  7. !! RESULT = Fat amount in ccm * 10.
  8. !! function for cup size volume in ccm y = 0,0002023*x^3 + 0,029199*x^2 + 4,3791*x + 70
  9. !! x = ((ARGS[1]/5) + 1)*10
  10. !! this function is based on the x figures for pcs_bust size (moving in steps of 5) and the actual cup sizes from a wikipedia table, which can be found here: https://en.wikipedia.org/wiki/Bra_size
  11. !! The function was estimated with excel using a trend line estimation for polynoms of third grade and a y = 0 at 70ccm
  12. !! https://www.ncbi.nlm.nih.gov/pubmed/11936199
  13. !! The percentage of fat volume in the total breast volume varied from 7 to 56% and the percentage of fat weight in the total breast weight varied from 3.6 to 37.6%. This great variability in the respective proportions of fat and glands in the evaluated specimens was not significantly correlated to age and body mass index.
  14. if ARGS[1] > 0:
  15. temp_var = ((ARGS[1]/5) + 1)*10
  16. temp_var2 = (((2023*temp_var*temp_var*temp_var)/10000000)+((29199*temp_var*temp_var)/1000000)+((43791*temp_var)/10000)+70)*10
  17. if temp_var2 > ARGS[2]:
  18. RESULT = temp_var2 - (ARGS[2] + ARGS[2]/50)
  19. elseif temp_var2 = ARGS[2]:
  20. RESULT = 0
  21. else
  22. cls & '<b><font color="red">BAD ARGUMENT CHECK IN <i>$get_bfat_tissue</i>!</font> - Node ARGS[1] - more mammary gland tissue available then total breast tissue.</b>'
  23. end
  24. else
  25. if ARGS[2] > 700:
  26. cls & '<b><font color="red">BAD ARGUMENT CHECK IN <i>$get_bfat_tissue</i>!</font> - Node ARGS[2] - more mammary gland tissue available then total breast tissue.</b>'
  27. else
  28. RESULT = 700
  29. end
  30. end
  31. end
  32. if $ARGS[0] = '$calc_npc_lactatemm_0':
  33. !! func('lact_lib', 'calc_npc_lactatemm_0', npc_glandamount, npc_prodstate, npc_breastage, npc_breastcount)
  34. !! New calc lactatemm function usuable for NPCs. Test function number one.
  35. !! ARGS[1] = npc_glandamount - The glandamount of the npc per breast. Glandamount here is actually the alveoli amount per breast. The value is 4500 to 150000 per breast depending on the genetics or if the npc went through pregnancy already.
  36. !! ARGS[2] = npc_prodstate - The breast production state of the npc. State can be "none", "induced" or "natural".
  37. !! ARGS[3] = npc_breastage - State can be "virgin" or "mature". Virgin in this case means that the breasts did not go through pregnancy changes yet, while mature is a fully developed breast that had all the changes during pregnancy.
  38. !! To determine the breastage, just check if the NPC has gone through pregnancy or not.
  39. !! ARGS[4] = npc_breastcount - The breast count of the NPC. If 0 the result will always be 0. Could be used for amputation events or multiple breasts events.
  40. !! The function will return something even if there is no lactation currently happening. this could be used for special events where sudden lactation is induced with the help of drugs. For example a lactation pill that will cause the NPC to lactate immediately without classical induction or natural growth during pregnancy.
  41. !! RESULT = lactatemm in ml*10
  42. if ARGS[2] = 'none':
  43. if ARGS[3] = 'virgin':
  44. temp_var = 2
  45. elseif ARGS[3] = 'mature':
  46. temp_var = 2
  47. else
  48. cls & '<b><font color="red">BAD ARGUMENT CHECK IN <i>$calc_npc_lactatemm_0</i>!</font> - Node ARGS[2] "none".</b>'
  49. end
  50. elseif ARGS[2] = 'induced':
  51. if ARGS[3] = 'virgin':
  52. temp_var = 20
  53. elseif ARGS[3] = 'mature':
  54. temp_var = 80
  55. else
  56. cls & '<b><font color="red">BAD ARGUMENT CHECK IN <i>$calc_npc_lactatemm_0</i>!</font> - Node ARGS[2] "induced".</b>'
  57. end
  58. elseif ARGS[2] = 'natural':
  59. if ARGS[3] = 'virgin':
  60. temp_var = 20
  61. elseif ARGS[3] = 'mature':
  62. temp_var = 80
  63. else
  64. cls & '<b><font color="red">BAD ARGUMENT CHECK IN <i>$calc_npc_lactatemm_0</i>!</font> - Node ARGS[2] "natural".</b>'
  65. end
  66. else
  67. cls & '<b><font color="red">BAD ARGUMENT CHECK IN <i>$calc_npc_lactatemm_0</i>!</font> - Root Node ARGS[2].</b>'
  68. end
  69. if ARGS[1] <= 0:
  70. RESULT = 0
  71. else
  72. RESULT = (ARGS[1]*temp_var*ARGS[4])/1000
  73. end
  74. end
  75. if $ARGS[0] = '$calc_lactatemm':
  76. !! func('lact_lib', 'calc_lactatemm')
  77. !! No arguments at the moment. Information is taken from the global variables 'nbsize', 'lactate','lactateinduced','kid'.
  78. !! lactatemm should be calculated every day, so if the breasts size is changed naturally the lactatemm will get higher. No change when silicone tits happen. Only natural breast tissue should make milk.
  79. !! Usage: lactatemm = func('lact_lib','$calc_lactatemm')
  80. !! RESULT = lactatemm in ml*10
  81. if lactate = 0:
  82. RESULT = 0
  83. elseif lactate >0:
  84. temp_breastsize = 0
  85. temp_breastsize += nbsize
  86. temp_var = 0
  87. !! This if needs to be changed later. If the kid is lost during the pregnancy, Sveta may still went through full breast development. If changing something here, please contact milky_boobs in the forums.
  88. if kid <= 0:
  89. temp_var = ((8*temp_breastsize*temp_breastsize)+(37*temp_breastsize))/4
  90. RESULT = temp_var
  91. else
  92. RESULT = ((8*temp_breastsize*temp_breastsize)+(37*temp_breastsize))
  93. end
  94. else
  95. cls & '<b><font color="red">BAD ARGUMENT CHECK IN <i>$calc_lactatemm</i>!</font></b>'
  96. end
  97. end
  98. if $ARGS[0] = '$get_breastmilk_time':
  99. !! func('lact_lib','$get_breastmilk_time', sucktion_type, milk_demand)
  100. !! ARGS[1] = sucktion_type: the type of sucktion. adult_mouth [0], child_mouth [1], baby_mouth [2], manual_breastpump [3] , electric_breastpump [4], hand_expressing [5], cow milker [6]
  101. !! ARGS[2] = milk_demand: how much milk is demanded. Warning: Should be ml and not in ml*10 for ease of use. :D
  102. !! RESULT = Time in Minutes
  103. !! Usage: breastmilktimetoget = func('lact_lib','$get_breastmilk_time', 2, 150)
  104. !! 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.
  105. !! If you want to milk sveta, use get_breastmilk.
  106. if lactate > 0:
  107. !! 'suck_flow_rate initialized' Base Rate of sucking is 10ml/minute.
  108. if ARGS[1] = 0:
  109. !! 'adult sucking'
  110. suck_flow_rate = 120
  111. elseif ARGS[1] = 1:
  112. !! 'child sucking'
  113. suck_flow_rate = 110
  114. elseif ARGS[1] = 2:
  115. !! 'baby sucking'
  116. suck_flow_rate = 80
  117. elseif ARGS[1] = 3:
  118. !! 'manual_breastpump sucking'
  119. suck_flow_rate = 180
  120. elseif ARGS[1] = 4:
  121. !! 'electric_breastpump sucking'
  122. suck_flow_rate = 400
  123. elseif ARGS[1] = 5:
  124. !! 'hand expression'
  125. suck_flow_rate = 105
  126. elseif ARGS[1] = 6:
  127. !! 'cow milker sucking'
  128. suck_flow_rate = 1000
  129. else
  130. !! 'suck flow else branch'
  131. suck_flow_rate = 100
  132. end
  133. if pcs_nips > 0:
  134. max_nip_flow_rate = 60
  135. elseif pcs_nips > 20:
  136. max_nip_flow_rate = 80
  137. elseif pcs_nips > 40:
  138. max_nip_flow_rate = 100
  139. elseif pcs_nips > 60:
  140. max_nip_flow_rate = 120
  141. elseif pcs_nips > 80:
  142. max_nip_flow_rate = 140
  143. elseif pcs_nips > 100:
  144. max_nip_flow_rate = 160
  145. else
  146. max_nip_flow_rate = 100
  147. end
  148. if breastcounter > 0:
  149. temp_var = breastcounter/10
  150. soreness_mod += temp_var
  151. if soreness_mod > 20: soreness_mod = 20
  152. if nipple_cream = 1:
  153. soreness_mod += 20
  154. nipple_cream = 0
  155. end
  156. end
  157. nip_flow_mod = 1
  158. temp_var = breastcounter/10
  159. nip_flow_mod += temp_var
  160. if nip_flow > 30: nip_flow_mod = 30
  161. max_nip_flow_rate += nip_flow_mod
  162. if (lactaterate/60) < 1 and lactaterate > 0:
  163. temp_lactaterate = 1
  164. else
  165. temp_lactaterate = lactaterate/60
  166. end
  167. if lactatemv >= (ARGS[2]*10):
  168. if max_nip_flow_rate <= suck_flow_rate:
  169. temp_var = (ARGS[2]*10)/max_nip_flow_rate
  170. else
  171. temp_var = (ARGS[2]*10)/suck_flow_rate
  172. end
  173. RESULT = temp_var
  174. elseif lactatemv > 0 and lactatemv < (ARGS[2]*10):
  175. if max_nip_flow_rate <= suck_flow_rate:
  176. temp_var = lactatemv/max_nip_flow_rate
  177. temp_var2 = (ARGS[2]*10) - lactatemv
  178. if max_nip_flow_rate <= temp_lactaterate:
  179. temp_var += temp_var2/max_nip_flow_rate
  180. else
  181. temp_var += temp_var2/(temp_lactaterate*10)
  182. end
  183. else
  184. temp_var = lactatemv/suck_flow_rate
  185. temp_var2 = (ARGS[2]*10) - lactatemv
  186. if suck_flow_rate <= temp_lactaterate:
  187. temp_var += temp_var2/suck_flow_rate
  188. else
  189. temp_var += temp_var2/(temp_lactaterate*10)
  190. end
  191. end
  192. RESULT = temp_var
  193. elseif lactatemv <=0:
  194. if max_nip_flow_rate <= suck_flow_rate:
  195. if max_nip_flow_rate <= temp_lactaterate:
  196. temp_var = (ARGS[2]*10)/max_nip_flow_rate
  197. else
  198. temp_var = (ARGS[2]*10)/(temp_lactaterate*10)
  199. end
  200. else
  201. if suck_flow_rate <= temp_lactaterate:
  202. temp_var = (ARGS[2]*10)/suck_flow_rate
  203. else
  204. temp_var = (ARGS[2]*10)/(temp_lactaterate*10)
  205. end
  206. end
  207. RESULT = temp_var
  208. else
  209. RESULT = 0
  210. end
  211. else
  212. RESULT = 0
  213. end
  214. end
  215. if $ARGS[0] = '$get_breastmilk':
  216. !! func('lact_lib','$get_breastmilk', sucktion_type, sucktion_time)
  217. !! ARGS[1] = sucktion_type: the type of sucktion. adult_mouth [0], child_mouth [1], baby_mouth [2], manual_breastpump [3] , electric_breastpump [4], hand_expressing [5], cow milker [6]
  218. !! ARGS[2] = sucktion_time: how many minutes the sucking/pumping takes place
  219. !! Usage: breastmilkvolume = func('lact_lib','$get_breastmilk', 4, 20)
  220. !! RESULT = Milk in ml*10
  221. !! Sveta, someone or something tries to milk Svetas breasts, so the daily variable breastpumped is switched on. This is used for the femcycle. If this is not switched on, possible changes like prolactinlvl etc go down.
  222. breastpumped = 1
  223. if soreness_mod <= 0: soreness_mod = 1
  224. !! what type of sucktion is happening? different sucktion can cause a different demand of breastmilk. Base rate of sucktion is 10ml/minute x 10. So if the sucktion rate is 10ml/min then suck_flow_rate = 100.
  225. if ARGS[1] = 0:
  226. !! 'adult sucking'
  227. suck_flow_rate = 120
  228. temp_var = pcs_mood +(ARGS[2]/8)
  229. if temp_var > 100:
  230. pcs_mood = 100
  231. else
  232. pcs_mood += ARGS[2]/8
  233. end
  234. elseif ARGS[1] = 1:
  235. !! 'child sucking'
  236. suck_flow_rate = 110
  237. temp_var = pcs_mood + (ARGS[2]/2)
  238. if temp_var > 100:
  239. pcs_mood = 100
  240. else
  241. pcs_mood += ARGS[2]/2
  242. end
  243. elseif ARGS[1] = 2:
  244. !! 'baby sucking'
  245. suck_flow_rate = 80
  246. temp_var = pcs_mood + ARGS[2]
  247. if temp_var > 100:
  248. pcs_mood = 100
  249. else
  250. pcs_mood += ARGS[2]
  251. end
  252. elseif ARGS[1] = 3:
  253. !! 'manual_breastpump sucking'
  254. suck_flow_rate = 180
  255. elseif ARGS[1] = 4:
  256. !! 'electric_breastpump sucking'
  257. suck_flow_rate = 400
  258. elseif ARGS[1] = 5:
  259. !! 'hand expression'
  260. suck_flow_rate = 105
  261. elseif ARGS[1] = 6:
  262. !! 'cow milker sucking'
  263. suck_flow_rate = 1000
  264. else
  265. !! 'suck flow else branch'
  266. suck_flow_rate = 100
  267. end
  268. !! If you pump and work your breast more, soreness will decrease after pumping. This can also decline if your breasts arent worked for a longer time.
  269. if breastcounter > 0:
  270. temp_var = breastcounter/10
  271. soreness_mod += temp_var
  272. if soreness_mod > 30: soreness_mod = 30
  273. if nipple_cream = 1:
  274. soreness_mod += 20
  275. nipple_cream = 0
  276. end
  277. end
  278. !! 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.
  279. if lactate <= 0:
  280. if milkoverdemand <= 0: milkoverdemand = 0
  281. pump_stop_brake = 0
  282. !! 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.
  283. max_sucktion_demand = suck_flow_rate*ARGS[2]
  284. if pain['nipples'] <= 60:
  285. suck_until_pain = (((60 - pain['nipples'])*soreness_mod)*10)/(suck_flow_rate/18)
  286. end
  287. temp_var = pain['nipples'] + max_sucktion_demand/(soreness_mod*100)
  288. if temp_var > 60:
  289. pain['nipples'] = 65
  290. pump_stop_brake = 1
  291. pumptime = suck_until_pain
  292. max_sucktion_demand = suck_flow_rate*pumptime
  293. else
  294. pain['nipples'] += max_sucktion_demand/(soreness_mod*100)
  295. end
  296. temp_var = pain['breasts'] + max_sucktion_demand/10000
  297. if temp_var > 20:
  298. pain['breasts'] = 25
  299. else
  300. pain['breasts'] += max_sucktion_demand/10000
  301. end
  302. !! Pumping breasts is exhausting even if no milk comes. Pumping will impact the stamina of Sveta if she is not lactating.
  303. temp_var = pcs_stam - max_sucktion_demand/300
  304. if temp_var < 0:
  305. pcs_stam = 0
  306. !! energy usage flag on.
  307. energytomilkpump = 1
  308. pcs_sweat += max_sucktion_demand/1000
  309. else
  310. pcs_stam -= max_sucktion_demand/300
  311. pcs_sweat += max_sucktion_demand/1000
  312. !! energy usage flag on.
  313. energytomilkpump = 1
  314. end
  315. if pumptime < 10:
  316. breastcounter += 1
  317. else
  318. breastcounter += pumptime/10
  319. end
  320. milkoverdemand += max_sucktion_demand
  321. RESULT = 0
  322. elseif lactate > 0:
  323. !! How much milk can go through the nipple. Base rate is 10ml/minute (100) when sucktion is applied to the nipple. If the demand is higher than the nipple can push through, nipple soreness will happen more quickly.
  324. if pcs_nips > 0:
  325. max_nip_flow_rate = 60
  326. elseif pcs_nips > 20:
  327. max_nip_flow_rate = 80
  328. elseif pcs_nips > 40:
  329. max_nip_flow_rate = 100
  330. elseif pcs_nips > 60:
  331. max_nip_flow_rate = 120
  332. elseif pcs_nips > 80:
  333. max_nip_flow_rate = 140
  334. elseif pcs_nips > 100:
  335. max_nip_flow_rate = 160
  336. else
  337. max_nip_flow_rate = 100
  338. end
  339. !! If you pump more, more milk will be able to flow out, disregarding nipplesize. Svetas nipples will get used to have milk stream through them, grows and drops with the breastcounter.
  340. nip_flow_mod = 1
  341. nip_flow_mod += breastcounter
  342. if nip_flow > 400: nip_flow_mod = 400
  343. max_nip_flow_rate += nip_flow_mod
  344. !! How much milk demand is applied to the breasts.
  345. max_sucktion_demand = suck_flow_rate*ARGS[2]
  346. !! 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.
  347. !! If we only need 20ml from a 100ml storage, we would only substract 20ml, leaving 80ml inside the breasts.
  348. !! Also lets make sure we start at zero from the stuff we get from Sveta.
  349. milkedvolume = 0
  350. !! Case: Enough milk in Svetas breasts, covering the demand
  351. if lactatemv >= max_sucktion_demand:
  352. !! 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.
  353. if max_nip_flow_rate >= suck_flow_rate:
  354. milkedvolume = max_sucktion_demand
  355. lactatemv -= max_sucktion_demand
  356. else:
  357. milkedvolume = max_nip_flow_rate*ARGS[2]
  358. lactatemv -= milkedvolume
  359. end
  360. !! Case: Not enough milk in Svetas breasts.
  361. elseif lactatemv < max_sucktion_demand:
  362. !! We have two sub cases in this one. Sveta has no lactatemv and Sveta has not enough lactatemv. This means she has to produce more milk, but first we need to know how much is needed.
  363. !! temp_var will be the amount of milk Sveta has to produce to serve the demand. pump time left is the time left after lactatemv is drained.
  364. if lactatemv <= 0:
  365. temp_var = max_sucktion_demand
  366. pumptime_left = ARGS[2]
  367. else
  368. temp_var = max_sucktion_demand - lactatemv
  369. if max_nip_flow_rate >= suck_flow_rate:
  370. pumptime_left = ARGS[2] - (lactatemv/suck_flow_rate)
  371. else
  372. pumptime_left = ARGS[2] - (lactatemv/max_nip_flow_rate)
  373. end
  374. if pumptime_left < 0: pumptime_left = 0
  375. end
  376. !! Now we know how much time we have and how much demand we have. Time to check if Sveta can do it.
  377. !! For the case, that svetas milk flow is not big enough pumptime left will be 0, therefore this is handled here.
  378. if pumptime_left >0:
  379. if max_nip_flow_rate >= suck_flow_rate:
  380. !! the lactaterate is per hour, so it is possible that lactaterate will end up being zero when devided by 60. therefore everything here is multiplied by 100.
  381. if (suck_flow_rate*100) <= ((lactaterate*100)/60):
  382. milkedvolume += suck_flow_rate*pumptime_left
  383. else
  384. milkedvolume += ((((lactaterate*100)/60)*pumptime_left)/100)
  385. breastcounter += 2
  386. end
  387. else
  388. !! Same here as above.
  389. if (max_nip_flow_rate*100) <= ((lactaterate*100)/60):
  390. milkedvolume += max_nip_flow_rate*pumptime_left
  391. breastcounter += 2
  392. else
  393. milkedvolume += ((((lactaterate*100)/60)*pumptime_left)/100)
  394. breastcounter += 2
  395. end
  396. end
  397. !! Produced milk needs to be subtracted from the hourly lactate rate, so femcycle is only adding the milk that was not produced yet in the next hour
  398. if pumptime_left > 60:
  399. if ((pumptime_left*100)/60) > 100:
  400. lactaterate_use -= ((((lactaterate*100)/60)*(pumptime_left mod 60))/100)
  401. else
  402. lactaterate_use = lactaterate
  403. end
  404. else
  405. if lactaterate >= lactaterate_use:
  406. lactaterate_use -= milkedvolume
  407. else
  408. lactaterate_use = lactaterate
  409. end
  410. end
  411. if lactaterate_use <= 0: lactaterate_use = 0
  412. !! Sveta had to make milk, so she needs to use some of her body resources to make the milk.
  413. if milkedvolume > 0:
  414. !! energy usage flag on. Can be used in events to show that sveta is getting hungry or thirsty
  415. energytomilkpump = 1
  416. pcs_stam -= max_sucktion_demand/300
  417. if pcs_stam <= 0: pcs_stam = 0
  418. pcs_sweat += max_sucktion_demand/1000
  419. pcs_hydra -= milkedvolume/120
  420. if pcs_hydra < 1: pcs_hydra = 1
  421. pcs_energy -= milkedvolume/1200
  422. end
  423. end
  424. !! 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.
  425. if temp_var > milkedvolume:
  426. milkoverdemand += (temp_var - milkedvolume)
  427. end
  428. !! time to add the pumped lactatemv to the milkedvolume and empty lactatemv.
  429. milkedvolume += lactatemv
  430. lactatemv = 0
  431. !! Here we have nipple and breastpain. The idea is - if there is more sucktion than the nipples can take more pain is applied. If the breasts make less milk then demanded pain to the breasts is applied.
  432. !! Else - there will only be nipple pain.
  433. if max_nip_flow_rate < suck_flow_rate:
  434. temp_var = pain['nipples'] + ((suck_flow_rate - max_nip_flow_rate)*100*ARGS[2])/2000 - (soreness_mod*ARGS[2])*15
  435. if temp_var >= 60:
  436. pain['nipples'] = 65
  437. elseif temp_var <= 0:
  438. pain['nipples'] += 1
  439. else
  440. pain['nipples'] += (((suck_flow_rate - max_nip_flow_rate)*100*ARGS[2])/2000 - (soreness_mod*ARGS[2])*15)
  441. end
  442. else
  443. if ARGS[2] < 10:
  444. pain['nipples'] += 1
  445. elseif ARGS[2] >= 10 and soreness_mod > ARGS[2]:
  446. pain['nipples'] += 1
  447. else
  448. pain['nipples'] += (ARGS[2]/10 - soreness_mod/10)
  449. end
  450. end
  451. if max_nip_flow_rate >= suck_flow_rate:
  452. if (suck_flow_rate*100) > ((lactaterate*100)/60):
  453. temp_var = pain['breasts'] + (((suck_flow_rate*100)-((lactaterate*100)/60))*pumptime_left)/1000
  454. if temp_var > 20:
  455. pain['breasts'] = 20
  456. else
  457. pain['breasts'] += (((suck_flow_rate*100)-((lactaterate*100)/60))*pumptime_left)/1000
  458. end
  459. end
  460. else
  461. if (max_nip_flow_rate*100) > ((lactaterate*100)/60):
  462. temp_var = pain['breasts'] + (((max_nip_flow_rate*100)-((lactaterate*100)/60))*pumptime_left)/1000
  463. if temp_var > 20:
  464. pain['breasts'] = 20
  465. else
  466. pain['breasts'] += (((max_nip_flow_rate*100)-((lactaterate*100)/60))*pumptime_left)/1000
  467. end
  468. end
  469. end
  470. end
  471. if pumptime < 10:
  472. breastcounter += 1
  473. else
  474. breastcounter += pumptime/10
  475. end
  476. !! Done - Result is the milked volume.
  477. RESULT = milkedvolume
  478. end
  479. end
  480. !! bp_milking - breast pump milking
  481. !! use href="exec:gt ''lact_lib'',''bp_milking''"
  482. if $ARGS[0] = 'bp_milking':
  483. pumptime = 0
  484. pumptype = 0
  485. if pump_bottletype < 1500: pump_bottletype = 1500
  486. if bpbottles <= 0: bpbottles = 1
  487. if $location_type ! 'bathroom' and pcs_exhibition < 60:
  488. 'You can''t use it here.'
  489. else
  490. *clr
  491. cla
  492. 'How long do you want to pump your breasts with the manual breast pump?'
  493. if bpbottlem > 0:
  494. if pump_bottletype = 1500:
  495. 'Current bottle size in use: &gt;150ml | <a href="exec:pump_bottletype = 2500 & gt ''lact_lib'', ''bp_milking''">250ml</a>'
  496. else
  497. 'Current bottle size in use <a href="exec:pump_bottletype = 1500 & gt ''lact_lib'', ''bp_milking''">150ml</a> | &gt;250ml'
  498. end
  499. end
  500. '<center><img <<$set_imgh>> src="images/pc/body/tits/breast_pump.jpg"></center>'
  501. if lactatemv > 0:
  502. pumptime = (func('lact_lib','$get_breastmilk_time', 3, (lactatemv/10)))
  503. if pumptime > 5:
  504. pumptime -= 2
  505. end
  506. if pumptime > 60:
  507. act 'Pump until breasts are empty':
  508. *clr
  509. cla
  510. minut += 2
  511. 'As you prepare for pumping you weight your breasts in your hands. You feel that your breasts carry a large amount of milk and pumping will probably take a long time.'
  512. 'Getting relieve for your breasts with the manual breast pump will probably take at least <<pumptime>> minutes.'
  513. if pcs_know_mward <= 0:
  514. 'You concider visiting a hospital to get help or buying a better breastpump.'
  515. pcs_ask_mward_help = 1
  516. pcs_knows_electric_pump = 1
  517. end
  518. 'Do you want to continue?'
  519. act 'Don''t pump':gt $loc, $metka
  520. act 'Continue':
  521. gt 'lact_lib', 'milking'
  522. end
  523. end
  524. elseif pumptime <= 0:
  525. act 'Pump until breasts are empty':
  526. *clr
  527. cla
  528. minute += 2
  529. 'As you prepare for pumping you weight your breasts in your hands. Your breasts feel really empty. There is no need to pump now.'
  530. act 'Don''t pump':gt $loc, $metka
  531. act 'back':gt 'lact_lib', 'bp_milking'
  532. end
  533. else
  534. act 'Pump until breasts are empty':
  535. pumptime = func('lact_lib','$get_breastmilk_time', 3, (lactatemv/10))
  536. if pumptime > 5:
  537. pumptime -= 2
  538. end
  539. gt 'lact_lib', 'milking'
  540. end
  541. end
  542. end
  543. act '15 Minutes':
  544. pumptime = 15
  545. gt 'lact_lib', 'milking'
  546. end
  547. act '30 Minutes':
  548. pumptime = 30
  549. gt 'lact_lib', 'milking'
  550. end
  551. act 'Custom':
  552. pumptime = input ("How long do you plan to pump your breasts? (Not more than 60 minutes)")
  553. if pumptime <= 0 or pumptime > 60:
  554. minut += 2
  555. act 'Don''t pump':gt $loc, $metka
  556. act 'back':gt 'lact_lib', 'bp_milking'
  557. elseif pumptime > 0 and pumptime <= 60:
  558. gt 'lact_lib', 'milking'
  559. end
  560. end
  561. act 'Don''t pump':gt $loc, $metka
  562. end
  563. end
  564. !! man_milking - manual (with hands) milking
  565. !! use href="exec:gt ''lact_lib'',''man_milking''"
  566. !! Warning! Protoype function! Don not make changes to this function as it is not used yet!
  567. if $ARGS[0] = 'man_milking':
  568. pumptime = 0
  569. pumptype = 1
  570. if $location_type ! 'bathroom' and pcs_inhib < 60:
  571. 'You can''t do this here.'
  572. else
  573. *clr
  574. cla
  575. pumptime = input ("How long would you like to milk your breasts? (Not more than 60 minutes)")
  576. if pumptime <= 0 or pumptime > 60:
  577. minut += 2
  578. act 'Don''t milk':gt $loc, $metka
  579. elseif pumptime > 0 and pumptime <= 60:
  580. gt 'lact_lib', 'milking'
  581. end
  582. end
  583. end
  584. !! milking
  585. !! never use directly. Always use bp_milking, man_milking or sex_milking
  586. if $ARGS[0] = 'milking':
  587. !! if pumptime <= 0 or pumptime > 60:
  588. !! act 'Finish':gt $loc, $metka
  589. !! end
  590. if pumptype = 1:
  591. pumptime = (pumptime*6)/10
  592. end
  593. !! :loop
  594. !! if k < kid:
  595. !! gs 'kid','kidlist'
  596. !! k += 1
  597. !! jump 'loop'
  598. !! end
  599. if lactate > 0 and pain['nipples'] < 60:
  600. milkedvolume = func('lact_lib','$get_breastmilk', 3, pumptime)
  601. '<center><img <<$set_imgh>> src="images/pc/body/tits/pump_lactating.jpg"></center>'
  602. if pumptime > 1:
  603. 'You attach the pump to your breast and start rythmically squeezing the bulb for <<pumptime>> minutes.'
  604. else
  605. 'You attach the pump to your breast and start rythmically squeezing the bulb for one minute.'
  606. end
  607. !! Fill the bottles :D
  608. if milkedvolume > pump_bottletype and (bpbottles*1500 + bpbottlem*2500) = pump_bottletype:
  609. 'During pumping you have to empty the collecting bottle as it filled up with your milk.'
  610. 'You give it a few more pumps and detach the pump.<br>You filled the bottle with <<pump_bottletype/10>>ml of your milk.'
  611. 'To collect all your pumped milk you should probably check if the pharmacy has additional bottles for your breast pump.'
  612. pcs_knowsmilkbottles = 1
  613. elseif milkedvolume > pump_bottletype and (bpbottles*1500 + bpbottlem*2500) > pump_bottletype:
  614. !! Checking which bottletype is used and filling those bottles up before the other type is used.
  615. bp_used_mbottle = 0
  616. bp_used_sbottle = 0
  617. :sbottleloop
  618. if pump_bottletype < 2500 and milkedvolume >= 1500 and bp_used_sbottle < bpbottles:
  619. bp_used_sbottle += 1
  620. milkedvolume -= 1500
  621. jump 'sbottleloop'
  622. end
  623. :mbottleloop
  624. if pump_bottletype >= 2500 and milkedvolume >= 2500 and bp_used_mbottle < bpbottlem:
  625. bp_used_mbottle += 1
  626. milkedvolume -= 2500
  627. jump 'mbottleloop'
  628. end
  629. !! Checking for the milkedvolume and if there are bottles left. if yes - use these bottles
  630. if milkedvolume > 0 and (((bpbottlem - bp_used_mbottle) > 0) or ((bpbottles - bp_used_sbottle) > 0)):
  631. :altfill01
  632. if pump_bottletype < 2500 and milkedvolume >= 2500 and bp_used_mbottle < bpbottlem:
  633. bp_used_mbottle += 1
  634. milkedvolume -= 2500
  635. jump 'altfill01'
  636. end
  637. :altfill02
  638. if pump_bottletype >= 2500 and milkedvolume >= 1500 and bp_used_sbottle < bpbottles:
  639. bp_used_sbottle += 1
  640. milkedvolume -= 1500
  641. jump 'altfill02'
  642. end
  643. end
  644. !! by this point all bottles should have been used up. Everything else needs to end up in the drain.
  645. if milkedvolume > 0 and bpbottlem = bp_used_mbottle and bpbottles = bp_used_sbottle:
  646. 'During pumping you have to switch the collecting bottle as it filled up with your milk. Unfortunately you don''t have enough bottles to collect all your milk.'
  647. 'You had to pour <<milkedvolume/10>>ml of your breast milk into the sink.'
  648. milkedvolume = ((bp_used_mbottle*2500) + (bp_used_sbottle*1500))
  649. elseif milkedvolume > 0 and milkedvolume < 1500 and (bpbottles - bp_used_sbottle) > 0:
  650. 'During pumping you have to switch the collecting bottle as it filled up with your milk.'
  651. elseif milkedvolume > 0 and milkedvolume < 2500 and milkedvolume > 1500 and (bpbottlem - bp_used_mbottle) > 0:
  652. 'During pumping you have to switch the collecting bottle as it filled up with your milk.'
  653. else
  654. 'During pumping you have to switch the collecting bottle as it filled up with your milk.'
  655. end
  656. if bp_used_mbottle >= 1 or bp_used_sbottle >= 1:
  657. '<center><img <<$set_imgh>> src="images/pc/body/tits/bottles_full.jpg"></center>'
  658. if milkedvolume = ((bp_used_mbottle*2500) + (bp_used_sbottle*1500)):
  659. 'You pumped <<milkedvolume/10>>ml of milk from your breasts, collecting it in:'
  660. if bp_used_sbottle = 1:
  661. 'One 150ml bottle'
  662. elseif bp_used_sbottle > 1:
  663. '<<bp_used_sbottle>> x 150ml bottles'
  664. end
  665. if bp_used_mbottle = 1:
  666. 'One 250ml bottle'
  667. elseif bp_used_mbottle > 1:
  668. '<<bp_used_mbottle>> x 250ml bottles'
  669. end
  670. else
  671. 'You pumped <<((bp_used_mbottle*2500)+(bp_used_sbottle*1500)+milkedvolume)/10>>ml of milk from your breasts collecting it in:'
  672. if bp_used_sbottle = 1:
  673. 'One 150ml bottle'
  674. elseif bp_used_sbottle > 1:
  675. '<<bp_used_sbottle>> x 150ml bottles'
  676. end
  677. if bp_used_mbottle = 1:
  678. 'One 250ml bottle'
  679. elseif bp_used_mbottle > 1:
  680. '<<bp_used_mbottle>> x 250ml bottles'
  681. end
  682. if (bpbottles - bp_used_sbottle) > 0 and milkedvolume <= 1500:
  683. 'You also stored <<milkedvolume/10>>ml of breast milk in a 150ml bottle.'
  684. elseif (bpbottlem - bp_used_mbottle) > 0 and milkedvolume <= 2500:
  685. 'You also stored <<milkedvolume/10>>ml of breast milk in a 250ml bottle.'
  686. else
  687. 'unhandled case - you shouldn''t end up here. Please report this in the bug section of Girl Life in the tfg-forums.'
  688. 'bp_used_mbottle: <<bp_used_mbottle>>'
  689. 'bp_used_sbottle: <<bp_used_sbottle>>'
  690. 'milkedvolume: <<milkedvolume>>'
  691. 'pump_bottletype: <<pump_bottletype>>'
  692. 'bpbottles: <<bpbottles>>'
  693. 'bpbottlem: <<bpbottlem>>'
  694. end
  695. milkedvolume += bp_used_mbottle*2500 + bp_used_sbottle*1500
  696. end
  697. else
  698. 'unhandled case - you shouldn''t end up here. Please report this in the bug section of Girl Life in the tfg-forums.'
  699. 'bp_used_mbottle: <<bp_used_mbottle>>'
  700. 'bp_used_sbottle: <<bp_used_sbottle>>'
  701. 'milkedvolume: <<milkedvolume>>'
  702. 'pump_bottletype: <<pump_bottletype>>'
  703. 'bpbottles: <<bpbottles>>'
  704. 'bpbottlem: <<bpbottlem>>'
  705. end
  706. else
  707. 'You give it a few more pumps and detach the pump.<br>You filled the bottle with <<milkedvolume/10>>ml of your milk.'
  708. end
  709. breastcounter += 1
  710. if energytomilkpump > 0 and pcs_energy = 0:
  711. '<br>During pumping you feel really hungry, producing breast milk seems to be more exhausing then thought.'
  712. energytomilkpump = 0
  713. elseif energytomilkpump > 0:
  714. '<br>You feel a bit thirsty after pumping.'
  715. energytomilkpump = 0
  716. end
  717. if bcream_used = 1:
  718. pcs_nips += rand(0,2)
  719. bcream_used = 0
  720. end
  721. minut += pumptime
  722. elseif lactate = 0 and pain['nipples'] < 60:
  723. if rand(1,50) + prolactinlvl >= rand(200,250):
  724. '<center><img <<$set_imgh>> src="images/pc/body/tits/lactate_start.jpg"></center>'
  725. 'As usual, you attach the pump but after a few pumps white liquid suddenly starts flowing from your nipples.<br>You started lactating!'
  726. lactateinduced = 1
  727. lactate = 1
  728. if func('lact_lib','$calc_lactatemm') > 0: lactatemm = func('lact_lib','$calc_lactatemm')
  729. if prolactinlvl < 200: prolactinlvl = 200
  730. lactaterate = 10*(prolactinlvl/200)
  731. pcs_nips += 2
  732. pumpinggrowth = 0
  733. else
  734. milkedvolume = func('lact_lib','$get_breastmilk', 3, pumptime)
  735. '<center><img <<$set_imgh>> src="images/pc/body/tits/t<<tits>>.jpg"></center>'
  736. if breastcounter < 100:
  737. 'You attach the pump to your nipples and start squeezing the bulb. The vacuum feels uncomfortable on your nipples.'
  738. elseif breastcounter >= 100 and breastcounter < 200:
  739. 'You attach the pump to your nipples and start squeezing the bulb. You are used to the vacuum on your nipples.'
  740. else
  741. 'You attach the pump to your nipples and start squeezing the bulb. The vacuum feels good on your nipples.'
  742. end
  743. if prolactinlvl > 70: 'A few droplets of liquid come out of your nipples but it is not milk.'
  744. breastcounter += 1
  745. if pump_stop_brake = 1:
  746. 'During pumping your nipples start to hurt extremely. You have to stop after <<pumptime>> minutes, because you couldn''t go on.'
  747. end
  748. if prolactinlvl > 75:
  749. if rand(0,10) > 9:
  750. pumpinggrowth += 1
  751. end
  752. 'After finishing, your breasts feel weirdly engorged.'
  753. end
  754. if bcream_used = 1:
  755. pcs_nips += rand(0,2)
  756. bcream_used = 0
  757. end
  758. end
  759. minut += pumptime
  760. else
  761. 'Your nipples feel too sore to use the pump right now.'
  762. end
  763. if milkedvolume > 0:
  764. lact_engorgement = 0
  765. lactatemess = 0
  766. act 'Pour it into the sink':
  767. *clr
  768. cla
  769. if milkedvolume > 1500 and bpbottles <= 1:
  770. '<center><img <<$set_imgh>> src="images/pc/body/tits/milk_sink.jpg"></center>'
  771. '<center>You pour 150ml of your breast milk into the sink and clean up your breastpump.</center>'
  772. else
  773. '<center><img <<$set_imgh>> src="images/pc/body/tits/milk_sink.jpg"></center>'
  774. '<center>You pour <<milkedvolume/10>>ml of your breast milk into the sink and clean up your breastpump.</center>'
  775. end
  776. minute += 5
  777. act 'Finish':
  778. milkedvolume = 0
  779. gt $loc, $metka
  780. end
  781. end
  782. if pcs_hydra < 100:
  783. act 'Drink it':
  784. *clr
  785. cla
  786. '<center><img <<$set_imgh>> src="images/pc/body/tits/milk_drink.jpg"></center>'
  787. '<center>You drink your own breast milk and clean up your breastpump.</center>'
  788. '<center>The milk is still warm from your breasts.</center>'
  789. if pcs_hydra < 90:
  790. pcs_hydra += 10
  791. else
  792. pcs_hydra = 100
  793. end
  794. minut += 7
  795. act 'Finish':
  796. milkedvolume = 0
  797. gt $loc, $metka
  798. end
  799. end
  800. end
  801. else
  802. act 'Finish':gt $loc, $metka
  803. end
  804. end
  805. !! engorged_morning
  806. !! use href="exec:gt ''lact_lib'',''engorged_morning''"
  807. if $ARGS[0] = 'engorged_morning':
  808. minut += 5
  809. '<center><img <<$set_imgh>> src="images/pc/body/tits/lactate_start.jpg"></center>'
  810. 'You wake up and your breasts hurt. As you look down, you can see that you have a heavy letdown. You should pump your breasts as soon as possible.'
  811. act 'Finish':gt $loc, $metka
  812. end
  813. --- lact_lib ---------------------------------