body_shape.qsrc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. # body_shape
  2. !!vhips = derived from salo in body_shape
  3. !!vhtmp = slows the change to vhips in body_shape
  4. !!wratio = waist to hips ratio set in body_shape
  5. !!bratio = band to waist ratio set in body_shape
  6. !!hratio = hip to height ratio set in body_shape
  7. !!vofat = used as a place to put extra salo at extreme high values (i.e. really, really fat) set in body_shape
  8. !!nbsize = starts at a set genetic bust size, but can be adjusted down if salo drops too low
  9. !!magicf2b = set in body_shape for the fat moved to bust
  10. !!genbsize = the set genetic bust size
  11. !!salocatnow = the current category of salo
  12. !!salocatlast = the previous category of salo
  13. !!magf2bdo = flag for magic bust increase; 0, ready; 1, do it; 2, ask; 3, no
  14. !!mgf2bnocnt = used to count the number of times a bust increase was turned down and stop asking after 3
  15. !!magtarcup = set in the dream code as the target cup size
  16. !!btwarn = used to flag if to display the gaining/losing weight message when bathing
  17. !!salolast = used when doing a soft rest to control the cycling of the main code
  18. !!sftrstflag = used to prevent a code chunk from firing on a soft reset
  19. !!Image set variables
  20. !! bodset = body image and descriptor control variable, used to indicate which image and descriptor set is in use
  21. !! $bodimgsets[x] = body shape descriptors, tens place is the set (using bodset), 0 - 7 the descriptors (using salocatnow), 8 filler, 9 is the folder name
  22. !! bdsetlock = flag to indicate set control override, 0 is use the formula to pick a set, 1 is use a fixed set
  23. !! fixbodset = the identification number of the fixed image set
  24. !! bodsetcnt = the number of sets present
  25. !! imgset6ovr[x] and imgset7ovr[x] = a flag to indicate that an image set (x) has its own image 6 and/or 7
  26. !! extended lash functionality; pcs_lashes = n are: {2, largest natural size}, {3, with temporary false lashes on or basic 2D lash extensions}, {4, with ornate false lashes on or lavish 4D extensions}, {5, with extremely ornate, 6D-style extensions} - xerya
  27. $this = 'body_shape'
  28. if $ARGS[0] = 'RegularUpdate':
  29. if dounspell = 0:
  30. gs $this, 'UpdateBodyMeasurement'
  31. pcs_weight = func($this, 'CalcWeight')
  32. pcs_bmi = func($this, 'CalcBMI')
  33. end
  34. end
  35. if $ARGS[0] = '':
  36. !!This controls the gradual change in stat to -buf
  37. if strenbuf > pcs_stren: strenbuf -= 1
  38. if strenbuf < pcs_stren: strenbuf += 1
  39. if vitalbuf > pcs_vital: vitalbuf -= 1
  40. if vitalbuf < pcs_vital: vitalbuf += 1
  41. if agilbuf > pcs_agil: agilbuf -= 1
  42. if agilbuf < pcs_agil: agilbuf += 1
  43. !!All the ratios were rounded to 2 digits and there are divide 100s at the final calc points
  44. !!Waist to hip ratio
  45. wrtemp = ((2 * vitalbuf + strenbuf + agilbuf) /4)
  46. !! Primary wratio handling
  47. if wrtemp < 11:
  48. wratio = 85 + (11 - (vitalbuf + strenbuf + agilbuf)/3)
  49. elseif wrtemp < 20:
  50. wratio = 85
  51. elseif wrtemp < 35:
  52. wratio = 85 - (wrtemp - 20) / 3
  53. elseif wrtemp < 55:
  54. wratio = 80 - (wrtemp - 35) / 4
  55. elseif wrtemp < 80:
  56. wratio = 75 - (wrtemp - 55) / 5
  57. elseif wrtemp >= 80:
  58. wratio = 70
  59. end
  60. !! High stat value edge case handling
  61. if (vitalbuf + strenbuf + agilbuf) /3 > 100: wratio -= ((vitalbuf + strenbuf)/2 - agilbuf)/5
  62. !! This is the oops and high stat gone overboard handling
  63. if wratio < 65: wratio = 65
  64. killvar 'wrtemp'
  65. !!For band to waist ratio
  66. brtemp = (2 * strenbuf + vitalbuf + agilbuf) /4
  67. if brtemp < 10:
  68. bratio = 105
  69. elseif brtemp =< 23:
  70. bratio = 106
  71. elseif brtemp =< 80:
  72. bratio = 106 + (brtemp - 23) / 3
  73. else
  74. bratio = 125
  75. end
  76. killvar 'brtemp'
  77. !!For hip to height ratio which is used to set the center point
  78. hrtemp = (2 * agilbuf + vitalbuf + strenbuf) /4
  79. if hrtemp < 35:
  80. hratio = 60
  81. elseif hrtemp < 45:
  82. hratio = 59
  83. elseif hrtemp < 60:
  84. hratio = 58
  85. elseif hrtemp < 80:
  86. hratio = 57
  87. else
  88. hratio = 56
  89. end
  90. killvar 'hrtemp'
  91. !!Salo Handling; the first part is because during a reset fat is not used and should be cleared
  92. if sftrstflag = 1 or cheatNoFat = 1:
  93. fat = 0
  94. else
  95. if fat > (17 + vitalbuf / 25): salo += 1 & fat = 0
  96. if fat < (-2 - (vitalbuf / 10)): salo -= 1 & fat = 0
  97. end
  98. !!This is the salo cap for the weight approximation
  99. if salo > 250: salo = 250
  100. !!This calculates the current salo category; ranges are 20 points, seemed to balance best if the range is x10 the hip devisor
  101. :salocatloop
  102. if salo < 10:
  103. salocatnow = 0
  104. else
  105. salocatnow = 1 + (salo - 10) / 20
  106. end
  107. !!This resets the genetic bust size (genbsize) when the cheat is used to reduce breast size (maybe other things later)
  108. if titreduc = 1:
  109. killvar 'titreduc'
  110. if genbsize > nbsize:
  111. genbsize = 2 + nbsize - nbsize mod 5
  112. end
  113. end
  114. !!This controls the movement of salo to/from bust in order of precedence
  115. if salobustdo = 0 and nbsize < genbsize and salocatnow > 2:
  116. if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
  117. nbsize += 1
  118. salo -= 3
  119. salobustdo = 1
  120. jump 'salocatloop'
  121. end
  122. if salobustdo = 0 and magf2bdo = 1 and salocatnow > salocatlast and pcs_mana >= manamax / 2 and magikDostup = 0:
  123. if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
  124. magicf2b += 1
  125. salo -= 3
  126. salobustdo = 1
  127. if magicf2b >= 2 + magtarcup * 5: magf2bdo = 0
  128. if pcs_magik < 20:
  129. pcs_mana -= 2000 / pcs_magik
  130. else
  131. mana -= 100
  132. end
  133. jump 'salocatloop'
  134. end
  135. if salobustdo = 0 and salocatnow < 2 and salocatlast >= 2 and magicf2b > 0 and magikDostup = 0:
  136. if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
  137. magicf2b -= 1
  138. salo += 3
  139. salobustdo = 1
  140. magf2bdo = 1
  141. jump 'salocatloop'
  142. end
  143. if salobustdo = 0 and salocatnow < 1 and salocatlast >= 1 and nbsize > 0:
  144. if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
  145. nbsize -= 1
  146. salo += 3
  147. salobustdo = 1
  148. jump 'salocatloop'
  149. end
  150. !!This sets which image set is to be used when the override is not set
  151. if bdsetlock = 0:
  152. if (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)):
  153. bodset = 3
  154. elseif strenbuf >= 70:
  155. bodset = 2
  156. elseif strenbuf <= 40:
  157. bodset = 0
  158. else
  159. bodset = 1
  160. end
  161. else
  162. bodset = fixbodset
  163. end
  164. !!This is if a Succubus has salo < 1
  165. if succubusflag = 1 and salo < 1:
  166. sucexcess -= 1
  167. salo += 3
  168. end
  169. !!This is if salo is still < 1
  170. if salo < 1:
  171. if fat >= 1:
  172. salo = 1
  173. fat -= 1
  174. elseif fat <= 0 and pcs_stren + pcs_vital > 0:
  175. stren_deg -= 1000
  176. vital_deg -= 1000
  177. salo = 1
  178. else
  179. if Enable_nogameover = 0:
  180. over = 3
  181. gt 'gameover'
  182. exit
  183. else
  184. pl '<font color=red><B>You starved to death, but Cheat Mode keeps you Alive.</B></font>'
  185. salo = 1
  186. end
  187. end
  188. end
  189. killvar 'tempvct' & killvar 'salobustdo'
  190. !!This is the hip calcs, 80 is the center of the current max-min range (10 - 130)
  191. vhtmp = (salo - 80) / 2
  192. if vhips > vhtmp: vhips -= 1
  193. if vhips < vhtmp: vhips += 1
  194. !! Because a reset should be updating hip size instantly (this set is a bit redundant anyway)
  195. if sftrstflag = 1: vhips = vhtmp
  196. if (pcs_hgt * hratio) / 100 + vhips > (pcs_hgt * 72) / 100:
  197. vofat = ((pcs_hgt * hratio) / 100 + vhips - (pcs_hgt * 72) / 100) / 2
  198. vhips -= vofat * 2
  199. end
  200. !!This will trigger the warning notices in the bathing code (the +/- 12 should always be +/- 11 + the max change to salo w/ fat)
  201. if salolast > salo and salo <= 12 + (20 * (salocatnow - 1)): btwarn = 1
  202. if salolast < salo and salo >= (20 * (salocatnow + 1)) - 12: btwarn = 2
  203. !!This will trigger the dream for the option to use magic to increase bust
  204. !!Three nos at the dream will lock it out (1 yes resets the count)
  205. if pcs_magik >= 5 and MagikDostup = 0 and magf2bdo = 0:
  206. if salolast < salo and salo >= (20 * (salocatnow + 1)) - 11 and tits < 10:
  207. if mgf2bnocnt < 3:
  208. magf2bdo = 2
  209. else
  210. magf2bdo = 3 & killvar 'mgf2bnocnt'
  211. end
  212. end
  213. end
  214. !!This is to deal with the possibility that salocatnow changed by more than 1 (fat burners, vitamins, plastic surgery, etc.)
  215. if salocatnow < salocatlast: salocatlast -= 1
  216. if salocatnow > salocatlast: salocatlast += 1
  217. !!This is for use in the warning code and as part of the reset routines
  218. if salolast > salo: salolast -= 1
  219. if salolast < salo: salolast += 1
  220. !!Setting the pcs_apprnc bonus based on fat and strength
  221. pcs_bmi = FUNC('body_shape', 'CalcBMI')
  222. bodykoef = FUNC('body_shape', 'setbodykoef')
  223. !!This is to clean up unused variables
  224. killvar 'normbuffpick' & killvar 'nrmbfpckct'
  225. killvar 'vmeat' & killvar 'vfat' & killvar 'Kves' & killvar 'krost'
  226. killvar 'koefvesbt' & killvar 'koefbt'
  227. end
  228. if $ARGS[0] = 'UpdateBodyMeasurement':
  229. pcs_hips = (pcs_hgt * hratio) / 100 + vhips
  230. pcs_waist = (pcs_hips * wratio) / 100 + vofat
  231. pcs_band = (pcs_waist * bratio) / 100 + vofat
  232. pcs_bust = (pcs_waist * bratio) / 100 + nbsize + magicf2b + silicone
  233. pcs_butt = (pcs_hips / 10) + silicone_butt + butt_cheat
  234. pcs_cupsize = pcs_bust - pcs_band
  235. ! Update tits size
  236. if pcs_cupsize <= 5:
  237. tits = 0
  238. $titsize = 'AA cup'
  239. elseif pcs_cupsize <= 10:
  240. tits = 1
  241. $titsize = 'A cup'
  242. elseif pcs_cupsize <= 15:
  243. tits = 2
  244. $titsize = 'B cup'
  245. elseif pcs_cupsize <= 20:
  246. tits = 3
  247. $titsize = 'C cup'
  248. elseif pcs_cupsize <= 25:
  249. tits = 4
  250. $titsize = 'D cup'
  251. elseif pcs_cupsize <= 30:
  252. tits = 5
  253. $titsize = 'E cup'
  254. elseif pcs_cupsize <= 35:
  255. tits = 6
  256. $titsize = 'F cup'
  257. elseif pcs_cupsize <= 40:
  258. tits = 7
  259. $titsize = 'G cup'
  260. elseif pcs_cupsize <= 45:
  261. tits = 8
  262. $titsize = 'H cup'
  263. elseif pcs_cupsize <= 50:
  264. tits = 9
  265. $titsize = 'I cup'
  266. elseif pcs_cupsize <= 55:
  267. tits = 10
  268. $titsize = 'J cup'
  269. else
  270. tits = 11
  271. $titsize = 'K cup'
  272. end
  273. end
  274. if $ARGS[0] = 'CalcWeight':
  275. !{pcs_weight: Svetas weight in kg
  276. Optimal Weight (170cm): 60kg, 60 salo
  277. This is an approximation, so that a sveta with a different height has the same BMI for the same salo values.
  278. The default height of 170 cm is used as a starting point. The bmi deviates by 0.06 for a deviation of 10cm and 0.4 for a deviation of 20cm.}
  279. result = 30 + salo / 2 + (pcs_hgt - 170) * 7 / 10
  280. !{Do not remove (julzor)
  281. This is the old more complex function, but it doesn''t work correctly.
  282. This variable is actually only used ONCE (except for the BMI calculation), when stripping, to see if you fall off the pole from being too heavy. I am reluctant to touch it, since the math is not explained. Maybe later.
  283. Weight = (height in cm x bottom of average weight in kilos for a 170cm female / 170cm + (hip modifier + 2 x overrun fat)/4 + cup size}
  284. !result = (pcs_hgt * 62 / 170) + (vhips + (vofat * 2)) / 4 + tits
  285. end
  286. if $ARGS[0] = 'UpdateBodyImage':
  287. if dounspell = 1:
  288. salocatnow = (pcs_hips / 10) - 5
  289. if bdsetlock = 0:
  290. if (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)):
  291. bodset = 3
  292. elseif strenbuf >= 70:
  293. bodset = 2
  294. elseif strenbuf <= 40:
  295. bodset = 0
  296. else
  297. bodset = 1
  298. end
  299. else
  300. bodset = fixbodset
  301. end
  302. elseif (knowpreg = 1 or (preg = 1 and thinkpreg = 1) or (preg = 1 and PregChem > 3600)) and bodet ! 3 and bdsetlock = 0:
  303. bodset = 3
  304. elseif preg = 0 and bodset = 3 and bdsetlock = 0:
  305. if strenbuf >= 70:
  306. bodset = 2
  307. elseif strenbuf <= 40:
  308. bodset = 0
  309. else
  310. bodset = 1
  311. end
  312. end
  313. end
  314. if $ARGS[0] = 'setbodykoef':
  315. !!Setting the pcs_apprnc bonus based on fat and strength
  316. if pcs_bmi < 16:
  317. !! severely underweight
  318. tempbodykoef = 30
  319. elseif pcs_bmi < 19:
  320. !! underweight
  321. tempbodykoef = 65
  322. elseif pcs_bmi < 25:
  323. !! healthy weight
  324. tempbodykoef = 85
  325. elseif pcs_bmi < 30:
  326. !! overweight
  327. tempbodykoef = 75
  328. elseif pcs_bmi < 35:
  329. !! moderately obese
  330. tempbodykoef = 45
  331. elseif pcs_bmi < 40:
  332. !! severely obese
  333. tempbodykoef = 25
  334. elseif pcs_bmi < 45:
  335. !! very severely obese
  336. tempbodykoef = 5
  337. else
  338. !! morbidly obese
  339. tempbodykoef = 0
  340. end
  341. if strenbuf >= 80:
  342. tempbodykoef += 8
  343. elseif strenbuf >= 60:
  344. tempbodykoef += 10
  345. elseif strenbuf >= 40:
  346. tempbodykoef += 8
  347. elseif strenbuf >= 20:
  348. tempbodykoef += 5
  349. else
  350. tempbodykoef += 2
  351. end
  352. !!This modifies bodykoef for high or low salo values
  353. if salocatnow = 0 or salocatnow >= 7:
  354. tempbodykoef -= 8
  355. elseif salocatnow = 1 or salocatnow = 6:
  356. tempbodykoef -= 4
  357. end
  358. if vofat > 0: tempbodykoef -= vofat
  359. result = tempbodykoef
  360. killvar 'tempbodykoef'
  361. end
  362. if $ARGS[0] = 'CalcBMI':
  363. result = 10000 * (30 + salo / 2 + (pcs_hgt - 170) * 7 / 10) / (pcs_hgt * pcs_hgt)
  364. end
  365. if $ARGS[0] = 'bmiadjust':
  366. tempValue = ARGS[1] & !!value to be adjusted
  367. tempadjpcs_bmi = ARGS[2] & !!pcs_bmi
  368. if tempadjpcs_bmi < 16:
  369. !! severely underweight
  370. tempValue = tempValue * 50 / 100
  371. elseif tempadjpcs_bmi < 19:
  372. !! underweight
  373. tempValue = tempValue * 95 / 100
  374. elseif tempadjpcs_bmi < 25:
  375. !! healthy weight
  376. !! normal bonus
  377. elseif tempadjpcs_bmi < 30:
  378. !! overweight
  379. tempValue = tempValue * 95 / 100
  380. elseif tempadjpcs_bmi < 35:
  381. !! moderately obese
  382. tempValue = tempValue * 80 / 100
  383. elseif tempadjpcs_bmi < 40:
  384. !! severely obese
  385. tempValue = tempValue * 55 / 100
  386. elseif tempadjpcs_bmi < 45:
  387. !! very severely obese
  388. tempValue = tempValue * 50 / 100
  389. else
  390. !!morbidly obese
  391. tempValue = tempValue * 40 / 100
  392. end
  393. result = tempValue
  394. killvar 'tempValue'
  395. killvar 'tempadjpcs_bmi'
  396. end
  397. if $ARGS[0] = 'softreset':
  398. !!This is for use in immediately updating shape if something has caused a large change in salo, primarily fat burners and plastic surgery
  399. sftrstflag = 1
  400. :resetloop
  401. if salo ! salolast:
  402. if gmstrtflag = 1: salobustdo = 1
  403. gs 'body_shape'
  404. jump 'resetloop'
  405. end
  406. !!Updates pcs_apprncbase after a reset
  407. gs 'body_shape', 'basebeautycalc', 1
  408. !!Clears the warning and reset status flags if they were set
  409. sftrstflag = 0
  410. btwarn = 0
  411. end
  412. if $ARGS[0] = 'hardreset':
  413. !!This is primarily for canceling out "dounspell" and setting salo to whatever value will result in the current hip size then balancing everything out.
  414. !!Also could be built in as a means to in-game undo "dounspell", other than the cheat.
  415. if dounspell = 1 and dounsplkil > 0:
  416. salo = 12
  417. fat = 0
  418. agilbuf = pcs_agil & strenbuf = pcs_stren & vitalbuf = pcs_vital
  419. salobustdo = 1 & sftrstflag = 1 & normbuffpick = -1
  420. gs 'body_shape'
  421. salo = (pcs_hips * 2) - ((pcs_hgt * hratio) / 50) + 80
  422. if salo < 10:
  423. salocatnow = 0
  424. else
  425. salocatnow = 1 + (salo - 10) / 20
  426. end
  427. salocatlast = salocatnow
  428. salolast = salo
  429. vhtmp = (salo - 80) / 2
  430. vhips = vhtmp
  431. if genbsize = 0 and nbsize > 0:
  432. If nbsize >= 27:
  433. genbsize = 27
  434. else
  435. genbsize = 2 + nbsize - nbsize mod 5
  436. end
  437. elseif genbsize = 0 and nbsize = 0 and silicone >= 20:
  438. genbsize = 12 & nbsize = 12 & silicone -= 10
  439. end
  440. sftrstflag = 0 & normbuffpick = 0 & btwarn = 0 & magf2bdo = 0
  441. killvar 'dounsplkil'
  442. newbdsp = 1
  443. dounspell = 0
  444. gs 'body_shape', 'basebeautycalc', 1
  445. gs 'body_shape'
  446. gs 'stat'
  447. else
  448. 'If you''re seeing this, something odd happened. Please make a bug report that the body shape hard reset improperly fired and what you were doing.'
  449. end
  450. end
  451. if $ARGS[0] = 'initial':
  452. !! Sets the genetic bust size if it was not set in the start routines
  453. if genbsize = 0:
  454. genbsize = 12 & nbsize = 12
  455. else
  456. nbsize = genbsize
  457. end
  458. agilbuf = pcs_agil & strenbuf = pcs_stren & vitalbuf = pcs_vital
  459. normbuffpick = -1 & gmstrtflag = 1
  460. !! Calling soft reset will cause the main code to cycle up to the starting value of salo
  461. gs 'body_shape', 'softreset'
  462. !! This sets/resets the controler variables
  463. salocatlast = salocatnow
  464. normbuffpick = 0 & magf2bdo = 0
  465. killvar 'gmstrtflag'
  466. newbdsp = 1
  467. !! This does all the body shape setting before the first stat call
  468. pcs_hips = (pcs_hgt * hratio) / 100 + vhips
  469. pcs_waist = (pcs_hips * wratio) / 100 + vofat
  470. pcs_band = (pcs_waist * bratio) / 100 + vofat
  471. pcs_bust = (pcs_waist * bratio) / 100 + nbsize + magicf2b + silicone
  472. pcs_cupsize = pcs_bust - pcs_band
  473. if pcs_cupsize <= 5:
  474. tits = 0
  475. $titsize = 'AA cup'
  476. elseif pcs_cupsize <= 10:
  477. tits = 1
  478. $titsize = 'A cup'
  479. elseif pcs_cupsize <= 15:
  480. tits = 2
  481. $titsize = 'B cup'
  482. elseif pcs_cupsize <= 20:
  483. tits = 3
  484. $titsize = 'C cup'
  485. elseif pcs_cupsize <= 25:
  486. tits = 4
  487. $titsize = 'D cup'
  488. elseif pcs_cupsize <= 30:
  489. tits = 5
  490. $titsize = 'E cup'
  491. elseif pcs_cupsize <= 35:
  492. tits = 6
  493. $titsize = 'F cup'
  494. elseif pcs_cupsize <= 40:
  495. tits = 7
  496. $titsize = 'G cup'
  497. elseif pcs_cupsize <= 45:
  498. tits = 8
  499. $titsize = 'H cup'
  500. elseif pcs_cupsize <= 50:
  501. tits = 9
  502. $titsize = 'I cup'
  503. elseif pcs_cupsize <= 55:
  504. tits = 10
  505. $titsize = 'J cup'
  506. else
  507. tits = 11
  508. $titsize = 'K cup'
  509. end
  510. !!pcs_weight: Svetas weight in kg
  511. !!Optimal Weight for a 170cm sveta (BMI: 20.76): 60 salo / 60kg
  512. !!This is an approximation, so that a sveta with a different height has the same BMI for the same salo values.
  513. !!The default height of 170 cm is used as a starting point for the approximation. The BMI deviates by 0.06 for a deviation of 10cm and 0.4 for a deviation of 20cm.
  514. pcs_weight = 30 + salo / 2 + (pcs_hgt - 170) * 7 / 10
  515. !!Do not remove (julzor)
  516. !!This is the old more complex function, but it doesn''t work correctly.
  517. !!This variable is actually only used ONCE (except for the BMI calculation), when stripping, to see if you fall off the pole from being too heavy. I am reluctant to touch it, since the math is not explained. Maybe later.
  518. !!Weight = (height in cm x bottom of average weight in kilos for a 170cm female / 170cm + (hip modifier + 2 x overrun fat)/4 + cup size
  519. !!pcs_weight = (pcs_hgt * 62 / 170) + (vhips + (vofat * 2)) / 4 + tits
  520. !!BMI Calculation
  521. pcs_bmi = FUNC('body_shape', 'CalcBMI')
  522. !!BMI Descriptions
  523. if pcs_bmi < 16:
  524. $bmi_desc = 'You are severely underweight.'
  525. elseif pcs_bmi >= 16 and pcs_bmi < 19:
  526. $bmi_desc = 'You are underweight'
  527. elseif pcs_bmi >= 19 and pcs_bmi < 25:
  528. $bmi_desc = 'You have a normal, healthy weight.'
  529. elseif pcs_bmi >= 25 and pcs_bmi < 30:
  530. $bmi_desc = 'You are overweight.'
  531. elseif pcs_bmi >= 30 and pcs_bmi < 35:
  532. $bmi_desc = 'You are moderately obese.'
  533. elseif pcs_bmi >= 35 and pcs_bmi < 40:
  534. $bmi_desc = 'You are severely obese.'
  535. elseif pcs_bmi >= 40 and pcs_bmi < 45:
  536. $bmi_desc = 'You are very severely obese.'
  537. elseif pcs_bmi >= 45:
  538. $bmi_desc = 'You are morbidly obese.'
  539. end
  540. end
  541. if $args[0] = 'basebeautycalc':
  542. if pcs_lashes <= 0: pcs_lashes = 0
  543. pcs_HeadBonus = FUNC('body_shape', 'calcHeadBonus')
  544. tempAttributeBonus = FUNC('body_shape', 'calcAttributeBonus')
  545. pcs_apprncbase = FUNC('body_shape', 'basebeautycalc2', ARGS[1])
  546. if ARGS[1] = 0:
  547. !! This is the rate of change limiter
  548. if pcs_apprncbase > vneshtemp:
  549. if pcs_apprncbase - 5 > vneshtemp:
  550. pcs_apprncbase -= 5
  551. elseif pcs_apprncbase - 3 > vneshtemp:
  552. pcs_apprncbase -= 3
  553. else
  554. pcs_apprncbase -= 1
  555. end
  556. elseif pcs_apprncbase < vneshtemp:
  557. if pcs_apprncbase + 5 < vneshtemp:
  558. pcs_apprncbase += 5
  559. elseif pcs_apprncbase + 3 < vneshtemp:
  560. pcs_apprncbase += 3
  561. else
  562. pcs_apprncbase += 1
  563. end
  564. end
  565. killvar 'vneshtemp'
  566. end
  567. killvar 'pcs_HeadBonus'
  568. killvar 'tempAttributeBonus'
  569. end
  570. if $ARGS[0] = 'calcHeadBonus':
  571. !! Setting Eyelashes bonus
  572. if pcs_lashes <= 0:
  573. resnicbonus = 0
  574. elseif pcs_lashes = 1:
  575. resnicbonus = 2
  576. elseif pcs_lashes = 2:
  577. resnicbonus = 5
  578. elseif pcs_lashes = 3:
  579. resnicbonus = 7
  580. elseif pcs_lashes = 4:
  581. resnicbonus = 8
  582. elseif pcs_lashes = 5:
  583. resnicbonus = 10
  584. else
  585. resnicbonus = 0
  586. end
  587. resnicbonus = FUNC('body_shape', 'bmiadjust', resnicbonus, pcs_bmi)
  588. !! Setting Eye Size bonus
  589. if pcs_eyesize = 1:
  590. glarazbonus = 1
  591. elseif pcs_eyesize = 2:
  592. glarazbonus = 3
  593. elseif pcs_eyesize = 3:
  594. glarazbonus = 2
  595. else
  596. glarazbonus = 0
  597. end
  598. glarazbonus = FUNC('body_shape', 'bmiadjust', glarazbonus, pcs_bmi)
  599. !! Setting the Lip size bonus
  600. if pcs_lip = 0:
  601. lipbonus = -2
  602. elseif pcs_lip = 1:
  603. lipbonus = 0
  604. elseif pcs_lip = 2:
  605. lipbonus = 3
  606. elseif pcs_lip = 3:
  607. lipbonus = 5
  608. else
  609. lipbonus = 3
  610. end
  611. lipbonus = FUNC('body_shape', 'bmiadjust', lipbonus, pcs_bmi)
  612. teethcalc = (5 * pcs_teeth)
  613. if teethcalc < 0: teethcalc = FUNC('body_shape', 'bmiadjust', teethcalc, pcs_bmi)
  614. result = resnicbonus + glarazbonus + lipbonus - teethcalc
  615. end
  616. if $ARGS[0] = 'calcAttributeBonus':
  617. tempAttributeBonus = (pcs_agil / 10) + (pcs_vital / 10)
  618. result = FUNC('body_shape', 'bmiadjust', tempAttributeBonus, pcs_bmi)
  619. killvar 'tempAttributeBonus'
  620. end
  621. !!This is the calculation for the base appearance if calling for testing always set ARGS[1] to 1
  622. if $args[0] = 'basebeautycalc2':
  623. !!ARGS[1] reset pcs_apprncbase
  624. !! result of pcs_HeadBonus
  625. !! result of calcAttributeBonus
  626. !! Setting vidagebonus
  627. vidagebonus = 100
  628. if vidage < 20: vidagebonus = 60 + (2 * vidage)
  629. if vidage > 30: vidagebonus = 160 - (2 * vidage)
  630. !! Preforming the calculation
  631. skincalc = (pcs_skin * 2 / 5)
  632. vneshtemp = vidagebonus * (skincalc + bodykoef + tempAttributeBonus + pcs_HeadBonus) / 100
  633. !! pcs_skin = skin condition, corrected to a 0 to 40 range; bodykoef set in main body_shape; pcs_teeth is missing teeth or cosmetically improved teeth (-1)
  634. !! This is the first limiter
  635. !!if vneshtemp > 100: vneshtemp = 100
  636. !! This adds the supernatural pcs_apprnc bonus; currently Bimbo and Succubus
  637. vneshtemp += supnatvnesh
  638. !! This is for use when a reset is called for by setting args[1] = 1
  639. if args[1] = 1: pcs_apprncbase = vneshtemp & killvar 'vneshtemp'
  640. result = pcs_apprncbase
  641. !! This is to clean up variables only used here
  642. !!do not kill vneshtemp here it gets killed in basebeautycalc
  643. killvar 'skincalc'
  644. killvar 'vidagebonus'
  645. killvar 'tempHeadBonus'
  646. killvar 'tempAttributeBonus'
  647. !! This is to unload old variables
  648. killvar 'CloNaturalBeauty'
  649. killvar 'CloBaseBeauty'
  650. killvar 'skin'
  651. killvar 'bimbobeauty'
  652. end
  653. --- body_shape ---------------------------------