Pārlūkot izejas kodu

[Changed] Appearance rework. BMI now has a greater impact on hotcat. High and low BMI now gets a better bonus from non revealing clothes. Mid BMI gets a bonus for revealing clothes but the bonus is lower.

philormand 3 gadi atpakaļ
vecāks
revīzija
b1c313255c
3 mainītis faili ar 1344 papildinājumiem un 268 dzēšanām
  1. 1178 233
      locations/UnitAppearance.qsrc
  2. 101 23
      locations/body.qsrc
  3. 65 12
      locations/body_shape.qsrc

+ 1178 - 233
locations/UnitAppearance.qsrc

@@ -1,22 +1,10 @@
 # UnitAppearance
 if $ARGS[0] = '':
-	*clr
+    unitDisplayType = ARGS[1]
+    unitRowType = ARGS[2]
+    *clr
     'Hotcat'
 	'<table>'
-		'<tr>
-			<th>Desc</th>
-			<th>hotcat</th>
-			<th>bmi</th>
-			<th>bodykoef</th>
-			<th>HeadBonus</th>
-			<th>AttributeBonus</th>
-			<th>clothingbonus</th>
-			<th>AccessoriesBonus</th>
-			<th>GroomingBonus</th>
-			<th>GroomingPenalty</th>
-			<th>pcs_apprncbase</th>
-			<th>pcs_apprnc</th>
-		</tr>'
 		gs 'UnitAppearance', 'GenerateSvetas'
 	'</table>'
 end
@@ -25,52 +13,43 @@ if $ARGS[0] = 'gashtest':
 end
 
 if $ARGS[0] = 'GenRow':
-	'<tr>'
-		'<td><<$svetadesc>></td>'
-		'<td><<unitHotcat>></td>'
-		'<td><<unitbmi_calc>></td>'
-		'<td><<unitbodykoef>></td>'
-		'<td><<unitHeadBonus>></td>'
-		'<td><<unitAttributeBonus>></td>'
-		'<td><<unitclothingbonus>></td>'
-		'<td><<unitAccessoriesBonus>></td>'
-		'<td><<unitGroomingBonus>></td>'
-		'<td><<unitGroomingPenalty>></td>'
-		'<td><<unitpcs_apprncbase>></td>'
-		'<td><<unitpcs_apprnc>></td>'
-	'</tr>'
+    if unitDisplayType = 0:
+        if unitRowType = 0:
+    	    '<tr><td align="left"><<$ARGS[1]>></td><td align="right"><<unitHotcat>></td></td><td align="right"><<unitpcs_apprnc>></td><td align="right"><<unitbmi_calc>></td><td align="right"><<unitbodykoef>></td><td align="right"><<unitHeadBonus>></td><td align="right"><<unitAttributeBonus>></td><td align="right"><<unitclothingbonus>></td><td align="right"><<unitAccessoriesBonus>></td><td align="right"><<unitGroomingBonus>></td><td align="right"><<unitGroomingPenalty>></td><td align="right"><<unitpcs_apprncbase>></tr>'
+        else
+    	    '<tr><td align="left"><<$ARGS[1]>></td><td align="right"><<unitclothingbonus1>></td><td align="right"><<unitclothingbonus2>></td><td align="right"><<unitclothingbonus3>></td><td align="right"><<unitclothingbonus4>></td><td align="right"><<unitclothingbonus5>></td><td align="right"><<unitclothingbonus6>></td><td align="right"><<unitclothingbonus7>></td><td align="right"><<unitclothingbonusnude>></td></tr>'
+        end
+    else
+	    '<<$ARGS[1]>>,<<unitHotcat>>,<<unitpcs_apprnc>>,<<unitbmi_calc>>,<<unitbodykoef>>,<<unitHeadBonus>>,<<unitAttributeBonus>>,<<unitclothingbonus>>,<<unitAccessoriesBonus>>,<<unitGroomingBonus>>,<<unitGroomingPenalty>>,<<unitpcs_apprncbase>>'
+    end
 end 
 
 if $ARGS[0] = 'GenRowBreak':
-	'<tr>'
-		'<td><<$ARGS[1]>></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-		'<td></td>'
-	'</tr>'
+    if unitDisplayType = 0:
+        if unitRowType = 0:
+            '<tr><th align="left"><<$ARGS[1]>></th><th align="right">hotcat</th><th align="right">pcs_apprnc</th><th align="right">bmi</th><th>bodykoef</th><th align="right">HeadBonus</th><th align="right">AttributeBonus</th><th align="right">clothingbonus</th><th align="right">AccessoriesBonus</th><th align="right">GroomingBonus</th><th align="right">GroomingPenalty</th><th align="right">pcs_apprncbase</th></tr>'
+        else
+            '<tr><th align="left"><<$ARGS[1]>></th><th align="right">clothingbonus Q1</th></th><th align="right">clothingbonus Q2</th></th><th align="right">clothingbonus Q3</th></th><th align="right">clothingbonus Q4</th></th><th align="right">clothingbonus Q5</th></th><th align="right">clothingbonus Q6</th></th><th align="right">clothingbonus Q7</th><th align="right">clothingbonus Nude</th></tr>'
+        end
+    else
+        '<<$ARGS[1]>>,hotcat,pcs_apprnc,bmi,bodykoef,HeadBonus,AttributeBonus,clothingbonus,AccessoriesBonus,GroomingBonus,GroomingPenalty,pcs_apprncbase'
+    end
 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)
-	unitAttributeBonus = FUNC('body_shape', 'calcAttributeBonus', unitpcs_agil, unitpcs_vital)
-	unitpcs_apprncbase = FUNC('body_shape', 'basebeautycalc2', unitResetBase, unitvidage, unitpcs_skin, unitbodykoef, unitunitHeadBonus, unitunitAttributeBonus, unitpcs_apprncbase)
-	unitclothingbonus = FUNC('body', 'calcClothesBonus', unitpcs_apprncbase, unitPXCloThinness, unitPXCloTopCut, unitPXCloBottomShortness, unitPCloQuality, $unitclothingworntype)
+	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)
+	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)
+	unitGroomingBonus = FUNC('body', 'calcGroomingBonus', unitpcs_lipbalm, unitmopkoef, unitpcs_hairbsh, unitpcs_breath, unitdeodorant_on, unitbmi_calc)
 	unitGroomingPenalty = FUNC('body', 'calcGroomingPenalty', unitpcs_hairlng, unitpcs_sweat, unitglassvnesh, unitdyevmod, unitlegkoef)
 	unitHotcat = FUNC('body', 'calcHotcat', unitpcs_apprncbase, unitsupnatvnesh, unitclothingbonus, unitAccessoriesBonus, unitGroomingBonus, unitGroomingPenalty)
-	unitpcs_apprnc = temppcs_apprnc & killvar 'temppcs_apprnc'
-	gs 'UnitAppearance', 'GenRow'
+    !!use value without the cap as what gets returned in temppcs_apprnc is capped at 200
+	unitpcs_apprnc = temppcs_maxapprnc & killvar 'temppcs_apprnc' & killvar 'temppcs_maxapprnc'
+	if unitRowType = 0: gs 'UnitAppearance', 'GenRow', $ARGS[1]
 end
 
 if $ARGS[0] = 'headbonus':
@@ -179,45 +158,83 @@ if $ARGS[0] = 'GenerateSvetas':
     unitResetBase = 0
 	gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
 
-    $svetadesc = 'Hot Sveta'
-    unitsalo = 65
+    $svetadesc = 'Queen Nerd Start'
+    unitsalo = 103
     unitpcs_hgt = 170
     unitstrenbuf = 30
-    unitsalocatnow = 3
+    unitsalocatnow = 5
     unitvofat = 0
-    unitpcs_lashes = 2
+    unitpcs_lashes = 1
     unitpcs_eyesize = 3
-    unitpcs_lip = 3
-    unitpcs_teeth = -1
-    unitpcs_agil = 100
-    unitpcs_vital = 100
-    unitvidage = 15
-    unitpcs_skin = 100
+    unitpcs_lip = 2
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 50
     unitPXCloThinness = 300
-    unitPXCloTopCut = 350
-    unitPXCloBottomShortness = 200
-    unitPCloQuality = 7
-    $unitclothingworntype = 'formal'
+    unitPXCloTopCut = 200
+    unitPXCloBottomShortness = 250
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
     unitbonusZ = 0
     unitPShoQuality = 0
-    $unitpantyworntype = 'boutique'
-    $unitbraworntype = 'boutique'
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
     unitpcs_lipbalm = 0
     unitmopkoef = 0
     unitpcs_hairbsh = 1
     unitpcs_breath = 0
     unitdeodorant_on = 0
-    unitpcs_hairlng = 700
+    unitpcs_hairlng = 300
     unitpcs_sweat = 0
     unitglassvnesh = 0
     unitdyevmod = 0
-    unitlegkoef = 0
+    unitlegkoef = 9
     unitsupnatvnesh = 0
     unitpcs_apprncbase = 0
     unitResetBase = 1
-	gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
 
-    $svetadesc = 'Nerd start Sveta'
+    $svetadesc = 'Good Student Start'
+    unitsalo = 161
+    unitpcs_hgt = 170
+    unitstrenbuf = 30
+    unitsalocatnow = 8
+    unitvofat = 10
+    unitpcs_lashes = 0
+    unitpcs_eyesize = 1
+    unitpcs_lip = 1
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 20
+    unitPXCloThinness = 200
+    unitPXCloTopCut = 100
+    unitPXCloBottomShortness = 100
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 10
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+   
+    $svetadesc = 'Computer Geek Start'
     unitsalo = 132
     unitpcs_hgt = 170
     unitstrenbuf = 30
@@ -242,7 +259,7 @@ if $ARGS[0] = 'GenerateSvetas':
     $unitbraworntype = 'cheap'
     unitpcs_lipbalm = 0
     unitmopkoef = 0
-    unitpcs_hairbsh = 0
+    unitpcs_hairbsh = 1
     unitpcs_breath = 0
     unitdeodorant_on = 0
     unitpcs_hairlng = 120
@@ -253,10 +270,85 @@ if $ARGS[0] = 'GenerateSvetas':
     unitsupnatvnesh = 0
     unitpcs_apprncbase = 0
     unitResetBase = 1
-	gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
-
-
-    $svetadesc = 'Dancer start Sveta'
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+   
+    $svetadesc = 'Chess Player Start'
+    unitsalo = 40
+    unitpcs_hgt = 170
+    unitstrenbuf = 30
+    unitsalocatnow = 2
+    unitvofat = 0
+    unitpcs_lashes = 0
+    unitpcs_eyesize = 1
+    unitpcs_lip = 1
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 35
+    unitPXCloThinness = 250
+    unitPXCloTopCut = 300
+    unitPXCloBottomShortness = 100
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+	
+    $svetadesc = 'Volleyball Start'
+    unitsalo = 75
+    unitpcs_hgt = 170
+    unitstrenbuf = 45
+    unitsalocatnow = 4
+    unitvofat = 0
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 3
+    unitpcs_lip = 2
+    unitpcs_teeth = 0
+    unitpcs_agil = 50
+    unitpcs_vital = 50
+    unitvidage = 16
+    unitpcs_skin = 50
+    unitPXCloThinness = 300
+    unitPXCloTopCut = 200
+    unitPXCloBottomShortness = 250
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 55
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+	
+    $svetadesc = 'Dancer Start'
     unitsalo = 55
     unitpcs_hgt = 170
     unitstrenbuf = 40
@@ -292,25 +384,24 @@ if $ARGS[0] = 'GenerateSvetas':
     unitsupnatvnesh = 0
     unitpcs_apprncbase = 0
     unitResetBase = 1
-	gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
-
-
-    $svetadesc = 'Popular start Sveta'
-    unitsalo = 80
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+	
+    $svetadesc = 'Runner Start'
+    unitsalo = 51
     unitpcs_hgt = 170
-    unitstrenbuf = 30
-    unitsalocatnow = 4
+    unitstrenbuf = 45
+    unitsalocatnow = 3
     unitvofat = 0
     unitpcs_lashes = 1
-    unitpcs_eyesize = 2
+    unitpcs_eyesize = 3
     unitpcs_lip = 2
     unitpcs_teeth = 0
-    unitpcs_agil = 30
-    unitpcs_vital = 30
+    unitpcs_agil = 50
+    unitpcs_vital = 60
     unitvidage = 16
-    unitpcs_skin = 50
-    unitPXCloThinness = 300
-    unitPXCloTopCut = 300
+    unitpcs_skin = 40
+    unitPXCloThinness = 350
+    unitPXCloTopCut = 200
     unitPXCloBottomShortness = 250
     unitPCloQuality = 1
     $unitclothingworntype = 'cheap'
@@ -320,10 +411,10 @@ if $ARGS[0] = 'GenerateSvetas':
     $unitbraworntype = 'cheap'
     unitpcs_lipbalm = 0
     unitmopkoef = 0
-    unitpcs_hairbsh = 0
+    unitpcs_hairbsh = 1
     unitpcs_breath = 0
     unitdeodorant_on = 0
-    unitpcs_hairlng = 200
+    unitpcs_hairlng = 55
     unitpcs_sweat = 0
     unitglassvnesh = 0
     unitdyevmod = 0
@@ -331,24 +422,24 @@ if $ARGS[0] = 'GenerateSvetas':
     unitsupnatvnesh = 0
     unitpcs_apprncbase = 0
     unitResetBase = 1
-	gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
-
-    $svetadesc = 'Gopnik start Sveta'
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+	
+    $svetadesc = 'Football Start'
     unitsalo = 80
     unitpcs_hgt = 170
-    unitstrenbuf = 40
+    unitstrenbuf = 50
     unitsalocatnow = 4
     unitvofat = 0
     unitpcs_lashes = 1
     unitpcs_eyesize = 3
     unitpcs_lip = 2
     unitpcs_teeth = 0
-    unitpcs_agil = 35
-    unitpcs_vital = 40
+    unitpcs_agil = 40
+    unitpcs_vital = 50
     unitvidage = 16
-    unitpcs_skin = 40
-    unitPXCloThinness = 350
-    unitPXCloTopCut = 250
+    unitpcs_skin = 50
+    unitPXCloThinness = 300
+    unitPXCloTopCut = 200
     unitPXCloBottomShortness = 250
     unitPCloQuality = 1
     $unitclothingworntype = 'cheap'
@@ -358,10 +449,10 @@ if $ARGS[0] = 'GenerateSvetas':
     $unitbraworntype = 'cheap'
     unitpcs_lipbalm = 0
     unitmopkoef = 0
-    unitpcs_hairbsh = 0
+    unitpcs_hairbsh = 1
     unitpcs_breath = 0
     unitdeodorant_on = 0
-    unitpcs_hairlng = 120
+    unitpcs_hairlng = 55
     unitpcs_sweat = 0
     unitglassvnesh = 0
     unitdyevmod = 0
@@ -369,25 +460,25 @@ if $ARGS[0] = 'GenerateSvetas':
     unitsupnatvnesh = 0
     unitpcs_apprncbase = 0
     unitResetBase = 1
-	gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
-
-    $svetadesc = 'Ugly start Sveta'
-    unitsalo = 220
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+	
+    $svetadesc = 'Popular Friends Start'
+    unitsalo = 80
     unitpcs_hgt = 170
     unitstrenbuf = 30
-    unitsalocatnow = 11
-    unitvofat = 25
-    unitpcs_lashes = 2
-    unitpcs_eyesize = 0
-    unitpcs_lip = 0
+    unitsalocatnow = 4
+    unitvofat = 0
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 2
+    unitpcs_lip = 2
     unitpcs_teeth = 0
     unitpcs_agil = 30
     unitpcs_vital = 30
     unitvidage = 16
-    unitpcs_skin = 1
-    unitPXCloThinness = 150
-    unitPXCloTopCut = 100
-    unitPXCloBottomShortness = 100
+    unitpcs_skin = 50
+    unitPXCloThinness = 300
+    unitPXCloTopCut = 300
+    unitPXCloBottomShortness = 250
     unitPCloQuality = 1
     $unitclothingworntype = 'cheap'
     unitbonusZ = 0
@@ -396,48 +487,48 @@ if $ARGS[0] = 'GenerateSvetas':
     $unitbraworntype = 'cheap'
     unitpcs_lipbalm = 0
     unitmopkoef = 0
-    unitpcs_hairbsh = 0
+    unitpcs_hairbsh = 1
     unitpcs_breath = 0
     unitdeodorant_on = 0
     unitpcs_hairlng = 200
     unitpcs_sweat = 0
-    unitglassvnesh = 10
+    unitglassvnesh = 0
     unitdyevmod = 0
     unitlegkoef = 9
     unitsupnatvnesh = 0
     unitpcs_apprncbase = 0
     unitResetBase = 1
-	gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
 
-    $svetadesc = 'Slut start Sveta'
-    unitsalo = 60
+    $svetadesc = 'Popular Beautiful Start'
+    unitsalo = 65
     unitpcs_hgt = 170
     unitstrenbuf = 30
     unitsalocatnow = 3
     unitvofat = 0
-    unitpcs_lashes = 1
+    unitpcs_lashes = 2
     unitpcs_eyesize = 2
-    unitpcs_lip = 2
+    unitpcs_lip = 3
     unitpcs_teeth = 0
     unitpcs_agil = 30
     unitpcs_vital = 30
     unitvidage = 16
-    unitpcs_skin = 60
+    unitpcs_skin = 70
     unitPXCloThinness = 350
-    unitPXCloTopCut = 400
-    unitPXCloBottomShortness = 300
-    unitPCloQuality = 2
+    unitPXCloTopCut = 300
+    unitPXCloBottomShortness = 250
+    unitPCloQuality = 1
     $unitclothingworntype = 'cheap'
     unitbonusZ = 0
     unitPShoQuality = 0
     $unitpantyworntype = 'cheap'
-    $unitbraworntype = 'none'
+    $unitbraworntype = 'cheap'
     unitpcs_lipbalm = 0
     unitmopkoef = 0
-    unitpcs_hairbsh = 0
+    unitpcs_hairbsh = 1
     unitpcs_breath = 0
     unitdeodorant_on = 0
-    unitpcs_hairlng = 120
+    unitpcs_hairlng = 300
     unitpcs_sweat = 0
     unitglassvnesh = 0
     unitdyevmod = 0
@@ -445,24 +536,24 @@ if $ARGS[0] = 'GenerateSvetas':
     unitsupnatvnesh = 0
     unitpcs_apprncbase = 0
     unitResetBase = 1
-	gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
 
-    $svetadesc = 'goth start Sveta'
-    unitsalo = 45
+    $svetadesc = 'Gopnik Start'
+    unitsalo = 80
     unitpcs_hgt = 170
-    unitstrenbuf = 30
-    unitsalocatnow = 2
+    unitstrenbuf = 40
+    unitsalocatnow = 4
     unitvofat = 0
     unitpcs_lashes = 1
     unitpcs_eyesize = 3
-    unitpcs_lip = 1
+    unitpcs_lip = 2
     unitpcs_teeth = 0
-    unitpcs_agil = 30
-    unitpcs_vital = 30
+    unitpcs_agil = 35
+    unitpcs_vital = 40
     unitvidage = 16
-    unitpcs_skin = 50
+    unitpcs_skin = 40
     unitPXCloThinness = 350
-    unitPXCloTopCut = 200
+    unitPXCloTopCut = 250
     unitPXCloBottomShortness = 250
     unitPCloQuality = 1
     $unitclothingworntype = 'cheap'
@@ -472,133 +563,987 @@ if $ARGS[0] = 'GenerateSvetas':
     $unitbraworntype = 'cheap'
     unitpcs_lipbalm = 0
     unitmopkoef = 0
-    unitpcs_hairbsh = 0
+    unitpcs_hairbsh = 1
     unitpcs_breath = 0
     unitdeodorant_on = 0
-    unitpcs_hairlng = 265
+    unitpcs_hairlng = 120
     unitpcs_sweat = 0
     unitglassvnesh = 0
     unitdyevmod = 0
     unitlegkoef = 9
     unitsupnatvnesh = 0
-   unitpcs_apprncbase = 0
-   unitResetBase = 1
-   gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
-
-end
-
-if $ARGS[0] = 'GenerateSvetaOptions':
-
-
-    gs 'UnitAppearance', 'GenRowBreak', $svetadesc
-
-    $svetadesc = 'Current Clothes <<$ARGS[1]>>'
-    
-    gs 'UnitAppearance', 'calcHotcat'
-
-    $svetadesc = 'Low Clothes <<$ARGS[1]>>'
-    unitPXCloThinness = 150
-    unitPXCloTopCut = 100
-    unitPXCloBottomShortness = 100
-    unitPCloQuality = 1
-    $unitclothingworntype = ''
-    unitbonusZ = 1
-    unitPShoQuality = 1
-    $unitpantyworntype = ''
-    $unitbraworntype = ''
-    gs 'UnitAppearance', 'calcHotcat'
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
 
-    $svetadesc = 'Med Clothes <<$ARGS[1]>>'
-    unitPXCloThinness = 250
-    unitPXCloTopCut = 300
-    unitPXCloBottomShortness = 150
-    unitPCloQuality = 4
+    $svetadesc = 'Punk Start'
+    unitsalo = 80
+    unitpcs_hgt = 170
+    unitstrenbuf = 40
+    unitsalocatnow = 4
+    unitvofat = 0
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 3
+    unitpcs_lip = 2
+    unitpcs_teeth = 0
+    unitpcs_agil = 35
+    unitpcs_vital = 35
+    unitvidage = 16
+    unitpcs_skin = 40
+    unitPXCloThinness = 350
+    unitPXCloTopCut = 250
+    unitPXCloBottomShortness = 250
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 55
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+
+    $svetadesc = 'Viteks Girlfriend Start'
+    unitsalo = 60
+    unitpcs_hgt = 170
+    unitstrenbuf = 30
+    unitsalocatnow = 3
+    unitvofat = 0
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 2
+    unitpcs_lip = 2
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 50
+    unitPXCloThinness = 350
+    unitPXCloTopCut = 300
+    unitPXCloBottomShortness = 250
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+
+    $svetadesc = 'Alt Party Girl Start'
+    unitsalo = 60
+    unitpcs_hgt = 170
+    unitstrenbuf = 35
+    unitsalocatnow = 3
+    unitvofat = 0
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 2
+    unitpcs_lip = 2
+    unitpcs_teeth = 0
+    unitpcs_agil = 40
+    unitpcs_vital = 40
+    unitvidage = 16
+    unitpcs_skin = 60
+    unitPXCloThinness = 300
+    unitPXCloTopCut = 250
+    unitPXCloBottomShortness = 300
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 120
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+
+    $svetadesc = 'Outcast No Friends Start'
+    unitsalo = 104
+    unitpcs_hgt = 170
+    unitstrenbuf = 30
+    unitsalocatnow = 5
+    unitvofat = 0
+    unitpcs_lashes = 0
+    unitpcs_eyesize = 1
+    unitpcs_lip = 1
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 10
+    unitPXCloThinness = 200
+    unitPXCloTopCut = 100
+    unitPXCloBottomShortness = 100
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+
+    $svetadesc = 'Ugly Duckling Start'
+    unitsalo = 220
+    unitpcs_hgt = 170
+    unitstrenbuf = 30
+    unitsalocatnow = 11
+    unitvofat = 25
+    unitpcs_lashes = 2
+    unitpcs_eyesize = 0
+    unitpcs_lip = 0
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 1
+    unitPXCloThinness = 150
+    unitPXCloTopCut = 100
+    unitPXCloBottomShortness = 100
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 10
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+
+    $svetadesc = 'Good Girl Start'
+    unitsalo = 104
+    unitpcs_hgt = 170
+    unitstrenbuf = 30
+    unitsalocatnow = 5
+    unitvofat = 0
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 3
+    unitpcs_lip = 2
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 30
+    unitPXCloThinness = 150
+    unitPXCloTopCut = 100
+    unitPXCloBottomShortness = 100
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 300
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+
+    $svetadesc = 'Slut Start'
+    unitsalo = 60
+    unitpcs_hgt = 170
+    unitstrenbuf = 30
+    unitsalocatnow = 3
+    unitvofat = 0
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 2
+    unitpcs_lip = 2
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 60
+    unitPXCloThinness = 350
+    unitPXCloTopCut = 400
+    unitPXCloBottomShortness = 300
+    unitPCloQuality = 2
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'none'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 120
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+
+    $svetadesc = 'Goth Start'
+    unitsalo = 45
+    unitpcs_hgt = 170
+    unitstrenbuf = 30
+    unitsalocatnow = 2
+    unitvofat = 0
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 3
+    unitpcs_lip = 1
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 50
+    unitPXCloThinness = 350
+    unitPXCloTopCut = 200
+    unitPXCloBottomShortness = 250
+    unitPCloQuality = 1
+    $unitclothingworntype = 'cheap'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+    unitpcs_lipbalm = 0
+    unitmopkoef = 0
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 0
+    unitpcs_hairlng = 265
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    gs 'UnitAppearance', 'GenerateSvetaOptions', $svetadesc
+	
+   gs 'UnitAppearance', 'GenRowBreak', 'BMI Maximums'
+
+    unitstrenbuf = 100
+    unitpcs_lashes = 5
+    unitpcs_eyesize = 3
+    unitpcs_lip = 3
+    unitpcs_teeth = -1
+    unitpcs_agil = 100
+    unitpcs_vital = 100
+    unitvidage = 20
+    unitpcs_skin = 100
+    unitpcs_lipbalm = 1
+    unitmopkoef = 30
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 1
+    unitdeodorant_on = 1
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 0
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    unitpcs_hgt = 170
     $unitclothingworntype = ''
-    unitbonusZ = 3
-    unitPShoQuality = 4
-    $unitpantyworntype = 'fashionista'
-    $unitbraworntype = 'fashionista'
-    gs 'UnitAppearance', 'calcHotcat'
-
-    $svetadesc = 'High Clothes <<$ARGS[1]>>'
-    unitPXCloThinness = 400
-    unitPXCloTopCut = 500
-    unitPXCloBottomShortness = 400
     unitPCloQuality = 7
-    $unitclothingworntype = ''
     unitbonusZ = 5
     unitPShoQuality = 7
     $unitpantyworntype = 'boutique'
     $unitbraworntype = 'boutique'
-    gs 'UnitAppearance', 'calcHotcat'
 
-    $svetadesc = 'Naked <<$ARGS[1]>>'
+    $svetadesc = 'Max morbidly obese'
+    unitsalo = 220
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'Max very severely obese'
+    unitsalo = 190
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'Max severely obese'
+    unitsalo = 160
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'Max moderately obese'
+    unitsalo = 135
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'Max overweight'
+    unitsalo = 105
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'Max normal'
+    unitsalo = 75
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'Max underweight'
+    unitsalo = 40
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'Max severely underweight'
+    unitsalo = 25
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+   gs 'UnitAppearance', 'GenRowBreak', 'BMI Average Apperance cheap clothes'
+
+    unitstrenbuf = 30
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 3
+    unitpcs_lip = 1
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 50
+    unitpcs_lipbalm = 1
+    unitmopkoef = 19
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 1
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 0
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    unitpcs_hgt = 170
+    $unitclothingworntype = 'cheap'
+    unitPCloQuality = 1
+    unitbonusZ = 0
+    unitPShoQuality = 1
+    $unitpantyworntype = 'cheap'
+    $unitbraworntype = 'cheap'
+
+    $svetadesc = 'morbidly obese'
+    unitsalo = 220
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'very severely obese'
+    unitsalo = 190
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'severely obese'
+    unitsalo = 160
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'moderately obese'
+    unitsalo = 135
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'overweight'
+    unitsalo = 105
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'normal'
+    unitsalo = 75
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'underweight'
+    unitsalo = 40
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'severely underweight'
+    unitsalo = 25
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+   gs 'UnitAppearance', 'GenRowBreak', 'BMI Average Apperance expensive clothes'
+
+    unitstrenbuf = 30
+    unitpcs_lashes = 1
+    unitpcs_eyesize = 3
+    unitpcs_lip = 1
+    unitpcs_teeth = 0
+    unitpcs_agil = 30
+    unitpcs_vital = 30
+    unitvidage = 16
+    unitpcs_skin = 50
+    unitpcs_lipbalm = 1
+    unitmopkoef = 19
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 0
+    unitdeodorant_on = 1
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 0
+    unitdyevmod = 0
+    unitlegkoef = 0
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    unitpcs_hgt = 170
+    $unitclothingworntype = ''
+    unitPCloQuality = 7
+    unitbonusZ = 0
+    unitPShoQuality = 7
+    $unitpantyworntype = 'boutique'
+    $unitbraworntype = 'boutique'
+
+    $svetadesc = 'morbidly obese'
+    unitsalo = 220
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'very severely obese'
+    unitsalo = 190
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'severely obese'
+    unitsalo = 160
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'moderately obese'
+    unitsalo = 135
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'overweight'
+    unitsalo = 105
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'normal'
+    unitsalo = 75
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'underweight'
+    unitsalo = 40
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'severely underweight'
+    unitsalo = 25
+    gs 'UnitAppearance', 'CalcSaloVars'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+
+end
+
+if $ARGS[0] = 'CalcSaloVars':
+
+    unitvhips = (unitsalo - 80) / 2
+	unithrtemp = (2 * unitpcs_agil + unitpcs_vital + unitstrenbuf) /4
+
+	if unithrtemp < 35:
+		unithratio = 60
+	elseif unithrtemp < 45:
+		unithratio = 59
+	elseif unithrtemp < 60:
+		unithratio = 58
+	elseif unithrtemp < 80:
+		unithratio = 57
+	else
+		unithratio = 56
+	end
+
+    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)
+    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)
+
+    $svetadesc = 'Current Clothes'
+    
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+
+    $svetadesc = 'Naked'
     unitPXCloThinness = 0
     unitPXCloTopCut = 0
     unitPXCloBottomShortness = 0
     unitPCloQuality = 0
     $unitclothingworntype = 'nude'
+    unitbonusZ = 0
+    unitPShoQuality = 0
+    $unitpantyworntype = ''
+    $unitbraworntype = ''
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+    gs 'UnitAppearance', 'RestoreBase'
+
+    $svetadesc = 'Max Bonus'
+    unitpcs_teeth = -1
+    unitpcs_skin = 100
+    unitpcs_lashes = 5
+    unitmopkoef = 30
+    unitpcs_lipbalm = 1
+    unitlegkoef = 0
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+    gs 'UnitAppearance', 'RestoreBase'
+
+    $svetadesc = 'Low Clothes'
+    gs 'UnitAppearance', 'GetClothThick', unitbmi_calc
+    unitPCloQuality = 1
+    $unitclothingworntype = ''
+    unitbonusZ = 1
+    unitPShoQuality = 1
     $unitpantyworntype = ''
     $unitbraworntype = ''
-    gs 'UnitAppearance', 'calcHotcat'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+    gs 'UnitAppearance', 'RestoreBase'
 
-    gs 'UnitAppearance', 'GenRowBreak', ''
+    $svetadesc = 'Med Clothes'
+    gs 'UnitAppearance', 'GetClothThick', unitbmi_calc
+    unitPCloQuality = 4
+    $unitclothingworntype = ''
+    unitbonusZ = 3
+    unitPShoQuality = 4
+    $unitpantyworntype = 'fashionista'
+    $unitbraworntype = 'fashionista'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+    gs 'UnitAppearance', 'RestoreBase'
+
+    $svetadesc = 'High Clothes'
+    gs 'UnitAppearance', 'GetClothThick', unitbmi_calc
+    unitPCloQuality = 7
+    $unitclothingworntype = ''
+    unitbonusZ = 5
+    unitPShoQuality = 7
+    $unitpantyworntype = 'boutique'
+    $unitbraworntype = 'boutique'
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
+    gs 'UnitAppearance', 'RestoreBase'
+
+    $svetadesc = 'High Clothes Max Bonus'
+    gs 'UnitAppearance', 'GetClothThick', unitbmi_calc
+    unitPCloQuality = 7
+    $unitclothingworntype = ''
+    unitbonusZ = 5
+    unitPShoQuality = 7
+    $unitpantyworntype = 'boutique'
+    $unitbraworntype = 'boutique'
+    unitpcs_teeth = -1
+    unitpcs_skin = 100
+    unitpcs_lashes = 5
+    unitmopkoef = 30
+    unitpcs_lipbalm = 1
+    unitlegkoef = 0
+    gs 'UnitAppearance', 'calcHotcat', $svetadesc
 
 end 
 
+if $ARGS[0] = 'GetClothThick':
+	if ARGS[1] < 16:
+		!!severely underweight
+        unitPXCloThinness = 150
+        unitPXCloTopCut = 100
+        unitPXCloBottomShortness = 100
+	elseif ARGS[1] >= 16 and ARGS[1] < 19:
+		!!underweight
+        unitPXCloThinness = 150
+        unitPXCloTopCut = 100
+        unitPXCloBottomShortness = 100
+	elseif ARGS[1] >= 19 and ARGS[1] < 25:
+		!!normal, healthy weight
+        unitPXCloThinness = 400
+        unitPXCloTopCut = 500
+        unitPXCloBottomShortness = 400
+	elseif ARGS[1] >= 25 and ARGS[1] < 30:
+		!!overweight
+        unitPXCloThinness = 400
+        unitPXCloTopCut = 500
+        unitPXCloBottomShortness = 400
+	elseif ARGS[1] >= 30 and ARGS[1] < 35:
+		!!moderately obese
+        unitPXCloThinness = 150
+        unitPXCloTopCut = 100
+        unitPXCloBottomShortness = 100
+	elseif ARGS[1] >= 35 and ARGS[1] < 40:
+		!!severely obese
+        unitPXCloThinness = 150
+        unitPXCloTopCut = 100
+        unitPXCloBottomShortness = 100
+	elseif ARGS[1] >= 40 and ARGS[1] < 45:
+		!!very severely obese
+        unitPXCloThinness = 150
+        unitPXCloTopCut = 100
+        unitPXCloBottomShortness = 100
+	elseif ARGS[1] >= 45:
+		!!morbidly obese
+        unitPXCloThinness = 150
+        unitPXCloTopCut = 100
+        unitPXCloBottomShortness = 100
+	end
+end
+
+
+
+if $args[0] = 'SaloTest':
+    unitDisplayType = ARGS[1]
+    unitRowType = ARGS[2]
+	*clr
+    'Hotcat'
+	'<table>'
+
+    unitstrenbuf = 19
+    unitvofat = 0
+    unitpcs_lashes = 5
+    unitpcs_eyesize = 3
+    unitpcs_lip = 3
+    unitpcs_teeth = -1
+    unitpcs_agil = 100
+    unitpcs_vital = 100
+    unitvidage = 20
+    unitpcs_skin = 1
+    unitpcs_lipbalm = 1
+    unitmopkoef = 5
+    unitpcs_hairbsh = 1
+    unitpcs_breath = 1
+    unitdeodorant_on = 1
+    unitpcs_hairlng = 200
+    unitpcs_sweat = 0
+    unitglassvnesh = 10
+    unitdyevmod = 0
+    unitlegkoef = 9
+    unitsupnatvnesh = 0
+    unitpcs_apprncbase = 0
+    unitResetBase = 1
+    unitpcs_hgt = 170
+    $unitclothingworntype = ''
+    unitbonusZ = 1
+    unitPShoQuality = 1
+    $unitpantyworntype = ''
+    $unitbraworntype = ''
+
+    unitsalo = 220
+    unitsalocatnow = 1 + (unitsalo - 10) / 20
+    gs 'UnitAppearance', 'SaloGenerateTest', 'morbidly obese'
+
+    unitsalo = 190
+    unitsalocatnow = 1 + (unitsalo - 10) / 20
+    gs 'UnitAppearance', 'SaloGenerateTest', 'very severely obese'
+
+    unitsalo = 160
+    unitsalocatnow = 1 + (unitsalo - 10) / 20
+    gs 'UnitAppearance', 'SaloGenerateTest', 'severely obese'
+
+    unitsalo = 135
+    unitsalocatnow = 1 + (unitsalo - 10) / 20
+    gs 'UnitAppearance', 'SaloGenerateTest', 'moderately obese'
+
+    unitsalo = 105
+    unitsalocatnow = 1 + (unitsalo - 10) / 20
+    gs 'UnitAppearance', 'SaloGenerateTest', 'overweight'
+
+    unitsalo = 75
+    unitsalocatnow = 1 + (unitsalo - 10) / 20
+    gs 'UnitAppearance', 'SaloGenerateTest', 'normal'
+
+    unitsalo = 40
+    unitsalocatnow = 1 + (unitsalo - 10) / 20
+    gs 'UnitAppearance', 'SaloGenerateTest', 'underweight'
+
+    unitsalo = 25
+    unitsalocatnow = 1 + (unitsalo - 10) / 20
+    gs 'UnitAppearance', 'SaloGenerateTest', 'severely underweight'
+
+	'</table>'
+end
+
+if $args[0] = 'SaloGenerateTest':
+
+    gs 'UnitAppearance', 'GenRowBreak', $ARGS[1]
+
+    unitPXCloThinness = 400
+    unitPXCloTopCut = 500
+    unitPXCloBottomShortness = 400
+
+    gs 'UnitAppearance', 'SaloGenerateRows', $ARGS[1], 'Most Revealing'
+
+    unitPXCloThinness = 350
+    unitPXCloTopCut = 400
+    unitPXCloBottomShortness = 350
+
+    gs 'UnitAppearance', 'SaloGenerateRows', $ARGS[1], ''
+
+    unitPXCloThinness = 300
+    unitPXCloTopCut = 350
+    unitPXCloBottomShortness = 300
+
+    gs 'UnitAppearance', 'SaloGenerateRows', $ARGS[1], ''
+
+    unitPXCloThinness = 250
+    unitPXCloTopCut = 300
+    unitPXCloBottomShortness = 250
+
+    gs 'UnitAppearance', 'SaloGenerateRows', $ARGS[1], ''
+
+    unitPXCloThinness = 200
+    unitPXCloTopCut = 250
+    unitPXCloBottomShortness = 200
+
+    gs 'UnitAppearance', 'SaloGenerateRows', $ARGS[1], ''
+
+    unitPXCloThinness = 150
+    unitPXCloTopCut = 200
+    unitPXCloBottomShortness = 150
+
+    gs 'UnitAppearance', 'SaloGenerateRows', $ARGS[1], ''
+
+    unitPXCloThinness = 150
+    unitPXCloTopCut = 150
+    unitPXCloBottomShortness = 100
+
+    gs 'UnitAppearance', 'SaloGenerateRows', $ARGS[1], ''
+
+    unitPXCloThinness = 150
+    unitPXCloTopCut = 100
+    unitPXCloBottomShortness = 100
+
+    gs 'UnitAppearance', 'SaloGenerateRows', $ARGS[1], 'Least Revealing'
+
+end
+
+if $args[0] = 'SaloGenerateRows':
+
+    $unitclothingworntype = ''    
+    unitPCloQuality = 1
+    $svetadesc = '<<$ARGS[2]>> Q1'
+    gs 'UnitAppearance', 'calcHotcat', '<<$ARGS[1]>> <<$svetadesc>>'
+    unitclothingbonus1 = unitclothingbonus
+
+    unitPCloQuality = 2
+    $svetadesc = '<<$ARGS[2]>> Q2'
+    gs 'UnitAppearance', 'calcHotcat', '<<$ARGS[1]>> <<$svetadesc>>'
+    unitclothingbonus2 = unitclothingbonus
+
+    unitPCloQuality = 3
+    $svetadesc = '<<$ARGS[2]>> Q3'
+    gs 'UnitAppearance', 'calcHotcat', '<<$ARGS[1]>> <<$svetadesc>>'
+    unitclothingbonus3 = unitclothingbonus
 
+    unitPCloQuality = 4
+    $svetadesc = '<<$ARGS[2]>> Q4'
+    gs 'UnitAppearance', 'calcHotcat', '<<$ARGS[1]>> <<$svetadesc>>'
+    unitclothingbonus4 = unitclothingbonus
+
+    unitPCloQuality = 5
+    $svetadesc = '<<$ARGS[2]>> Q5'
+    gs 'UnitAppearance', 'calcHotcat', '<<$ARGS[1]>> <<$svetadesc>>'
+    unitclothingbonus5 = unitclothingbonus
+
+    unitPCloQuality = 6
+    $svetadesc = '<<$ARGS[2]>> Q6'
+    gs 'UnitAppearance', 'calcHotcat', '<<$ARGS[1]>> <<$svetadesc>>'
+    unitclothingbonus6 = unitclothingbonus
+
+    unitPCloQuality = 7
+    $svetadesc = '<<$ARGS[2]>> Q7'
+    gs 'UnitAppearance', 'calcHotcat', '<<$ARGS[1]>> <<$svetadesc>>'
+    unitclothingbonus7 = unitclothingbonus
+
+    $unitclothingworntype = 'nude'    
+    $svetadesc = '<<$ARGS[2]>> Nude'
+    gs 'UnitAppearance', 'calcHotcat', '<<$ARGS[1]>> <<$svetadesc>>'
+    unitclothingbonusnude = unitclothingbonus
+
+    if unitRowType = 1: $svetadesc = '<<$ARGS[2]>>' & gs 'UnitAppearance', 'GenRow', $svetadesc, ARGS[1]
+
+end
+
+
+
+if $ARGS[0] = 'SaveBase':
+    tunitsalo = unitsalo
+    tunitpcs_hgt = unitpcs_hgt
+    tunitstrenbuf = unitstrenbuf
+    tunitsalocatnow = unitsalocatnow
+    tunitvofat = unitvofat
+    tunitpcs_lashes = unitpcs_lashes
+    tunitpcs_eyesize = unitpcs_eyesize
+    tunitpcs_lip = unitpcs_lip
+    tunitpcs_teeth = unitpcs_teeth
+    tunitpcs_agil = unitpcs_agil
+    tunitpcs_vital = unitpcs_vital
+    tunitvidage = unitvidage
+    tunitpcs_skin = unitpcs_skin
+    tunitPXCloThinness = unitPXCloThinness
+    tunitPXCloTopCut = unitPXCloTopCut
+    tunitPXCloBottomShortness = unitPXCloBottomShortness
+    tunitPCloQuality = unitPCloQuality
+    $tunitclothingworntype = $unitclothingworntype
+    tunitbonusZ = unitbonusZ
+    tunitPShoQuality = unitPShoQuality
+    $tunitpantyworntype = $unitpantyworntype
+    $tunitbraworntype = $unitbraworntype
+    tunitpcs_lipbalm = unitpcs_lipbalm
+    tunitmopkoef = unitmopkoef
+    tunitpcs_hairbsh = unitpcs_hairbsh
+    tunitpcs_breath = unitpcs_breath
+    tunitdeodorant_on = unitdeodorant_on
+    tunitpcs_hairlng = unitpcs_hairlng
+    tunitpcs_sweat = unitpcs_sweat
+    tunitglassvnesh = unitglassvnesh
+    tunitdyevmod = unitdyevmod
+    tunitlegkoef = unitlegkoef
+    tunitsupnatvnesh = unitsupnatvnesh
+    tunitpcs_apprncbase = unitpcs_apprncbase
+    tunitResetBase = unitResetBase
+end
+
+if $ARGS[0] = 'RestoreBase':
+    unitsalo = tunitsalo
+    unitpcs_hgt = tunitpcs_hgt
+    unitstrenbuf = tunitstrenbuf
+    unitsalocatnow = tunitsalocatnow
+    unitvofat = tunitvofat
+    unitpcs_lashes = tunitpcs_lashes
+    unitpcs_eyesize = tunitpcs_eyesize
+    unitpcs_lip = tunitpcs_lip
+    unitpcs_teeth = tunitpcs_teeth
+    unitpcs_agil = tunitpcs_agil
+    unitpcs_vital = tunitpcs_vital
+    unitvidage = tunitvidage
+    unitpcs_skin = tunitpcs_skin
+    unitPXCloThinness = tunitPXCloThinness
+    unitPXCloTopCut = tunitPXCloTopCut
+    unitPXCloBottomShortness = tunitPXCloBottomShortness
+    unitPCloQuality = tunitPCloQuality
+    $unitclothingworntype = $utnitclothingworntype
+    unitbonusZ = tunitbonusZ
+    unitPShoQuality = tunitPShoQuality
+    $unitpantyworntype = $tunitpantyworntype
+    $unitbraworntype = $tunitbraworntype
+    unitpcs_lipbalm = tunitpcs_lipbalm
+    unitmopkoef = tunitmopkoef
+    unitpcs_hairbsh = tunitpcs_hairbsh
+    unitpcs_breath = tunitpcs_breath
+    unitdeodorant_on = tunitdeodorant_on
+    unitpcs_hairlng = tunitpcs_hairlng
+    unitpcs_sweat = tunitpcs_sweat
+    unitglassvnesh = tunitglassvnesh
+    unitdyevmod = tunitdyevmod
+    unitlegkoef = tunitlegkoef
+    unitsupnatvnesh = tunitsupnatvnesh
+    unitpcs_apprncbase = tunitpcs_apprncbase
+    unitResetBase = tunitResetBase
+end
 
 if $ARGS[0] = 'CurVal':
     $SvetaDesc = input("Enter a description for Sveta")
 	*clr
 	''
-	'	$svetadesc = ''<<$SvetaDesc>>'''
-	'	unitsalo = <<salo>>'
-	'	unitpcs_hgt = <<pcs_hgt>>'
-	'	unitstrenbuf = <<strenbuf>>'
-	'	unitsalocatnow = <<salocatnow>>'
-	'	unitvofat = <<vofat>>'
-	'	unitpcs_lashes = <<pcs_lashes>>'
-	'	unitpcs_eyesize = <<pcs_eyesize>>'
-	'	unitpcs_lip = <<pcs_lip>>'
-	'	unitpcs_teeth = <<pcs_teeth>>'
-	'	unitpcs_agil = <<pcs_agil>>'
-	'	unitpcs_vital = <<pcs_vital>>'
-	'	unitvidage = <<vidage>>'
-	'	unitpcs_skin = <<pcs_skin>>'
-	'	unitPXCloThinness = <<PXCloThinness>>'
-	'	unitPXCloTopCut = <<PXCloTopCut>>'
-	'	unitPXCloBottomShortness = <<PXCloBottomShortness>>'
-	'	unitPCloQuality = <<PCloQuality>>'
-	'	$unitclothingworntype = ''<<$clothingworntype>>'''
-	'	unitbonusZ = <<bonusZ>>'
-	'	unitPShoQuality = <<PShoQuality>>'
-	'	$unitpantyworntype = ''<<$pantyworntype>>'''
-	'	$unitbraworntype = ''<<$braworntype>>'''
-	'	unitpcs_lipbalm = <<pcs_lipbalm>>'
-	'	unitmopkoef = <<mopkoef>>'
-	'	unitpcs_hairbsh = <<pcs_hairbsh>>'
-	'	unitpcs_breath = <<pcs_breath>>'
-	'	unitdeodorant_on = <<deodorant_on>>'
-	'	unitpcs_hairlng = <<pcs_hairlng>>'
-	'	unitpcs_sweat = <<pcs_sweat>>'
-	'	unitglassvnesh = <<glassvnesh>>'
-	'	unitdyevmod = <<dyevmod>>'
-	'	unitlegkoef = <<legkoef>>'
-	'	unitsupnatvnesh = <<supnatvnesh>>'
-    '   unitpcs_apprncbase = 0'
-    '   unitResetBase = 1'
-	'   gs ''UnitAppearance'', ''calcHotcat'''
-	''
-    '   $svetadesc = ''Naked <<$SvetaDesc>>'''
-    '   unitPXCloThinness = 0'
-    '   unitPXCloTopCut = 0'
-    '   unitPXCloBottomShortness = 0'
-    '   unitPCloQuality = 0'
-    '   $unitclothingworntype = ''nude'''
-    '   $unitpantyworntype = '''''
-    '   $unitbraworntype = '''''
-	'   gs ''UnitAppearance'', ''calcHotcat'''
+	'    $svetadesc = ''<<$SvetaDesc>>'''
+	'    unitsalo = <<salo>>'
+	'    unitpcs_hgt = <<pcs_hgt>>'
+	'    unitstrenbuf = <<strenbuf>>'
+	'    unitsalocatnow = <<salocatnow>>'
+	'    unitvofat = <<vofat>>'
+	'    unitpcs_lashes = <<pcs_lashes>>'
+	'    unitpcs_eyesize = <<pcs_eyesize>>'
+	'    unitpcs_lip = <<pcs_lip>>'
+	'    unitpcs_teeth = <<pcs_teeth>>'
+	'    unitpcs_agil = <<pcs_agil>>'
+	'    unitpcs_vital = <<pcs_vital>>'
+	'    unitvidage = <<vidage>>'
+	'    unitpcs_skin = <<pcs_skin>>'
+	'    unitPXCloThinness = <<PXCloThinness>>'
+	'    unitPXCloTopCut = <<PXCloTopCut>>'
+	'    unitPXCloBottomShortness = <<PXCloBottomShortness>>'
+	'    unitPCloQuality = <<PCloQuality>>'
+	'    $unitclothingworntype = ''<<$clothingworntype>>'''
+	'    unitbonusZ = <<bonusZ>>'
+	'    unitPShoQuality = <<PShoQuality>>'
+	'    $unitpantyworntype = ''<<$pantyworntype>>'''
+	'    $unitbraworntype = ''<<$braworntype>>'''
+	'    unitpcs_lipbalm = <<pcs_lipbalm>>'
+	'    unitmopkoef = <<mopkoef>>'
+	'    unitpcs_hairbsh = <<pcs_hairbsh>>'
+	'    unitpcs_breath = <<pcs_breath>>'
+	'    unitdeodorant_on = <<deodorant_on>>'
+	'    unitpcs_hairlng = <<pcs_hairlng>>'
+	'    unitpcs_sweat = <<pcs_sweat>>'
+	'    unitglassvnesh = <<glassvnesh>>'
+	'    unitdyevmod = <<dyevmod>>'
+	'    unitlegkoef = <<legkoef>>'
+	'    unitsupnatvnesh = <<supnatvnesh>>'
+    '    unitpcs_apprncbase = 0'
+    '    unitResetBase = 1'
+	'    gs ''UnitAppearance'', ''GenerateSvetaOptions'', $svetadesc'
     ''
 
 end

+ 101 - 23
locations/body.qsrc

@@ -2264,12 +2264,12 @@ if $ARGS[0] = '':
 	end
 
 	!! Calculate hotcat etc
-	tempclothingbonus = FUNC('body', 'calcClothesBonus', pcs_apprncbase, PXCloThinness, PXCloTopCut, PXCloBottomShortness, PCloQuality, $clothingworntype)
+	tempclothingbonus = FUNC('body', 'calcClothesBonus', PXCloThinness, PXCloTopCut, PXCloBottomShortness, PCloQuality, $clothingworntype, bmi_calc)
 	tempAccessoriesBonus = FUNC('body', 'calcAccessoriesBonus', bonusZ, PShoQuality, $pantyworntype, $braworntype)
-	tempGroomingBonus = FUNC('body', 'calcGroomingBonus', pcs_lipbalm, mopkoef, pcs_hairbsh, pcs_breath, deodorant_on)
+	tempGroomingBonus = FUNC('body', 'calcGroomingBonus', pcs_lipbalm, mopkoef, pcs_hairbsh, pcs_breath, deodorant_on, bmi_calc)
 	tempGroomingPenalty = FUNC('body', 'calcGroomingPenalty', pcs_hairlng, pcs_sweat, glassvnesh, dyevmod, legkoef)
 	Hotcat = FUNC('body', 'calcHotcat', pcs_apprncbase, supnatvnesh, tempclothingbonus, tempAccessoriesBonus, tempGroomingBonus, tempGroomingPenalty)
-	pcs_apprnc = temppcs_apprnc & killvar 'temppcs_apprnc'
+	pcs_apprnc = temppcs_apprnc & killvar 'temppcs_apprnc' & killvar 'temppcs_maxapprnc'
 
 
 	if StrongNarkota <= 0:
@@ -2389,35 +2389,103 @@ end
 
 if $ARGS[0] = 'calcClothesBonus':
 	!! Note there is a limit of 9 args
-	temppcs_apprncbase = ARGS[1] & !! pcs_apprncbase
-	tempPXCloThinness = ARGS[2] & !! PXCloThinness
-	tempPXCloTopCut = ARGS[3] & !! PXCloTopCut
-	tempPXCloBottomShortness = ARGS[4] & !! PXCloBottomShortness
-	tempPCloQuality = ARGS[5] & !! PCloQuality
-	$tempclothingworntype = $ARGS[6] & !!$clothingworntype
+	tempPXCloThinness = ARGS[1] & !! PXCloThinness
+	tempPXCloTopCut = ARGS[2] & !! PXCloTopCut
+	tempPXCloBottomShortness = ARGS[3] & !! PXCloBottomShortness
+	tempPCloQuality = ARGS[4] & !! PCloQuality
+	$tempclothingworntype = $ARGS[5] & !!$clothingworntype
+	tempbmi_calc = ARGS[6] & !! bmi_calc
+
+	if tempbmi_calc < 16:
+		!!severely underweight
+		if $tempclothingworntype = 'nude':
+			tempRevealing = 0
+			tempPCloQuality = 1
+		else
+			tempRevealing = (400 - tempPXCloThinness) + (500 - tempPXCloTopCut) + (400 - tempPXCloBottomShortness)
+			tempRevealing = tempRevealing / 2
+		end
+	elseif tempbmi_calc >= 16 and tempbmi_calc < 19:
+		!!underweight
+		if $tempclothingworntype = 'nude':
+			tempRevealing = 0
+			tempPCloQuality = 1
+		else
+			tempRevealing = (400 - tempPXCloThinness) + (500 - tempPXCloTopCut) + (400 - tempPXCloBottomShortness)
+			tempRevealing = tempRevealing / 2
+		end
+	elseif tempbmi_calc >= 19 and tempbmi_calc < 25:
+		!!normal, healthy weight
+		if $tempclothingworntype = 'nude':
+			tempRevealing = 405
+			tempPCloQuality = 3
+		else
+			tempRevealing = tempPXCloThinness + tempPXCloTopCut + tempPXCloBottomShortness
+			tempRevealing = tempRevealing / 2
+		end
+	elseif tempbmi_calc >= 25 and tempbmi_calc < 30:
+		!!overweight
+		if $tempclothingworntype = 'nude':
+			tempRevealing = 405
+			tempPCloQuality = 3
+		else
+			tempRevealing = tempPXCloThinness + tempPXCloTopCut + tempPXCloBottomShortness
+			tempRevealing = tempRevealing / 2
+		end
+	elseif tempbmi_calc >= 30 and tempbmi_calc < 35:
+		!!moderately obese
+		if $tempclothingworntype = 'nude':
+			tempRevealing = 0
+			tempPCloQuality = 1
+		else
+			tempRevealing = (400 - tempPXCloThinness) + (500 - tempPXCloTopCut) + (400 - tempPXCloBottomShortness)
+			tempRevealing = tempRevealing * 3 / 4
+		end
+	elseif tempbmi_calc >= 35 and tempbmi_calc < 40:
+		!!severely obese
+		if $tempclothingworntype = 'nude':
+			tempRevealing = 0
+			tempPCloQuality = 1
+		else
+			tempRevealing = (400 - tempPXCloThinness) + (500 - tempPXCloTopCut) + (400 - tempPXCloBottomShortness)
+			tempRevealing = tempRevealing * 3 / 4
+		end
+	elseif tempbmi_calc >= 40 and tempbmi_calc < 45:
+		!!very severely obese
+		if $tempclothingworntype = 'nude':
+			tempRevealing = 0
+			tempPCloQuality = 1
+		else
+			tempRevealing = (400 - tempPXCloThinness) + (500 - tempPXCloTopCut) + (400 - tempPXCloBottomShortness)
+			tempRevealing = tempRevealing * 3 / 4
+		end
+	elseif tempbmi_calc >= 45:
+		!!morbidly obese
+		if $tempclothingworntype = 'nude':
+			tempRevealing = 0
+			tempPCloQuality = 1
+		else
+			tempRevealing = (400 - tempPXCloThinness) + (500 - tempPXCloTopCut) + (400 - tempPXCloBottomShortness)
+			tempRevealing = tempRevealing * 3 / 4
+		end
+	end
 
-	tempRevealing = tempPXCloThinness + tempPXCloTopCut + tempPXCloBottomShortness
+	tempRevealing = tempRevealing / 76
 
-	if $tempclothingworntype = 'nude':
-		!! needs a rethink as this is skewing the results
-		tempCloAdjustedBeauty =  0
-	else
-		tempCloAdjustedBeauty = temppcs_apprncbase * tempRevealing * tempPCloQuality / 10000
-	end
+	tempCloAdjustedBeauty = tempRevealing * tempPCloQuality
 
-	if $tempclothingworntype = 'exercise': tempCloAdjustedBeauty = tempCloAdjustedBeauty * 2 / 3
+	!!if $tempclothingworntype = 'exercise': tempCloAdjustedBeauty = tempCloAdjustedBeauty * 2 / 3
 
 	result = tempCloAdjustedBeauty
 
-	killvar 'temppcs_apprncbase'
 	killvar 'tempPXCloThinness'
 	killvar 'tempPXCloTopCut'
 	killvar 'tempPXCloBottomShortness'
 	killvar 'tempPCloQuality'
-	killvar 'tempclothingworntype'
+	killvar '$tempclothingworntype'
 	killvar 'tempRevealing'
 	killvar 'tempCloAdjustedBeauty'
-	killvar 'tempclothingbonus'
+	killvar 'tempbmi_calc'
 end
 
 if $ARGS[0] = 'calcAccessoriesBonus':
@@ -2458,6 +2526,7 @@ if $ARGS[0] = 'calcGroomingBonus':
 	temppcs_hairbsh = ARGS[3] & !! pcs_hairbsh
 	temppcs_breath = ARGS[4] & !! pcs_breath
 	tempdeodorant_on = ARGS[5] & !! deodorant_on
+	tempbmi_calc = ARGS[6] & !! bmi_calc
 
 	if temppcs_lipbalm > 0:
 		lipbalmKoef = 5
@@ -2474,6 +2543,8 @@ if $ARGS[0] = 'calcGroomingBonus':
 	!!Small bonus for wearing deodorant, if pcs_sweat is low enough
 	if tempdeodorant_on = 1 and temppcs_sweat < 20: tempGroomingBonus += 5
 
+	tempGroomingBonus = FUNC('body_shape', 'bmiadjust', tempGroomingBonus, tempbmi_calc)
+
 	result = tempGroomingBonus
 
 	killvar 'temppcs_lipbalm'
@@ -2544,9 +2615,15 @@ if $ARGS[0] = 'calcHotcat':
 
 	temppcs_apprnc = temppcs_apprncbase + tempCloAdjustedBeauty + tempAccessoriesBonus + tempGroomingBonus - tempGroomingPenalty
 	!!adjustment to make max achievable
-	temppcs_apprnc = temppcs_apprnc*200/170
+	!!temppcs_maxapprnc = temppcs_apprnc*200/170
+	temppcs_maxapprnc = temppcs_apprnc
+
+	if temppcs_maxapprnc >= 200: 
+		temppcs_apprnc = 200
+	else
+		temppcs_apprnc = temppcs_maxapprnc
+	end 
 
-	if temppcs_apprnc >= 200: temppcs_apprnc = 200
 	temppcs_apprnc = temppcs_apprnc + tempsupnatvnesh
 
 	if temppcs_apprnc < 0: temppcs_apprnc = 0
@@ -2564,7 +2641,8 @@ if $ARGS[0] = 'calcHotcat':
 	killvar 'temppcs_apprncbase'
 	killvar 'tempCloAdjustedBeauty'
 	killvar 'tempGroomingBonus'
-	killvar 'tempAccessoriesBonus'
+	killvar 'tempGroomingBonus'
+	killvar 'tempGroomingPenalty'
 end 
 
 

+ 65 - 12
locations/body_shape.qsrc

@@ -261,23 +261,31 @@ if $ARGS[0] = 'setbodykoef':
 	tempvofat = ARGS[4] & !! vofat
 
 	if tempbmi_calc < 16:
-		tempbodykoef = 35
+		!! severely underweight
+		tempbodykoef = 30
     elseif tempbmi_calc < 19:
-		tempbodykoef = 70
+		!! underweight
+		tempbodykoef = 65
     elseif tempbmi_calc < 25:
-		tempbodykoef = 90
+		!! healthy weight
+		tempbodykoef = 85
     elseif tempbmi_calc < 30:
-		tempbodykoef = 80
+		!! overweight
+		tempbodykoef = 75
     elseif tempbmi_calc < 35:
-		tempbodykoef = 50
+		!! moderately obese
+		tempbodykoef = 45
     elseif tempbmi_calc < 40:
-		tempbodykoef = 30
+		!! severely obese
+		tempbodykoef = 25
     elseif tempbmi_calc < 45:
-		tempbodykoef = 10
+		!! very severely obese
+		tempbodykoef = 5
     else
+		!! morbidly obese
 		tempbodykoef = 0
     end
-	
+
 	if tempstrenbuf >= 80:
 		tempbodykoef += 8
 	elseif tempstrenbuf >= 60:
@@ -296,6 +304,7 @@ if $ARGS[0] = 'setbodykoef':
 	elseif tempsalocatnow = 1 or tempsalocatnow = 6:
 		tempbodykoef -= 4
 	end
+
 	if tempvofat > 0: tempbodykoef -= tempvofat
 
 	result = tempbodykoef
@@ -317,6 +326,41 @@ if $ARGS[0] = 'bmicalc':
 	killvar 'tempbmi_calc'
 end
 
+if $ARGS[0] = 'bmiadjust':
+	tempValue = ARGS[1] & !!value to be adjusted
+	tempadjbmi_calc = ARGS[2] & !!bmi_calc
+
+	if tempadjbmi_calc < 16:
+		!! severely underweight
+		tempValue = tempValue * 50 / 100
+    elseif tempadjbmi_calc < 19:
+		!! underweight
+		tempValue = tempValue * 95 / 100
+    elseif tempadjbmi_calc < 25:
+		!! healthy weight
+		!! normal bonus
+    elseif tempadjbmi_calc < 30:
+		!! overweight
+		!! normal bonus
+    elseif tempadjbmi_calc < 35:
+		!! moderately obese
+		tempValue = tempValue * 90 / 100
+    elseif tempadjbmi_calc < 40:
+		!! severely obese
+		tempValue = tempValue * 55 / 100
+    elseif tempadjbmi_calc < 45:
+		!! very severely obese
+		tempValue = tempValue * 50 / 100
+    else
+		!!morbidly obese
+		tempValue = tempValue * 40 / 100
+    end
+
+	result = tempValue
+	killvar 'tempValue'
+	killvar 'tempadjbmi_calc'
+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
@@ -472,9 +516,9 @@ end
 
 if $args[0] = 'basebeautycalc':
 	if pcs_lashes <= 0: pcs_lashes = 0
-	tempHeadBonus = FUNC('body_shape', 'calcHeadBonus', pcs_lashes, pcs_eyesize, pcs_lip, pcs_teeth)
-	tempAttributeBonus = FUNC('body_shape', 'calcAttributeBonus', pcs_agil, pcs_vital)
-	pcs_apprncbase = FUNC('body_shape', 'basebeautycalc2', ARGS[1], vidage, pcs_skin, bodykoef, tempHeadBonus, tempAttributeBonus, pcs_apprncbase)
+	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)
 
 	if ARGS[1] = 0:
 !!	This is the rate of change limiter
@@ -498,7 +542,6 @@ if $args[0] = 'basebeautycalc':
 		killvar 'vneshtemp'
 	end
 
-	killvar 'tempHeadBonus'
 	killvar 'tempAttributeBonus'
 end 
 
@@ -507,6 +550,8 @@ if $ARGS[0] = 'calcHeadBonus':
 	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:
 		resnicbonus = 0
@@ -523,6 +568,7 @@ if $ARGS[0] = 'calcHeadBonus':
 	else
 		resnicbonus = 0		
 	end
+	resnicbonus = FUNC('body_shape', 'bmiadjust', resnicbonus, tempbmi_calc)
 
 !!	Setting Eye Size bonus
 	if temppcs_eyesize = 1:
@@ -534,6 +580,7 @@ if $ARGS[0] = 'calcHeadBonus':
 	else
 		glarazbonus = 0
 	end
+	glarazbonus = FUNC('body_shape', 'bmiadjust', glarazbonus, tempbmi_calc)
 
 !!	Setting the Lip size bonus
 	if temppcs_lip = 0:
@@ -547,8 +594,10 @@ if $ARGS[0] = 'calcHeadBonus':
 	else
 		lipbonus = 3
 	end
+	lipbonus = FUNC('body_shape', 'bmiadjust', lipbonus, tempbmi_calc)
 	
 	teethcalc = (5 * temppcs_teeth)
+	if teethcalc < 0: teethcalc = FUNC('body_shape', 'bmiadjust', teethcalc, tempbmi_calc)
 
 	tempHeadBonus = resnicbonus + glarazbonus + lipbonus - teethcalc
 
@@ -559,18 +608,22 @@ if $ARGS[0] = 'calcHeadBonus':
 	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)
 
 	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