# lact_lib
if $ARGS[0] = '$get_bfat_tissue':
!! func('lac_lib', 'get_bfattissue', npc_nbsize, npc_lactatemm)
!! function to get breast fat tissue amount. Can be used for NPC as well as PC.
!! ARGS[1] = npc_nbsize - the natural bust size of the NPC/PC.
!! ARGS[2] = npc_lactatemm - he lactatemm of the NPC/PC.
!! RESULT = Fat amount in ccm * 10.
!! function for cup size volume in ccm y = 0,0002023*x^3 + 0,029199*x^2 + 4,3791*x + 70
!! x = ((ARGS[1]/5) + 1)*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
!! The function was estimated with excel using a trend line estimation for polynoms of third grade and a y = 0 at 70ccm
!! https://www.ncbi.nlm.nih.gov/pubmed/11936199
!! 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.
if ARGS[1] > 0:
temp_var = ((ARGS[1]/5) + 1)*10
temp_var2 = (((2023*temp_var*temp_var*temp_var)/10000000)+((29199*temp_var*temp_var)/1000000)+((43791*temp_var)/10000)+70)*10
if temp_var2 > ARGS[2]:
RESULT = temp_var2 - (ARGS[2] + ARGS[2]/50)
elseif temp_var2 = ARGS[2]:
RESULT = 0
else
cls & 'BAD ARGUMENT CHECK IN $get_bfat_tissue! - Node ARGS[1] - more mammary gland tissue available then total breast tissue.'
end
else
if ARGS[2] > 700:
cls & 'BAD ARGUMENT CHECK IN $get_bfat_tissue! - Node ARGS[2] - more mammary gland tissue available then total breast tissue.'
else
RESULT = 700
end
end
end
if $ARGS[0] = '$calc_npc_lactatemm_0':
!! func('lact_lib', 'calc_npc_lactatemm_0', npc_glandamount, npc_prodstate, npc_breastage, npc_breastcount)
!! New calc lactatemm function usuable for NPCs. Test function number one.
!! 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.
!! ARGS[2] = npc_prodstate - The breast production state of the npc. State can be "none", "induced" or "natural".
!! 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.
!! To determine the breastage, just check if the NPC has gone through pregnancy or not.
!! 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.
!! 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.
!! RESULT = lactatemm in ml*10
if ARGS[2] = 'none':
if ARGS[3] = 'virgin':
temp_var = 2
elseif ARGS[3] = 'mature':
temp_var = 2
else
cls & 'BAD ARGUMENT CHECK IN $calc_npc_lactatemm_0! - Node ARGS[2] "none".'
end
elseif ARGS[2] = 'induced':
if ARGS[3] = 'virgin':
temp_var = 20
elseif ARGS[3] = 'mature':
temp_var = 80
else
cls & 'BAD ARGUMENT CHECK IN $calc_npc_lactatemm_0! - Node ARGS[2] "induced".'
end
elseif ARGS[2] = 'natural':
if ARGS[3] = 'virgin':
temp_var = 20
elseif ARGS[3] = 'mature':
temp_var = 80
else
cls & 'BAD ARGUMENT CHECK IN $calc_npc_lactatemm_0! - Node ARGS[2] "natural".'
end
else
cls & 'BAD ARGUMENT CHECK IN $calc_npc_lactatemm_0! - Root Node ARGS[2].'
end
if ARGS[1] <= 0:
RESULT = 0
else
RESULT = (ARGS[1]*temp_var*ARGS[4])/1000
end
end
if $ARGS[0] = '$calc_lactatemm':
!! func('lact_lib', 'calc_lactatemm')
!! No arguments at the moment. Information is taken from the global variables 'nbsize', 'lactate','lactateinduced','kid'.
!! 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.
!! Usage: lactatemm = func('lact_lib','$calc_lactatemm')
!! RESULT = lactatemm in ml*10
if lactate = 0:
RESULT = 0
elseif lactate >0:
temp_breastsize = 0
temp_breastsize += nbsize
temp_var = 0
if lactateinduced > 0 and kid <= 0:
temp_var = ((8*temp_breastsize*temp_breastsize)+(37*temp_breastsize))/4
RESULT = temp_var
else
RESULT = ((8*temp_breastsize*temp_breastsize)+(37*temp_breastsize))
end
else
cls & 'BAD ARGUMENT CHECK IN $calc_lactatemm!'
end
end
if $ARGS[0] = '$get_breastmilk':
!! func('lact_lib','$get_breastmilk', sucktion_type, sucktion_time)
!! 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]
!! ARGS[2] = sucktion_time: how many minutes the sucking/pumping takes place
!! Usage: breastmilkvolume = func('lact_lib','$get_breastmilk', 4, 20)
!! RESULT = Milk in ml*10
!! what type of sucktion is happening? different sucktion can cause a different demand of breastmilk. Base rate of sucktion is 10ml/minute.
soreness_mod = 10
breastpumped = 1
!! 'suck_flow_rate initialized'
if ARGS[1] = 0:
!! 'adult sucking'
suck_flow_rate = 12 + rand(0,4)
temp_var = pcs_mood +(ARGS[2]/8)
if temp_var > 100:
pcs_mood = 100
else
pcs_mood += ARGS[2]/8
end
elseif ARGS[1] = 1:
!! 'child sucking'
suck_flow_rate = 8 + rand(0,2)
temp_var = pcs_mood + (ARGS[2]/2)
if temp_var > 100:
pcs_mood = 100
else
pcs_mood += ARGS[2]/2
end
elseif ARGS[1] = 2:
!! 'baby sucking'
suck_flow_rate = 6 + (rand(0,2))
temp_var = pcs_mood + ARGS[2]
if temp_var > 100:
pcs_mood = 100
else
pcs_mood += ARGS[2]
end
elseif ARGS[1] = 3:
!! 'manual_breastpump sucking'
suck_flow_rate = 9
elseif ARGS[1] = 4:
!! 'electric_breastpump sucking'
suck_flow_rate = 10
elseif ARGS[1] = 5:
!! 'hand expression'
suck_flow_rate = 3 + rand(1,2)
elseif ARGS[1] = 6:
!! 'cow milker sucking'
suck_flow_rate = 100
else
!! 'suck flow else branch'
suck_flow_rate = 10
end
!! 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.
if breastcounter > 0:
temp_var = breastcounter/10
soreness_mod += temp_var
if soreness_mod > 20: soreness_mod = 20
if nipple_cream = 1:
soreness_mod += 20
nipple_cream = 0
end
end
!! No lactation, no milk, but stimulus is applied, so some things are going to happen here.
if lactate = 0:
if milkoverdemand <= 0: milkoverdemand = 0
pump_stop_brake = 0
!! 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.
max_sucktion_demand = 10*suck_flow_rate*ARGS[2]
if pain['nipples'] <= 60:
suck_until_pain = ((60 - pain['nipples'])*10*(soreness_mod/10))/suck_flow_rate
end
temp_var = pain['nipples'] + (max_sucktion_demand/100)/(soreness_mod/10)
if temp_var > 60:
pain['nipples'] = 65
pump_stop_brake = 1
pumptime = suck_until_pain
max_sucktion_demand = 10*suck_flow_rate*pumptime
else
pain['nipples'] += (max_sucktion_demand/100)/(soreness_mod/10)
end
temp_var = pain['breasts'] + max_sucktion_demand/1000
if temp_var > 20:
pain['breasts'] = 25
else
pain['breasts'] += max_sucktion_demand/1000
end
!! Pumping breasts is exhausting even if no milk comes. so this is handled here.
temp_var = pcs_energy - max_sucktion_demand/1500
if temp_var < 0:
pcs_energy = 0
!! energy usage flag on.
energytomilkpump = 1
else
pcs_energy -= max_sucktion_demand/1500
!! energy usage flag on.
energytomilkpump = 1
end
if pumptime < 10:
breastcounter += 1
else
breastcounter += pumptime/10
end
milkoverdemand += max_sucktion_demand
RESULT = 0
!! If there is lactation, do the magic
elseif lactate >0:
!! How much milk can go through the nipple. Base rate is 10ml/minute when sucktion is applied to the nipple. If the demand is higher than the nipple can push through, nipple soreness will happen more quickly.
if pcs_nips > 0:
max_nip_flow_rate = 6
elseif pcs_nips > 20:
max_nip_flow_rate = 8
elseif pcs_nips > 40:
max_nip_flow_rate = 10
elseif pcs_nips > 60:
max_nip_flow_rate = 12
elseif pcs_nips > 80:
max_nip_flow_rate = 14
elseif pcs_nips > 100:
max_nip_flow_rate = 16
else
max_nip_flow_rate = 10
end
!! 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.
if breastcounter > 0:
temp_var = breastcounter/10
soreness_mod += temp_var
if soreness_mod > 20: soreness_mod = 20
if nipple_cream = 1:
soreness_mod += 10
nipple_cream = 0
end
end
!! If you pump more, more milk will come, disregarding nipplesize. Things will get used to milking and be more loose.
nip_flow_mod = 1
temp_var = breastcounter/10
nip_flow_mod += temp_var
if nip_flow > 30: nip_flow_mod = 30
max_nip_flow_rate += nip_flow_mod
!! How much milk demand is applied to the breasts. 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.
!! If we only need 20ml from a 100ml storage, we would only substract 20ml, leaving 80ml inside the breasts.
max_sucktion_demand = 10*suck_flow_rate*ARGS[2]
!! Is enough milk already in the breasts?
if lactatemv > max_sucktion_demand:
!! can the nipples handle the flow?
if max_nip_flow_rate >= suck_flow_rate:
milkedvolume = max_sucktion_demand
lactatemv -= max_sucktion_demand
elseif max_nip_flow_rate < suck_flow_rate:
milkedvolume = max_nip_flow_rate*10*ARGS[2]
lactatemv -= milkedvolume
!! time for sore nipples. We apply more sucking than the nipples can handle. So it hurts more. if nipple pain over 60, then it goes to 65. else it just adds soreness.
max_sucktion_demand -= milkedvolume
temp_var = pain['nipples'] + (max_sucktion_demand/100)/(soreness_mod/10)
if temp_var > 60:
pain['nipples'] = 65
else
pain['nipples'] += (max_sucktion_demand/100)/(soreness_mod/10)
end
else
cls & 'BAD ARGUMENT CHECK IN $get_breastmilk!Error in Lactatemv bigger than max_sucktion_demand fork.'
end
elseif lactatemv < max_sucktion_demand:
!! Magic!
temp_var = (lactatemv/(max_nip_flow_rate*10))
if temp_var <= 0 and lactatemv > 0: temp_var = 1
pumptime_left = ARGS[2] - temp_var
if pumptime_left <= 0 and lactatemv > 0: pumptime_left = 1
temp_var = lactaterate/60
if temp_var <= 0 and lactaterate > 0: temp_var = 1
if temp_var >= max_nip_flow_rate:
if ARGS[1] = 2: breastcounter += 50
milkedvolume = (max_nip_flow_rate * 10 * pumptime_left) + (max_nip_flow_rate * 10 * (ARGS[2] - pumptime_left))
lactatemv -= (max_nip_flow_rate * 10 * (ARGS[2] - pumptime_left))
elseif temp_var < max_nip_flow_rate:
!!with a baby sucking, more milk should be made due to nature ...
if ARGS[1] = 2: milkoverdemand += 100000
milkedvolume = (temp_var * pumptime_left) + (max_nip_flow_rate * 10 * (ARGS[2] - pumptime_left))
lactatemv -= (max_nip_flow_rate * 10 * (ARGS[2] - pumptime_left))
else
cls & 'BAD ARGUMENT CHECK IN $get_breastmilk!Error in Lactatemv smaller than max_sucktion_demand fork.'
end
if lactatemv <= 0: lactatemv = 0
!! the breasts had to produce milk, so energy is used.
temp_var = pcs_energy - milkedvolume/1000
if temp_var < 0:
pcs_energy = 0
if rand(0,100) > 90: fat -= 1
!! this is checking if pcs_energy was impacted during milking.
energytomilkpump = 1
else
pcs_energy -= milkedvolume/1000
!! this is checking if pcs_energy was impacted during milking.
energytomilkpump = 1
end
!! the breasts had to produce milk, so hydration is used.
temp_var = pcs_hydra - milkedvolume/500
if temp_var < 0:
pcs_hydra = 0
energytomilkpump = 1
else
pcs_hydra -= milkedvolume/500
energytomilkpump = 1
end
!! if more is pumped than produced the breasts will hurt too.
if milkedvolume < max_sucktion_demand:
!! milkoverdemand: This is used for the daily milk growth. If there is overdemand, the lactaterate will change the next day. Will be set to 0 every day.
milkoverdemand += max_sucktion_demand - milkedvolume
temp_var = pain['breasts'] + (max_sucktion_demand - milkedvolume)/1000
if temp_var > 20:
pain['breasts'] = 20
else
pain['breasts'] += (max_sucktion_demand - milkedvolume)/1000
end
end
if max_nip_flow_rate < suck_flow_rate:
!! sore nipples again. "used to breastpumping" variable needs to come in here too!
temp_var = pain['nipples'] + ((((max_nip_flow_rate*100)/60) * pumptime_left)/100) + (max_sucktion_demand/100)/(soreness_mod/10)
if temp_var > 60:
pain['nipples'] = 65
else
pain['nipples'] += ((((max_nip_flow_rate*100)/60) * pumptime_left)/100) + (max_sucktion_demand/100)/(soreness_mod/10)
end
end
end
!! The standard nipple pain applied due to pumping. Adding to the pain that is calculated above
temp_var = pain['nipples'] + (max_sucktion_demand/100)/(soreness_mod/10)
if temp_var > 60:
pain['nipples'] = 65
else
pain['nipples'] += (max_sucktion_demand/100)/(soreness_mod/10)
end
if pumptime < 10:
breastcounter += 1
else
breastcounter += pumptime/10
end
RESULT = milkedvolume
else
cls & 'BAD ARGUMENT CHECK IN $get_breastmilk!'
end
end
!! lact_lib
!! bp_milking - breast pump milking
!! use href="exec:gt ''lact_lib'',''bp_milking''"
if $ARGS[0] = 'bp_milking':
pumptime = 0
pumptype = 0
if $location_type ! 'bathroom' and pcs_inhib < 50:
'You can''t use it here.'
act 'Don''t pump':gt $loc, $metka
else
*clr
cla
pumptime = input ("How long do you plan to pump your breasts?
(Defaults 15 minutes, maximum 60 minutes)")
if pumptime = '':pumptime = 15
if pumptime > 0 and pumptime <= 60:
gt 'lact_lib', 'milking'
elseif pumptime <= 0 or pumptime > 60:
minut += 2
act 'Don''t pump':gt $loc, $metka
end
end
end
!! man_milking - manual (with hands) milking
!! use href="exec:gt ''lact_lib'',''man_milking''"
if $ARGS[0] = 'man_milking':
pumptime = 0
pumptype = 1
if $location_type ! 'bathroom' and pcs_inhib < 50:
'You can''t do this here.'
act 'Don''t pump':gt $loc, $metka
else
*clr
cla
pumptime = input ("How long would you like to milk your breasts?
(Default 15 minutes, maximum 60 minutes)")
if pumptime = '':pumptime = 15
if pumptime > 0 and pumptime <= 60:
gt 'lact_lib', 'milking'
elseif pumptime <= 0 or pumptime > 60:
minut += 2
act 'Don''t pump':gt $loc, $metka
end
end
end
!! milking
!! never use directly. Always use bp_milking, man_milking or sex_milking
if $ARGS[0] = 'milking':
if pumptime <= 0 or pumptime > 60:
act 'Finish':gt $loc, $metka
end
if pumptype = 1:
pumptime = (pumptime*6)/10
end
if lactate > 0 and pain['nipples'] < 60:
milkedvolume = func('lact_lib','$get_breastmilk', 3, pumptime)
'