Browse Source

[Refactored] Refactored Grooming Bonus and Penalty and Accessories Bonus

ADCSux 2 years ago
parent
commit
16368fd10f
3 changed files with 81 additions and 101 deletions
  1. 73 84
      locations/body.qsrc
  2. 8 15
      locations/body_desc.qsrc
  3. 0 2
      locations/body_shape.qsrc

+ 73 - 84
locations/body.qsrc

@@ -10,17 +10,13 @@
 $this = 'body'
 
 if $ARGS[0] = '':
-	mopkoef = pcs_makupskl / 5
-	if pcs_makeup = 0: mopkoef = -5
-	if pcs_makeup = 1: mopkoef = 0
-	if pcs_makeup = 5: mopkoef = 30
 	if pcs_makeup = 6 and bimbolevel >= 2: extra_supnatvnesh = 2*bimbolevel - 2
 
 	!! Calculate hotcat etc
 	clothingBonus = FUNC('body', 'CalcClothingBonus')
-	accessoriesBonus = FUNC('body', 'CalcAccessoriesBonus', bonusZ, PShoQuality, $pantyworntype, $braworntype)
-	groomingBonus = FUNC('body', 'CalcGroomingBonus', pcs_lipbalm, mopkoef, pcs_hairbsh, pcs_breath, deodorant_on, pcs_bmi)
-	groomingPenalty = FUNC('body', 'CalcGroomingPenalty', pcs_hairlng, pcs_sweat, glassvnesh, dyevmod, legkoef)
+	accessoriesBonus = FUNC('body', 'CalcAccessoriesBonus', bonusZ, PShoQuality)
+	groomingBonus = FUNC('body', 'CalcGroomingBonus')
+	groomingPenalty = FUNC('body', 'CalcGroomingPenalty')
 	Hotcat = FUNC('body', 'calcHotcat', pcs_apprncbase, (supnatvnesh + extra_supnatvnesh), clothingBonus, accessoriesBonus, groomingBonus, groomingPenalty)
 	pcs_apprnc = temppcs_apprnc & killvar 'temppcs_apprnc' & killvar 'temppcs_maxapprnc'
 
@@ -187,117 +183,110 @@ if $ARGS[0] = 'CalcClothingBonus':
 end
 
 if $ARGS[0] = 'CalcAccessoriesBonus':
-	tempcoatbonus = ARGS[1] & !! bonusZ
-	tempPShoQuality = ARGS[2] & !! PShoQuality
-	$temppantyworntype = $ARGS[3] & !! $pantyworntype
-	$tempbraworntype = $ARGS[4] & !! $braworntype
+	coatQualityBonus = ARGS[1] & !! bonusZ
+	shoesQualityBonus = ARGS[2] & !! PShoQuality
 	
 	!!bonuses for certain underwear
-	if $temppantyworntype = 'boutique':
-		temppantybounus = 4
-	elseif $temppantyworntype = 'fashionista':
-		temppantybounus = 2
+	if $pantyworntype = 'boutique':
+		pantyBonus = 4
+	elseif $pantyworntype = 'fashionista':
+		pantyBonus = 2
 	end
 
-	if $tempbraworntype = 'boutique':
-		tempbrabounus = 4
-	elseif $tempbraworntype = 'fashionista':
-		tempbrabounus = 2
+	if $braworntype = 'boutique':
+		braBonus = 4
+	elseif $braworntype = 'fashionista':
+		braBonus = 2
 	end
 
-	tempAccessoriesBonus = tempcoatbonus + tempPShoQuality + temppantybounus + tempbrabounus
+	result = coatQualityBonus + shoesQualityBonus + pantyBonus + braBonus
 
-	result = tempAccessoriesBonus
-	killvar 'tempcoatbonus'
-	killvar 'tempPShoQuality'
-	killvar 'temppantybounus'
-	killvar 'tempbrabounus'
-	killvar '$temppantyworntype'
-	killvar '$tempbraworntype'
-	killvar 'tempAccessoriesBonus'
+	killvar 'coatQualityBonus'
+	killvar 'shoesQualityBonus'
+	killvar 'pantyBonus'
+	killvar 'braBonus'
 end
 
 if $ARGS[0] = 'CalcGroomingBonus':
-	!! Note there is a limit of 9 args
-	temppcs_lipbalm = ARGS[1] & !! pcs_lipbalm
-	tempmakeupkoef = ARGS[2] & !! mopkoef 
-	temppcs_hairbsh = ARGS[3] & !! pcs_hairbsh
-	temppcs_breath = ARGS[4] & !! pcs_breath
-	tempdeodorant_on = ARGS[5] & !! deodorant_on
-	temppcs_bmi = ARGS[6] & !! pcs_bmi
-
-	if temppcs_lipbalm > 0:
-		lipbalmKoef = 5
+	if pcs_lipbalm > 0:
+		lipBalmBonus = 5
 	else
-		lipbalmKoef = 0
+		lipBalmBonus = 0
 	end
 
-	tempHairBonus = temppcs_hairbsh * 10
+	makeupBonus = pcs_makupskl / 5
+	if pcs_makeup = 0: makeupBonus = -5
+	if pcs_makeup = 1: makeupBonus = 0
+	if pcs_makeup = 5: makeupBonus = 30
 
-	tempBreathBonus = temppcs_breath * 5
+	hairBonus = pcs_hairbsh * 10
 
-	tempGroomingBonus = tempmakeupkoef + tempHairBonus + lipbalmKoef + tempBreathBonus
+	breathBonus = pcs_breath * 5
 
-	!!Small bonus for wearing deodorant, if pcs_sweat is low enough
-	if tempdeodorant_on = 1 and temppcs_sweat < 20: tempGroomingBonus += 5
+	tempGroomingBonus = makeupBonus + hairBonus + lipBalmBonus + breathBonus
 
-	tempGroomingBonus = FUNC('body_shape', 'bmiadjust', tempGroomingBonus, temppcs_bmi)
+	!!Small bonus for wearing deodorant, if pcs_sweat is low enough
+	if deodorant_on = 1 and pcs_sweat < 20: tempGroomingBonus += 5
 
-	result = tempGroomingBonus
+	result = FUNC($this, 'AdjustFromBMI', tempGroomingBonus, pcs_bmi)
 
-	killvar 'temppcs_lipbalm'
-	killvar 'tempmakeupkoef'
-	killvar 'temppcs_hairbsh'
-	killvar 'temppcs_breath'
-	killvar 'tempdeodorant_on'
-	killvar 'tempHairBonus'
-	killvar 'tempBreathBonus'
+	killvar 'lipBalmBonus'
+	killvar 'makeupBonus'
+	killvar 'hairBonus'
+	killvar 'breathBonus'
 	killvar 'tempGroomingBonus'
-
-!! commented out as not used in the original calc
-!!Removed as primary appearance factors; will be eventually used in an NPC preference system instead; tanKoef = suntan
-!!	if temppcs_tan > 0:
-!!		tanKoef = 1
-!!	else
-!!		tanKoef = 0
-!!	end
-
 end
 
 if $ARGS[0] = 'CalcGroomingPenalty':
-	temppcs_hairlng = ARGS[1] & !! pcs_hairlng
-	temppcs_sweat = ARGS[2] & !! pcs_sweat
-	tempglassvnesh = ARGS[3] & !! glassvnesh
-	tempdyevmod = ARGS[4] & !! dyevmod
-	templegkoef = ARGS[5] & !! legkoef
-
 	!! buzzcut penalty to pcs_apprnc
-	if temppcs_hairlng < 10:
-		hairkoef = 10
+	if pcs_hairlng < 10:
+		buzzCutPenalty = 10
 	else
-		hairkoef = 0
+		buzzCutPenalty = 0
 	end
 
-	if temppcs_sweat < 22:
-		sweatKoef = 0
+	if pcs_sweat < 22:
+		sweatPenalty = 0
 	elseif temppcs_sweat < 38:
-		sweatKoef = (temppcs_sweat - 10) / 4
+		sweatPenalty = (temppcs_sweat - 10) / 4
 	elseif temppcs_sweat < 54:
-		sweatKoef = (temppcs_sweat - 10) / 2
+		sweatPenalty = (temppcs_sweat - 10) / 2
+	else
+		sweatPenalty = 3 * (temppcs_sweat - 10) / 4
+	end
+
+	!Glasses Penalty
+	if glass >= 2 or glass = 0:
+		glassesPenalty = 0
+	elseif glass = 1:
+		glassesPenalty = 10
+	end
+
+	!hair color fade penalty
+	if pcs_haircol ! nathcol:
+		if dyefade > 0 and dyefade < 7: hairDyePenalty = 5
+		if dyefade = 0: hairDyePenalty = 15
+	end
+
+	! Leg hair penalty
+	if pcs_leghair <= 0:
+		legPenalty = 0
+	elseif pcs_leghair <= 3:
+		legPenalty = 3
+	elseif pcs_leghair <= 6:
+		legPenalty = 6
 	else
-		sweatKoef = 3 * (temppcs_sweat - 10) / 4
+		legPenalty = 9 
 	end
 
-	tempGroomingPenalty = sweatKoef + tempglassvnesh + tempdyevmod + hairkoef + templegkoef
+	result = sweatPenalty + glassesPenalty + hairDyePenalty + buzzCutPenalty + legPenalty
 
-	result = tempGroomingPenalty
 
-	killvar 'temppcs_hairlng'
-	killvar 'temppcs_sweat'
-	killvar 'tempglassvnesh'
-	killvar 'tempdyevmod'
-	killvar 'templegkoef'
-	killvar 'tempGroomingPenalty'
+	killvar 'sweatPenalty'
+	killvar 'glassesPenalty'
+	killvar 'hairDyePenalty'
+	killvar 'buzzCutPenalty'
+	killvar 'legPenalty'
 end
 
 

+ 8 - 15
locations/body_desc.qsrc

@@ -187,21 +187,21 @@ end
 
 if $ARGS[0] = 'BMI':
 	!!BMI Descriptions
-	if bmi_calc < 16:
+	if pcs_bmi < 16:
 		$bmi_desc = 'You are severely underweight.'
-	elseif bmi_calc >= 16 and bmi_calc < 19:
+	elseif pcs_bmi >= 16 and pcs_bmi < 19:
 		$bmi_desc = 'You are underweight'
-	elseif bmi_calc >= 19 and bmi_calc < 25:
+	elseif pcs_bmi >= 19 and pcs_bmi < 25:
 		$bmi_desc = 'You have a normal, healthy weight.'
-	elseif bmi_calc >= 25 and bmi_calc < 30:
+	elseif pcs_bmi >= 25 and pcs_bmi < 30:
 		$bmi_desc = 'You are overweight.'
-	elseif bmi_calc >= 30 and bmi_calc < 35:
+	elseif pcs_bmi >= 30 and pcs_bmi < 35:
 		$bmi_desc = 'You are moderately obese.'
-	elseif bmi_calc >= 35 and bmi_calc < 40:
+	elseif pcs_bmi >= 35 and pcs_bmi < 40:
 		$bmi_desc = 'You are severely obese.'
-	elseif bmi_calc >= 40 and bmi_calc < 45:
+	elseif pcs_bmi >= 40 and bmi_pcs_bmicalc < 45:
 		$bmi_desc = 'You are very severely obese.'
-	elseif bmi_calc >= 45:
+	elseif pcs_bmi >= 45:
 		$bmi_desc = 'You are morbidly obese.'
 	end
 end
@@ -602,16 +602,13 @@ if $ARGS[0] = 'glasses':
 		$pc_desc['vision'] = func($this, 'ChooseDescWord', 'glasses', 'lenses')
 		$pc_descWordy['vision'] = 'chic, stylish glasses'
 		$glass = ' You wear glasses.'
-		glassvnesh = 0
 	elseif glass = 1:
 		$pc_desc['vision'] = func($this, 'ChooseDescWord', 'glasses', 'lenses', 'dorky glasses', 'geeky lenses')
 		$pc_descWordy['vision'] = 'cheap, utilitarian glasses'
 		$glass = ' You wear silly glasses in a cheap frame.'
-		glassvnesh = 10
 	else
 		glass = 0
 		$glass = ''
-		glassvnesh = 0
 	end
 end
 
@@ -914,22 +911,18 @@ if $ARGS[0] = 'legs':
     if pcs_leghair <= 0:
 		$pc_desc['legs'] = func($this, 'ChooseDescWord', 'smooth', 'silky', 'soft')
 		$pc_descWordy['legs'] = 'soft and silky-smooth'
-		legkoef = 0
 		$pcs_leghair = 'You have smooth legs.'
 	elseif pcs_leghair <= 3:
 		$pc_desc['legs'] = func($this, 'ChooseDescWord', 'slightly scratchy', 'faintly stubbly')
 		$pc_descWordy['legs'] = 'slightly rough, invisibly-stubbled'
-		legkoef = 3
 		$pcs_leghair = 'You can''t see any hair, but your legs feel rough to the touch.'
 	elseif pcs_leghair <= 6:
 		$pc_desc['legs'] = func($this, 'ChooseDescWord', 'somewhat hairy', 'lightly-furred')
 		$pc_descWordy['legs'] = 'lightly-furred, soft-haired'
-		legkoef = 6
 		$pcs_leghair = 'You have light and just barely visible hair on your legs.'
 	else
 		$pc_desc['legs'] = func($this, 'ChooseDescWord', 'hairy', 'unshaven', 'ungroomed')
 		$pc_descWordy['legs'] = 'hairy, unshaven'
-		legkoef = 9
 		$pcs_leghair = 'Your legs are hairy.'
 	end
 end

+ 0 - 2
locations/body_shape.qsrc

@@ -108,8 +108,6 @@ if $ARGS[0] = 'DailyUpdate':
 	if pcs_haircol ! nathcol:
 		dyefade -=1
 		if dyefade < 0: dyefade = 0
-		if dyefade > 0 and dyefade < 7: dyevmod = 5
-		if dyefade = 0: dyevmod = 15
 	end
 
 	!!pubic hair colouring