123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- # 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'
- }
- clothingBonus = func('AppearanceSystem', 'CalcClothingBonus')
- accessoriesBonus = func('AppearanceSystem', 'CalcAccessoriesBonus', bonusZ, PShoQuality)
- groomingBonus = func('AppearanceSystem', 'CalcGroomingBonus')
- groomingPenalty = func('AppearanceSystem', 'CalcGroomingPenalty')
- stdPenalty = func('AppearanceSystem', 'CalcSTDPenalty')
- pcs_apprnc = func('AppearanceSystem', 'CalcAppearance', supnatvnesh)
- pcs_hotcat = func('AppearanceSystem', 'ConvertToHotcat', pcs_apprnc)
- killvar 'clothingBonus'
- killvar 'accessoriesBonus'
- killvar 'groomingBonus'
- killvar 'groomingPenalty'
- end
- if $args[0] = 'UpdateBaseAppearance':
- !{
- 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), attributes (endurance and agility)
- }
- attributeBonus = func('AppearanceSystem', 'CalcAttributeBonus')
- skinBonus = pcs_skin / 10
- bodyShapeBonus = func('AppearanceSystem', 'SetBodyShapeBonus')
- visibleAgePenalty = func('AppearanceSystem', 'CalcVisibleAgePenalty')
- teethPenalty = func('AppearanceSystem', 'CalcTeethPenalty')
- ! Calculte base appearance
- pcs_apprncbase = 30 + skinBonus + bodyShapeBonus + attributeBonus - visibleAgePenalty - teethPenalty + supnatvnesh
- end
- if $ARGS[0] = 'CalcFaceBonus':
- !! Setting Eyelashes bonus
- if pcs_lashes <= 0:
- eyelashesBonus = 0
- elseif pcs_lashes = 1:
- eyelashesBonus = 1
- elseif pcs_lashes >= 2:
- eyelashesBonus = pcs_lashes + 1
- end
- eyelashesBonus = FUNC('AppearanceSystem', 'AdjustFromBMI', eyelashesBonus)
- !! Setting Eye Size bonus
- if pcs_eyesize <= 1:
- eyeSizeBonus = pcs_eyesize
- elseif pcs_eyesize = 2:
- eyeSizeBonus = 3
- else
- eyeSizeBonus = 2
- end
- eyeSizeBonus = FUNC('AppearanceSystem', 'AdjustFromBMI', eyeSizeBonus)
- !! Setting the Lip size bonus
- if pcs_lip <= 0:
- lipBonus = -2
- elseif pcs_lip <= 2:
- lipBonus = pcs_lip - 1
- else
- lipBonus = 3
- end
- lipBonus = FUNC('AppearanceSystem', 'AdjustFromBMI', lipBonus)
- result = eyelashesBonus + eyeSizeBonus + lipBonus
- end
- if $ARGS[0] = 'CalcAttributeBonus':
- tempAttributeBonus = (pcs_agil + pcs_vital) / 5
- result = func('AppearanceSystem', 'AdjustFromBMI', tempAttributeBonus)
- killvar 'tempAttributeBonus'
- end
- if $ARGS[0] = 'CalcVisibleAgePenalty':
- if vidage < 20: tempAttributePenalty = (5*(20 - vidage) + 1) / 2
- result = func('AppearanceSystem', 'AdjustFromBMI', tempAttributePenalty)
- killvar 'tempAttributePenalty'
- end
- if $ARGS[0] = 'CalcTeethPenalty':
- if pcs_teeth > 0:
- tempAttributePenalty = 10 * pcs_teeth
- elseif pcs_teeth = 0:
- tempAttributePenalty = 5
- else
- tempAttributePenalty = 0
- end
- if pcs_missing_teeth > 0:
- tempAttributePenalty += 10 * pcs_missing_teeth
- end
- result = func('AppearanceSystem', 'AdjustFromBMI', tempAttributePenalty)
- killvar 'tempAttributePenalty'
- 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
- ! Succubus gets maximum appearance bonus
- elseif succubusflag > 0:
- result = func('body_structure', 'appearance_bonus', 22, 90)
- !!Setting the pcs_apprnc bonus based on fat and strength
- else
- result = func('body_structure', 'appearance_bonus')
- !!This modifies bodykoef for high or low pcs_mass['body'] values
- if pcs_mass['body'] < 8 or pcs_mass['body'] >= 98:
- result -= 8
- elseif pcs_mass['body'] < 23 or pcs_mass['body'] >= 83:
- result -= 4
- end
- result -= max(0, bodyVars['vofat'])
- end
- end
- if $ARGS[0] = 'CalcClothingBonus':
- if $clothingworntype = 'nude':
- if func('pcs_has_attr', 'OR', 'body_bmi_normal', 'body_bmi_overweight'):
- ! Healthy and overweight
- result = 15
- else
- result = 0
- end
- else
- if func('pcs_has_attr', 'OR', 'body_bmi_starving', 'body_bmi_underweight'):
- !Skinny and severely skinny
- tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness)) / 2
- elseif func('pcs_has_attr', 'OR', 'body_bmi_normal', 'body_bmi_overweight'):
- !Healthy and overweight
- tempRevealing = (PXCloThinness + PXCloTopCut + PXCloBottomShortness)/2
- else
- !Moderately overweight and above
- tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness)) * 3 / 4
- end
- result = tempRevealing / 76 * PCloQuality
- killvar 'tempRevealing'
- end
- end
- if $ARGS[0] = 'CalcAccessoriesBonus':
- coatQualityBonus = ARGS[1] & !! bonusZ
- shoesQualityBonus = ARGS[2] & !! PShoQuality
- !!bonuses for certain underwear
- if $pantyworntype ! 'none':
- if PPanQuality => 4:
- pantyBonus = PPanQuality - 2
- else
- pantyBonus = PPanQuality - 1
- end
- end
- if $braworntype ! 'none':
- if PBraQuality => 4:
- braBonus = PBraQuality - 2
- else
- braBonus = PBraQuality - 1
- end
- end
- result = coatQualityBonus + shoesQualityBonus + pantyBonus + braBonus
- killvar 'coatQualityBonus'
- killvar 'shoesQualityBonus'
- killvar 'pantyBonus'
- killvar 'braBonus'
- end
- if $ARGS[0] = 'CalcGroomingBonus':
- makeupBonus = pcs_makupskl/5 - 5
- if pcs_makeup = 0:
- makeupBonus = -5
- elseif pcs_makeup = 1:
- makeupBonus = 0
- elseif pcs_makeup = 5:
- makeupBonus = 30
- elseif pcs_makeup = 6 and bimbolevel >= 2:
- makeupBonus += 2 * (bimbolevel - 1)
- elseif pcs_makeup = 7:
- makeupBonus += pcs_makeupskl / 10 - 50
- end
- breathBonus = 5 * pcs_breath
- result = func('AppearanceSystem', 'AdjustFromBMI', makeupBonus + breathBonus)
- killvar 'breathBonus'
- killvar 'makeupBonus'
- end
- if $ARGS[0] = 'CalcGroomingPenalty':
- if pcs_lipbalm <= 0: lipBalmPenalty = 5
- hairPenalty = (1 - pcs_hairbsh) * 10
- !! buzzcut penalty to pcs_apprnc
- if pcs_hairlng < 10: buzzCutPenalty = 10
- !!Small penalty for not wearing deodorant, if pcs_sweat is low enough
- if deodorant_on = 0 or pcs_sweat >= 20: deodorantPenalty = 5
- 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 = 1: glassesPenalty = 10
- !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
- legPenalty = max(0, min(3 * (pcs_leghair / 3), 9))
- result = sweatPenalty + glassesPenalty + hairDyePenalty + buzzCutPenalty + legPenalty + lipBalmPenalty + hairPenalty + deodorantPenalty
- killvar 'buzzCutPenalty'
- killvar 'deodorantPenalty'
- killvar 'glassesPenalty'
- killvar 'hairDyePenalty'
- killvar 'hairPenalty'
- killvar 'legPenalty'
- killvar 'lipBalmPenalty'
- killvar 'sweatPenalty'
- end
- if $ARGS[0] = 'CalcSTDPenalty':
- if Orerpes = 1 and pcs_makeup < 4: oralHerpesPenalty = 20
- if Sifilis >= 50:
- syphilisPenalty = 250
- elseif Sifilis >= 21:
- syphilisPenalty = rand(150, 200)
- end
- if $pantyworntype = 'none' and (PCloSkirt > 3 or $clothingworntype = 'nude'):
- if GenHerpes = 1:
- if Gerpes >= 20:
- genitalHerpesPenalty = 250
- elseif Gerpes >= 10:
- genitalHerpesPenalty = 150
- elseif Gerpes >= 5:
- genitalHerpesPenalty = 25
- end
- end
- if Triper > 2:
- gonorrheaPenalty = rand(150, 200)
- end
- if Kandidoz > 30:
- yeastPenalty = rand(150, 200)
- end
- end
- result = oralHerpesPenalty + genitalHerpesPenalty + syphilisPenalty + gonorrheaPenalty + yeastPenalty
- killvar 'oralHerpesPenalty'
- killvar 'genitalHerpesPenalty'
- killvar 'syphilisPenalty'
- killvar 'gonorrheaPenalty'
- killvar 'yeastPenalty'
- end
- if $ARGS[0] = 'CalcAppearance':
- superNaturalBonus = ARGS[1] & !! supnatvnesh
- temp_apprnc = pcs_apprncbase + clothingBonus + accessoriesBonus + groomingBonus - groomingPenalty - stdPenalty
- !Any super natural bonuses are allowed to go above the max scale
- result = max(0, min(temp_apprnc, 200)) + superNaturalBonus
- killvar 'temp_apprnc'
- killvar 'superNaturalBonus'
- end
- if $ARGS[0] = 'ConvertToHotcat':
- if ARGS[1] <= 40:
- result = 1
- elseif ARGS[1] <= 60:
- result = 2
- elseif ARGS[1] <= 80:
- result = 3
- elseif ARGS[1] <= 100:
- result = 4
- elseif ARGS[1] <= 125:
- result = 5
- elseif ARGS[1] <= 150:
- result = 6
- elseif ARGS[1] <= 165:
- result = 7
- elseif ARGS[1] <= 180:
- result = 8
- elseif ARGS[1] <= 199:
- result = 9
- else
- result = 10
- end
- end
- if $ARGS[0] = 'AdjustFromBMI':
- tempValue = ARGS[1] & !!value to be adjusted
- temp_bs_class = func('body_structure', 'get_class')
- if temp_bs_class < 100:
- !! severely underweight
- result = tempValue * 50 / 100
- elseif temp_bs_class < 200:
- !! underweight
- result = tempValue * 95 / 100
- elseif temp_bs_class < 400:
- !! healthy weight
- !! normal bonus
- result = tempValue
- elseif temp_bs_class < 500:
- !! overweight
- result = tempValue * 95 / 100
- elseif temp_bs_class < 600:
- !! moderately obese
- result = tempValue * 80 / 100
- elseif temp_bs_class < 700:
- !! severely obese
- result = tempValue * 55 / 100
- elseif temp_bs_class < 800:
- !! very severely obese
- result = tempValue * 50 / 100
- else
- !!morbidly obese
- result = tempValue * 40 / 100
- end
- killvar 'tempValue'
- killvar 'temp_bs_class'
- end
- --- AppearanceSystem ---------------------------------
|