1
0
Просмотр исходного кода

[added] a bunch of comments to make the body_structure file slightly less obtuse

anjuna krokus 8 месяцев назад
Родитель
Сommit
63b7c50ac7
1 измененных файлов с 128 добавлено и 39 удалено
  1. 128 39
      locations/body_structure.qsrc

+ 128 - 39
locations/body_structure.qsrc

@@ -1,26 +1,31 @@
 # body_structure
 
+
+!	Get the bmi-strength class
+!	bs_class = func('body_structure', 'get_class', pcs_bmi, strenbuf)
 if $ARGS[0] = 'get_class':
-	if ARGS[1] <= 15:
+	!	bmi
+	if ARGS[1] < 16:
 		result = 0
-	elseif ARGS[1] <= 18:
+	elseif ARGS[1] < 19:
 		result = 100
-	elseif ARGS[1] <= 21:
+	elseif ARGS[1] < 22:
 		result = 200
-	elseif ARGS[1] <= 24:
+	elseif ARGS[1] < 25:
 		result = 300
-	elseif ARGS[1] <= 29:
+	elseif ARGS[1] < 30:
 		result = 400
-	elseif ARGS[1] <= 34:
+	elseif ARGS[1] < 35:
 		result = 500
-	elseif ARGS[1] <= 39:
+	elseif ARGS[1] < 40:
 		result = 600
-	elseif ARGS[1] <= 44:
+	elseif ARGS[1] < 45:
 		result = 700
 	else
 		result = 800
 	end
 
+	!	strenbuf
 	if ARGS[2] <= 5:
 		result += 0
 	elseif ARGS[2] <= 10:
@@ -60,6 +65,9 @@ if $ARGS[0] = 'get_class':
 	end
 end
 
+
+!	Get the bmi description:
+!	$bodyVars['bmi_desc'] = func('body_structure', pcs_bmi)
 if $ARGS[0] = 'bmi_desc':
 	if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
 
@@ -88,81 +96,101 @@ if $ARGS[0] = 'bmi_desc':
 	killvar 'bs_temp_bs_class'
 end
 
-! For succubus call this as func('body_structure', pcs_bmi, 90)
+
+!	Get the appearance bonus
+!	Appearance_bonus = func('body_structure', 'appearance_bonus', pcs_bmi, strenbuf, succubusflag)
 if $ARGS[0] = 'appearance_bonus':
 	if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
 	if arrsize('ARGS') = 2: ARGS[2] = strenbuf
 	if arrsize('ARGS') = 3: ARGS[3] = succubusflag
-	if ARGS[3] = 1: ARGS[2] = 80
+	if ARGS[3] = 1: ARGS[2] = 90
 
 	bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], ARGS[2])
 
 	if bs_temp_bs_class < 100:
-		!! severely underweight
+		!	starving: bmi < 16
 		result = -10
 	elseif bs_temp_bs_class < 200:
-		!! underweight
+		!	underweight: 16 <= bmi < 16
 		result = 25
 	elseif bs_temp_bs_class < 300:
-		!! healthy weight
+		!	slender: 19 <= bmi < 21
 		result = 50
 	elseif bs_temp_bs_class < 400:
-		!! healthy weight
+		!	healthy: 21 <= bmi < 25
 		result = 50
 	elseif bs_temp_bs_class < 500:
-		!! overweight
+		!	overweight: 26 <= bmi < 30
 		result = 25
 	elseif bs_temp_bs_class < 600:
-		!! moderately obese
+		!	moderately obese: 30 <= bmi < 35
 		result = 10
 	elseif bs_temp_bs_class < 700:
-		!! severely obese
+		!	severely obese: 35 <= bmi < 40
 		result = -15
 	elseif bs_temp_bs_class < 800:
-		!! very severely obese
+		!	very severely obese: 40 <= bmi < 45
 		result = -40
 	else
-		!! morbidly obese
+		!	morbidly obese: 45 <= bmi
 		result = -80
 	end
 
 	bs_temp_bs_class = bs_temp_bs_class mod 100
 
 	if bs_temp_bs_class = 0:
+		!	0 <= strenbuf <= 5
 		result -= 30
 	elseif bs_temp_bs_class = 1:
+		!	5 < strenbuf <= 10
 		result -= 20
 	elseif bs_temp_bs_class = 2:
+		!	10 < strenbuf <= 15
 		result -= 15
 	elseif bs_temp_bs_class = 3:
+		!	15 < strenbuf <= 25
 		result -= 10
 	elseif bs_temp_bs_class = 4:
+		!	25 < strenbuf <= 35
 		result -= 5
 	elseif bs_temp_bs_class = 5:
+		!	35 < strenbuf <= 50
 		result += 0
 	elseif bs_temp_bs_class = 6:
+		!	50 < strenbuf <= 70
 		result += 5
 	elseif bs_temp_bs_class = 7:
+		!	70 < strenbuf <= 100
 		result += 10
 	elseif bs_temp_bs_class = 8:
+		!	100 < strenbuf <= 110
 		result += 5
 	elseif bs_temp_bs_class = 9:
+		!	110 < strenbuf <= 120
 		result += 0
 	elseif bs_temp_bs_class = 10:
+		!	120 < strenbuf <= 130
 		result -= 5
 	elseif bs_temp_bs_class = 11:
+		!	130 < strenbuf <= 140
 		result -= 15
 	elseif bs_temp_bs_class = 12:
+		!	140 < strenbuf <= 150
 		result -= 30
 	elseif bs_temp_bs_class = 13:
+		!	150 < strenbuf <= 160
 		result -= 45
 	elseif bs_temp_bs_class = 14:
+		!	160 < strenbuf <= 170
 		result -= 60
 	elseif bs_temp_bs_class = 15:
+		!	170 < strenbuf <= 180
 		result -= 75
 	elseif bs_temp_bs_class = 16:
+		!	180 < strenbuf <= 190
 		result -= 100
 	else
+		!	190 < strenbuf <= 200
 		result -= 130
 	end
 
@@ -170,7 +198,11 @@ if $ARGS[0] = 'appearance_bonus':
 end
 
 
+!	Get the body shape image
+!	$bodyVars['img'] = func('body_structure', 'body_img', pcs_bmi, strenbuf, succubusflag)
 if $ARGS[0] = 'body_img':
+
+	! =======      Pregnant       ======= !
 	if bdsetlock = 0 and (knowpreg = 1 or (preg = 1 and (thinkpreg = 1 or PregChem > 3600))):
 		if PregChem <= 2687:
 			$result = 'images/pc/body/shape/default_preg/0.jpg'
@@ -200,61 +232,88 @@ if $ARGS[0] = 'body_img':
 	end
 
 
-	! starving:
+	! =======      starving       ======= !
+	! -----           bmi < 16      ----- !
 	if bs_temp_bs_class <= 17:
+		!	0 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/0.jpg'
 
-	! underweight
+	! =======     underweight     ======= !
+	! -----     16 <= bmi < 19      ----- !
 	elseif bs_temp_bs_class <= 105:
+		!	0 <= strenbuf <= 50
 		$result = 'images/pc/body/shape/default_low/1.jpg'
 	elseif bs_temp_bs_class <= 107:
+		!	51 <= strenbuf <= 100
 		$result = 'images/pc/body/shape/default_mid/1.jpg'
 	elseif bs_temp_bs_class <= 117:
+		!	101 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/default_high/1.jpg'
 
-	! slender
+	! =======       slender       ======= !
+	! -----     19 <= bmi < 21      ----- !
 	elseif bs_temp_bs_class <= 205:
+		!	0 <= strenbuf <= 50
 		$result = 'images/pc/body/shape/default_low/2.jpg'
 	elseif bs_temp_bs_class <= 207:
+		!	51 <= strenbuf <= 100
 		$result = 'images/pc/body/shape/default_mid/2.jpg'
 	elseif bs_temp_bs_class <= 217:
+		!	101 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/default_high/2.jpg'
 
-	! healthy
+	! =======       healthy       ======= !
+	! -----     21 <= bmi < 25      ----- !
 	elseif bs_temp_bs_class <= 305:
+		!	0 <= strenbuf <= 50
 		$result = 'images/pc/body/shape/default_low/3.jpg'
 	elseif bs_temp_bs_class <= 307:
+		!	51 <= strenbuf <= 100
 		$result = 'images/pc/body/shape/default_mid/3.jpg'
 	elseif bs_temp_bs_class <= 317:
+		!	101 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/default_high/3.jpg'
 
-	! overweight
+	! =======     overweight      ======= !
+	! -----     26 <= bmi < 30      ----- !
 	elseif bs_temp_bs_class <= 405:
+		!	0 <= strenbuf <= 50
 		$result = 'images/pc/body/shape/default_low/4.jpg'
 	elseif bs_temp_bs_class <= 407:
+		!	51 <= strenbuf <= 100
 		$result = 'images/pc/body/shape/default_mid/4.jpg'
 	elseif bs_temp_bs_class <= 417:
+		!	101 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/default_high/4.jpg'
 
-	! moderately obese
-	elseif bs_temp_bs_class <= 517:
+	! =======  moderately obese   ======= !
+	! -----     30 <= bmi < 35      ----- !
 	elseif bs_temp_bs_class <= 505:
+		!	0 <= strenbuf <= 50
 		$result = 'images/pc/body/shape/default_low/5.jpg'
 	elseif bs_temp_bs_class <= 507:
+		!	51 <= strenbuf <= 100
 		$result = 'images/pc/body/shape/default_mid/5.jpg'
 	elseif bs_temp_bs_class <= 517:
+		!	101 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/default_high/5.jpg'
 
-	! severely obese
+	! =======   severely obese    ======= !
+	! -----     35 <= bmi < 40      ----- !
 	elseif bs_temp_bs_class <= 617:
+		!	0 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/6.jpg'
 
-	! very severely obese
+	! ======= very severely obese ======= !
+	! -----     40 <= bmi < 45      ----- !
 	elseif bs_temp_bs_class <= 717:
+		!	0 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/7.jpg'
 
-	! morbidly obese
+	! =======   morbidly obese    ======= !
+	! -----     45 <= bmi           ----- !
 	else
+		!	0 <= strenbuf <= 200
 		$result = 'images/pc/body/shape/8.jpg'
 	end
 
@@ -262,6 +321,8 @@ if $ARGS[0] = 'body_img':
 end
 
 
+!	Get the body description
+!	$bodyVars['desc'] = func('body_structure', 'body_desc', pcs_bmi, strenbuf, succubusflag)
 if $ARGS[0] = 'body_desc':
 	if knowpreg = 1 or (preg = 1 and (thinkpreg = 1 or PregChem > 3600)):
 		if PregChem <= 2687:
@@ -294,60 +355,88 @@ if $ARGS[0] = 'body_desc':
 
 	bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], ARGS[2])
 
-	! starving:
+
+	! =======      starving       ======= !
+	! -----           bmi < 16      ----- !
 	if bs_temp_bs_class <= 17:
+		!	0 <= strenbuf <= 200
 		$result = 'starving'
 
-	! underweight
+	! =======     underweight     ======= !
+	! -----     16 <= bmi < 19      ----- !
 	elseif bs_temp_bs_class <= 105:
+		!	0 <= strenbuf <= 50
 		$result = 'underweight'
 	elseif bs_temp_bs_class <= 107:
+		!	51 <= strenbuf <= 100
 		$result = 'slight'
 	elseif bs_temp_bs_class <= 117:
+		!	101 <= strenbuf <= 200
 		$result = 'wiry'
 
-	! slender
+	! =======       slender       ======= !
+	! -----     19 <= bmi < 21      ----- !
 	elseif bs_temp_bs_class <= 205:
+		!	0 <= strenbuf <= 50
 		$result = 'slender'
 	elseif bs_temp_bs_class <= 207:
+		!	51 <= strenbuf <= 100
 		$result = 'skinny'
 	elseif bs_temp_bs_class <= 217:
+		!	101 <= strenbuf <= 200
 		$result = 'lean'
 
-	! healthy
+	! =======       healthy       ======= !
+	! -----     21 <= bmi < 25      ----- !
 	elseif bs_temp_bs_class <= 305:
+		!	0 <= strenbuf <= 50
 		$result = 'healthy'
 	elseif bs_temp_bs_class <= 307:
+	!		51 <= strenbuf <= 100
 		$result = 'toned'
 	elseif bs_temp_bs_class <= 317:
+		!	101 <= strenbuf <= 200
 		$result = 'ripped'
 
-	! overweight
+	! =======     overweight      ======= !
+	! -----     26 <= bmi < 30      ----- !
 	elseif bs_temp_bs_class <= 405:
+		!	0 <= strenbuf <= 50
 		$result = 'overweight'
 	elseif bs_temp_bs_class <= 407:
+	!		51 <= strenbuf <= 100
 		$result = 'curvy'
 	elseif bs_temp_bs_class <= 417:
+		!	101 <= strenbuf <= 200
 		$result = 'heavy set'
 
-	! moderately obese
+	! =======  moderately obese   ======= !
+	! -----     30 <= bmi < 35      ----- !
 	elseif bs_temp_bs_class <= 517:
+		!	0 <= strenbuf <= 200
 		$result = 'moderately obese'
 
-	! severely obese
+	! =======   severely obese    ======= !
+	! -----     35 <= bmi < 40      ----- !
 	elseif bs_temp_bs_class <= 617:
+		!	0 <= strenbuf <= 200
 		$result = 'severely obese'
 
-	! very severely obese
+	! ======= very severely obese ======= !
+	! -----     40 <= bmi < 45      ----- !
 	elseif bs_temp_bs_class <= 717:
+		!	0 <= strenbuf <= 200
 		$result = 'very severely obese'
 
-	! morbidly obese
+	! =======   morbidly obese    ======= !
+	! -----     45 <= bmi           ----- !
 	else
+		!	0 <= strenbuf <= 200
 		$result = 'morbidly obese'
 	end
 
 	killvar 'bs_temp_bs_class'
 end
 
---- body_structure ---------------------------------
+
+--- body_structure ---------------------------------