ApperanceSystem.qsrc 8.9 KB

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