Browse Source

[fixed] Removed some duplication of variables that was making the file hard to read

Kevin_Smarts 2 years ago
parent
commit
9d308dd9d5
1 changed files with 31 additions and 56 deletions
  1. 31 56
      locations/body_shape.qsrc

+ 31 - 56
locations/body_shape.qsrc

@@ -516,9 +516,9 @@ end
 
 if $args[0] = 'basebeautycalc':
 	if pcs_lashes <= 0: pcs_lashes = 0
-	pcs_HeadBonus = FUNC('body_shape', 'calcHeadBonus', pcs_lashes, pcs_eyesize, pcs_lip, pcs_teeth, bmi_calc)
-	tempAttributeBonus = FUNC('body_shape', 'calcAttributeBonus', pcs_agil, pcs_vital, bmi_calc)
-	pcs_apprncbase = FUNC('body_shape', 'basebeautycalc2', ARGS[1], vidage, pcs_skin, bodykoef, pcs_HeadBonus, tempAttributeBonus, pcs_apprncbase)
+	pcs_HeadBonus = FUNC('body_shape', 'calcHeadBonus')
+	tempAttributeBonus = FUNC('body_shape', 'calcAttributeBonus')
+	pcs_apprncbase = FUNC('body_shape', 'basebeautycalc2', ARGS[1])
 
 	if ARGS[1] = 0:
 !!	This is the rate of change limiter
@@ -547,105 +547,84 @@ if $args[0] = 'basebeautycalc':
 end 
 
 if $ARGS[0] = 'calcHeadBonus':
-	temppcs_lashes = ARGS[1] & !! pcs_lashes
-	temppcs_eyesize = ARGS[2] & !! pcs_eyesize
-	temppcs_lip = ARGS[3] & !! pcs_lip
-	temppcs_teeth = ARGS[4] & !! pcs_teeth (missing teeth)
-	tempbmi_calc = ARGS[5] & !! bmi_calc
 
 !!	Setting Eyelashes bonus
-	if temppcs_lashes <= 0:
+	if pcs_lashes <= 0:
 		resnicbonus = 0
-	elseif temppcs_lashes = 1:
+	elseif pcs_lashes = 1:
 		resnicbonus = 2
-	elseif temppcs_lashes = 2:
+	elseif pcs_lashes = 2:
 		resnicbonus = 5
-	elseif temppcs_lashes = 3:
+	elseif pcs_lashes = 3:
 		resnicbonus = 7
-	elseif temppcs_lashes = 4:
+	elseif pcs_lashes = 4:
 		resnicbonus = 8
-	elseif temppcs_lashes = 5:
+	elseif pcs_lashes = 5:
 		resnicbonus = 10
 	else
 		resnicbonus = 0		
 	end
-	resnicbonus = FUNC('body_shape', 'bmiadjust', resnicbonus, tempbmi_calc)
+	resnicbonus = FUNC('body_shape', 'bmiadjust', resnicbonus, bmi_calc)
 
 !!	Setting Eye Size bonus
-	if temppcs_eyesize = 1:
+	if pcs_eyesize = 1:
 		glarazbonus = 1
-	elseif temppcs_eyesize = 2:
+	elseif pcs_eyesize = 2:
 		glarazbonus = 3
-	elseif temppcs_eyesize = 3:
+	elseif pcs_eyesize = 3:
 		glarazbonus = 2
 	else
 		glarazbonus = 0
 	end
-	glarazbonus = FUNC('body_shape', 'bmiadjust', glarazbonus, tempbmi_calc)
+	glarazbonus = FUNC('body_shape', 'bmiadjust', glarazbonus, bmi_calc)
 
 !!	Setting the Lip size bonus
-	if temppcs_lip = 0:
+	if pcs_lip = 0:
 		lipbonus = -2
-	elseif temppcs_lip = 1:
+	elseif pcs_lip = 1:
 		lipbonus = 0
-	elseif temppcs_lip = 2:
+	elseif pcs_lip = 2:
 		lipbonus = 3
-	elseif temppcs_lip = 3:
+	elseif pcs_lip = 3:
 		lipbonus = 5
 	else
 		lipbonus = 3
 	end
-	lipbonus = FUNC('body_shape', 'bmiadjust', lipbonus, tempbmi_calc)
+	lipbonus = FUNC('body_shape', 'bmiadjust', lipbonus, bmi_calc)
 	
-	teethcalc = (5 * temppcs_teeth)
-	if teethcalc < 0: teethcalc = FUNC('body_shape', 'bmiadjust', teethcalc, tempbmi_calc)
+	teethcalc = (5 * pcs_teeth)
+	if teethcalc < 0: teethcalc = FUNC('body_shape', 'bmiadjust', teethcalc, bmi_calc)
 
 	tempHeadBonus = resnicbonus + glarazbonus + lipbonus - teethcalc
 
 	result = tempHeadBonus
 
-	killvar 'temppcs_lashes'
-	killvar 'temppcs_eyesize'
-	killvar 'temppcs_lip'
-	killvar 'temppcs_teeth'
 	killvar 'tempHeadBonus'
-	killvar 'tempbmi_calc'
 end
 
 if $ARGS[0] = 'calcAttributeBonus':
-	temppcs_agil = ARGS[1] & !! pcs_agil
-	temppcs_vital = ARGS[2] & !! pcs_vital
-	tempbmi_calc = ARGS[3] & !! bmi_calc
-
-	tempAttributeBonus = (temppcs_agil / 10) + (temppcs_vital / 10)
-	tempAttributeBonus = FUNC('body_shape', 'bmiadjust', tempAttributeBonus, tempbmi_calc)
+	tempAttributeBonus = (pcs_agil / 10) + (pcs_vital / 10)
+	tempAttributeBonus = FUNC('body_shape', 'bmiadjust', tempAttributeBonus, bmi_calc)
 
 	result = tempAttributeBonus
-	killvar 'temppcs_agil'
-	killvar 'temppcs_vital'
 	killvar 'tempAttributeBonus'
-	killvar 'tempbmi_calc'
 end
 
 !!This is the calculation for the base appearance if calling for testing always set ARGS[1] to 1
 if $args[0] = 'basebeautycalc2':
 	!!ARGS[1] reset pcs_apprncbase
-	tempvidage = ARGS[2] & !! vidage
-	temppcs_skin = ARGS[3] & !! pcs_skin
-	tempbodykoef = ARGS[4] & !! bodykoef
-	tempHeadBonus = ARGS[5] & !! result of calcHeadBonus
-	tempAttributeBonus = ARGS[6] & !! result of calcAttributeBonus
-	temppcs_apprncbase = ARGS[7] & !! pcs_apprncbase
+	!! result of pcs_HeadBonus
+	!! result of calcAttributeBonus
 
 
 !!	Setting vidagebonus
 	vidagebonus = 100
-	if tempvidage < 20: vidagebonus = 60 + (2 * tempvidage)
-	if tempvidage > 30: vidagebonus = 160 - (2 * tempvidage)
+	if vidage < 20: vidagebonus = 60 + (2 * vidage)
+	if vidage > 30: vidagebonus = 160 - (2 * vidage)
 
 !!	Preforming the calculation
-	skincalc = (temppcs_skin * 2 / 5)
-	vneshtemp = vidagebonus * (skincalc + tempbodykoef + tempAttributeBonus + tempHeadBonus) / 100
+	skincalc = (pcs_skin * 2 / 5)
+	vneshtemp = vidagebonus * (skincalc + bodykoef + tempAttributeBonus + pcs_HeadBonus) / 100
 
 !!	pcs_skin = skin condition, corrected to a 0 to 40 range; bodykoef set in main body_shape; pcs_teeth is missing teeth or cosmetically improved teeth (-1)
 
@@ -656,17 +635,13 @@ if $args[0] = 'basebeautycalc2':
 	vneshtemp += supnatvnesh
 
 !!	This is for use when a reset is called for by setting args[1] = 1
-	if args[1] = 1: temppcs_apprncbase = vneshtemp & killvar 'vneshtemp'
+	if args[1] = 1: pcs_apprncbase = vneshtemp & killvar 'vneshtemp'
 
-	result = temppcs_apprncbase
+	result = pcs_apprncbase
 
 !!	This is to clean up variables only used here
 	!!do not kill vneshtemp here it gets killed in basebeautycalc
-	killvar 'temppcs_apprncbase'
 	killvar 'skincalc'
-	killvar 'tempvidage'
-	killvar 'temppcs_skin'
-	killvar 'tempbodykoef'
 	killvar 'vidagebonus'
 	killvar 'tempHeadBonus'
 	killvar 'tempAttributeBonus'