Browse Source

[fixed] Removed some more duplicate variables in body_shape file

Kevin_Smarts 2 years ago
parent
commit
3f9fae89b7
1 changed files with 18 additions and 34 deletions
  1. 18 34
      locations/body_shape.qsrc

+ 18 - 34
locations/body_shape.qsrc

@@ -245,7 +245,7 @@ if $ARGS[0] = '':
 
 !!Setting the pcs_apprnc bonus based on fat and strength
 	bmi_calc = FUNC('body_shape', 'bmicalc', salo, pcs_hgt)
-	bodykoef = FUNC('body_shape', 'setbodykoef', bmi_calc, strenbuf, salocatnow, vofat)
+	bodykoef = FUNC('body_shape', 'setbodykoef')
 
 !!This is to clean up unused variables
 	killvar 'normbuffpick' & killvar 'nrmbfpckct'
@@ -255,30 +255,26 @@ end
 
 if $ARGS[0] = 'setbodykoef':
 	!!Setting the pcs_apprnc bonus based on fat and strength
-	tempbmi_calc = ARGS[1] & !! result of bmicalc
-	tempstrenbuf = ARGS[2] & !!strenbuf
-	tempsalocatnow = ARGS[3] & !! salocatnow
-	tempvofat = ARGS[4] & !! vofat
 
-	if tempbmi_calc < 16:
+	if bmi_calc < 16:
 		!! severely underweight
 		tempbodykoef = 30
-    elseif tempbmi_calc < 19:
+    elseif bmi_calc < 19:
 		!! underweight
 		tempbodykoef = 65
-    elseif tempbmi_calc < 25:
+    elseif bmi_calc < 25:
 		!! healthy weight
 		tempbodykoef = 85
-    elseif tempbmi_calc < 30:
+    elseif bmi_calc < 30:
 		!! overweight
 		tempbodykoef = 75
-    elseif tempbmi_calc < 35:
+    elseif bmi_calc < 35:
 		!! moderately obese
 		tempbodykoef = 45
-    elseif tempbmi_calc < 40:
+    elseif bmi_calc < 40:
 		!! severely obese
 		tempbodykoef = 25
-    elseif tempbmi_calc < 45:
+    elseif bmi_calc < 45:
 		!! very severely obese
 		tempbodykoef = 5
     else
@@ -286,44 +282,36 @@ if $ARGS[0] = 'setbodykoef':
 		tempbodykoef = 0
     end
 
-	if tempstrenbuf >= 80:
+	if strenbuf >= 80:
 		tempbodykoef += 8
-	elseif tempstrenbuf >= 60:
+	elseif strenbuf >= 60:
 		tempbodykoef += 10
-	elseif tempstrenbuf >= 40:
+	elseif strenbuf >= 40:
 		tempbodykoef += 8
-	elseif tempstrenbuf >= 20:
+	elseif strenbuf >= 20:
 		tempbodykoef += 5
 	else
 		tempbodykoef += 2
 	end
 
 !!This modifies bodykoef for high or low salo values
-	if tempsalocatnow = 0 or tempsalocatnow >= 7:
+	if salocatnow = 0 or salocatnow >= 7:
 		tempbodykoef -= 8
-	elseif tempsalocatnow = 1 or tempsalocatnow = 6:
+	elseif salocatnow = 1 or salocatnow = 6:
 		tempbodykoef -= 4
 	end
 
-	if tempvofat > 0: tempbodykoef -= tempvofat
+	if vofat > 0: tempbodykoef -= vofat
 
 	result = tempbodykoef
 
-	killvar 'tempbmi_calc'
 	killvar 'tempbodykoef'
-	killvar 'tempbodyFat'
-	killvar 'temppcs_hgt'
-	killvar 'tempstrenbuf'
-	killvar 'tempsalocatnow'
-	killvar 'tempvofat'
 end
 
 if $ARGS[0] = 'bmicalc':
 	!! ARGS[1] salo
 	!! ARGS[2] pcs_hgt
-	tempbmi_calc = 10000 * (30 + ARGS[1] / 2 + (ARGS[2] - 170) * 7 / 10) / (ARGS[2] * ARGS[2])
-	result = tempbmi_calc
-	killvar 'tempbmi_calc'
+	result = 10000 * (30 + ARGS[1] / 2 + (ARGS[2] - 170) * 7 / 10) / (ARGS[2] * ARGS[2])
 end
 
 if $ARGS[0] = 'bmiadjust':
@@ -595,18 +583,14 @@ if $ARGS[0] = 'calcHeadBonus':
 	teethcalc = (5 * pcs_teeth)
 	if teethcalc < 0: teethcalc = FUNC('body_shape', 'bmiadjust', teethcalc, bmi_calc)
 
-	tempHeadBonus = resnicbonus + glarazbonus + lipbonus - teethcalc
-
-	result = tempHeadBonus
+	result = resnicbonus + glarazbonus + lipbonus - teethcalc
 
-	killvar 'tempHeadBonus'
 end
 
 if $ARGS[0] = 'calcAttributeBonus':
 	tempAttributeBonus = (pcs_agil / 10) + (pcs_vital / 10)
-	tempAttributeBonus = FUNC('body_shape', 'bmiadjust', tempAttributeBonus, bmi_calc)
 
-	result = tempAttributeBonus
+	result = FUNC('body_shape', 'bmiadjust', tempAttributeBonus, bmi_calc)
 	killvar 'tempAttributeBonus'
 end