1
0

body_shape.qsrc 20 KB

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