2 Commits b266185ed4 ... 7029f184ee

Author SHA1 Message Date
  ADCSux 7029f184ee [Renamed] Renamed body_shape.qsrc to body to now reflect all updates regarding body now happen in body.qsrc 2 years ago
  ADCSux 839b73a270 [Renamed] Renamed body.qsrc to AppearanceSystem.qsrc to reflect on what the file does 2 years ago

+ 4 - 1
changes from 0_8_5 to 0_8_6.txt

@@ -24,6 +24,8 @@ pav_beach_chat
 katja_lake			<- split from katjaEv
 
 body_desc
+AppearanceSystem               <- body
+body                           <- body_shape
 
 === deleted locations ===
 
@@ -39,7 +41,8 @@ rex_party_boys_events
 rex_party_girls_events
 rex_party_sister_events
 $phone_theme
-
+body                                 -> AppearanceSystem
+body_shape                           -> body
 
 
 Variables:

+ 1 - 1
glife.qproj

@@ -65,8 +65,8 @@
 		<Location name="grades"/>
 	</Folder>
 	<Folder name="Body">
+		<Location name="ApperanceSystem"/>
 		<Location name="body"/>
-		<Location name="body_shape"/>
 		<Location name="body_desc"/>
 		<Location name="lact_lib"/>
 		<Location name="lact_bp"/>

+ 378 - 0
locations/ApperanceSystem.qsrc

@@ -0,0 +1,378 @@
+# AppearanceSystem
+$this = 'AppearanceSystem'
+
+if $ARGS[0] = '':
+	!{
+        PC's appearance is updated regularly in stat.qsrc.
+        Note: A huge part of PC's appearance is from base appearance, which is updated once a day. Because it's
+        a global variable, it does not show in this function in particular, but it's used in 'CalcAppearance'
+    }
+	if pcs_makeup = 6 and bimbolevel >= 2: extra_supnatvnesh = 2*bimbolevel - 2
+
+	!STD check. STD will make appearance automatically -10
+	if Gerpes >= 3 or Sifilis >= 21 or Triper > 2:
+		pcs_apprnc = -10
+	else:
+		clothingBonus = func($this, 'CalcClothingBonus')
+		accessoriesBonus = func($this, 'CalcAccessoriesBonus', bonusZ, PShoQuality)
+		groomingBonus = func($this, 'CalcGroomingBonus')
+		groomingPenalty = func($this, 'CalcGroomingPenalty')
+		pcs_apprnc = func($this, 'CalcAppearance', (supnatvnesh + extra_supnatvnesh))
+		Hotcat = func($this, 'ConvertToHotcat')
+	end
+
+	killvar 'clothingBonus'
+	killvar 'accessoriesBonus'
+	killvar 'groomingBonus'
+	killvar 'groomingPenalty'
+end
+
+if $args[0] = 'UpdateBaseAppearnce':
+	!{
+		Base Appearance is updated once a day at midnight and called from cikl
+		Base Appearance is calculated from:
+			vidage, skin, body shape (fat and strength), face (lip size, eyes size, and eyelashes)
+			attributes (endurance and agility)
+	}
+	faceBonus = func($this, 'CalcFaceBonus')
+	attributeBonus = func($this, 'CalcAttributeBonus')
+
+	!!	Setting vidageBonus
+	if vidage < 20: 
+		vidageBonus = 60 + (2 * vidage)
+	elseif vidage > 30: 
+		vidageBonus = 160 - (2 * vidage)
+	else
+		vinageBonus = 100
+	end
+
+	skinBonus = (pcs_skin * 2 / 5)
+	bodyShapeBonus = func($this, 'SetBodyShapeBonus')
+
+	! Calculte base appearance
+	pcs_apprncbase = (vidageBonus * (skinBonus + bodyShapeBonus + faceBonus + attributeBonus) / 100) + supnatvnesh
+
+	killvar 'vidageBonus'
+	killvar 'skinBonus'
+	killvar 'bodyShapeBonus'
+	killvar 'faceBonus'
+	killvar 'attributeBonus'
+end 
+
+if $ARGS[0] = 'CalcFaceBonus':
+	!!	Setting Eyelashes bonus
+	if pcs_lashes <= 0:
+		eyelashesBonus = 0
+	elseif pcs_lashes = 1:
+		eyelashesBonus = 2
+	elseif pcs_lashes = 2:
+		eyelashesBonus = 5
+	elseif pcs_lashes = 3:
+		eyelashesBonus = 7
+	elseif pcs_lashes = 4:
+		eyelashesBonus = 8
+	elseif pcs_lashes = 5:
+		eyelashesBonus = 10
+	else
+		eyelashesBonus = 0		
+	end
+	eyelashesBonus = FUNC($this, 'AdjustFromBMI', eyelashesBonus)
+
+	!!	Setting Eye Size bonus
+	if pcs_eyesize = 1:
+		eyeSizeBonus = 1
+	elseif pcs_eyesize = 2:
+		eyeSizeBonus = 3
+	elseif pcs_eyesize = 3:
+		eyeSizeBonus = 2
+	else
+		eyeSizeBonus = 0
+	end
+	eyeSizeBonus = FUNC($this, 'AdjustFromBMI', eyeSizeBonus)
+
+	!!	Setting the Lip size bonus
+	if pcs_lip = 0:
+		lipBonus = -2
+	elseif pcs_lip = 1:
+		lipBonus = 0
+	elseif pcs_lip = 2:
+		lipBonus = 3
+	elseif pcs_lip = 3:
+		lipBonus = 5
+	else
+		lipBonus = 3
+	end
+	lipBonus = FUNC($this, 'AdjustFromBMI', lipBonus)
+
+	result = eyelashesBonus + eyeSizeBonus + lipBonus
+
+	killvar 'eyelashesBonus'
+	killvar 'eyeSizeBonus'
+	killvar 'lipBonus'
+end
+
+if $ARGS[0] = 'CalcAttributeBonus':
+	tempAttributeBonus = (pcs_agil / 10) + (pcs_vital / 10)
+
+	result = func($this, 'AdjustFromBMI', tempAttributeBonus)
+	killvar 'tempAttributeBonus'
+end
+
+if $ARGS[0] = 'SetBodyShapeBonus':
+	! Magic uses a different calculation
+	if dounspell = 1:
+		bodytipe = pcs_hips - pcs_waist
+		if bodytipe < 20:
+			result = 0
+		elseif bodytipe >= 20 and bodytipe < 25:
+			result = 2
+		elseif (bodytipe >= 25 and bodytipe < 30) or bodytipe >=35:
+			result = 4
+		elseif bodytipe >= 30 and bodytipe < 35:
+			result = 8
+		end
+
+	!!Setting the pcs_apprnc bonus based on fat and strength
+	else
+		if pcs_bmi < 16:
+			!! severely underweight
+			tempBodyShapeBonus = 30
+		elseif pcs_bmi < 19:
+			!! underweight
+			tempBodyShapeBonus = 65
+		elseif pcs_bmi < 25:
+			!! healthy weight
+			tempBodyShapeBonus = 85
+		elseif pcs_bmi < 30:
+			!! overweight
+			tempBodyShapeBonus = 75
+		elseif pcs_bmi < 35:
+			!! moderately obese
+			tempBodyShapeBonus = 45
+		elseif pcs_bmi < 40:
+			!! severely obese
+			tempBodyShapeBonus = 25
+		elseif pcs_bmi < 45:
+			!! very severely obese
+			tempBodyShapeBonus = 5
+		else
+			!! morbidly obese
+			tempBodyShapeBonus = 0
+		end
+
+		if (strenbuf >= 40 and strenbuf < 60) or strenbuf >= 80:
+			tempBodyShapeBonus += 8
+		elseif strenbuf >= 60:
+			tempBodyShapeBonus += 10
+		elseif strenbuf >= 20:
+			tempBodyShapeBonus += 5
+		end
+
+		!!This modifies bodykoef for high or low salo values
+		if salocatnow = 0 or salocatnow >= 7:
+			tempBodyShapeBonus -= 8
+		elseif salocatnow = 1 or salocatnow = 6:
+			tempBodyShapeBonus -= 4
+		end
+
+		if vofat > 0: tempBodyShapeBonus -= vofat
+
+		result = tempBodyShapeBonus
+
+		killvar 'tempBodyShapeBonus'
+	end
+end
+
+if $ARGS[0] = 'CalcClothingBonus':
+	if $clothingworntype = 'nude':
+		if pcs_bmi >= 19 and pcs_bmi < 30:
+			! Healthy and overweight
+			tempRevealing = 405
+			PCloQuality = 3
+		else
+			tempRevealing = 0
+			PCloQuality = 1
+		end
+	else
+		if pcs_bmi < 19:
+			!Skinny and severely skinny
+			tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness))/2
+		elseif pcs_bmi >= 19 and pcs_bmi < 30:
+			!Healthy and overweight
+			tempRevealing = (PXCloThinness + PXCloTopCut + PXCloBottomShortness)/2
+		elseif pcs_bmi >= 30:
+			!Moderately overweight and above
+			tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness)) * 3/4
+		end
+	end
+
+	result = tempRevealing/ 76 * PCloQuality
+	killvar 'tempRevealing'
+
+end
+
+if $ARGS[0] = 'CalcAccessoriesBonus':
+	coatQualityBonus = ARGS[1] & !! bonusZ
+	shoesQualityBonus = ARGS[2] & !! PShoQuality
+	
+	!!bonuses for certain underwear
+	if $pantyworntype = 'boutique':
+		pantyBonus = 4
+	elseif $pantyworntype = 'fashionista':
+		pantyBonus = 2
+	end
+
+	if $braworntype = 'boutique':
+		braBonus = 4
+	elseif $braworntype = 'fashionista':
+		braBonus = 2
+	end
+
+	result = coatQualityBonus + shoesQualityBonus + pantyBonus + braBonus
+
+	killvar 'coatQualityBonus'
+	killvar 'shoesQualityBonus'
+	killvar 'pantyBonus'
+	killvar 'braBonus'
+end
+
+if $ARGS[0] = 'CalcGroomingBonus':
+	if pcs_lipbalm > 0:
+		lipBalmBonus = 5
+	else
+		lipBalmBonus = 0
+	end
+
+	makeupBonus = pcs_makupskl / 5
+	if pcs_makeup = 0: makeupBonus = -5
+	if pcs_makeup = 1: makeupBonus = 0
+	if pcs_makeup = 5: makeupBonus = 30
+
+	hairBonus = pcs_hairbsh * 10
+
+	breathBonus = pcs_breath * 5
+
+	tempGroomingBonus = makeupBonus + hairBonus + lipBalmBonus + breathBonus
+
+	!!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)
+
+	killvar 'lipBalmBonus'
+	killvar 'makeupBonus'
+	killvar 'hairBonus'
+	killvar 'breathBonus'
+	killvar 'tempGroomingBonus'
+end
+
+if $ARGS[0] = 'CalcGroomingPenalty':
+	!! buzzcut penalty to pcs_apprnc
+	if pcs_hairlng < 10:
+		buzzCutPenalty = 10
+	else
+		buzzCutPenalty = 0
+	end
+
+	if pcs_sweat < 22:
+		sweatPenalty = 0
+	elseif temppcs_sweat < 38:
+		sweatPenalty = (pcs_sweat - 10) / 4
+	elseif temppcs_sweat < 54:
+		sweatPenalty = (pcs_sweat - 10) / 2
+	else
+		sweatPenalty = 3 * (pcs_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
+		legPenalty = 9 
+	end
+
+	result = sweatPenalty + glassesPenalty + hairDyePenalty + buzzCutPenalty + legPenalty
+
+
+	killvar 'sweatPenalty'
+	killvar 'glassesPenalty'
+	killvar 'hairDyePenalty'
+	killvar 'buzzCutPenalty'
+	killvar 'legPenalty'
+end
+
+
+if $ARGS[0] = 'CalcAppearance':
+	superNaturalBonus = ARGS[1] & !! supnatvnesh
+
+	temp_apprnc = pcs_apprncbase + clothingBonus + accessoriesBonus + groomingBonus - groomingPenalty
+
+	if temp_apprnc >= 200: temp_apprnc = 200 
+	if temp_apprnc < 0: temp_apprnc = 0
+
+	!Any super natural bonuses are allowed to go above the max scale
+	result = temp_apprnc + superNaturalBonus
+	
+	killvar 'superNaturalBonus'
+	killvar 'temp_apprnc'
+end
+
+if $ARGS[0] = 'ConvertToHotcat':
+	if pcs_apprnc <= 200:
+		result = pcs_apprnc / 20
+	else
+		result = 10
+	end
+end
+
+if $ARGS[0] = 'AdjustFromBMI':
+	tempValue = ARGS[1] & !!value to be adjusted
+
+	if pcs_bmi < 16:
+		!! severely underweight
+		tempValue = tempValue * 50 / 100
+    elseif pcs_bmi < 19:
+		!! underweight
+		tempValue = tempValue * 95 / 100
+    elseif pcs_bmi < 25:
+		!! healthy weight
+		!! normal bonus
+    elseif pcs_bmi < 30:
+		!! overweight
+		tempValue = tempValue * 95 / 100
+    elseif pcs_bmi < 35:
+		!! moderately obese
+		tempValue = tempValue * 80 / 100
+    elseif pcs_bmi < 40:
+		!! severely obese
+		tempValue = tempValue * 55 / 100
+    elseif pcs_bmi < 45:
+		!! very severely obese
+		tempValue = tempValue * 50 / 100
+    else
+		!!morbidly obese
+		tempValue = tempValue * 40 / 100
+    end
+
+	result = tempValue
+	killvar 'tempValue'
+end
+--- AppearanceSystem ---------------------------------

+ 18 - 18
locations/Cheatmenu_din.qsrc

@@ -206,68 +206,68 @@ $cheatmenu['bodyMod'] = {
 		'starving (No, you may not select ''starving'', it''s here to show where the scale starts)'
 		''
 		if salocatnow ! 1:
-			'<a href="exec:salo = 20 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 1)]>></a>'
+			'<a href="exec:salo = 20 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 1)]>></a>'
 			''
 		end
 		if salocatnow ! 2:
-			'<a href="exec:salo = 40 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 2)]>></a>'
+			'<a href="exec:salo = 40 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 2)]>></a>'
 			''
 		end
 		if salocatnow ! 3:
-			'<a href="exec:salo = 60 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 3)]>></a>'
+			'<a href="exec:salo = 60 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 3)]>></a>'
 			''
 		end
 		if salocatnow ! 4:
-			'<a href="exec:salo = 80 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 4)]>></a>'
+			'<a href="exec:salo = 80 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 4)]>></a>'
 			''
 		end
 		if salocatnow ! 5:
-			'<a href="exec:salo = 100 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 5)]>></a>'
+			'<a href="exec:salo = 100 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 5)]>></a>'
 			''
 		end
 		if salocatnow ! 6:
-			'<a href="exec:salo = 120 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 6)]>></a>'
+			'<a href="exec:salo = 120 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 6)]>></a>'
 			''
 		end
 		if salocatnow ! 7:
-			'<a href="exec:salo = 140 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 7)]>></a>'
+			'<a href="exec:salo = 140 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 7)]>></a>'
 			''
 		end
 	else
 		if (pregchem < 2688) = 0:
-			'<a href="exec:pregchem = 100 & pregtime = 4 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10))]>></a>'
+			'<a href="exec:pregchem = 100 & pregtime = 4 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10))]>></a>'
 			''
 		end
 		if (pregchem >= 2688 and pregchem < 3192) = 0:
-			'<a href="exec:pregchem = 2688 & pregtime = 112 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 1)]>></a>'
+			'<a href="exec:pregchem = 2688 & pregtime = 112 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 1)]>></a>'
 			''
 		end
 		if (pregchem >= 3192 and pregchem < 3696) = 0:
-			'<a href="exec:pregchem = 3192 & pregtime = 133 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 2)]>></a>'
+			'<a href="exec:pregchem = 3192 & pregtime = 133 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 2)]>></a>'
 			''
 		end
 		if (pregchem >= 3696 and pregchem < 4200) = 0:
-			'<a href="exec:pregchem = 3696 & pregtime = 154 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 3)]>></a>'
+			'<a href="exec:pregchem = 3696 & pregtime = 154 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 3)]>></a>'
 			''
 		end
 		if (pregchem >= 4200 and pregchem < 4704) = 0:
-			'<a href="exec:pregchem = 4200 & pregtime = 175 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 4)]>></a>'
+			'<a href="exec:pregchem = 4200 & pregtime = 175 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 4)]>></a>'
 			''
 		end
 		if (pregchem >= 4704 and pregchem < 5208) = 0:
-			'<a href="exec:pregchem = 4704 & pregtime = 196 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 5)]>></a>'
+			'<a href="exec:pregchem = 4704 & pregtime = 196 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 5)]>></a>'
 			''
 		end
 		if (pregchem >= 5208 and pregchem < 5712) = 0:
-			'<a href="exec:pregchem = 5208 & pregtime = 217 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 6)]>></a>'
+			'<a href="exec:pregchem = 5208 & pregtime = 217 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 6)]>></a>'
 			''
 		end
 		if (pregchem >= 5712 and pregchem < 6216) = 0:
-			'<a href="exec:pregchem = 5712 & pregtime = 238 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 7)]>></a>'
+			'<a href="exec:pregchem = 5712 & pregtime = 238 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 7)]>></a>'
 			''
 		end
 		if (pregchem >= 6216) = 0:
-			'<a href="exec:pregchem = 6216 & pregtime = 259 & gs ''body_shape'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 8)]>></a>'
+			'<a href="exec:pregchem = 6216 & pregtime = 259 & gs ''body'', ''softreset'' & gs ''stat'' & dynamic $cheatmenu[''bodyMod'']"><<$bodimgsets[((bodset * 10) + 8)]>></a>'
 			''
 		end
 	end
@@ -809,7 +809,7 @@ $cheatmenu['looks'] = {
 	if pcs_throat >= 5:'<a href="exec:pcs_throat -= 5 & dynamic $cheatmenu[''looks'']">Decrease throat capacity</a>'
 	if dounspell = 1:
 		*nl
-		'<a href="exec:dounsplkil = 2 & gs ''body_shape'', ''hardreset''">Hard Reset body shape</a>'
+		'<a href="exec:dounsplkil = 2 & gs ''body'', ''hardreset''">Hard Reset body shape</a>'
 	end
 
 	'</td><td width="33%" cellpadding="20" valign="top">'
@@ -840,7 +840,7 @@ $cheatmenu['looks'] = {
 	*nl
 	if dounspell = 0:
 		if fat ! 0: '<a href="exec:fat = 0 & dynamic $cheatmenu[''looks'']">Zero fat</a>'
-		'Body Fat = (<<salo>>): <a href="exec:salo -= 10 & gs ''body_shape'', ''softreset'' & dynamic $cheatmenu[''looks'']">-10</a> <a href="exec:salo -= 5 & gs ''body_shape'', ''softreset'' & dynamic $cheatmenu[''looks'']">-5</a> <a href="exec:salo -= 1 & gs ''body_shape'', ''softreset'' & dynamic $cheatmenu[''looks'']">-1</a> <a href="exec:salo += 1 & gs ''body_shape'', ''softreset'' & dynamic $cheatmenu[''looks'']">+1</a> <a href="exec:salo += 5 & gs ''body_shape'', ''softreset'' & dynamic $cheatmenu[''looks'']">+5</a> <a href="exec:salo += 10 & gs ''body_shape'', ''softreset'' & dynamic $cheatmenu[''looks'']">+10</a>'
+		'Body Fat = (<<salo>>): <a href="exec:salo -= 10 & gs ''body'', ''softreset'' & dynamic $cheatmenu[''looks'']">-10</a> <a href="exec:salo -= 5 & gs ''body'', ''softreset'' & dynamic $cheatmenu[''looks'']">-5</a> <a href="exec:salo -= 1 & gs ''body'', ''softreset'' & dynamic $cheatmenu[''looks'']">-1</a> <a href="exec:salo += 1 & gs ''body'', ''softreset'' & dynamic $cheatmenu[''looks'']">+1</a> <a href="exec:salo += 5 & gs ''body'', ''softreset'' & dynamic $cheatmenu[''looks'']">+5</a> <a href="exec:salo += 10 & gs ''body'', ''softreset'' & dynamic $cheatmenu[''looks'']">+10</a>'
 		'Note: You need some Body Fat to survive, any value under 11 is clasified as "starving" and a value of 0 can lead to a Game Over.'
 	end
 	*nl

+ 9 - 9
locations/UnitAppearance.qsrc

@@ -37,11 +37,11 @@ if $ARGS[0] = 'GenRowBreak':
 end 
 
 if $ARGS[0] = 'calcHotcat':
-	unitbmi_calc = FUNC('body_shape', 'bmicalc', unitsalo, unitpcs_hgt)
-	unitbodykoef = FUNC('body_shape', 'setbodykoef', unitbmi_calc, unitstrenbuf, unitsalocatnow, unitvofat)
-	unitHeadBonus = FUNC('body_shape', 'calcHeadBonus', unitpcs_lashes, unitpcs_eyesize, unitpcs_lip, unitpcs_teeth, unitbmi_calc)
-	unitAttributeBonus = FUNC('body_shape', 'calcAttributeBonus', unitpcs_agil, unitpcs_vital, unitbmi_calc)
-	unitpcs_apprncbase = FUNC('body_shape', 'basebeautycalc2', unitResetBase, unitvidage, unitpcs_skin, unitbodykoef, unitHeadBonus, unitAttributeBonus, unitpcs_apprncbase)
+	unitbmi_calc = FUNC('body', 'bmicalc', unitsalo, unitpcs_hgt)
+	unitbodykoef = FUNC('body', 'setbodykoef', unitbmi_calc, unitstrenbuf, unitsalocatnow, unitvofat)
+	unitHeadBonus = FUNC('body', 'calcHeadBonus', unitpcs_lashes, unitpcs_eyesize, unitpcs_lip, unitpcs_teeth, unitbmi_calc)
+	unitAttributeBonus = FUNC('body', 'calcAttributeBonus', unitpcs_agil, unitpcs_vital, unitbmi_calc)
+	unitpcs_apprncbase = FUNC('body', 'basebeautycalc2', unitResetBase, unitvidage, unitpcs_skin, unitbodykoef, unitHeadBonus, unitAttributeBonus, unitpcs_apprncbase)
 	unitclothingbonus = FUNC('body', 'calcClothesBonus', unitPXCloThinness, unitPXCloTopCut, unitPXCloBottomShortness, unitPCloQuality, $unitclothingworntype, unitbmi_calc)
 	unitAccessoriesBonus = FUNC('body', 'calcAccessoriesBonus', unitbonusZ, unitPShoQuality, $unitpantyworntype, $unitbraworntype)
 	unitGroomingBonus = FUNC('body', 'calcGroomingBonus', unitpcs_lipbalm, unitmopkoef, unitpcs_hairbsh, unitpcs_breath, unitdeodorant_on, unitbmi_calc)
@@ -77,7 +77,7 @@ if $ARGS[0] = 'HeadBonusCalc':
 end
 
 if $ARGS[0] = 'GenHeadRow':
-    unitHeadBonus = FUNC('body_shape', 'calcHeadBonus', ARGS[1], ARGS[2], ARGS[3], ARGS[4])
+    unitHeadBonus = FUNC('body', 'calcHeadBonus', ARGS[1], ARGS[2], ARGS[3], ARGS[4])
     '<tr>'
         '<td><<unitHeadBonus>></td>'
         '<td><<ARGS[1]>></td>'
@@ -110,7 +110,7 @@ if $ARGS[0] = 'AttribBonusCalc':
 end
 
 if $ARGS[0] = 'GenAttribRow':
-    unitAttribBonus = FUNC('body_shape', 'calcAttributeBonus', ARGS[1], ARGS[2])
+    unitAttribBonus = FUNC('body', 'calcAttributeBonus', ARGS[1], ARGS[2])
     '<tr>'
         '<td><<unitAttribBonus>></td>'
         '<td><<ARGS[1]>></td>'
@@ -1119,14 +1119,14 @@ if $ARGS[0] = 'CalcSaloVars':
     unitvofat = ((unitpcs_hgt * unithratio) / 100 + unitvhips - (unitpcs_hgt * 72) / 100) / 2
 
     unitsalocatnow = 1 + (unitsalo - 10) / 20
-    unitbmi_calc = FUNC('body_shape', 'bmicalc', unitsalo, unitpcs_hgt)
+    unitbmi_calc = FUNC('body', 'bmicalc', unitsalo, unitpcs_hgt)
     gs 'UnitAppearance', 'GetClothThick', unitbmi_calc
 end
 
 if $ARGS[0] = 'GenerateSvetaOptions':
     gs 'UnitAppearance', 'SaveBase'
     gs 'UnitAppearance', 'GenRowBreak', $ARGS[1]
-    unitbmi_calc = FUNC('body_shape', 'bmicalc', unitsalo, unitpcs_hgt)
+    unitbmi_calc = FUNC('body', 'bmicalc', unitsalo, unitpcs_hgt)
 
     $svetadesc = 'Current Clothes'
     

+ 479 - 308
locations/body.qsrc

@@ -1,378 +1,549 @@
 # body
+
+!!vhips = derived from salo in body_shape
+!!vhtmp = slows the change to vhips in body_shape
+!!wratio = waist to hips ratio set in body_shape
+!!bratio = band to waist ratio set in body_shape
+!!hratio = hip to height ratio set in body_shape
+!!vofat = used as a place to put extra salo at extreme high values (i.e. really, really fat) set in body_shape
+!!nbsize = starts at a set genetic bust size, but can be adjusted down if salo drops too low
+!!magicf2b = set in body_shape for the fat moved to bust
+!!genbsize = the set genetic bust size
+!!salocatnow = the current category of salo
+!!salocatlast = the previous category of salo
+!!magf2bdo = flag for magic bust increase; 0, ready; 1, do it; 2, ask; 3, no
+!!mgf2bnocnt = used to count the number of times a bust increase was turned down and stop asking after 3
+!!magtarcup = set in the dream code as the target cup size 
+!!btwarn = used to flag if to display the gaining/losing weight message when bathing
+!!salolast = used when doing a soft rest to control the cycling of the main code
+!!sftrstflag = used to prevent a code chunk from firing on a soft reset
+!!Image set variables
+!! bodset = body image and descriptor control variable, used to indicate which image and descriptor set is in use
+!! $bodimgsets[x] = body shape descriptors, tens place is the set (using bodset), 0 - 7 the descriptors (using salocatnow), 8 filler, 9 is the folder name
+!! bdsetlock = flag to indicate set control override, 0 is use the formula to pick a set, 1 is use a fixed set
+!! fixbodset = the identification number of the fixed image set
+!! bodsetcnt = the number of sets present
+!! 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
+
 $this = 'body'
 
-if $ARGS[0] = '':
-	!{
-        PC's appearance is updated regularly in stat.qsrc.
-        Note: A huge part of PC's appearance is from base appearance, which is updated once a day. Because it's
-        a global variable, it does not show in this function in particular, but it's used in 'CalcAppearance'
-    }
-	if pcs_makeup = 6 and bimbolevel >= 2: extra_supnatvnesh = 2*bimbolevel - 2
-
-	!STD check. STD will make appearance automatically -10
-	if Gerpes >= 3 or Sifilis >= 21 or Triper > 2:
-		pcs_apprnc = -10
-	else:
-		clothingBonus = func($this, 'CalcClothingBonus')
-		accessoriesBonus = func($this, 'CalcAccessoriesBonus', bonusZ, PShoQuality)
-		groomingBonus = func($this, 'CalcGroomingBonus')
-		groomingPenalty = func($this, 'CalcGroomingPenalty')
-		pcs_apprnc = func($this, 'CalcAppearance', (supnatvnesh + extra_supnatvnesh))
-		Hotcat = func($this, 'ConvertToHotcat')
+if $ARGS[0] = 'RegularUpdate':
+	if dounspell = 0:
+		gs $this, 'UpdateBodyMeasurement'
+		pcs_weight = func($this, 'CalcWeight')
+		pcs_bmi = func($this, 'CalcBMI')
 	end
 
-	killvar 'clothingBonus'
-	killvar 'accessoriesBonus'
-	killvar 'groomingBonus'
-	killvar 'groomingPenalty'
+	if pcs_skin > 100:
+		pcs_skin = 100
+	elseif pcs_skin < 0:
+		pcs_skin = 0
+	end
+	
+	!!Since "musle" is used all over the place
+	musle = strenbuf
 end
 
-if $args[0] = 'UpdateBaseAppearnce':
+if $ARGS[0] = 'DailyUpdate':
 	!{
-		Base Appearance is updated once a day at midnight and called from cikl
-		Base Appearance is calculated from:
-			vidage, skin, body shape (fat and strength), face (lip size, eyes size, and eyelashes)
-			attributes (endurance and agility)
+		Update once a day and called from cikl
 	}
-	faceBonus = func($this, 'CalcFaceBonus')
-	attributeBonus = func($this, 'CalcAttributeBonus')
-
-	!!	Setting vidageBonus
-	if vidage < 20: 
-		vidageBonus = 60 + (2 * vidage)
-	elseif vidage > 30: 
-		vidageBonus = 160 - (2 * vidage)
+	if dounspell = 1:
+		if strenbuf > 90:
+			strenbuf -= 2
+		elseif strenbuf > 80:
+			strenbuf -= 1
+		end
+	
+		if vitalbuf > 90:
+			vitalbuf -= 2
+		elseif vitalbuf > 80:
+			vitalbuf -= 1
+		end
+	
+		if strenbuf > pcs_stren: strenbuf -= 1
+		if strenbuf < pcs_stren: strenbuf += 1
+		if vitalbuf > pcs_vital: vitalbuf -= 1
+		if vitalbuf < pcs_vital: vitalbuf += 1
+		if agilbuf > pcs_agil: agilbuf -= 1
+		if agilbuf < pcs_agil: agilbuf += 1
 	else
-		vinageBonus = 100
+		gs $this
 	end
 
-	skinBonus = (pcs_skin * 2 / 5)
-	bodyShapeBonus = func($this, 'SetBodyShapeBonus')
-
-	! Calculte base appearance
-	pcs_apprncbase = (vidageBonus * (skinBonus + bodyShapeBonus + faceBonus + attributeBonus) / 100) + supnatvnesh
-
-	killvar 'vidageBonus'
-	killvar 'skinBonus'
-	killvar 'bodyShapeBonus'
-	killvar 'faceBonus'
-	killvar 'attributeBonus'
-end 
-
-if $ARGS[0] = 'CalcFaceBonus':
-	!!	Setting Eyelashes bonus
-	if pcs_lashes <= 0:
-		eyelashesBonus = 0
-	elseif pcs_lashes = 1:
-		eyelashesBonus = 2
-	elseif pcs_lashes = 2:
-		eyelashesBonus = 5
-	elseif pcs_lashes = 3:
-		eyelashesBonus = 7
-	elseif pcs_lashes = 4:
-		eyelashesBonus = 8
-	elseif pcs_lashes = 5:
-		eyelashesBonus = 10
-	else
-		eyelashesBonus = 0		
+	gs $this, 'UpdateBodyImage'
+
+	!!---- Calculation of lash extension degradation and false lash removal
+	if pcs_lashes > 2:
+		if lashextensionstyle >= 1:
+			lashextensionduration -= 1
+			if lashextensionduration >= 1 and lashextensionduration <= 4:
+				'It''s time for you to do your maintenance on your lash extensions; you should go to the salon or you risk growing them all out.'
+			end
+			if lashextensionduration <= 0:
+				'You waited too long to do maintenance on your lash extensions; there''s too little there to notice or work with at this point.'
+				pcs_lashes = pcs_naturallashes
+				killvar 'lashextensionstyle'
+				killvar 'lashextensionduration'
+				killvar 'lashextensionnew'
+			end
+		end
+		if false_lashes > 0:
+			false_lashes -= 1
+			if false_lashes = 0:
+				'Your false lashes came off in the night; there''s no recovering them now.'
+				pcs_lashes = pcs_naturallashes
+			else
+				'Somehow, your lashes managed to stay attached throughout the night. You might be able to get away with wearing them another day straight.'
+			end
+		end
 	end
-	eyelashesBonus = FUNC($this, 'AdjustFromBMI', eyelashesBonus)
-
-	!!	Setting Eye Size bonus
-	if pcs_eyesize = 1:
-		eyeSizeBonus = 1
-	elseif pcs_eyesize = 2:
-		eyeSizeBonus = 3
-	elseif pcs_eyesize = 3:
-		eyeSizeBonus = 2
-	else
-		eyeSizeBonus = 0
+
+	!! Max. Hair length 600mm, or 60cm, which should be somewhere in the lower back area.
+	!! Hair grows 1mm each day, it takes 20 months (1 month = 30 days) to regrow the hair from 0.
+	if pcs_hairlng < 1001 and hairgrowcht = 0:pcs_hairlng += 1
+
+	! Hair colour change
+	if pcs_haircol ! nathcol:
+		dyefade -=1
+		if dyefade < 0: dyefade = 0
 	end
-	eyeSizeBonus = FUNC($this, 'AdjustFromBMI', eyeSizeBonus)
-
-	!!	Setting the Lip size bonus
-	if pcs_lip = 0:
-		lipBonus = -2
-	elseif pcs_lip = 1:
-		lipBonus = 0
-	elseif pcs_lip = 2:
-		lipBonus = 3
-	elseif pcs_lip = 3:
-		lipBonus = 5
-	else
-		lipBonus = 3
+
+	!!pubic hair colouring
+	!! pcs_pubecol = natural colour
+	!! pcs_pubecol[1] = flag for saveupdate
+	!! pcs_pubecol[2] = actual colour
+	!! pcs_pubecol[3] = countdown timer for dye
+	if pcs_pubecol[2] ! pcs_pubecol:
+		pcs_pubecol[3] -=1
+		if pcs_pubecol[3] < 0: pcs_pubecol[3] = 0
+		if pcs_pubecol[3] = 0: pcs_pubecol[2] = pcs_pubecol
 	end
-	lipBonus = FUNC($this, 'AdjustFromBMI', lipBonus)
 
-	result = eyelashesBonus + eyeSizeBonus + lipBonus
+	if pcs_pubes < 2: pcs_pubecol[2] = pcs_pubecol
 
-	killvar 'eyelashesBonus'
-	killvar 'eyeSizeBonus'
-	killvar 'lipBonus'
-end
+	if hscrunch > 0:
+		hscrunchrand = rand(1, 100)
 
-if $ARGS[0] = 'CalcAttributeBonus':
-	tempAttributeBonus = (pcs_agil / 10) + (pcs_vital / 10)
+		if hscrunchrand <= 8:hscrunch -= 1
+	end
 
-	result = func($this, 'AdjustFromBMI', tempAttributeBonus)
-	killvar 'tempAttributeBonus'
+	! Leg and pubes hair growth
+	if lashair ! 1:
+		pcs_leghair += 1
+		!!Pubic hair growth at 1/2 per night
+		if pcs_pubes['growth'] > 1:
+			pcs_pubes['growth'] = 0
+			pcs_pubes += 1
+		end
+		pcs_pubes['growth'] += 1
+	end
+	
+	if age < 18 and rand (0,2) = 0 and pcs_leghair > 0: pcs_leghair -= 1
 end
 
-if $ARGS[0] = 'SetBodyShapeBonus':
-	! Magic uses a different calculation
-	if dounspell = 1:
-		bodytipe = pcs_hips - pcs_waist
-		if bodytipe < 20:
-			result = 0
-		elseif bodytipe >= 20 and bodytipe < 25:
-			result = 2
-		elseif (bodytipe >= 25 and bodytipe < 30) or bodytipe >=35:
-			result = 4
-		elseif bodytipe >= 30 and bodytipe < 35:
-			result = 8
-		end
+if $ARGS[0] = '':
+	!!This controls the gradual change in stat to -buf
+	if strenbuf > pcs_stren: strenbuf -= 1
+	if strenbuf < pcs_stren: strenbuf += 1
+	if vitalbuf > pcs_vital: vitalbuf -= 1
+	if vitalbuf < pcs_vital: vitalbuf += 1
+	if agilbuf > pcs_agil: agilbuf -= 1
+	if agilbuf < pcs_agil: agilbuf += 1
+
+	!!All the ratios were rounded to 2 digits and there are divide 100s at the final calc points
+	!!Waist to hip ratio
+
+	wrtemp = ((2 * vitalbuf + strenbuf + agilbuf) /4)
+
+	!!	Primary wratio handling
+	if wrtemp < 11:
+		wratio = 85 + (11 - (vitalbuf + strenbuf + agilbuf)/3)
+	elseif wrtemp < 20:
+		wratio = 85
+	elseif wrtemp < 35:
+		wratio = 85 - (wrtemp - 20) / 3
+	elseif wrtemp < 55:
+		wratio = 80 - (wrtemp - 35) / 4
+	elseif wrtemp < 80:
+		wratio = 75 - (wrtemp - 55) / 5
+	elseif wrtemp >= 80:
+		wratio = 70
+	end
 
-	!!Setting the pcs_apprnc bonus based on fat and strength
+	!!	High stat value edge case handling
+	if (vitalbuf + strenbuf + agilbuf) /3 > 100: wratio -= ((vitalbuf + strenbuf)/2 - agilbuf)/5
+
+	!!	This is the oops and high stat gone overboard handling
+	if wratio < 65: wratio = 65
+
+	killvar 'wrtemp'
+
+	!!For band to waist ratio
+	brtemp = (2 * strenbuf + vitalbuf + agilbuf) /4
+
+	if brtemp < 10:
+		bratio = 105
+	elseif brtemp =< 23:
+		bratio = 106
+	elseif brtemp =< 80:
+		bratio = 106 + (brtemp - 23) / 3
 	else
-		if pcs_bmi < 16:
-			!! severely underweight
-			tempBodyShapeBonus = 30
-		elseif pcs_bmi < 19:
-			!! underweight
-			tempBodyShapeBonus = 65
-		elseif pcs_bmi < 25:
-			!! healthy weight
-			tempBodyShapeBonus = 85
-		elseif pcs_bmi < 30:
-			!! overweight
-			tempBodyShapeBonus = 75
-		elseif pcs_bmi < 35:
-			!! moderately obese
-			tempBodyShapeBonus = 45
-		elseif pcs_bmi < 40:
-			!! severely obese
-			tempBodyShapeBonus = 25
-		elseif pcs_bmi < 45:
-			!! very severely obese
-			tempBodyShapeBonus = 5
-		else
-			!! morbidly obese
-			tempBodyShapeBonus = 0
-		end
+		bratio = 125
+	end
 
-		if (strenbuf >= 40 and strenbuf < 60) or strenbuf >= 80:
-			tempBodyShapeBonus += 8
-		elseif strenbuf >= 60:
-			tempBodyShapeBonus += 10
-		elseif strenbuf >= 20:
-			tempBodyShapeBonus += 5
-		end
+	killvar 'brtemp'
 
-		!!This modifies bodykoef for high or low salo values
-		if salocatnow = 0 or salocatnow >= 7:
-			tempBodyShapeBonus -= 8
-		elseif salocatnow = 1 or salocatnow = 6:
-			tempBodyShapeBonus -= 4
-		end
+	!!For hip to height ratio which is used to set the center point
+	hrtemp = (2 * agilbuf + vitalbuf + strenbuf) /4
 
-		if vofat > 0: tempBodyShapeBonus -= vofat
+	if hrtemp < 35:
+		hratio = 60
+	elseif hrtemp < 45:
+		hratio = 59
+	elseif hrtemp < 60:
+		hratio = 58
+	elseif hrtemp < 80:
+		hratio = 57
+	else
+		hratio = 56
+	end
 
-		result = tempBodyShapeBonus
+	killvar 'hrtemp'
 
-		killvar 'tempBodyShapeBonus'
+	!!Salo Handling; the first part is because during a reset fat is not used and should be cleared
+	if sftrstflag = 1 or cheatNoFat = 1:
+		fat = 0
+	else
+		if fat > (17 + vitalbuf / 25): salo += 1 & fat = 0
+		if fat < (-2 - (vitalbuf / 10)): salo -= 1 & fat = 0
 	end
-end
 
-if $ARGS[0] = 'CalcClothingBonus':
-	if $clothingworntype = 'nude':
-		if pcs_bmi >= 19 and pcs_bmi < 30:
-			! Healthy and overweight
-			tempRevealing = 405
-			PCloQuality = 3
-		else
-			tempRevealing = 0
-			PCloQuality = 1
-		end
+	!!This is the salo cap for the weight approximation
+	if salo > 250: salo = 250
+		
+	!!This calculates the current salo category; ranges are 20 points, seemed to balance best if the range is x10 the hip devisor
+	:salocatloop
+	if salo < 10:
+		salocatnow = 0
 	else
-		if pcs_bmi < 19:
-			!Skinny and severely skinny
-			tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness))/2
-		elseif pcs_bmi >= 19 and pcs_bmi < 30:
-			!Healthy and overweight
-			tempRevealing = (PXCloThinness + PXCloTopCut + PXCloBottomShortness)/2
-		elseif pcs_bmi >= 30:
-			!Moderately overweight and above
-			tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness)) * 3/4
-		end
+		salocatnow = 1 + (salo - 10) / 20
 	end
 
-	result = tempRevealing/ 76 * PCloQuality
-	killvar 'tempRevealing'
+	!!This resets the genetic bust size (genbsize) when the cheat is used to reduce breast size (maybe other things later)
+	if titreduc = 1:
+		killvar 'titreduc'
+		if genbsize > nbsize:
+			genbsize = 2 + nbsize - nbsize mod 5
+		end
+	end
 
-end
+	!!This controls the movement of salo to/from bust in order of precedence
+	if salobustdo = 0 and nbsize < genbsize and salocatnow > 2:
+		if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
+		nbsize += 1
+		salo -= 3
+		salobustdo = 1
+		jump 'salocatloop'
+	end
 
-if $ARGS[0] = 'CalcAccessoriesBonus':
-	coatQualityBonus = ARGS[1] & !! bonusZ
-	shoesQualityBonus = ARGS[2] & !! PShoQuality
-	
-	!!bonuses for certain underwear
-	if $pantyworntype = 'boutique':
-		pantyBonus = 4
-	elseif $pantyworntype = 'fashionista':
-		pantyBonus = 2
+	if salobustdo = 0 and magf2bdo = 1 and salocatnow > salocatlast and pcs_mana >= manamax / 2 and magikDostup = 0:
+		if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
+		magicf2b += 1
+		salo -= 3
+		salobustdo = 1
+		if magicf2b >= 2 + magtarcup * 5: magf2bdo = 0
+		if pcs_magik < 20:
+			pcs_mana -= 2000 / pcs_magik
+		else
+			mana -= 100
+		end
+		jump 'salocatloop'
 	end
 
-	if $braworntype = 'boutique':
-		braBonus = 4
-	elseif $braworntype = 'fashionista':
-		braBonus = 2
+	if salobustdo = 0 and salocatnow < 2 and salocatlast >= 2 and magicf2b > 0 and magikDostup = 0:
+		if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
+		magicf2b -= 1
+		salo += 3
+		salobustdo = 1
+		magf2bdo = 1
+		jump 'salocatloop'
 	end
 
-	result = coatQualityBonus + shoesQualityBonus + pantyBonus + braBonus
+	if salobustdo = 0 and salocatnow < 1 and salocatlast >= 1 and nbsize > 0:
+		if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
+		nbsize -= 1
+		salo += 3
+		salobustdo = 1
+		jump 'salocatloop'
+	end
 
-	killvar 'coatQualityBonus'
-	killvar 'shoesQualityBonus'
-	killvar 'pantyBonus'
-	killvar 'braBonus'
-end
+	!!This is if a Succubus has salo < 1
+	if succubusflag = 1 and salo < 1:
+		sucexcess -= 1
+		salo += 3
+	end
 
-if $ARGS[0] = 'CalcGroomingBonus':
-	if pcs_lipbalm > 0:
-		lipBalmBonus = 5
-	else
-		lipBalmBonus = 0
+	!!This is if salo is still < 1
+	if salo < 1:
+		if fat >= 1:
+			salo = 1
+			fat -= 1
+		elseif fat <= 0 and pcs_stren + pcs_vital > 0:
+			stren_deg -= 1000
+			vital_deg -= 1000
+			salo = 1
+		else
+			if Enable_nogameover = 0:
+				over = 3
+				gt 'gameover'
+				exit
+			else
+				pl '<font color=red><B>You starved to death, but Cheat Mode keeps you Alive.</B></font>'
+				salo = 1
+			end
+		end
 	end
 
-	makeupBonus = pcs_makupskl / 5
-	if pcs_makeup = 0: makeupBonus = -5
-	if pcs_makeup = 1: makeupBonus = 0
-	if pcs_makeup = 5: makeupBonus = 30
+	killvar 'tempvct' & killvar 'salobustdo'
 
-	hairBonus = pcs_hairbsh * 10
+	!!This is the hip calcs, 80 is the center of the current max-min range (10 - 130)
+	vhtmp = (salo - 80) / 2
+	
+	if vhips > vhtmp: vhips -= 1
+	if vhips < vhtmp: vhips += 1
+	!!	Because a reset should be updating hip size instantly (this set is a bit redundant anyway)
+	if sftrstflag = 1: vhips = vhtmp
+
+	if (pcs_hgt * hratio) / 100 + vhips > (pcs_hgt * 72) / 100:
+		vofat = ((pcs_hgt * hratio) / 100 + vhips - (pcs_hgt * 72) / 100) / 2
+		vhips -= vofat * 2
+	end
 
-	breathBonus = pcs_breath * 5
+	!!This will trigger the warning notices in the bathing code (the +/- 12 should always be +/- 11 + the max change to salo w/ fat)
+	if salolast > salo and salo <= 12 + (20 * (salocatnow - 1)): btwarn = 1
+	if salolast < salo and salo >= (20 * (salocatnow + 1)) - 12: btwarn = 2
+
+	!!This will trigger the dream for the option to use magic to increase bust
+	!!Three nos at the dream will lock it out (1 yes resets the count)
+	if pcs_magik >= 5 and MagikDostup = 0 and magf2bdo = 0:
+		if salolast < salo and salo >= (20 * (salocatnow + 1)) - 11 and tits < 10:
+			if mgf2bnocnt < 3:
+				magf2bdo = 2
+			else
+				magf2bdo = 3 & killvar 'mgf2bnocnt'
+			end
+		end
+	end
 
-	tempGroomingBonus = makeupBonus + hairBonus + lipBalmBonus + breathBonus
+	!!This is to deal with the possibility that salocatnow changed by more than 1 (fat burners, vitamins, plastic surgery, etc.)
+	if salocatnow < salocatlast: salocatlast -= 1
+	if salocatnow > salocatlast: salocatlast += 1
 
-	!!Small bonus for wearing deodorant, if pcs_sweat is low enough
-	if deodorant_on = 1 and pcs_sweat < 20: tempGroomingBonus += 5
+	!!This is for use in the warning code and as part of the reset routines
+	if salolast > salo: salolast -= 1
+	if salolast < salo: salolast += 1
 
-	!result = tempGroomingBonus
-	result = func($this, 'AdjustFromBMI', tempGroomingBonus)
+	!!Setting the pcs_apprnc bonus based on fat and strength
+	pcs_bmi = FUNC($this, 'CalcBMI')
 
-	killvar 'lipBalmBonus'
-	killvar 'makeupBonus'
-	killvar 'hairBonus'
-	killvar 'breathBonus'
-	killvar 'tempGroomingBonus'
+	!!This is to clean up unused variables
+	killvar 'normbuffpick' & killvar 'nrmbfpckct'
+	killvar 'vmeat' & killvar 'vfat' & killvar 'Kves' & killvar 'krost'
+	killvar 'koefvesbt' & killvar 'koefbt'
 end
 
-if $ARGS[0] = 'CalcGroomingPenalty':
-	!! buzzcut penalty to pcs_apprnc
-	if pcs_hairlng < 10:
-		buzzCutPenalty = 10
-	else
-		buzzCutPenalty = 0
-	end
-
-	if pcs_sweat < 22:
-		sweatPenalty = 0
-	elseif temppcs_sweat < 38:
-		sweatPenalty = (pcs_sweat - 10) / 4
-	elseif temppcs_sweat < 54:
-		sweatPenalty = (pcs_sweat - 10) / 2
+if $ARGS[0] = 'UpdateBodyMeasurement':
+	pcs_hips = (pcs_hgt * hratio) / 100 + vhips
+	pcs_waist = (pcs_hips * wratio) / 100 + vofat
+	pcs_band = (pcs_waist * bratio) / 100 + vofat
+	pcs_bust = (pcs_waist * bratio) / 100 + nbsize + magicf2b + silicone
+	pcs_butt = (pcs_hips / 10) + silicone_butt + butt_cheat
+	pcs_cupsize = pcs_bust - pcs_band
+
+	! Update tits size
+	if pcs_cupsize <= 5:
+		tits = 0
+		$titsize = 'AA cup'
+	elseif pcs_cupsize <= 10:
+		tits = 1
+		$titsize = 'A cup'
+	elseif pcs_cupsize <= 15:
+		tits = 2
+		$titsize = 'B cup'
+	elseif pcs_cupsize <= 20:
+		tits = 3
+		$titsize = 'C cup'
+	elseif pcs_cupsize <= 25:
+		tits = 4
+		$titsize = 'D cup'
+	elseif pcs_cupsize <= 30:
+		tits = 5
+		$titsize = 'E cup'
+	elseif pcs_cupsize <= 35:
+		tits = 6
+		$titsize = 'F cup'
+	elseif pcs_cupsize <= 40:
+		tits = 7
+		$titsize = 'G cup'
+	elseif pcs_cupsize <= 45:
+		tits = 8
+		$titsize = 'H cup'
+	elseif pcs_cupsize <= 50:
+		tits = 9
+		$titsize = 'I cup'
+	elseif pcs_cupsize <= 55:
+		tits = 10
+		$titsize = 'J cup'
 	else
-		sweatPenalty = 3 * (pcs_sweat - 10) / 4
+		tits = 11
+		$titsize = 'K cup'
 	end
+end
 
-	!Glasses Penalty
-	if glass >= 2 or glass = 0:
-		glassesPenalty = 0
-	elseif glass = 1:
-		glassesPenalty = 10
-	end
+if $ARGS[0] = 'CalcWeight':
+	!{pcs_weight: Svetas weight in kg 
+	Optimal Weight (170cm): 60kg, 60 salo
+	This is an approximation, so that a sveta with a different height has the same BMI for the same salo 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.}
+	result = 30 + salo / 2 + (pcs_hgt - 170) * 7 / 10
+
+	!{Do not remove (julzor)
+	This is the old more complex function, but it doesn''t work correctly.
+	This variable is actually only used ONCE (except for the BMI calculation), when stripping, to see if you fall off the pole from being too heavy. I am reluctant to touch it, since the math is not explained. Maybe later.
+	Weight = (height in cm x bottom of average weight in kilos for a 170cm female / 170cm + (hip modifier + 2 x overrun fat)/4 + cup size}
+	
+	!result = (pcs_hgt * 62 / 170) + (vhips + (vofat * 2)) / 4 + tits
+end
 
-	!hair color fade penalty
-	if pcs_haircol ! nathcol:
-		if dyefade > 0 and dyefade < 7: hairDyePenalty = 5
-		if dyefade = 0: hairDyePenalty = 15
+if $ARGS[0] = 'UpdateBodyImage':
+	!Update body image set
+	if dounspell = 1:
+		salocatnow = (pcs_hips / 10) - 5
+		if bdsetlock = 0:
+			if (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)):
+				bodset = 3
+			elseif strenbuf >= 70:
+				bodset = 2
+			elseif strenbuf <= 40:
+				bodset = 0
+			else
+				bodset = 1
+			end
+		else
+			bodset = fixbodset
+		end
+	elseif (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)) and bodet ! 3 and bdsetlock = 0:
+		bodset = 3
+	elseif preg = 0 and bodset = 3 and bdsetlock = 0:
+		if strenbuf >= 70:
+			bodset = 2
+		elseif strenbuf <= 40:
+			bodset = 0
+		else
+			bodset = 1
+		end
 	end
 
-	! Leg hair penalty
-	if pcs_leghair <= 0:
-		legPenalty = 0
-	elseif pcs_leghair <= 3:
-		legPenalty = 3
-	elseif pcs_leghair <= 6:
-		legPenalty = 6
+	! Update body description
+	if (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)) and bodset = 3:
+		if PregChem > 6216:
+			$body = $bodimgsets[((bodset * 10) + 8)]
+		elseif PregChem < 2688:
+			$body = $bodimgsets[(bodset * 10)]
+		else 
+			$body = $bodimgsets[((bodset * 10)+((PregChem - 2184)/504))]
+		end
+	elseif salocatnow <= 7:
+		$body = $bodimgsets[((bodset * 10) + salocatnow)]
 	else
-		legPenalty = 9 
+		$body = $bodimgsets[((bodset * 10) + 7)]
 	end
-
-	result = sweatPenalty + glassesPenalty + hairDyePenalty + buzzCutPenalty + legPenalty
-
-
-	killvar 'sweatPenalty'
-	killvar 'glassesPenalty'
-	killvar 'hairDyePenalty'
-	killvar 'buzzCutPenalty'
-	killvar 'legPenalty'
 end
 
+if $ARGS[0] = 'CalcBMI':
+	result = 10000 * (30 + salo / 2 + (pcs_hgt - 170) * 7 / 10) / (pcs_hgt * pcs_hgt)
+end
 
-if $ARGS[0] = 'CalcAppearance':
-	superNaturalBonus = ARGS[1] & !! supnatvnesh
-
-	temp_apprnc = pcs_apprncbase + clothingBonus + accessoriesBonus + groomingBonus - groomingPenalty
-
-	if temp_apprnc >= 200: temp_apprnc = 200 
-	if temp_apprnc < 0: temp_apprnc = 0
-
-	!Any super natural bonuses are allowed to go above the max scale
-	result = temp_apprnc + superNaturalBonus
-	
-	killvar 'superNaturalBonus'
-	killvar 'temp_apprnc'
+if $ARGS[0] = 'softreset':
+	!!This is for use in immediately updating shape if something has caused a large change in salo, primarily fat burners and plastic surgery
+	sftrstflag = 1
+	:resetloop
+	if salo ! salolast:
+		if gmstrtflag = 1: salobustdo = 1
+		gs 'body'
+		jump 'resetloop'
+	end
+	!!Updates pcs_apprncbase after a reset
+	gs 'AppearanceSystem', 'UpdateBaseAppearnce'
+	!!Clears the warning and reset status flags if they were set
+	sftrstflag = 0
+	btwarn = 0
 end
 
-if $ARGS[0] = 'ConvertToHotcat':
-	if pcs_apprnc <= 200:
-		result = pcs_apprnc / 20
+if $ARGS[0] = 'hardreset':
+	!!This is primarily for canceling out "dounspell" and setting salo to whatever value will result in the current hip size then balancing everything out.
+	!!Also could be built in as a means to in-game undo "dounspell", other than the cheat.
+	if dounspell = 1 and dounsplkil > 0:
+		salo = 12
+		fat = 0
+		agilbuf = pcs_agil & strenbuf = pcs_stren & vitalbuf = pcs_vital
+		salobustdo = 1 & sftrstflag = 1 & normbuffpick = -1
+		gs 'body'
+		salo = (pcs_hips * 2) - ((pcs_hgt * hratio) / 50) + 80
+		if salo < 10:
+			salocatnow = 0
+		else
+			salocatnow = 1 + (salo - 10) / 20
+		end
+		salocatlast = salocatnow
+		salolast = salo
+		vhtmp = (salo - 80) / 2
+		vhips = vhtmp
+		if genbsize = 0 and nbsize > 0:
+			If nbsize >= 27:
+				genbsize = 27
+			else
+				genbsize = 2 + nbsize - nbsize mod 5
+			end
+		elseif genbsize = 0 and nbsize = 0 and silicone >= 20:
+			genbsize = 12 & nbsize = 12 & silicone -= 10
+		end
+		sftrstflag = 0 & normbuffpick = 0 & btwarn = 0 & magf2bdo = 0
+		killvar 'dounsplkil'
+		newbdsp = 1
+		dounspell = 0
+		gs 'AppearanceSystem', 'UpdateBaseAppearnce'
+		gs 'body'
+		gs 'stat'
 	else
-		result = 10
+		'If you''re seeing this, something odd happened. Please make a bug report that the body shape hard reset improperly triggered and what you were doing.'
 	end
 end
 
-if $ARGS[0] = 'AdjustFromBMI':
-	tempValue = ARGS[1] & !!value to be adjusted
-
-	if pcs_bmi < 16:
-		!! severely underweight
-		tempValue = tempValue * 50 / 100
-    elseif pcs_bmi < 19:
-		!! underweight
-		tempValue = tempValue * 95 / 100
-    elseif pcs_bmi < 25:
-		!! healthy weight
-		!! normal bonus
-    elseif pcs_bmi < 30:
-		!! overweight
-		tempValue = tempValue * 95 / 100
-    elseif pcs_bmi < 35:
-		!! moderately obese
-		tempValue = tempValue * 80 / 100
-    elseif pcs_bmi < 40:
-		!! severely obese
-		tempValue = tempValue * 55 / 100
-    elseif pcs_bmi < 45:
-		!! very severely obese
-		tempValue = tempValue * 50 / 100
-    else
-		!!morbidly obese
-		tempValue = tempValue * 40 / 100
-    end
-
-	result = tempValue
-	killvar 'tempValue'
+if $ARGS[0] = 'initial':
+	!!	Sets the genetic bust size if it was not set in the start routines
+	if genbsize = 0:
+		genbsize = 12 & nbsize = 12
+	else
+		nbsize = genbsize
+	end
+	agilbuf = pcs_agil & strenbuf = pcs_stren & vitalbuf = pcs_vital
+	normbuffpick = -1 & gmstrtflag = 1
+	!!	Calling soft reset will cause the main code to cycle up to the starting value of salo
+	gs 'body', 'softreset'
+	!!	This sets/resets the controler variables
+	salocatlast = salocatnow
+	normbuffpick = 0 & magf2bdo = 0
+	killvar 'gmstrtflag'
+	newbdsp = 1
+	!!	This does all the body shape setting before the first stat call
+	gs $this, 'UpdateBodyMeasurement'
+	pcs_weight = func($this, 'CalcWeight')
+	pcs_bmi = func($this, 'CalcBMI')
+	gs 'body_desc', 'BMI'
 end
+
 --- body ---------------------------------
+

+ 0 - 549
locations/body_shape.qsrc

@@ -1,549 +0,0 @@
-# body_shape
-
-!!vhips = derived from salo in body_shape
-!!vhtmp = slows the change to vhips in body_shape
-!!wratio = waist to hips ratio set in body_shape
-!!bratio = band to waist ratio set in body_shape
-!!hratio = hip to height ratio set in body_shape
-!!vofat = used as a place to put extra salo at extreme high values (i.e. really, really fat) set in body_shape
-!!nbsize = starts at a set genetic bust size, but can be adjusted down if salo drops too low
-!!magicf2b = set in body_shape for the fat moved to bust
-!!genbsize = the set genetic bust size
-!!salocatnow = the current category of salo
-!!salocatlast = the previous category of salo
-!!magf2bdo = flag for magic bust increase; 0, ready; 1, do it; 2, ask; 3, no
-!!mgf2bnocnt = used to count the number of times a bust increase was turned down and stop asking after 3
-!!magtarcup = set in the dream code as the target cup size 
-!!btwarn = used to flag if to display the gaining/losing weight message when bathing
-!!salolast = used when doing a soft rest to control the cycling of the main code
-!!sftrstflag = used to prevent a code chunk from firing on a soft reset
-!!Image set variables
-!! bodset = body image and descriptor control variable, used to indicate which image and descriptor set is in use
-!! $bodimgsets[x] = body shape descriptors, tens place is the set (using bodset), 0 - 7 the descriptors (using salocatnow), 8 filler, 9 is the folder name
-!! bdsetlock = flag to indicate set control override, 0 is use the formula to pick a set, 1 is use a fixed set
-!! fixbodset = the identification number of the fixed image set
-!! bodsetcnt = the number of sets present
-!! 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
-
-$this = 'body_shape'
-
-if $ARGS[0] = 'RegularUpdate':
-	if dounspell = 0:
-		gs $this, 'UpdateBodyMeasurement'
-		pcs_weight = func($this, 'CalcWeight')
-		pcs_bmi = func($this, 'CalcBMI')
-	end
-
-	if pcs_skin > 100:
-		pcs_skin = 100
-	elseif pcs_skin < 0:
-		pcs_skin = 0
-	end
-	
-	!!Since "musle" is used all over the place
-	musle = strenbuf
-end
-
-if $ARGS[0] = 'DailyUpdate':
-	!{
-		Update once a day and called from cikl
-	}
-	if dounspell = 1:
-		if strenbuf > 90:
-			strenbuf -= 2
-		elseif strenbuf > 80:
-			strenbuf -= 1
-		end
-	
-		if vitalbuf > 90:
-			vitalbuf -= 2
-		elseif vitalbuf > 80:
-			vitalbuf -= 1
-		end
-	
-		if strenbuf > pcs_stren: strenbuf -= 1
-		if strenbuf < pcs_stren: strenbuf += 1
-		if vitalbuf > pcs_vital: vitalbuf -= 1
-		if vitalbuf < pcs_vital: vitalbuf += 1
-		if agilbuf > pcs_agil: agilbuf -= 1
-		if agilbuf < pcs_agil: agilbuf += 1
-	else
-		gs $this
-	end
-
-	gs $this, 'UpdateBodyImage'
-
-	!!---- Calculation of lash extension degradation and false lash removal
-	if pcs_lashes > 2:
-		if lashextensionstyle >= 1:
-			lashextensionduration -= 1
-			if lashextensionduration >= 1 and lashextensionduration <= 4:
-				'It''s time for you to do your maintenance on your lash extensions; you should go to the salon or you risk growing them all out.'
-			end
-			if lashextensionduration <= 0:
-				'You waited too long to do maintenance on your lash extensions; there''s too little there to notice or work with at this point.'
-				pcs_lashes = pcs_naturallashes
-				killvar 'lashextensionstyle'
-				killvar 'lashextensionduration'
-				killvar 'lashextensionnew'
-			end
-		end
-		if false_lashes > 0:
-			false_lashes -= 1
-			if false_lashes = 0:
-				'Your false lashes came off in the night; there''s no recovering them now.'
-				pcs_lashes = pcs_naturallashes
-			else
-				'Somehow, your lashes managed to stay attached throughout the night. You might be able to get away with wearing them another day straight.'
-			end
-		end
-	end
-
-	!! Max. Hair length 600mm, or 60cm, which should be somewhere in the lower back area.
-	!! Hair grows 1mm each day, it takes 20 months (1 month = 30 days) to regrow the hair from 0.
-	if pcs_hairlng < 1001 and hairgrowcht = 0:pcs_hairlng += 1
-
-	! Hair colour change
-	if pcs_haircol ! nathcol:
-		dyefade -=1
-		if dyefade < 0: dyefade = 0
-	end
-
-	!!pubic hair colouring
-	!! pcs_pubecol = natural colour
-	!! pcs_pubecol[1] = flag for saveupdate
-	!! pcs_pubecol[2] = actual colour
-	!! pcs_pubecol[3] = countdown timer for dye
-	if pcs_pubecol[2] ! pcs_pubecol:
-		pcs_pubecol[3] -=1
-		if pcs_pubecol[3] < 0: pcs_pubecol[3] = 0
-		if pcs_pubecol[3] = 0: pcs_pubecol[2] = pcs_pubecol
-	end
-
-	if pcs_pubes < 2: pcs_pubecol[2] = pcs_pubecol
-
-	if hscrunch > 0:
-		hscrunchrand = rand(1, 100)
-
-		if hscrunchrand <= 8:hscrunch -= 1
-	end
-
-	! Leg and pubes hair growth
-	if lashair ! 1:
-		pcs_leghair += 1
-		!!Pubic hair growth at 1/2 per night
-		if pcs_pubes['growth'] > 1:
-			pcs_pubes['growth'] = 0
-			pcs_pubes += 1
-		end
-		pcs_pubes['growth'] += 1
-	end
-	
-	if age < 18 and rand (0,2) = 0 and pcs_leghair > 0: pcs_leghair -= 1
-end
-
-if $ARGS[0] = '':
-	!!This controls the gradual change in stat to -buf
-	if strenbuf > pcs_stren: strenbuf -= 1
-	if strenbuf < pcs_stren: strenbuf += 1
-	if vitalbuf > pcs_vital: vitalbuf -= 1
-	if vitalbuf < pcs_vital: vitalbuf += 1
-	if agilbuf > pcs_agil: agilbuf -= 1
-	if agilbuf < pcs_agil: agilbuf += 1
-
-	!!All the ratios were rounded to 2 digits and there are divide 100s at the final calc points
-	!!Waist to hip ratio
-
-	wrtemp = ((2 * vitalbuf + strenbuf + agilbuf) /4)
-
-	!!	Primary wratio handling
-	if wrtemp < 11:
-		wratio = 85 + (11 - (vitalbuf + strenbuf + agilbuf)/3)
-	elseif wrtemp < 20:
-		wratio = 85
-	elseif wrtemp < 35:
-		wratio = 85 - (wrtemp - 20) / 3
-	elseif wrtemp < 55:
-		wratio = 80 - (wrtemp - 35) / 4
-	elseif wrtemp < 80:
-		wratio = 75 - (wrtemp - 55) / 5
-	elseif wrtemp >= 80:
-		wratio = 70
-	end
-
-	!!	High stat value edge case handling
-	if (vitalbuf + strenbuf + agilbuf) /3 > 100: wratio -= ((vitalbuf + strenbuf)/2 - agilbuf)/5
-
-	!!	This is the oops and high stat gone overboard handling
-	if wratio < 65: wratio = 65
-
-	killvar 'wrtemp'
-
-	!!For band to waist ratio
-	brtemp = (2 * strenbuf + vitalbuf + agilbuf) /4
-
-	if brtemp < 10:
-		bratio = 105
-	elseif brtemp =< 23:
-		bratio = 106
-	elseif brtemp =< 80:
-		bratio = 106 + (brtemp - 23) / 3
-	else
-		bratio = 125
-	end
-
-	killvar 'brtemp'
-
-	!!For hip to height ratio which is used to set the center point
-	hrtemp = (2 * agilbuf + vitalbuf + strenbuf) /4
-
-	if hrtemp < 35:
-		hratio = 60
-	elseif hrtemp < 45:
-		hratio = 59
-	elseif hrtemp < 60:
-		hratio = 58
-	elseif hrtemp < 80:
-		hratio = 57
-	else
-		hratio = 56
-	end
-
-	killvar 'hrtemp'
-
-	!!Salo Handling; the first part is because during a reset fat is not used and should be cleared
-	if sftrstflag = 1 or cheatNoFat = 1:
-		fat = 0
-	else
-		if fat > (17 + vitalbuf / 25): salo += 1 & fat = 0
-		if fat < (-2 - (vitalbuf / 10)): salo -= 1 & fat = 0
-	end
-
-	!!This is the salo cap for the weight approximation
-	if salo > 250: salo = 250
-		
-	!!This calculates the current salo category; ranges are 20 points, seemed to balance best if the range is x10 the hip devisor
-	:salocatloop
-	if salo < 10:
-		salocatnow = 0
-	else
-		salocatnow = 1 + (salo - 10) / 20
-	end
-
-	!!This resets the genetic bust size (genbsize) when the cheat is used to reduce breast size (maybe other things later)
-	if titreduc = 1:
-		killvar 'titreduc'
-		if genbsize > nbsize:
-			genbsize = 2 + nbsize - nbsize mod 5
-		end
-	end
-
-	!!This controls the movement of salo to/from bust in order of precedence
-	if salobustdo = 0 and nbsize < genbsize and salocatnow > 2:
-		if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
-		nbsize += 1
-		salo -= 3
-		salobustdo = 1
-		jump 'salocatloop'
-	end
-
-	if salobustdo = 0 and magf2bdo = 1 and salocatnow > salocatlast and pcs_mana >= manamax / 2 and magikDostup = 0:
-		if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
-		magicf2b += 1
-		salo -= 3
-		salobustdo = 1
-		if magicf2b >= 2 + magtarcup * 5: magf2bdo = 0
-		if pcs_magik < 20:
-			pcs_mana -= 2000 / pcs_magik
-		else
-			mana -= 100
-		end
-		jump 'salocatloop'
-	end
-
-	if salobustdo = 0 and salocatnow < 2 and salocatlast >= 2 and magicf2b > 0 and magikDostup = 0:
-		if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
-		magicf2b -= 1
-		salo += 3
-		salobustdo = 1
-		magf2bdo = 1
-		jump 'salocatloop'
-	end
-
-	if salobustdo = 0 and salocatnow < 1 and salocatlast >= 1 and nbsize > 0:
-		if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
-		nbsize -= 1
-		salo += 3
-		salobustdo = 1
-		jump 'salocatloop'
-	end
-
-	!!This is if a Succubus has salo < 1
-	if succubusflag = 1 and salo < 1:
-		sucexcess -= 1
-		salo += 3
-	end
-
-	!!This is if salo is still < 1
-	if salo < 1:
-		if fat >= 1:
-			salo = 1
-			fat -= 1
-		elseif fat <= 0 and pcs_stren + pcs_vital > 0:
-			stren_deg -= 1000
-			vital_deg -= 1000
-			salo = 1
-		else
-			if Enable_nogameover = 0:
-				over = 3
-				gt 'gameover'
-				exit
-			else
-				pl '<font color=red><B>You starved to death, but Cheat Mode keeps you Alive.</B></font>'
-				salo = 1
-			end
-		end
-	end
-
-	killvar 'tempvct' & killvar 'salobustdo'
-
-	!!This is the hip calcs, 80 is the center of the current max-min range (10 - 130)
-	vhtmp = (salo - 80) / 2
-	
-	if vhips > vhtmp: vhips -= 1
-	if vhips < vhtmp: vhips += 1
-	!!	Because a reset should be updating hip size instantly (this set is a bit redundant anyway)
-	if sftrstflag = 1: vhips = vhtmp
-
-	if (pcs_hgt * hratio) / 100 + vhips > (pcs_hgt * 72) / 100:
-		vofat = ((pcs_hgt * hratio) / 100 + vhips - (pcs_hgt * 72) / 100) / 2
-		vhips -= vofat * 2
-	end
-
-	!!This will trigger the warning notices in the bathing code (the +/- 12 should always be +/- 11 + the max change to salo w/ fat)
-	if salolast > salo and salo <= 12 + (20 * (salocatnow - 1)): btwarn = 1
-	if salolast < salo and salo >= (20 * (salocatnow + 1)) - 12: btwarn = 2
-
-	!!This will trigger the dream for the option to use magic to increase bust
-	!!Three nos at the dream will lock it out (1 yes resets the count)
-	if pcs_magik >= 5 and MagikDostup = 0 and magf2bdo = 0:
-		if salolast < salo and salo >= (20 * (salocatnow + 1)) - 11 and tits < 10:
-			if mgf2bnocnt < 3:
-				magf2bdo = 2
-			else
-				magf2bdo = 3 & killvar 'mgf2bnocnt'
-			end
-		end
-	end
-
-	!!This is to deal with the possibility that salocatnow changed by more than 1 (fat burners, vitamins, plastic surgery, etc.)
-	if salocatnow < salocatlast: salocatlast -= 1
-	if salocatnow > salocatlast: salocatlast += 1
-
-	!!This is for use in the warning code and as part of the reset routines
-	if salolast > salo: salolast -= 1
-	if salolast < salo: salolast += 1
-
-	!!Setting the pcs_apprnc bonus based on fat and strength
-	pcs_bmi = FUNC('body_shape', 'CalcBMI')
-
-	!!This is to clean up unused variables
-	killvar 'normbuffpick' & killvar 'nrmbfpckct'
-	killvar 'vmeat' & killvar 'vfat' & killvar 'Kves' & killvar 'krost'
-	killvar 'koefvesbt' & killvar 'koefbt'
-end
-
-if $ARGS[0] = 'UpdateBodyMeasurement':
-	pcs_hips = (pcs_hgt * hratio) / 100 + vhips
-	pcs_waist = (pcs_hips * wratio) / 100 + vofat
-	pcs_band = (pcs_waist * bratio) / 100 + vofat
-	pcs_bust = (pcs_waist * bratio) / 100 + nbsize + magicf2b + silicone
-	pcs_butt = (pcs_hips / 10) + silicone_butt + butt_cheat
-	pcs_cupsize = pcs_bust - pcs_band
-
-	! Update tits size
-	if pcs_cupsize <= 5:
-		tits = 0
-		$titsize = 'AA cup'
-	elseif pcs_cupsize <= 10:
-		tits = 1
-		$titsize = 'A cup'
-	elseif pcs_cupsize <= 15:
-		tits = 2
-		$titsize = 'B cup'
-	elseif pcs_cupsize <= 20:
-		tits = 3
-		$titsize = 'C cup'
-	elseif pcs_cupsize <= 25:
-		tits = 4
-		$titsize = 'D cup'
-	elseif pcs_cupsize <= 30:
-		tits = 5
-		$titsize = 'E cup'
-	elseif pcs_cupsize <= 35:
-		tits = 6
-		$titsize = 'F cup'
-	elseif pcs_cupsize <= 40:
-		tits = 7
-		$titsize = 'G cup'
-	elseif pcs_cupsize <= 45:
-		tits = 8
-		$titsize = 'H cup'
-	elseif pcs_cupsize <= 50:
-		tits = 9
-		$titsize = 'I cup'
-	elseif pcs_cupsize <= 55:
-		tits = 10
-		$titsize = 'J cup'
-	else
-		tits = 11
-		$titsize = 'K cup'
-	end
-end
-
-if $ARGS[0] = 'CalcWeight':
-	!{pcs_weight: Svetas weight in kg 
-	Optimal Weight (170cm): 60kg, 60 salo
-	This is an approximation, so that a sveta with a different height has the same BMI for the same salo 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.}
-	result = 30 + salo / 2 + (pcs_hgt - 170) * 7 / 10
-
-	!{Do not remove (julzor)
-	This is the old more complex function, but it doesn''t work correctly.
-	This variable is actually only used ONCE (except for the BMI calculation), when stripping, to see if you fall off the pole from being too heavy. I am reluctant to touch it, since the math is not explained. Maybe later.
-	Weight = (height in cm x bottom of average weight in kilos for a 170cm female / 170cm + (hip modifier + 2 x overrun fat)/4 + cup size}
-	
-	!result = (pcs_hgt * 62 / 170) + (vhips + (vofat * 2)) / 4 + tits
-end
-
-if $ARGS[0] = 'UpdateBodyImage':
-	!Update body image set
-	if dounspell = 1:
-		salocatnow = (pcs_hips / 10) - 5
-		if bdsetlock = 0:
-			if (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)):
-				bodset = 3
-			elseif strenbuf >= 70:
-				bodset = 2
-			elseif strenbuf <= 40:
-				bodset = 0
-			else
-				bodset = 1
-			end
-		else
-			bodset = fixbodset
-		end
-	elseif (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)) and bodet ! 3 and bdsetlock = 0:
-		bodset = 3
-	elseif preg = 0 and bodset = 3 and bdsetlock = 0:
-		if strenbuf >= 70:
-			bodset = 2
-		elseif strenbuf <= 40:
-			bodset = 0
-		else
-			bodset = 1
-		end
-	end
-
-	! Update body description
-	if (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)) and bodset = 3:
-		if PregChem > 6216:
-			$body = $bodimgsets[((bodset * 10) + 8)]
-		elseif PregChem < 2688:
-			$body = $bodimgsets[(bodset * 10)]
-		else 
-			$body = $bodimgsets[((bodset * 10)+((PregChem - 2184)/504))]
-		end
-	elseif salocatnow <= 7:
-		$body = $bodimgsets[((bodset * 10) + salocatnow)]
-	else
-		$body = $bodimgsets[((bodset * 10) + 7)]
-	end
-end
-
-if $ARGS[0] = 'CalcBMI':
-	result = 10000 * (30 + salo / 2 + (pcs_hgt - 170) * 7 / 10) / (pcs_hgt * pcs_hgt)
-end
-
-if $ARGS[0] = 'softreset':
-	!!This is for use in immediately updating shape if something has caused a large change in salo, primarily fat burners and plastic surgery
-	sftrstflag = 1
-	:resetloop
-	if salo ! salolast:
-		if gmstrtflag = 1: salobustdo = 1
-		gs 'body_shape'
-		jump 'resetloop'
-	end
-	!!Updates pcs_apprncbase after a reset
-	gs 'body', 'UpdateBaseAppearnce'
-	!!Clears the warning and reset status flags if they were set
-	sftrstflag = 0
-	btwarn = 0
-end
-
-if $ARGS[0] = 'hardreset':
-	!!This is primarily for canceling out "dounspell" and setting salo to whatever value will result in the current hip size then balancing everything out.
-	!!Also could be built in as a means to in-game undo "dounspell", other than the cheat.
-	if dounspell = 1 and dounsplkil > 0:
-		salo = 12
-		fat = 0
-		agilbuf = pcs_agil & strenbuf = pcs_stren & vitalbuf = pcs_vital
-		salobustdo = 1 & sftrstflag = 1 & normbuffpick = -1
-		gs 'body_shape'
-		salo = (pcs_hips * 2) - ((pcs_hgt * hratio) / 50) + 80
-		if salo < 10:
-			salocatnow = 0
-		else
-			salocatnow = 1 + (salo - 10) / 20
-		end
-		salocatlast = salocatnow
-		salolast = salo
-		vhtmp = (salo - 80) / 2
-		vhips = vhtmp
-		if genbsize = 0 and nbsize > 0:
-			If nbsize >= 27:
-				genbsize = 27
-			else
-				genbsize = 2 + nbsize - nbsize mod 5
-			end
-		elseif genbsize = 0 and nbsize = 0 and silicone >= 20:
-			genbsize = 12 & nbsize = 12 & silicone -= 10
-		end
-		sftrstflag = 0 & normbuffpick = 0 & btwarn = 0 & magf2bdo = 0
-		killvar 'dounsplkil'
-		newbdsp = 1
-		dounspell = 0
-		gs 'body', 'UpdateBaseAppearnce'
-		gs 'body_shape'
-		gs 'stat'
-	else
-		'If you''re seeing this, something odd happened. Please make a bug report that the body shape hard reset improperly triggered and what you were doing.'
-	end
-end
-
-if $ARGS[0] = 'initial':
-	!!	Sets the genetic bust size if it was not set in the start routines
-	if genbsize = 0:
-		genbsize = 12 & nbsize = 12
-	else
-		nbsize = genbsize
-	end
-	agilbuf = pcs_agil & strenbuf = pcs_stren & vitalbuf = pcs_vital
-	normbuffpick = -1 & gmstrtflag = 1
-	!!	Calling soft reset will cause the main code to cycle up to the starting value of salo
-	gs 'body_shape', 'softreset'
-	!!	This sets/resets the controler variables
-	salocatlast = salocatnow
-	normbuffpick = 0 & magf2bdo = 0
-	killvar 'gmstrtflag'
-	newbdsp = 1
-	!!	This does all the body shape setting before the first stat call
-	gs $this, 'UpdateBodyMeasurement'
-	pcs_weight = func($this, 'CalcWeight')
-	pcs_bmi = func($this, 'CalcBMI')
-	gs 'body_desc', 'BMI'
-end
-
---- body_shape ---------------------------------
-

+ 2 - 2
locations/cikl.qsrc

@@ -628,8 +628,8 @@ inhib_flr = inhib_lvl
 gs 'stat_sklattrib', 'daycall'
 
 !Update body measurements and base appearnce
-gs 'body_shape', 'DailyUpdate'
-gs 'body', 'UpdateBaseAppearnce'
+gs 'body', 'DailyUpdate'
+gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 gs 'body_desc'
 
 

+ 3 - 3
locations/city_clinic.qsrc

@@ -225,7 +225,7 @@ if $ARGS[0] = 'start':
 						*clr & cla
 						money -= zubpay
 						minut += 60
-						gs 'body', 'UpdateBaseAppearnce'
+						gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 						gs 'stat'
 						if pcs_teeth > 0:
 							pcs_teeth = 0
@@ -243,7 +243,7 @@ if $ARGS[0] = 'start':
 						*clr & cla
 						karta -= zubpay
 						minut += 60
-						gs 'body', 'UpdateBaseAppearnce'
+						gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 						gs 'stat'
 						if pcs_teeth > 0:
 							pcs_teeth = 0
@@ -1477,7 +1477,7 @@ if $ARGS[0] = 'lyposuction':
 	salo -= 40
 	if salo < 11: salo = 11
 	money -= 75000
-	gs 'body_shape', 'softreset'
+	gs 'body', 'softreset'
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/locations/city/residential/clinic/cosmeticsur.jpg"></center>'
 	'The surgeon has you strip, put on a gown and lie down on the table. He gives you a mask and tells you: "Just breathe in deeply... we''ll be done before you know it."'

+ 2 - 2
locations/din_van.qsrc

@@ -36,7 +36,7 @@ $showerdin = {
 			'Unfortunately, your false lashes don''t make it through the shower.'
 			false_lashes = 0
 			pcs_lashes = pcs_naturallashes
-			gs 'body', 'UpdateBaseAppearnce'
+			gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 		end
 	end
 }
@@ -837,7 +837,7 @@ $basin = {
 			pcs_lashes = pcs_naturallashes
 			false_lashes = 0
 			minut += 5
-			gs 'body', 'UpdateBaseAppearnce'
+			gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 			act 'Finish':menu_off = 0 & gt $loc, $loc_arg
 		end
 	end

+ 1 - 1
locations/intro_initialization.qsrc

@@ -101,7 +101,7 @@ nathcol = pcs_haircol
 pcs_pubecol = pcs_haircol & pcs_pubecol[1] = 1
 oldsavepcs_haircol = 1
 
-gs 'body_shape', 'initial'
+gs 'body', 'initial'
 
 !! Adding underwear and default shoes and assigning them
 

+ 1 - 1
locations/lover_change.qsrc

@@ -1098,7 +1098,7 @@ if $ARGS[0] = 'Figure':
 								salo = 20 * figurePrefMin + 1
 								if salo < 11: salo = 11
 
-								gs 'body_shape', 'softreset'
+								gs 'body', 'softreset'
 								!!'<<salocatnow>> is the value for salocatnow, the value for fat is <<fat>>, and the value for salo is <<salo>>.'
 								
 							if salocatnow > figurePrefMax:jump 'loopfatRemover'

+ 1 - 1
locations/obj_din.qsrc

@@ -121,7 +121,7 @@ if $ARGS[0] = 'menu_disabled': '<font color="red"><b>Menu is disabled for this e
 if $ARGS[0] = 'description':
 	*clr & cla
 	gs 'obj_din','chartabs'
-	gs 'body'
+	gs 'AppearanceSystem'
 	gs 'body_desc'
 	!'<center><img src="images/system/icons/description.png"><br></center>'
 	'<center><h1>Character Description</h1></center>'

+ 2 - 2
locations/pav_clinic.qsrc

@@ -162,7 +162,7 @@ if $ARGS[0] = '':
 							*clr & cla
 							money -= zubpay
 							minut += 60
-							gs 'body', 'UpdateBaseAppearnce'
+							gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 							gs 'stat'
 							if pcs_teeth > 0:
 								pcs_teeth = 0
@@ -180,7 +180,7 @@ if $ARGS[0] = '':
 							*clr & cla
 							karta -= zubpay
 							minut += 60
-							gs 'body', 'UpdateBaseAppearnce'
+							gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 							gs 'stat'
 							if pcs_teeth > 0:
 								pcs_teeth = 0

+ 1 - 1
locations/preCUST.qsrc

@@ -366,7 +366,7 @@ if $ARGS[0] = 'Done':
 	pcs_pubecol = pcs_haircol & pcs_pubecol[1] = 1
 	oldsavepcs_haircol = 1
 
-	gs 'body_shape', 'initial'
+	gs 'body', 'initial'
 
 !! Adding underwear and default shoes and assigning them
 

+ 5 - 5
locations/salon.qsrc

@@ -1122,7 +1122,7 @@ if $ARGS[0] = 'lashTreatment':
 	else
 		money -= 5000
 	end
-	gs 'body', 'UpdateBaseAppearnce'
+	gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 	
 	gs 'stat'
 	'The specialist collects your payment and moves you over to a chair with a headrest, which she has you tilt your head back up against.'
@@ -1155,7 +1155,7 @@ if $ARGS[0] = 'lashFalsies':
 		end
 		'She spends a few minutes selecting and trimming a set of ornate, dramatically-feathered false lashes to get them to line up neatly with your own natural set, and with practiced ease she glues them delicately in place, only having to give them one or two gentle, settling nudges.'
 	end
-	gs 'body', 'UpdateBaseAppearnce'
+	gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 	gs 'stat'
 	'"There you go! You''re all set! Have fun with wherever you''re going!"'
 	act 'Leave':gt 'salon', 'start'
@@ -1262,7 +1262,7 @@ if $ARGS[0] = 'lashExtension':
 		killvar 'lashextensionduration'
 		killvar 'lashextensionstyle'
 	end
-	gs 'body', 'UpdateBaseAppearnce'
+	gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 	gs 'stat'
 	'After what seems like forever, you''re finally allowed to open your eyes and take a look.'
 	act 'Leave':gt 'salon', 'start'
@@ -1577,7 +1577,7 @@ if $ARGS[0] = 'skin_care':
 	else
 		money -= 5000
 	end
-	gs 'body', 'UpdateBaseAppearnce'
+	gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/mall/salon/facialmask.jpg"></center>'
 	'You get a beauty mask treatment, afterwards your face feels smooth and your skin tight.'
@@ -1594,7 +1594,7 @@ if $ARGS[0] = 'rejuvination':
 	else
 		money -= 25000
 	end
-	gs 'body', 'UpdateBaseAppearnce'
+	gs 'AppearanceSystem', 'UpdateBaseAppearnce'
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/locations/city/citycenter/mall/salon/bodyscrub.jpg"></center>'
 	'You get a full body rejuvenation procedure, afterwards your skin feels soft and silky smooth.'

+ 2 - 2
locations/stat.qsrc

@@ -1049,8 +1049,8 @@ if StrongNarkota > 0:
 end
 
 !!Health, Willpower, Auto Birth Control pregnancy check
-gs 'body_shape', 'RegularUpdate'
-gs 'body'
+gs 'body', 'RegularUpdate'
+gs 'AppearanceSystem'
 gs 'body_desc'
 
 if pcs_health >= healthmax:

+ 1 - 1
locations/tatiana_lab.qsrc

@@ -383,7 +383,7 @@ if $ARGS[0] = 'Tatiana':
 					cla
 					minut += 30
 					dounspell = 1
-					gs 'body_shape', 'hardreset'
+					gs 'body', 'hardreset'
 					gs 'stat'
 					'<center><img <<$set_imgh>> src="images/characters/city/tatiana/magiclook.jpg"></center>'
 					'Tatiana lowers her glasses and stares deeply into your eyes. It feels like time just stops being a thing and you are floating.'