AppearanceSystem.qsrc 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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. if succubusflag = 1:
  122. temp_BodyShapeBonus = func('body_bmi_stren', 'appearance_bonus', pcs_bmi, 80)
  123. else
  124. temp_BodyShapeBonus = func('body_bmi_stren', 'appearance_bonus', pcs_bmi, strenbuf)
  125. end
  126. !!This modifies bodykoef for high or low pcs_mass['body'] values
  127. if salocatnow = 0 or salocatnow >= 7:
  128. tempBodyShapeBonus -= 8
  129. elseif salocatnow = 1 or salocatnow = 6:
  130. tempBodyShapeBonus -= 4
  131. end
  132. if bodyVars['vofat'] > 0: tempBodyShapeBonus -= bodyVars['vofat']
  133. result = tempBodyShapeBonus
  134. killvar 'tempBodyShapeBonus'
  135. end
  136. end
  137. if $ARGS[0] = 'CalcClothingBonus':
  138. if $clothingworntype = 'nude':
  139. if pcs_bmi >= 19 and pcs_bmi < 30:
  140. ! Healthy and overweight
  141. tempRevealing = 405
  142. PCloQuality = 3
  143. else
  144. tempRevealing = 0
  145. PCloQuality = 1
  146. end
  147. else
  148. if pcs_bmi < 19:
  149. !Skinny and severely skinny
  150. tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness))/2
  151. elseif pcs_bmi >= 19 and pcs_bmi < 30:
  152. !Healthy and overweight
  153. tempRevealing = (PXCloThinness + PXCloTopCut + PXCloBottomShortness)/2
  154. elseif pcs_bmi >= 30:
  155. !Moderately overweight and above
  156. tempRevealing = ((400 - PXCloThinness) + (500 - PXCloTopCut) + (400 - PXCloBottomShortness)) * 3/4
  157. end
  158. end
  159. result = tempRevealing/ 76 * PCloQuality
  160. killvar 'tempRevealing'
  161. end
  162. if $ARGS[0] = 'CalcAccessoriesBonus':
  163. coatQualityBonus = ARGS[1] & !! bonusZ
  164. shoesQualityBonus = ARGS[2] & !! PShoQuality
  165. !!bonuses for certain underwear
  166. if PanQuality = 6:
  167. pantyBonus = 4
  168. elseif PanQuality = 5:
  169. pantyBonus = 3
  170. elseif PanQuality >= 3:
  171. pantyBonus = 2
  172. else
  173. pantyBonus = PanQuality - 1
  174. end
  175. if BraQuality = 6:
  176. braBonus = 4
  177. elseif BraQuality = 5:
  178. braBonus = 3
  179. elseif BraQuality >= 3:
  180. braBonus = 2
  181. else
  182. braBonus = BraQuality - 1
  183. end
  184. result = coatQualityBonus + shoesQualityBonus + pantyBonus + braBonus
  185. killvar 'coatQualityBonus'
  186. killvar 'shoesQualityBonus'
  187. killvar 'pantyBonus'
  188. killvar 'braBonus'
  189. end
  190. if $ARGS[0] = 'CalcGroomingBonus':
  191. makeupBonus = pcs_makupskl/5 - 5
  192. if pcs_makeup = 0: makeupBonus = -5
  193. if pcs_makeup = 1: makeupBonus = 0
  194. if pcs_makeup = 5: makeupBonus = 30
  195. breathBonus = pcs_breath * 5
  196. tempGroomingBonus = makeupBonus + breathBonus
  197. !result = tempGroomingBonus
  198. result = func('AppearanceSystem', 'AdjustFromBMI', tempGroomingBonus)
  199. end
  200. if $ARGS[0] = 'CalcGroomingPenalty':
  201. if pcs_lipbalm > 0:
  202. lipBalmPenalty = 0
  203. else
  204. lipBalmPenalty = 5
  205. end
  206. hairPenalty = (1 - pcs_hairbsh) * 10
  207. !! buzzcut penalty to pcs_apprnc
  208. if pcs_hairlng < 10:
  209. buzzCutPenalty = 10
  210. else
  211. buzzCutPenalty = 0
  212. end
  213. !!Small penalty for not wearing deodorant, if pcs_sweat is low enough
  214. if deodorant_on = 0 or pcs_sweat >= 20: deodorantPenalty = 5
  215. if pcs_sweat < 22:
  216. sweatPenalty = 0
  217. elseif temppcs_sweat < 38:
  218. sweatPenalty = (pcs_sweat - 10) / 4
  219. elseif temppcs_sweat < 54:
  220. sweatPenalty = (pcs_sweat - 10) / 2
  221. else
  222. sweatPenalty = 3 * (pcs_sweat - 10) / 4
  223. end
  224. !Glasses Penalty
  225. if glass >= 2 or glass = 0:
  226. glassesPenalty = 0
  227. elseif glass = 1:
  228. glassesPenalty = 10
  229. end
  230. !hair color fade penalty
  231. if pcs_haircol ! nathcol:
  232. if dyefade > 0 and dyefade < 7: hairDyePenalty = 5
  233. if dyefade = 0: hairDyePenalty = 15
  234. end
  235. ! Leg hair penalty
  236. if pcs_leghair <= 0:
  237. legPenalty = 0
  238. elseif pcs_leghair <= 3:
  239. legPenalty = 3
  240. elseif pcs_leghair <= 6:
  241. legPenalty = 6
  242. else
  243. legPenalty = 9
  244. end
  245. result = sweatPenalty + glassesPenalty + hairDyePenalty + buzzCutPenalty + legPenalty + lipBalmPenalty + hairPenalty + deodorantPenalty
  246. killvar 'buzzCutPenalty'
  247. killvar 'deodorantPenalty'
  248. killvar 'glassesPenalty'
  249. killvar 'hairDyePenalty'
  250. killvar 'hairPenalty'
  251. killvar 'legPenalty'
  252. killvar 'lipBalmPenalty'
  253. killvar 'sweatPenalty'
  254. end
  255. if $ARGS[0] = 'CalcAppearance':
  256. superNaturalBonus = ARGS[1] & !! supnatvnesh
  257. temp_apprnc = pcs_apprncbase + clothingBonus + accessoriesBonus + groomingBonus - groomingPenalty
  258. if temp_apprnc >= 200: temp_apprnc = 200
  259. if temp_apprnc < 0: temp_apprnc = 0
  260. !Any super natural bonuses are allowed to go above the max scale
  261. result = temp_apprnc + superNaturalBonus
  262. end
  263. if $ARGS[0] = 'ConvertToHotcat':
  264. if pcs_apprnc <= 40:
  265. result = 1
  266. elseif pcs_apprnc <= 60:
  267. result = 2
  268. elseif pcs_apprnc <= 80:
  269. result = 3
  270. elseif pcs_apprnc <= 100:
  271. result = 4
  272. elseif pcs_apprnc <= 125:
  273. result = 5
  274. elseif pcs_apprnc <= 150:
  275. result = 6
  276. elseif pcs_apprnc <= 165:
  277. result = 7
  278. elseif pcs_apprnc <= 180:
  279. result = 8
  280. elseif pcs_apprnc <= 199:
  281. result = 9
  282. else
  283. result = 10
  284. end
  285. end
  286. if $ARGS[0] = 'AdjustFromBMI':
  287. tempValue = ARGS[1] & !!value to be adjusted
  288. if pcs_bmi < 16:
  289. !! severely underweight
  290. tempValue = tempValue * 50 / 100
  291. elseif pcs_bmi < 19:
  292. !! underweight
  293. tempValue = tempValue * 95 / 100
  294. elseif pcs_bmi < 25:
  295. !! healthy weight
  296. !! normal bonus
  297. elseif pcs_bmi < 30:
  298. !! overweight
  299. tempValue = tempValue * 95 / 100
  300. elseif pcs_bmi < 35:
  301. !! moderately obese
  302. tempValue = tempValue * 80 / 100
  303. elseif pcs_bmi < 40:
  304. !! severely obese
  305. tempValue = tempValue * 55 / 100
  306. elseif pcs_bmi < 45:
  307. !! very severely obese
  308. tempValue = tempValue * 50 / 100
  309. else
  310. !!morbidly obese
  311. tempValue = tempValue * 40 / 100
  312. end
  313. result = tempValue
  314. killvar 'tempValue'
  315. end
  316. --- AppearanceSystem ---------------------------------