Sfoglia il codice sorgente

[Added] weight scaling due to pregnancy. Could not just depend on `pcs_mass['body']` due to the highly unequal distrubution of pregnancy mass.

anjuna krokus 2 mesi fa
parent
commit
a1703894c1
2 ha cambiato i file con 92 aggiunte e 26 eliminazioni
  1. 33 16
      locations/Cheatmenu_din.qsrc
  2. 59 10
      locations/body.qsrc

+ 33 - 16
locations/Cheatmenu_din.qsrc

@@ -226,39 +226,39 @@ $cheatmenu['bodyMod'] = {
 	''
 	''
 	if knowpreg = 1 or (preg = 1 and (thinkpreg = 1 or PregChem > 3600)):
 	if knowpreg = 1 or (preg = 1 and (thinkpreg = 1 or PregChem > 3600)):
 		if (pregchem < 2688) = 0:
 		if (pregchem < 2688) = 0:
-			'<a href="exec:pregchem = 100 & pregtime = 4 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 100)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 100"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 100)>></a>'
 			''
 			''
 		end
 		end
 		if (pregchem >= 2688 and pregchem < 3192) = 0:
 		if (pregchem >= 2688 and pregchem < 3192) = 0:
-			'<a href="exec:pregchem = 2688 & pregtime = 112 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 2688)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 2688"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 2688)>></a>'
 			''
 			''
 		end
 		end
 		if (pregchem >= 3192 and pregchem < 3696) = 0:
 		if (pregchem >= 3192 and pregchem < 3696) = 0:
-			'<a href="exec:pregchem = 3192 & pregtime = 133 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 3192)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 3192"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 3192)>></a>'
 			''
 			''
 		end
 		end
 		if (pregchem >= 3696 and pregchem < 4200) = 0:
 		if (pregchem >= 3696 and pregchem < 4200) = 0:
-			'<a href="exec:pregchem = 3696 & pregtime = 154 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 3696)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 3696"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 3696)>></a>'
 			''
 			''
 		end
 		end
 		if (pregchem >= 4200 and pregchem < 4704) = 0:
 		if (pregchem >= 4200 and pregchem < 4704) = 0:
-			'<a href="exec:pregchem = 4200 & pregtime = 175 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 4200)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 4200"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 4200)>></a>'
 			''
 			''
 		end
 		end
 		if (pregchem >= 4704 and pregchem < 5208) = 0:
 		if (pregchem >= 4704 and pregchem < 5208) = 0:
-			'<a href="exec:pregchem = 4704 & pregtime = 196 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 4704)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 4704"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 4704)>></a>'
 			''
 			''
 		end
 		end
 		if (pregchem >= 5208 and pregchem < 5712) = 0:
 		if (pregchem >= 5208 and pregchem < 5712) = 0:
-			'<a href="exec:pregchem = 5208 & pregtime = 217 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 5208)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 5208"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 5208)>></a>'
 			''
 			''
 		end
 		end
 		if (pregchem >= 5712 and pregchem < 6216) = 0:
 		if (pregchem >= 5712 and pregchem < 6216) = 0:
-			'<a href="exec:pregchem = 5712 & pregtime = 238 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 5712)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 5712"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 5712)>></a>'
 			''
 			''
 		end
 		end
 		if (pregchem >= 6216) = 0:
 		if (pregchem >= 6216) = 0:
-			'<a href="exec:pregchem = 6216 & pregtime = 259 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 6216)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_preg_body''], 6216"><<func(''body_structure'', ''body_desc'', pcs_bmi, strenbuf, 6216)>></a>'
 			''
 			''
 		end
 		end
 	else
 	else
@@ -266,31 +266,31 @@ $cheatmenu['bodyMod'] = {
 		'starving (No, you may not select ''starving'', it''s here to show where the scale starts)'
 		'starving (No, you may not select ''starving'', it''s here to show where the scale starts)'
 		''
 		''
 		if (bs_temp_bs_class / 100) ! 1:
 		if (bs_temp_bs_class / 100) ! 1:
-			'<a href="exec: pcs_mass[''body''] = func(''body'', ''CalcOptBodyMass'', 170) & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', 17, strenbuf)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_body_class''], 170"><<func(''body_structure'', ''body_desc'', 17, strenbuf)>></a>'
 			''
 			''
 		end
 		end
 		if (bs_temp_bs_class / 100) ! 2:
 		if (bs_temp_bs_class / 100) ! 2:
-			'<a href="exec: pcs_mass[''body''] = func(''body'', ''CalcOptBodyMass'', 200) & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', 20, strenbuf)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_body_class''], 200"><<func(''body_structure'', ''body_desc'', 20, strenbuf)>></a>'
 			''
 			''
 		end
 		end
 		if (bs_temp_bs_class / 100) ! 3:
 		if (bs_temp_bs_class / 100) ! 3:
-			'<a href="exec: pcs_mass[''body''] = func(''body'', ''CalcOptBodyMass'', 230) & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', 23, strenbuf)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_body_class''], 230"><<func(''body_structure'', ''body_desc'', 23, strenbuf)>></a>'
 			''
 			''
 		end
 		end
 		if (bs_temp_bs_class / 100) ! 4:
 		if (bs_temp_bs_class / 100) ! 4:
-			'<a href="exec: pcs_mass[''body''] = func(''body'', ''CalcOptBodyMass'', 270) & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', 27, strenbuf)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_body_class''], 270"><<func(''body_structure'', ''body_desc'', 27, strenbuf)>></a>'
 			''
 			''
 		end
 		end
 		if (bs_temp_bs_class / 100) ! 5:
 		if (bs_temp_bs_class / 100) ! 5:
-			'<a href="exec: pcs_mass[''body''] = func(''body'', ''CalcOptBodyMass'', 320) & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', 32, strenbuf)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_body_class''], 320"><<func(''body_structure'', ''body_desc'', 32, strenbuf)>></a>'
 			''
 			''
 		end
 		end
 		if (bs_temp_bs_class / 100) ! 6:
 		if (bs_temp_bs_class / 100) ! 6:
-			'<a href="exec: pcs_mass[''body''] = func(''body'', ''CalcOptBodyMass'', 370) & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', 37, strenbuf)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_body_class''], 370"><<func(''body_structure'', ''body_desc'', 37, strenbuf)>></a>'
 			''
 			''
 		end
 		end
 		if (bs_temp_bs_class / 100) ! 7:
 		if (bs_temp_bs_class / 100) ! 7:
-			'<a href="exec: pcs_mass[''body''] = func(''body'', ''CalcOptBodyMass'', 420) & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<func(''body_structure'', ''body_desc'', 42, strenbuf)>></a>'
+			'<a href="exec: dynamic $cheatmenu[''set_body_class''], 420"><<func(''body_structure'', ''body_desc'', 42, strenbuf)>></a>'
 			''
 			''
 		end
 		end
 		killvar 'bs_temp_bs_class'
 		killvar 'bs_temp_bs_class'
@@ -299,6 +299,23 @@ $cheatmenu['bodyMod'] = {
 	'</tr></table></b></center>'
 	'</tr></table></b></center>'
 }
 }
 
 
+$cheatmenu['set_preg_body'] = {
+	pregchem = ARGS[0]
+	pregtime = ARGS[0] / 24
+	gs 'body', 'reset_preg_mass'
+	gs 'body', 'softreset'
+	gs 'stat'
+	dynamic $cheatmenu['bodyMod']
+}
+
+$cheatmenu['set_body_class'] = {
+	pcs_mass['body'] = func('body', 'CalcOptBodyMass', ARGS[0])
+	gs 'body', 'softreset'
+	gs 'stat'
+	dynamic $cheatmenu['bodyMod']
+}
+
+
 $cheatmenu['addict'] = {
 $cheatmenu['addict'] = {
 	if drugVars['cheat_immune'] = 0:
 	if drugVars['cheat_immune'] = 0:
 		drugVars['cheat_immune'] = 1
 		drugVars['cheat_immune'] = 1

+ 59 - 10
locations/body.qsrc

@@ -32,6 +32,13 @@
 !! imgset6ovr[x] and imgset7ovr[x] = a flag to indicate that an image set (x) has its own image 6 and/or 7
 !! imgset6ovr[x] and imgset7ovr[x] = a flag to indicate that an image set (x) has its own image 6 and/or 7
 !! extended lash functionality; pcs_lashes = n are: {2, largest natural size}, {3, with temporary false lashes on or basic 2D lash extensions}, {4, with ornate false lashes on or lavish 4D extensions}, {5, with extremely ornate, 6D-style extensions} - xerya
 !! extended lash functionality; pcs_lashes = n are: {2, largest natural size}, {3, with temporary false lashes on or basic 2D lash extensions}, {4, with ornate false lashes on or lavish 4D extensions}, {5, with extremely ornate, 6D-style extensions} - xerya
 
 
+
+!! Pregnancy weight gain:
+!! Weight gain in the first 5 weeks (roughly pregChem < 800. -> Pregtime = pregchem / 24) is negligable
+!! Afterwards we approximate the weight gain as mass = ((pregChem - 800)^2 * 33 / (7000 - 800)^2) approx (pregChem - 800)^2 / (1080)^2
+
+
+
 if $ARGS[0] = 'RegularUpdate':
 if $ARGS[0] = 'RegularUpdate':
 	if dounspell = 0:
 	if dounspell = 0:
 		gs 'body', 'UpdateBodyMeasurement'
 		gs 'body', 'UpdateBodyMeasurement'
@@ -58,7 +65,7 @@ if $ARGS[0] = 'UpdateBodyMeasurement':
 	pcs_hips  = (pcs_hgt   * bodyVars['hratio']) / 100 + bodyVars['vhips']
 	pcs_hips  = (pcs_hgt   * bodyVars['hratio']) / 100 + bodyVars['vhips']
 	pcs_waist = (pcs_hips  * bodyVars['wratio']) / 100 + bodyVars['vofat']
 	pcs_waist = (pcs_hips  * bodyVars['wratio']) / 100 + bodyVars['vofat']
 	pcs_band  = (pcs_waist * bodyVars['bratio']) / 100 + bodyVars['vofat']
 	pcs_band  = (pcs_waist * bodyVars['bratio']) / 100 + bodyVars['vofat']
-	pcs_bust  = (pcs_waist * bodyVars['bratio']) / 100 + pcs_mass['bust'] + bodyVars['bust_magic'] + bodyVars['bust_silicone'] + max(-10, min(bodyVars['bust_other'], 10))
+	pcs_bust  = (pcs_waist * bodyVars['bratio']) / 100 + pcs_mass['bust'] + bodyVars['bust_magic'] + bodyVars['bust_silicone'] + max(-10, min(bodyVars['bust_other'], 10)) + pcs_mass['preg'] / 5
 	pcs_butt  = min(pcs_mass['butt'], 50) + bodyVars['butt_bonus'] + bodyVars['butt_silicone'] + bodyVars['butt_cheat'] + pcs_butt_tr + max(-10, min(bodyVars['butt_other'], 10))
 	pcs_butt  = min(pcs_mass['butt'], 50) + bodyVars['butt_bonus'] + bodyVars['butt_silicone'] + bodyVars['butt_cheat'] + pcs_butt_tr + max(-10, min(bodyVars['butt_other'], 10))
 
 
 	!! pcs_cupsize = pcs_mass['bust'] + bodyVars['bust_magic'] + bodyVars['bust_silicone'] - bodyVars['vofat']
 	!! pcs_cupsize = pcs_mass['bust'] + bodyVars['bust_magic'] + bodyVars['bust_silicone'] - bodyVars['vofat']
@@ -71,7 +78,7 @@ if $ARGS[0] = 'CalcWeight':
 	This is an approximation, so that a sveta with a different height has the same BMI for the same pcs_mass['body'] values.
 	This is an approximation, so that a sveta with a different height has the same BMI for the same pcs_mass['body'] values.
 	The default height of 170 cm is used as a starting point. The bmi deviates by 0.06 for a deviation of 10cm and 0.4 for a deviation of 20cm.}
 	The default height of 170 cm is used as a starting point. The bmi deviates by 0.06 for a deviation of 10cm and 0.4 for a deviation of 20cm.}
 
 
-	result = (2820 + 33 * (pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']) + 70 * (pcs_hgt - 165)) / 100
+	result = (2820 + 33 * (pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt'] + pcs_mass['preg']) + 70 * (pcs_hgt - 165)) / 100
 
 
 	!{Do not remove (julzor)
 	!{Do not remove (julzor)
 	This is the old more complex function, but it doesn''t work correctly.
 	This is the old more complex function, but it doesn''t work correctly.
@@ -83,7 +90,7 @@ end
 
 
 if $ARGS[0] = 'CalcWeight2':
 if $ARGS[0] = 'CalcWeight2':
 	!! weight2 = 10 * weight
 	!! weight2 = 10 * weight
-	result = (2820 + 33 * (pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']) + 70 * (pcs_hgt - 165)) / 10
+	result = (2820 + 33 * (pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt'] + pcs_mass['preg']) + 70 * (pcs_hgt - 165)) / 10
 	!result = (pcs_hgt * 62 / 17) + (10 * (vhips + (bodyVars['vofat'] * 2))) / 4 + 10 * tits
 	!result = (pcs_hgt * 62 / 17) + (10 * (vhips + (bodyVars['vofat'] * 2))) / 4 + 10 * tits
 end
 end
 
 
@@ -322,15 +329,44 @@ if $ARGS[0] = 'Update_Body':
 	if bodyresetflag = 1 or cheatNoFat = 1:
 	if bodyresetflag = 1 or cheatNoFat = 1:
 		fat = 0
 		fat = 0
 	else
 	else
-		if fat > (17 + vitalbuf / 25):
-			pcs_mass['body'] += 1
-			fat = 0
-		elseif fat < -(2 + vitalbuf / 10):
-			pcs_mass['body'] -= 1
-			fat = 0
+		if pregChem >= 800 and (pregChem - 800)*(pregChem - 800) >= bodyVars['pchem_next']:
+			pcs_mass['preg'] += 1
+			bodyVars['pchem_next'] += 1166400	& !! 1080 * 1080
+		elseif bodyVars['pchem_next'] > 0 and bodyVars['pchem_next'] - 1166400 >= (pregChem - 800) * (pregChem - 800):
+			if pcs_mass['preg'] > 0:
+				pcs_mass['preg'] -= 1
+				bodyVars['pchem_next'] -= 1166400	& !! 1080 * 1080
+			else
+				pcs_mass['preg'] = 0
+				bodyVars['pchem_next'] = 0
+			end
+		end
+		if pregChem >= 800:
+			if fat > (12 + vitalbuf / 25):
+				pcs_mass['body'] += 1
+				fat = 0
+			elseif fat < -(7 + vitalbuf / 10):
+				pcs_mass['body'] -= 1
+				fat = 0
+			else
+				if fat < 0:
+					fat = fat / 2
+				else
+					fat = fat / 6
+				end
+			end
 		else
 		else
-			fat = fat / 4
+			if fat > (17 + vitalbuf / 25):
+				pcs_mass['body'] += 1
+				fat = 0
+			elseif fat < -(2 + vitalbuf / 10):
+				pcs_mass['body'] -= 1
+				fat = 0
+			else
+				fat = fat / 4
+			end
 		end
 		end
+
 	end
 	end
 
 
 	!!This is the pcs_mass['body'] cap for the weight approximation
 	!!This is the pcs_mass['body'] cap for the weight approximation
@@ -750,6 +786,17 @@ if $ARGS[0] = 'Reset_mass_distribution':
 	gs 'body', 'Update_vhips'
 	gs 'body', 'Update_vhips'
 end
 end
 
 
+if $ARGS[0] = 'Reset_preg_mass':
+	bodyVars['pchem_next'] = 0
+	pcs_mass['preg'] = 0
+	:set_preg_body_loop
+	if pregChem >= 800 and (pregChem - 800) * (pregChem - 800) >= bodyVars['pchem_next']:
+		bodyVars['pchem_next'] += 1166400	& 1080 * 1080
+		pcs_mass['preg'] += 1
+		jump 'set_preg_body_loop'
+	end
+end
+
 
 
 if $ARGS[0] = 'Set_mass_distribution_using_body':
 if $ARGS[0] = 'Set_mass_distribution_using_body':
 	pcs_mass['body'] = ARGS[1]
 	pcs_mass['body'] = ARGS[1]
@@ -917,6 +964,8 @@ if $ARGS[0] = 'hardreset':
 		pcs_mass['bust_message'] = pcs_mass['bust']
 		pcs_mass['bust_message'] = pcs_mass['bust']
 		pcs_mass['butt_message'] = pcs_mass['butt']
 		pcs_mass['butt_message'] = pcs_mass['butt']
 
 
+		gs 'body', 'reset_preg_mass'
+
 		bodyresetflag = 0
 		bodyresetflag = 0
 		normbuffpick = 0
 		normbuffpick = 0
 		bodyVars['weight_warning'] = 0
 		bodyVars['weight_warning'] = 0