ApperanceSystem.qsrc 10 KB

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