body_structure.qsrc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. # body_structure
  2. ! Get the bmi-strength class
  3. ! bs_class = func('body_structure', 'get_class', pcs_bmi, strenbuf)
  4. if $ARGS[0] = 'get_class':
  5. ! bmi
  6. if ARGS[1] < 16:
  7. result = 0
  8. elseif ARGS[1] < 19:
  9. result = 100
  10. elseif ARGS[1] < 22:
  11. result = 200
  12. elseif ARGS[1] < 25:
  13. result = 300
  14. elseif ARGS[1] < 30:
  15. result = 400
  16. elseif ARGS[1] < 35:
  17. result = 500
  18. elseif ARGS[1] < 40:
  19. result = 600
  20. elseif ARGS[1] < 45:
  21. result = 700
  22. else
  23. result = 800
  24. end
  25. ! strenbuf
  26. if ARGS[2] <= 5:
  27. result += 0
  28. elseif ARGS[2] <= 10:
  29. result += 1
  30. elseif ARGS[2] <= 15:
  31. result += 2
  32. elseif ARGS[2] <= 25:
  33. result += 3
  34. elseif ARGS[2] <= 35:
  35. result += 4
  36. elseif ARGS[2] <= 50:
  37. result += 5
  38. elseif ARGS[2] <= 70:
  39. result += 6
  40. elseif ARGS[2] <= 100:
  41. result += 7
  42. elseif ARGS[2] <= 110:
  43. result += 8
  44. elseif ARGS[2] <= 120:
  45. result += 9
  46. elseif ARGS[2] <= 130:
  47. result += 10
  48. elseif ARGS[2] <= 140:
  49. result += 11
  50. elseif ARGS[2] <= 150:
  51. result += 12
  52. elseif ARGS[2] <= 160:
  53. result += 13
  54. elseif ARGS[2] <= 170:
  55. result += 14
  56. elseif ARGS[2] <= 180:
  57. result += 15
  58. elseif ARGS[2] <= 190:
  59. result += 16
  60. else
  61. result += 17
  62. end
  63. end
  64. ! Get the bmi description:
  65. ! $bodyVars['bmi_desc'] = func('body_structure', pcs_bmi)
  66. if $ARGS[0] = 'bmi_desc':
  67. if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
  68. bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], 30)
  69. if bs_temp_bs_class < 100:
  70. $result = 'You are severely underweight.'
  71. elseif bs_temp_bs_class < 200:
  72. $result = 'You are underweight'
  73. elseif bs_temp_bs_class < 300:
  74. $result = 'You have a normal, healthy weight.'
  75. elseif bs_temp_bs_class < 400:
  76. $result = 'You have a normal, healthy weight.'
  77. elseif bs_temp_bs_class < 500:
  78. $result = 'You are overweight.'
  79. elseif bs_temp_bs_class < 600:
  80. $result = 'You are moderately obese.'
  81. elseif bs_temp_bs_class < 700:
  82. $result = 'You are severely obese.'
  83. elseif bs_temp_bs_class < 800:
  84. $result = 'You are very severely obese.'
  85. else
  86. $result = 'You are morbidly obese.'
  87. end
  88. killvar 'bs_temp_bs_class'
  89. end
  90. ! Get the appearance bonus
  91. ! Appearance_bonus = func('body_structure', 'appearance_bonus', pcs_bmi, strenbuf)
  92. if $ARGS[0] = 'appearance_bonus':
  93. if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
  94. if arrsize('ARGS') = 2: ARGS[2] = strenbuf
  95. bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], ARGS[2])
  96. if bs_temp_bs_class < 100:
  97. ! starving: bmi < 16
  98. result = -10
  99. elseif bs_temp_bs_class < 200:
  100. ! underweight: 16 <= bmi < 16
  101. result = 25
  102. elseif bs_temp_bs_class < 300:
  103. ! slender: 19 <= bmi < 21
  104. result = 50
  105. elseif bs_temp_bs_class < 400:
  106. ! healthy: 21 <= bmi < 25
  107. result = 50
  108. elseif bs_temp_bs_class < 500:
  109. ! overweight: 26 <= bmi < 30
  110. result = 25
  111. elseif bs_temp_bs_class < 600:
  112. ! moderately obese: 30 <= bmi < 35
  113. result = 10
  114. elseif bs_temp_bs_class < 700:
  115. ! severely obese: 35 <= bmi < 40
  116. result = -15
  117. elseif bs_temp_bs_class < 800:
  118. ! very severely obese: 40 <= bmi < 45
  119. result = -40
  120. else
  121. ! morbidly obese: 45 <= bmi
  122. result = -80
  123. end
  124. bs_temp_bs_class = bs_temp_bs_class mod 100
  125. if bs_temp_bs_class = 0:
  126. ! 0 <= strenbuf <= 5
  127. result -= 30
  128. elseif bs_temp_bs_class = 1:
  129. ! 5 < strenbuf <= 10
  130. result -= 20
  131. elseif bs_temp_bs_class = 2:
  132. ! 10 < strenbuf <= 15
  133. result -= 15
  134. elseif bs_temp_bs_class = 3:
  135. ! 15 < strenbuf <= 25
  136. result -= 10
  137. elseif bs_temp_bs_class = 4:
  138. ! 25 < strenbuf <= 35
  139. result -= 5
  140. elseif bs_temp_bs_class = 5:
  141. ! 35 < strenbuf <= 50
  142. result += 0
  143. elseif bs_temp_bs_class = 6:
  144. ! 50 < strenbuf <= 70
  145. result += 5
  146. elseif bs_temp_bs_class = 7:
  147. ! 70 < strenbuf <= 100
  148. result += 10
  149. elseif bs_temp_bs_class = 8:
  150. ! 100 < strenbuf <= 110
  151. result += 5
  152. elseif bs_temp_bs_class = 9:
  153. ! 110 < strenbuf <= 120
  154. result += 0
  155. elseif bs_temp_bs_class = 10:
  156. ! 120 < strenbuf <= 130
  157. result -= 5
  158. elseif bs_temp_bs_class = 11:
  159. ! 130 < strenbuf <= 140
  160. result -= 15
  161. elseif bs_temp_bs_class = 12:
  162. ! 140 < strenbuf <= 150
  163. result -= 30
  164. elseif bs_temp_bs_class = 13:
  165. ! 150 < strenbuf <= 160
  166. result -= 45
  167. elseif bs_temp_bs_class = 14:
  168. ! 160 < strenbuf <= 170
  169. result -= 60
  170. elseif bs_temp_bs_class = 15:
  171. ! 170 < strenbuf <= 180
  172. result -= 75
  173. elseif bs_temp_bs_class = 16:
  174. ! 180 < strenbuf <= 190
  175. result -= 100
  176. else
  177. ! 190 < strenbuf <= 200
  178. result -= 130
  179. end
  180. killvar 'bs_temp_bs_class'
  181. end
  182. ! Get the body shape image
  183. ! $bodyVars['img'] = func('body_structure', 'body_img', pcs_bmi, strenbuf, PregChem)
  184. if $ARGS[0] = 'body_img':
  185. if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
  186. if arrsize('ARGS') = 2: ARGS[2] = strenbuf
  187. if arrsize('ARGS') = 3: ARGS[3] = PregChem
  188. ! ======= Pregnant ======= !
  189. if bdsetlock = 0 and (knowpreg = 1 or (preg = 1 and (thinkpreg = 1 or ARGS[3] > 3600))):
  190. if ARGS[3] <= 2687:
  191. $result = 'images/pc/body/shape/default_preg/0.jpg'
  192. elseif ARGS[3] <= 6215:
  193. $result = 'images/pc/body/shape/default_preg/<<((ARGS[3] - 2184)/504)>>.jpg'
  194. else
  195. $result = 'images/pc/body/shape/default_preg/8.jpg'
  196. end
  197. exit
  198. end
  199. bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], ARGS[2])
  200. if bdsetlock = 1:
  201. if fixbodset = 0:
  202. bs_temp_bs_class = 100 * (bs_temp_bs_class / 100) + 4
  203. elseif fixbodset = 1:
  204. bs_temp_bs_class = 100 * (bs_temp_bs_class / 100) + 6
  205. elseif fixbodset = 2:
  206. bs_temp_bs_class = 100 * (bs_temp_bs_class / 100) + 8
  207. else
  208. $result = func('body_structure', 'custom_body_img', bs_temp_bs_class)
  209. killvar 'bs_temp_bs_class'
  210. exit
  211. end
  212. end
  213. ! ======= starving ======= !
  214. ! ----- bmi < 16 ----- !
  215. if bs_temp_bs_class <= 17:
  216. ! 0 <= strenbuf <= 200
  217. $result = 'images/pc/body/shape/0.jpg'
  218. ! ======= underweight ======= !
  219. ! ----- 16 <= bmi < 19 ----- !
  220. elseif bs_temp_bs_class <= 105:
  221. ! 0 <= strenbuf <= 50
  222. $result = 'images/pc/body/shape/default_low/1.jpg'
  223. elseif bs_temp_bs_class <= 107:
  224. ! 51 <= strenbuf <= 100
  225. $result = 'images/pc/body/shape/default_mid/1.jpg'
  226. elseif bs_temp_bs_class <= 117:
  227. ! 101 <= strenbuf <= 200
  228. $result = 'images/pc/body/shape/default_high/1.jpg'
  229. ! ======= slender ======= !
  230. ! ----- 19 <= bmi < 21 ----- !
  231. elseif bs_temp_bs_class <= 205:
  232. ! 0 <= strenbuf <= 50
  233. $result = 'images/pc/body/shape/default_low/2.jpg'
  234. elseif bs_temp_bs_class <= 207:
  235. ! 51 <= strenbuf <= 100
  236. $result = 'images/pc/body/shape/default_mid/2.jpg'
  237. elseif bs_temp_bs_class <= 217:
  238. ! 101 <= strenbuf <= 200
  239. $result = 'images/pc/body/shape/default_high/2.jpg'
  240. ! ======= healthy ======= !
  241. ! ----- 21 <= bmi < 25 ----- !
  242. elseif bs_temp_bs_class <= 305:
  243. ! 0 <= strenbuf <= 50
  244. $result = 'images/pc/body/shape/default_low/3.jpg'
  245. elseif bs_temp_bs_class <= 307:
  246. ! 51 <= strenbuf <= 100
  247. $result = 'images/pc/body/shape/default_mid/3.jpg'
  248. elseif bs_temp_bs_class <= 317:
  249. ! 101 <= strenbuf <= 200
  250. $result = 'images/pc/body/shape/default_high/3.jpg'
  251. ! ======= overweight ======= !
  252. ! ----- 26 <= bmi < 30 ----- !
  253. elseif bs_temp_bs_class <= 405:
  254. ! 0 <= strenbuf <= 50
  255. $result = 'images/pc/body/shape/default_low/4.jpg'
  256. elseif bs_temp_bs_class <= 407:
  257. ! 51 <= strenbuf <= 100
  258. $result = 'images/pc/body/shape/default_mid/4.jpg'
  259. elseif bs_temp_bs_class <= 417:
  260. ! 101 <= strenbuf <= 200
  261. $result = 'images/pc/body/shape/default_high/4.jpg'
  262. ! ======= moderately obese ======= !
  263. ! ----- 30 <= bmi < 35 ----- !
  264. elseif bs_temp_bs_class <= 505:
  265. ! 0 <= strenbuf <= 50
  266. $result = 'images/pc/body/shape/default_low/5.jpg'
  267. elseif bs_temp_bs_class <= 507:
  268. ! 51 <= strenbuf <= 100
  269. $result = 'images/pc/body/shape/default_mid/5.jpg'
  270. elseif bs_temp_bs_class <= 517:
  271. ! 101 <= strenbuf <= 200
  272. $result = 'images/pc/body/shape/default_high/5.jpg'
  273. ! ======= severely obese ======= !
  274. ! ----- 35 <= bmi < 40 ----- !
  275. elseif bs_temp_bs_class <= 617:
  276. ! 0 <= strenbuf <= 200
  277. $result = 'images/pc/body/shape/6.jpg'
  278. ! ======= very severely obese ======= !
  279. ! ----- 40 <= bmi < 45 ----- !
  280. elseif bs_temp_bs_class <= 717:
  281. ! 0 <= strenbuf <= 200
  282. $result = 'images/pc/body/shape/7.jpg'
  283. ! ======= morbidly obese ======= !
  284. ! ----- 45 <= bmi ----- !
  285. else
  286. ! 0 <= strenbuf <= 200
  287. $result = 'images/pc/body/shape/8.jpg'
  288. end
  289. killvar 'bs_temp_bs_class'
  290. end
  291. if $ARGS[0] = 'custom_body_img':
  292. ARGS[1] = ARGS[1] / 100
  293. if ARGS[1] = 0 or ARGS[1] >= 6:
  294. if dyneval('result = imset<<ARGS[1]>>ovr[<<fixbodset>>]') = 0:
  295. $result = 'images/pc/body/shape/<<ARGS[1]>>.jpg'
  296. exit
  297. end
  298. end
  299. $result = 'images/pc/body/shape/<<$bodimgsets[((fixbodset * 10) + 9)]>>/<<ARGS[1]>>.jpg'
  300. end
  301. ! Get the body description
  302. ! $bodyVars['desc'] = func('body_structure', 'body_desc', pcs_bmi, strenbuf, PregChem)
  303. if $ARGS[0] = 'body_desc':
  304. if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
  305. if arrsize('ARGS') = 2: ARGS[2] = strenbuf
  306. if arrsize('ARGS') = 3: ARGS[3] = PregChem
  307. if knowpreg = 1 or (preg = 1 and (thinkpreg = 1 or ARGS[3] > 3600)):
  308. if ARGS[3] <= 2687:
  309. $result = 'pregnant, but not showing'
  310. elseif ARGS[3] <= 3191:
  311. $result = 'glowing'
  312. elseif ARGS[3] <= 3695:
  313. $result = 'starting to show'
  314. elseif ARGS[3] <= 4199:
  315. $result = 'clearly showing'
  316. elseif ARGS[3] <= 4703:
  317. $result = 'fairly pregnant'
  318. elseif ARGS[3] <= 5207:
  319. $result = 'quite pregnant'
  320. elseif ARGS[3] <= 5711:
  321. $result = 'very pregnant'
  322. elseif ARGS[3] <= 6215:
  323. $result = 'extremely pregnant'
  324. else
  325. $result = 'ready to pop'
  326. end
  327. exit
  328. end
  329. bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], ARGS[2])
  330. ! ======= starving ======= !
  331. ! ----- bmi < 16 ----- !
  332. if bs_temp_bs_class <= 17:
  333. ! 0 <= strenbuf <= 200
  334. $result = 'starving'
  335. ! ======= underweight ======= !
  336. ! ----- 16 <= bmi < 19 ----- !
  337. elseif bs_temp_bs_class <= 105:
  338. ! 0 <= strenbuf <= 50
  339. $result = 'underweight'
  340. elseif bs_temp_bs_class <= 107:
  341. ! 51 <= strenbuf <= 100
  342. $result = 'slight'
  343. elseif bs_temp_bs_class <= 117:
  344. ! 101 <= strenbuf <= 200
  345. $result = 'wiry'
  346. ! ======= slender ======= !
  347. ! ----- 19 <= bmi < 21 ----- !
  348. elseif bs_temp_bs_class <= 205:
  349. ! 0 <= strenbuf <= 50
  350. $result = 'slender'
  351. elseif bs_temp_bs_class <= 207:
  352. ! 51 <= strenbuf <= 100
  353. $result = 'skinny'
  354. elseif bs_temp_bs_class <= 217:
  355. ! 101 <= strenbuf <= 200
  356. $result = 'lean'
  357. ! ======= healthy ======= !
  358. ! ----- 21 <= bmi < 25 ----- !
  359. elseif bs_temp_bs_class <= 305:
  360. ! 0 <= strenbuf <= 50
  361. $result = 'healthy'
  362. elseif bs_temp_bs_class <= 307:
  363. ! 51 <= strenbuf <= 100
  364. $result = 'toned'
  365. elseif bs_temp_bs_class <= 317:
  366. ! 101 <= strenbuf <= 200
  367. $result = 'ripped'
  368. ! ======= overweight ======= !
  369. ! ----- 26 <= bmi < 30 ----- !
  370. elseif bs_temp_bs_class <= 405:
  371. ! 0 <= strenbuf <= 50
  372. $result = 'overweight'
  373. elseif bs_temp_bs_class <= 407:
  374. ! 51 <= strenbuf <= 100
  375. $result = 'curvy'
  376. elseif bs_temp_bs_class <= 417:
  377. ! 101 <= strenbuf <= 200
  378. $result = 'heavy set'
  379. ! ======= moderately obese ======= !
  380. ! ----- 30 <= bmi < 35 ----- !
  381. elseif bs_temp_bs_class <= 517:
  382. ! 0 <= strenbuf <= 200
  383. $result = 'moderately obese'
  384. ! ======= severely obese ======= !
  385. ! ----- 35 <= bmi < 40 ----- !
  386. elseif bs_temp_bs_class <= 617:
  387. ! 0 <= strenbuf <= 200
  388. $result = 'severely obese'
  389. ! ======= very severely obese ======= !
  390. ! ----- 40 <= bmi < 45 ----- !
  391. elseif bs_temp_bs_class <= 717:
  392. ! 0 <= strenbuf <= 200
  393. $result = 'very severely obese'
  394. ! ======= morbidly obese ======= !
  395. ! ----- 45 <= bmi ----- !
  396. else
  397. ! 0 <= strenbuf <= 200
  398. $result = 'morbidly obese'
  399. end
  400. killvar 'bs_temp_bs_class'
  401. end
  402. --- body_structure ---------------------------------