AppearanceSystem.qsrc 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. # AppearanceSystem
  2. if $ARGS[0] = '':
  3. !{
  4. PC's appearance is updated regularly in stat.qsrc.
  5. Note: A huge part of PC's appearance is from base appearance, which is updated once a day. Because it's
  6. a global variable, it does not show in this function in particular, but it's used in 'CalcAppearance'
  7. }
  8. if pcs_makeup = 6 and bimbolevel >= 2: extra_supnatvnesh = 2*bimbolevel - 2
  9. clothingBonus = func('AppearanceSystem', 'CalcClothingBonus')
  10. accessoriesBonus = func('AppearanceSystem', 'CalcAccessoriesBonus', bonusZ, PShoQuality)
  11. groomingBonus = func('AppearanceSystem', 'CalcGroomingBonus')
  12. groomingPenalty = func('AppearanceSystem', 'CalcGroomingPenalty')
  13. pcs_apprnc = func('AppearanceSystem', 'CalcAppearance', (supnatvnesh + extra_supnatvnesh))
  14. Hotcat = func('AppearanceSystem', 'ConvertToHotcat')
  15. killvar 'clothingBonus'
  16. killvar 'accessoriesBonus'
  17. killvar 'groomingBonus'
  18. killvar 'groomingPenalty'
  19. end
  20. if $args[0] = 'UpdateBaseAppearance':
  21. !{
  22. Base Appearance is updated once a day at midnight and called from cikl
  23. Base Appearance is calculated from:
  24. vidage, skin, body shape (fat and strength), attributes (endurance and agility)
  25. }
  26. attributeBonus = func('AppearanceSystem', 'CalcAttributeBonus')
  27. skinBonus = pcs_skin / 10
  28. bodyShapeBonus = func('AppearanceSystem', 'SetBodyShapeBonus')
  29. visibleAgePenalty = func('AppearanceSystem', 'CalcVisibleAgePenalty')
  30. teethPenalty = func('AppearanceSystem', 'CalcTeethPenalty')
  31. ! Calculte base appearance
  32. pcs_apprncbase = skinBonus + bodyShapeBonus + attributeBonus - visibleAgePenalty - teethPenalty + supnatvnesh
  33. end
  34. if $ARGS[0] = 'CalcFaceBonus':
  35. !! Setting Eyelashes bonus
  36. if pcs_lashes <= 0:
  37. eyelashesBonus = 0
  38. elseif pcs_lashes = 1:
  39. eyelashesBonus = 1
  40. elseif pcs_lashes = 2:
  41. eyelashesBonus = 3
  42. elseif pcs_lashes = 3:
  43. eyelashesBonus = 4
  44. elseif pcs_lashes = 4:
  45. eyelashesBonus = 5
  46. elseif pcs_lashes = 5:
  47. eyelashesBonus = 6
  48. else
  49. eyelashesBonus = 0
  50. end
  51. eyelashesBonus = FUNC('AppearanceSystem', 'AdjustFromBMI', eyelashesBonus)
  52. !! Setting Eye Size bonus
  53. if pcs_eyesize = 1:
  54. eyeSizeBonus = 1
  55. elseif pcs_eyesize = 2:
  56. eyeSizeBonus = 3
  57. elseif pcs_eyesize = 3:
  58. eyeSizeBonus = 2
  59. else
  60. eyeSizeBonus = 0
  61. end
  62. eyeSizeBonus = FUNC('AppearanceSystem', 'AdjustFromBMI', eyeSizeBonus)
  63. !! Setting the Lip size bonus
  64. if pcs_lip = 0:
  65. lipBonus = -2
  66. elseif pcs_lip = 1:
  67. lipBonus = 0
  68. elseif pcs_lip = 2:
  69. lipBonus = 1
  70. elseif pcs_lip = 3:
  71. lipBonus = 3
  72. else
  73. lipBonus = 3
  74. end
  75. lipBonus = FUNC('AppearanceSystem', 'AdjustFromBMI', lipBonus)
  76. result = eyelashesBonus + eyeSizeBonus + lipBonus
  77. end
  78. if $ARGS[0] = 'CalcAttributeBonus':
  79. tempAttributeBonus = (pcs_agil / 5) + (pcs_vital / 5)
  80. result = func('AppearanceSystem', 'AdjustFromBMI', tempAttributeBonus)
  81. killvar 'tempAttributeBonus'
  82. end
  83. if $ARGS[0] = 'CalcVisibleAgePenalty':
  84. if vidage < 20:
  85. tempAttributePenalty = func('shortgs','round_divide', (5*(20 - vidage)), 2)
  86. else
  87. tempAttributePenalty = 0
  88. end
  89. result = func('AppearanceSystem', 'AdjustFromBMI', tempAttributePenalty)
  90. killvar 'tempAttributePenalty'
  91. end
  92. if $ARGS[0] = 'CalcTeethPenalty':
  93. if pcs_teeth > 0:
  94. tempAttributePenalty = 10 * pcs_teeth
  95. elseif pcs_teeth = 0:
  96. tempAttributePenalty = 5
  97. else
  98. tempAttributePenalty = 0
  99. end
  100. if pcs_missing_teeth > 0:
  101. tempAttributePenalty += 10 * pcs_missing_teeth
  102. end
  103. result = func('AppearanceSystem', 'AdjustFromBMI', tempAttributePenalty)
  104. killvar 'tempAttributePenalty'
  105. end
  106. if $ARGS[0] = 'SetBodyShapeBonus':
  107. ! Magic uses a different calculation
  108. if dounspell = 1:
  109. bodytipe = pcs_hips - pcs_waist
  110. if bodytipe < 20:
  111. result = 0
  112. elseif bodytipe >= 20 and bodytipe < 25:
  113. result = 2
  114. elseif (bodytipe >= 25 and bodytipe < 30) or bodytipe >=35:
  115. result = 4
  116. elseif bodytipe >= 30 and bodytipe < 35:
  117. result = 8
  118. end
  119. !!Setting the pcs_apprnc bonus based on fat and strength
  120. else
  121. tempBodyShapeBonus = func('body_structure', 'appearance_bonus')
  122. !!This modifies bodykoef for high or low pcs_mass['body'] values
  123. if salocatnow = 0 or salocatnow >= 7:
  124. tempBodyShapeBonus -= 8
  125. elseif salocatnow = 1 or salocatnow = 6:
  126. tempBodyShapeBonus -= 4
  127. end
  128. if bodyVars['vofat'] > 0: tempBodyShapeBonus -= bodyVars['vofat']
  129. result = tempBodyShapeBonus
  130. killvar 'tempBodyShapeBonus'
  131. end
  132. end
  133. if $ARGS[0] = 'CalcClothingBonus':
  134. if $clothingworntype = 'nude':
  135. if pcs_bmi >= 19 and pcs_bmi < 30:
  136. ! Healthy and overweight
  137. tempRevealing = 405
  138. PCloQuality = 3
  139. else
  140. tempRevealing = 0
  141. PCloQuality = 1
  142. end
  143. else
  144. if pcs_bmi < 19:
  145. !Skinny and severely skinny
  146. tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness))/2
  147. elseif pcs_bmi >= 19 and pcs_bmi < 30:
  148. !Healthy and overweight
  149. tempRevealing = (PXCloThinness + PXCloTopCut + PXCloBottomShortness)/2
  150. elseif pcs_bmi >= 30:
  151. !Moderately overweight and above
  152. tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness)) * 3/4
  153. end
  154. end
  155. result = tempRevealing/ 76 * PCloQuality
  156. killvar 'tempRevealing'
  157. end
  158. if $ARGS[0] = 'CalcAccessoriesBonus':
  159. coatQualityBonus = ARGS[1] & !! bonusZ
  160. shoesQualityBonus = ARGS[2] & !! PShoQuality
  161. !!bonuses for certain underwear
  162. if PanQuality = 6:
  163. pantyBonus = 4
  164. elseif PanQuality = 5:
  165. pantyBonus = 3
  166. elseif PanQuality >= 3:
  167. pantyBonus = 2
  168. else
  169. pantyBonus = PanQuality - 1
  170. end
  171. if BraQuality = 6:
  172. braBonus = 4
  173. elseif BraQuality = 5:
  174. braBonus = 3
  175. elseif BraQuality >= 3:
  176. braBonus = 2
  177. else
  178. braBonus = BraQuality - 1
  179. end
  180. result = coatQualityBonus + shoesQualityBonus + pantyBonus + braBonus
  181. killvar 'coatQualityBonus'
  182. killvar 'shoesQualityBonus'
  183. killvar 'pantyBonus'
  184. killvar 'braBonus'
  185. end
  186. if $ARGS[0] = 'CalcGroomingBonus':
  187. makeupBonus = pcs_makupskl/5 - 5
  188. if pcs_makeup = 0: makeupBonus = -5
  189. if pcs_makeup = 1: makeupBonus = 0
  190. if pcs_makeup = 5: makeupBonus = 30
  191. breathBonus = pcs_breath * 5
  192. tempGroomingBonus = makeupBonus + breathBonus
  193. !result = tempGroomingBonus
  194. result = func('AppearanceSystem', 'AdjustFromBMI', tempGroomingBonus)
  195. end
  196. if $ARGS[0] = 'CalcGroomingPenalty':
  197. if pcs_lipbalm > 0:
  198. lipBalmPenalty = 0
  199. else
  200. lipBalmPenalty = 5
  201. end
  202. hairPenalty = (1 - pcs_hairbsh) * 10
  203. !! buzzcut penalty to pcs_apprnc
  204. if pcs_hairlng < 10:
  205. buzzCutPenalty = 10
  206. else
  207. buzzCutPenalty = 0
  208. end
  209. !!Small penalty for not wearing deodorant, if pcs_sweat is low enough
  210. if deodorant_on = 0 or pcs_sweat >= 20: deodorantPenalty = 5
  211. if pcs_sweat < 22:
  212. sweatPenalty = 0
  213. elseif temppcs_sweat < 38:
  214. sweatPenalty = (pcs_sweat - 10) / 4
  215. elseif temppcs_sweat < 54:
  216. sweatPenalty = (pcs_sweat - 10) / 2
  217. else
  218. sweatPenalty = 3 * (pcs_sweat - 10) / 4
  219. end
  220. !Glasses Penalty
  221. if glass >= 2 or glass = 0:
  222. glassesPenalty = 0
  223. elseif glass = 1:
  224. glassesPenalty = 10
  225. end
  226. !hair color fade penalty
  227. if pcs_haircol ! nathcol:
  228. if dyefade > 0 and dyefade < 7: hairDyePenalty = 5
  229. if dyefade = 0: hairDyePenalty = 15
  230. end
  231. ! Leg hair penalty
  232. if pcs_leghair <= 0:
  233. legPenalty = 0
  234. elseif pcs_leghair <= 3:
  235. legPenalty = 3
  236. elseif pcs_leghair <= 6:
  237. legPenalty = 6
  238. else
  239. legPenalty = 9
  240. end
  241. result = sweatPenalty + glassesPenalty + hairDyePenalty + buzzCutPenalty + legPenalty + lipBalmPenalty + hairPenalty + deodorantPenalty
  242. killvar 'buzzCutPenalty'
  243. killvar 'deodorantPenalty'
  244. killvar 'glassesPenalty'
  245. killvar 'hairDyePenalty'
  246. killvar 'hairPenalty'
  247. killvar 'legPenalty'
  248. killvar 'lipBalmPenalty'
  249. killvar 'sweatPenalty'
  250. end
  251. if $ARGS[0] = 'CalcAppearance':
  252. superNaturalBonus = ARGS[1] & !! supnatvnesh
  253. temp_apprnc = pcs_apprncbase + clothingBonus + accessoriesBonus + groomingBonus - groomingPenalty
  254. if temp_apprnc >= 200: temp_apprnc = 200
  255. if temp_apprnc < 0: temp_apprnc = 0
  256. !Any super natural bonuses are allowed to go above the max scale
  257. result = temp_apprnc + superNaturalBonus
  258. end
  259. if $ARGS[0] = 'ConvertToHotcat':
  260. if pcs_apprnc <= 40:
  261. result = 1
  262. elseif pcs_apprnc <= 60:
  263. result = 2
  264. elseif pcs_apprnc <= 80:
  265. result = 3
  266. elseif pcs_apprnc <= 100:
  267. result = 4
  268. elseif pcs_apprnc <= 125:
  269. result = 5
  270. elseif pcs_apprnc <= 150:
  271. result = 6
  272. elseif pcs_apprnc <= 165:
  273. result = 7
  274. elseif pcs_apprnc <= 180:
  275. result = 8
  276. elseif pcs_apprnc <= 199:
  277. result = 9
  278. else
  279. result = 10
  280. end
  281. end
  282. if $ARGS[0] = 'AdjustFromBMI':
  283. tempValue = ARGS[1] & !!value to be adjusted
  284. if pcs_bmi < 16:
  285. !! severely underweight
  286. tempValue = tempValue * 50 / 100
  287. elseif pcs_bmi < 19:
  288. !! underweight
  289. tempValue = tempValue * 95 / 100
  290. elseif pcs_bmi < 25:
  291. !! healthy weight
  292. !! normal bonus
  293. elseif pcs_bmi < 30:
  294. !! overweight
  295. tempValue = tempValue * 95 / 100
  296. elseif pcs_bmi < 35:
  297. !! moderately obese
  298. tempValue = tempValue * 80 / 100
  299. elseif pcs_bmi < 40:
  300. !! severely obese
  301. tempValue = tempValue * 55 / 100
  302. elseif pcs_bmi < 45:
  303. !! very severely obese
  304. tempValue = tempValue * 50 / 100
  305. else
  306. !!morbidly obese
  307. tempValue = tempValue * 40 / 100
  308. end
  309. result = tempValue
  310. killvar 'tempValue'
  311. end
  312. --- AppearanceSystem ---------------------------------