body_structure.qsrc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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. if $ARGS[0] = 'body_img_totals':
  65. if ARGS[0] = 000:
  66. result = 2
  67. elseif ARGS[0] = 006:
  68. result = 2
  69. elseif ARGS[0] = 100:
  70. result = 4
  71. elseif ARGS[0] = 106:
  72. result = 3
  73. elseif ARGS[0] = 200:
  74. result = 2
  75. elseif ARGS[0] = 206:
  76. result = 4
  77. elseif ARGS[0] = 207:
  78. result = 3
  79. elseif ARGS[0] = 208:
  80. result = 1
  81. elseif ARGS[0] = 210:
  82. result = 1
  83. elseif ARGS[0] = 213:
  84. result = 1
  85. elseif ARGS[0] = 215:
  86. result = 1
  87. elseif ARGS[0] = 300:
  88. result = 3
  89. elseif ARGS[0] = 306:
  90. result = 3
  91. elseif ARGS[0] = 307:
  92. result = 1
  93. elseif ARGS[0] = 308:
  94. result = 1
  95. elseif ARGS[0] = 400:
  96. result = 2
  97. elseif ARGS[0] = 406:
  98. result = 2
  99. elseif ARGS[0] = 500:
  100. result = 3
  101. elseif ARGS[0] = 506:
  102. result = 2
  103. elseif ARGS[0] = 600:
  104. result = 1
  105. elseif ARGS[0] = 700:
  106. result = 2
  107. elseif ARGS[0] = 800:
  108. result = 1
  109. end
  110. end
  111. if $ARGS[0] = 'Body_img_transform':
  112. if ARGS[1] < 006:
  113. result = 000
  114. elseif ARGS[1] < 100:
  115. result = 006
  116. elseif ARGS[1] < 106:
  117. result = 100
  118. elseif ARGS[1] < 200:
  119. result = 106
  120. elseif ARGS[1] < 206:
  121. result = 200
  122. elseif ARGS[1] = 206:
  123. result = 206
  124. elseif ARGS[1] = 207:
  125. result = 207
  126. elseif ARGS[1] < 210:
  127. result = 208
  128. elseif ARGS[1] < 213:
  129. result = 210
  130. elseif ARGS[1] < 215:
  131. result = 213
  132. elseif ARGS[1] < 300:
  133. result = 215
  134. elseif ARGS[1] < 306:
  135. result = 300
  136. elseif ARGS[1] = 306:
  137. result = 306
  138. elseif ARGS[1] = 307:
  139. result = 307
  140. elseif ARGS[1] < 310:
  141. result = 308
  142. elseif ARGS[1] < 313:
  143. result = 210
  144. elseif ARGS[1] < 315:
  145. result = 213
  146. elseif ARGS[1] < 400:
  147. result = 215
  148. elseif ARGS[1] < 406:
  149. result = 400
  150. elseif ARGS[1] < 500:
  151. result = 406
  152. elseif ARGS[1] < 506:
  153. result = 500
  154. elseif ARGS[1] < 600:
  155. result = 506
  156. elseif ARGS[1] < 700:
  157. result = 600
  158. elseif ARGS[1] < 800:
  159. result = 700
  160. else
  161. result = 800
  162. end
  163. end
  164. ! ARGS[1] = bs_class
  165. if $ARGS[0] = 'default_set_class_transform':
  166. result = ARGS[1]
  167. if cheatVars['fix_bi_set'] mod 10 = 0:
  168. result = 100 * (result / 100) + 2
  169. elseif cheatVars['fix_bi_set'] mod 10 = 1:
  170. result = 100 * (result / 100) + 6
  171. elseif cheatVars['fix_bi_set'] mod 10 = 2:
  172. result = 100 * (result / 100) + 8
  173. end
  174. if cheatVars['fix_bi_set'] / 10 mod 10 ! 9:
  175. result = (cheatVars['fix_bi_set'] / 10 mod 10) * 100 + result mod 100
  176. end
  177. end
  178. ! Get the body shape image
  179. ! $bodyVars['img'] = func('body_structure', 'body_img', pcs_bmi, strenbuf, PregChem)
  180. if $ARGS[0] = 'body_img':
  181. if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
  182. if arrsize('ARGS') = 2: ARGS[2] = strenbuf
  183. if arrsize('ARGS') = 3: ARGS[3] = PregChem
  184. ! ======= Pregnant ======= !
  185. if cheatVars['fix_bodyimg'] = 0 and (knowpreg = 1 or (preg = 1 and (thinkpreg = 1 or ARGS[3] > 3600))):
  186. if ARGS[3] <= 2687:
  187. $result = 'images/pc/body/shape/preg/0/0.jpg'
  188. elseif ARGS[3] <= 6215:
  189. $result = 'images/pc/body/shape/preg/0/<<((ARGS[3] - 2184)/504)>>.jpg'
  190. else
  191. $result = 'images/pc/body/shape/preg/0/8.jpg'
  192. end
  193. exit
  194. end
  195. bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], ARGS[2])
  196. if cheatVars['fix_bodyimg'] = 1:
  197. if cheatVars['fix_bi_set'] < 10:
  198. $result = func('body_structure', 'custom_body_img', bs_temp_bs_class)
  199. killvar 'bs_temp_bs_class'
  200. exit
  201. else
  202. bs_temp_bs_class = func('body_structure', 'default_set_class_transform', bs_temp_bs_class)
  203. end
  204. end
  205. $result = func('body_structure', 'body_img_from_class', bs_temp_bs_class)
  206. killvar 'bs_temp_bs_class'
  207. end
  208. if $ARGS[0] = 'body_img_from_class':
  209. $result = 'images/pc/body/shape/'
  210. ARGS[1] = func('body_structure', 'Body_img_transform', ARGS[1])
  211. if ARGS[1] < 100:
  212. $result += '0_starving/'
  213. elseif ARGS[1] < 200:
  214. $result += '1_underweight/'
  215. elseif ARGS[1] < 300:
  216. $result += '2_slender/'
  217. elseif ARGS[1] < 400:
  218. $result += '3_healthy/'
  219. elseif ARGS[1] < 500:
  220. $result += '4_overweight/'
  221. elseif ARGS[1] < 600:
  222. $result += '5_modobese/'
  223. elseif ARGS[1] < 700:
  224. $result += '6_sevobese/'
  225. elseif ARGS[1] < 800:
  226. $result += '7_vsevobese/'
  227. else
  228. $result += '8_morobese/'
  229. end
  230. if ARGS[1] mod 100 = 0:
  231. $result += '0_low_'
  232. elseif ARGS[1] mod 100 = 6:
  233. $result += '6_mid_'
  234. elseif ARGS[1] mod 100 = 7:
  235. $result += '7_high_'
  236. elseif ARGS[1] mod 100 = 8:
  237. $result += '8_strong_'
  238. elseif ARGS[1] mod 100 = 10:
  239. $result += '10_vstrong_'
  240. elseif ARGS[1] mod 100 = 13:
  241. $result += '13_bbuilder_'
  242. elseif ARGS[1] mod 100 = 15:
  243. $result += '15_hulk_'
  244. end
  245. temp_img_totals = func('body_structure', 'body_img_totals', ARGS[1])
  246. if arrsize('ARGS') <= 2:
  247. temp_img_chosen = rand(0, temp_img_totals-1)
  248. elseif ARGS[2] < 0:
  249. temp_img_chosen = 0
  250. elseif ARGS[2] < temp_img_totals:
  251. temp_img_chosen = ARGS[2]
  252. else
  253. temp_img_chosen = temp_img_totals - 1
  254. end
  255. $result += '<<temp_img_chosen>>.jpg'
  256. killvar 'temp_img_totals'
  257. killvar 'bs_temp_bs_class'
  258. end
  259. if $ARGS[0] = 'custom_body_img':
  260. ARGS[1] = ARGS[1] / 100
  261. $temp_img_name = $cheatVars['fix_biset_<<cheatVars[''fix_bi_set'']>>_img_<<ARGS[1]>>']
  262. if $temp_img_name = '':
  263. $result = func('body_structure', 'body_img_from_class', ARGS[1] * 100)
  264. killvar '$temp_img_name'
  265. exit
  266. end
  267. $temp_base_folder = 'images/pc/body/shape/' + $cheatVars['fix_biset_<<cheatVars[''fix_bi_set'']>>_folder']
  268. $result = '<<$temp_base_folder>>/<<$temp_img_name>>.jpg'
  269. killvar '$temp_base_folder'
  270. killvar '$temp_img_name'
  271. end
  272. ! Get the body description
  273. ! $bodyVars['desc'] = func('body_structure', 'body_desc', pcs_bmi, strenbuf, PregChem)
  274. if $ARGS[0] = 'body_desc':
  275. if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
  276. if arrsize('ARGS') = 2: ARGS[2] = strenbuf
  277. if arrsize('ARGS') = 3: ARGS[3] = PregChem
  278. if knowpreg = 1 or (preg = 1 and (thinkpreg = 1 or ARGS[3] > 3600)):
  279. if ARGS[3] <= 2687:
  280. $result = 'pregnant, but not showing'
  281. elseif ARGS[3] <= 3191:
  282. $result = 'glowing'
  283. elseif ARGS[3] <= 3695:
  284. $result = 'starting to show'
  285. elseif ARGS[3] <= 4199:
  286. $result = 'clearly showing'
  287. elseif ARGS[3] <= 4703:
  288. $result = 'fairly pregnant'
  289. elseif ARGS[3] <= 5207:
  290. $result = 'quite pregnant'
  291. elseif ARGS[3] <= 5711:
  292. $result = 'very pregnant'
  293. elseif ARGS[3] <= 6215:
  294. $result = 'extremely pregnant'
  295. else
  296. $result = 'ready to pop'
  297. end
  298. exit
  299. end
  300. bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], ARGS[2])
  301. if cheatVars['fix_bodyimg'] = 1:
  302. if cheatVars['fix_bi_set'] < 10:
  303. $result = func('body_structure', 'custom_body_desc', bs_temp_bs_class)
  304. killvar 'bs_temp_bs_class'
  305. exit
  306. else
  307. bs_temp_bs_class = func('body_structure', 'default_set_class_transform', bs_temp_bs_class)
  308. end
  309. end
  310. $result = func('body_structure', 'body_desc_from_class', bs_temp_bs_class)
  311. killvar 'bs_temp_bs_class'
  312. end
  313. if $ARGS[0] = 'body_desc_from_class':
  314. ! ======= starving ======= !
  315. ! ----- bmi < 16 ----- !
  316. if ARGS[1] <= 17:
  317. ! 0 <= strenbuf <= 200
  318. $result = 'starving'
  319. ! ======= underweight ======= !
  320. ! ----- 16 <= bmi < 19 ----- !
  321. elseif ARGS[1] <= 105:
  322. ! 0 <= strenbuf <= 50
  323. $result = 'underweight'
  324. elseif ARGS[1] <= 107:
  325. ! 51 <= strenbuf <= 100
  326. $result = 'slight'
  327. elseif ARGS[1] <= 117:
  328. ! 101 <= strenbuf <= 200
  329. $result = 'wiry'
  330. ! ======= slender ======= !
  331. ! ----- 19 <= bmi < 22 ----- !
  332. elseif ARGS[1] <= 205:
  333. ! 0 <= strenbuf <= 50
  334. $result = 'slender'
  335. elseif ARGS[1] <= 207:
  336. ! 51 <= strenbuf <= 100
  337. $result = 'skinny'
  338. elseif ARGS[1] <= 217:
  339. ! 101 <= strenbuf <= 200
  340. $result = 'lean'
  341. ! ======= healthy ======= !
  342. ! ----- 22 <= bmi < 25 ----- !
  343. elseif ARGS[1] <= 305:
  344. ! 0 <= strenbuf <= 50
  345. $result = 'healthy'
  346. elseif ARGS[1] <= 307:
  347. ! 51 <= strenbuf <= 100
  348. $result = 'toned'
  349. elseif ARGS[1] <= 317:
  350. ! 101 <= strenbuf <= 200
  351. $result = 'ripped'
  352. ! ======= overweight ======= !
  353. ! ----- 26 <= bmi < 30 ----- !
  354. elseif ARGS[1] <= 405:
  355. ! 0 <= strenbuf <= 50
  356. $result = 'overweight'
  357. elseif ARGS[1] <= 407:
  358. ! 51 <= strenbuf <= 100
  359. $result = 'curvy'
  360. elseif ARGS[1] <= 417:
  361. ! 101 <= strenbuf <= 200
  362. $result = 'heavy set'
  363. ! ======= moderately obese ======= !
  364. ! ----- 30 <= bmi < 35 ----- !
  365. elseif ARGS[1] <= 517:
  366. ! 0 <= strenbuf <= 200
  367. $result = 'moderately obese'
  368. ! ======= severely obese ======= !
  369. ! ----- 35 <= bmi < 40 ----- !
  370. elseif ARGS[1] <= 617:
  371. ! 0 <= strenbuf <= 200
  372. $result = 'severely obese'
  373. ! ======= very severely obese ======= !
  374. ! ----- 40 <= bmi < 45 ----- !
  375. elseif ARGS[1] <= 717:
  376. ! 0 <= strenbuf <= 200
  377. $result = 'very severely obese'
  378. ! ======= morbidly obese ======= !
  379. ! ----- 45 <= bmi ----- !
  380. else
  381. ! 0 <= strenbuf <= 200
  382. $result = 'morbidly obese'
  383. end
  384. end
  385. if $ARGS[0] = 'custom_body_desc':
  386. ARGS[1] = ARGS[1] / 100
  387. $temp_bs_body_desc = $cheatVars['fix_biset_<<cheatVars[''fix_bi_set'']>>_desc_<<ARGS[1]>>']
  388. if $temp_bs_body_desc = '':
  389. $temp_bs_body_desc = func('body_structure', 'body_desc_from_class', ARGS[1] * 100)
  390. end
  391. $result = $temp_bs_body_desc
  392. killvar '$temp_bs_body_desc'
  393. end
  394. ! Get the bmi description:
  395. ! $bodyVars['bmi_desc'] = func('body_structure', pcs_bmi)
  396. if $ARGS[0] = 'bmi_desc':
  397. if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
  398. bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], 30)
  399. $result = func('body_structure', 'bmi_desc_from_class', bs_temp_bs_class)
  400. killvar 'bs_temp_bs_class'
  401. end
  402. if $ARGS[0] = 'bmi_desc_from_class':
  403. if ARGS[1] < 100:
  404. $result = 'You are severely underweight.'
  405. elseif ARGS[1] < 200:
  406. $result = 'You are underweight'
  407. elseif ARGS[1] < 300:
  408. $result = 'You have a normal, healthy weight.'
  409. elseif ARGS[1] < 400:
  410. $result = 'You have a normal, healthy weight.'
  411. elseif ARGS[1] < 500:
  412. $result = 'You are overweight.'
  413. elseif ARGS[1] < 600:
  414. $result = 'You are moderately obese.'
  415. elseif ARGS[1] < 700:
  416. $result = 'You are severely obese.'
  417. elseif ARGS[1] < 800:
  418. $result = 'You are very severely obese.'
  419. else
  420. $result = 'You are morbidly obese.'
  421. end
  422. end
  423. ! Get the appearance bonus
  424. ! Appearance_bonus = func('body_structure', 'appearance_bonus', pcs_bmi, strenbuf)
  425. if $ARGS[0] = 'appearance_bonus':
  426. if arrsize('ARGS') = 1: ARGS[1] = pcs_bmi
  427. if arrsize('ARGS') = 2: ARGS[2] = strenbuf
  428. bs_temp_bs_class = func('body_structure', 'get_class', ARGS[1], ARGS[2])
  429. result = func('body_structure', 'appearance_bonus_from_class', bs_temp_bs_class)
  430. killvar 'bs_temp_bs_class'
  431. end
  432. if $ARGS[0] = 'appearance_bonus_from_class':
  433. if ARGS[1] < 100:
  434. ! starving: bmi < 16
  435. result = -10
  436. elseif ARGS[1] < 200:
  437. ! underweight: 16 <= bmi < 16
  438. result = 25
  439. elseif ARGS[1] < 300:
  440. ! slender: 19 <= bmi < 21
  441. result = 50
  442. elseif ARGS[1] < 400:
  443. ! healthy: 21 <= bmi < 25
  444. result = 50
  445. elseif ARGS[1] < 500:
  446. ! overweight: 26 <= bmi < 30
  447. result = 25
  448. elseif ARGS[1] < 600:
  449. ! moderately obese: 30 <= bmi < 35
  450. result = 10
  451. elseif ARGS[1] < 700:
  452. ! severely obese: 35 <= bmi < 40
  453. result = -15
  454. elseif ARGS[1] < 800:
  455. ! very severely obese: 40 <= bmi < 45
  456. result = -40
  457. else
  458. ! morbidly obese: 45 <= bmi
  459. result = -80
  460. end
  461. ARGS[1] = ARGS[1] mod 100
  462. if ARGS[1] = 0:
  463. ! 0 <= strenbuf <= 5
  464. result -= 30
  465. elseif ARGS[1] = 1:
  466. ! 5 < strenbuf <= 10
  467. result -= 20
  468. elseif ARGS[1] = 2:
  469. ! 10 < strenbuf <= 15
  470. result -= 15
  471. elseif ARGS[1] = 3:
  472. ! 15 < strenbuf <= 25
  473. result -= 10
  474. elseif ARGS[1] = 4:
  475. ! 25 < strenbuf <= 35
  476. result -= 5
  477. elseif ARGS[1] = 5:
  478. ! 35 < strenbuf <= 50
  479. result += 0
  480. elseif ARGS[1] = 6:
  481. ! 50 < strenbuf <= 70
  482. result += 5
  483. elseif ARGS[1] = 7:
  484. ! 70 < strenbuf <= 100
  485. result += 10
  486. elseif ARGS[1] = 8:
  487. ! 100 < strenbuf <= 110
  488. result += 5
  489. elseif ARGS[1] = 9:
  490. ! 110 < strenbuf <= 120
  491. result += 0
  492. elseif ARGS[1] = 10:
  493. ! 120 < strenbuf <= 130
  494. result -= 5
  495. elseif ARGS[1] = 11:
  496. ! 130 < strenbuf <= 140
  497. result -= 15
  498. elseif ARGS[1] = 12:
  499. ! 140 < strenbuf <= 150
  500. result -= 30
  501. elseif ARGS[1] = 13:
  502. ! 150 < strenbuf <= 160
  503. result -= 45
  504. elseif ARGS[1] = 14:
  505. ! 160 < strenbuf <= 170
  506. result -= 60
  507. elseif ARGS[1] = 15:
  508. ! 170 < strenbuf <= 180
  509. result -= 75
  510. elseif ARGS[1] = 16:
  511. ! 180 < strenbuf <= 190
  512. result -= 100
  513. else
  514. ! 190 < strenbuf <= 200
  515. result -= 130
  516. end
  517. end
  518. --- body_structure ---------------------------------