body_shape 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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. !!normbuffpick = sets the status of using normal or buff body images and calculation
  17. !!nrmbfpckct = used to count the number of times a switch to buff was turned down and stop asking after 3
  18. !!btwarn = used to flag if to display the gaining/losing weight message when bathing
  19. !!salolast = used when doing a soft rest to control the cycling of the main code
  20. !!sftrstflag = used to prevent a code chunk from firing on a soft reset
  21. if $ARGS[0] = '':
  22. !!Fall of muscularity over time
  23. if stren >= 26 and vital >= 26 and sftrstflag = 0:
  24. if downmusl >= 5:
  25. downmusl = 0
  26. stren -= 1
  27. vital -= 1
  28. agil -= 1
  29. fat += 5
  30. else
  31. downmusl += rand (0,1)
  32. end
  33. end
  34. !!This controls the gradual change in stat to -buf
  35. if strenbuf > stren: strenbuf -= 1
  36. if strenbuf < stren: strenbuf += 1
  37. if vitalbuf > vital: vitalbuf -= 1
  38. if vitalbuf < vital: vitalbuf += 1
  39. if agilbuf > agil: agilbuf -= 1
  40. if agilbuf < agil: agilbuf += 1
  41. !!All the ratios were rounded to 2 digits and there are divide 100s at the final calc points
  42. !!Waist to hip ratio
  43. wrtemp = ((2 * vitalbuf + strenbuf + agilbuf) /4)
  44. !! Primary wratio handling
  45. if wrtemp < 11:
  46. wratio = 85 + (11 - (vitalbuf + strenbuf + agilbuf)/3)
  47. elseif wrtemp < 20:
  48. wratio = 85
  49. elseif wrtemp < 35:
  50. wratio = 85 - (wrtemp - 20) / 3
  51. elseif wrtemp < 55:
  52. wratio = 80 - (wrtemp - 35) / 4
  53. elseif wrtemp < 80:
  54. wratio = 75 - (wrtemp - 55) / 5
  55. elseif wrtemp >= 80:
  56. wratio = 70
  57. end
  58. !! High stat value edge case handling
  59. if (vitalbuf + strenbuf + agilbuf) /3 > 100: wratio -= ((vitalbuf + strenbuf)/2 - agilbuf)/5
  60. !! This is the oops and high stat gone overboard handling
  61. if wratio < 65: wratio = 65
  62. killvar 'wrtemp'
  63. !!Setting the vnesh bonus based on wratio
  64. if wratio >= 85:
  65. bodykoef = 0
  66. elseif wratio >= 80:
  67. bodykoef = 2
  68. elseif wratio >= 75:
  69. bodykoef = 4
  70. elseif wratio >= 70:
  71. bodykoef = 8
  72. else
  73. bodykoef = 4
  74. end
  75. !!For band to waist ratio
  76. brtemp = (2 * strenbuf + vitalbuf + agilbuf) /4
  77. if brtemp < 10:
  78. bratio = 105
  79. elseif brtemp =< 23:
  80. bratio = 106
  81. elseif brtemp =< 80:
  82. bratio = 106 + (brtemp - 23) / 3
  83. else
  84. bratio = 125
  85. end
  86. killvar 'brtemp'
  87. !!For hip to height ratio which is used to set the center point
  88. hrtemp = (2 * agilbuf + vitalbuf + strenbuf) /4
  89. if hrtemp < 35:
  90. hratio = 60
  91. elseif hrtemp < 45:
  92. hratio = 59
  93. elseif hrtemp < 60:
  94. hratio = 58
  95. elseif hrtemp < 80:
  96. hratio = 57
  97. else
  98. hratio = 56
  99. end
  100. killvar 'hrtemp'
  101. !!Salo Handling
  102. if salo > fat: salo -= 1
  103. if salo < fat: salo += 1
  104. !!This calculates the current salo category; ranges are 20 points, seemed to balance best if the range is x10 the hip devisor
  105. :salocatloop
  106. if salo < 10:
  107. salocatnow = 0
  108. else
  109. salocatnow = 1 + (salo - 10) / 20
  110. end
  111. !!This controls the movement of salo to/from bust in order of precedence
  112. if salobustdo = 0 and nbsize < genbsize and salocatnow > 2:
  113. if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
  114. nbsize += 1
  115. salo -= 3
  116. salobustdo = 1
  117. jump 'salocatloop'
  118. end
  119. if salobustdo = 0 and magf2bdo = 1 and salocatnow > salocatlast and manna >= mannamax / 2:
  120. if sftrstflag = 0:'<b>Your breasts seem fuller.</b>'
  121. magicf2b += 1
  122. salo -= 3
  123. salobustdo = 1
  124. if magicf2b >= 2 + magtarcup * 5: magf2bdo = 0
  125. if magik < 20:
  126. manna -= 2000 / magik
  127. else
  128. mana -= 100
  129. end
  130. jump 'salocatloop'
  131. end
  132. if salobustdo = 0 and salocatnow < 2 and salocatlast >= 2 and magicf2b > 0:
  133. if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
  134. magicf2b -= 1
  135. salo += 3
  136. salobustdo = 1
  137. magf2bdo = 1
  138. jump 'salocatloop'
  139. end
  140. if salobustdo = 0 and salocatnow < 2 and salocatlast >= 2 and nbsize > 0:
  141. if sftrstflag = 0:'<b>Your breasts seem to be getting smaller.</b>'
  142. nbsize -= 1
  143. salo += 3
  144. salobustdo = 1
  145. jump 'salocatloop'
  146. end
  147. !!This is for switching to and from the normal and buff image sets (& vital resisting salo w/ buff set)
  148. if normbuffpick = 0 and salocatnow <= 2 and (strenbuf + agilbuf) >= 50: normbuffpick = 1
  149. if normbuffpick = 1 and nrmbfpckct >= 3: normbuffpick = -1
  150. if normbuffpick >= 1 and salocatnow > 2 and vitalbuf >= 25:
  151. if vitalbuf / 25 > tempvct:
  152. tempvct += 1
  153. salo -= 1
  154. jump 'salocatloop'
  155. else
  156. normbuffpick = 0
  157. end
  158. end
  159. !!Note: normbuffpick = 1 will trigger the bathing option scene and three nos there will set normbuffpick = -1; until a choice is made, will behave as =2
  160. !!This is if salo is still < 1 (will add code for Succubus here later)
  161. if salo < 1:
  162. if fat >= 1:
  163. salo = 1
  164. if fat > 1: fat -= 1
  165. elseif fat <= 0 and stren + vital > 0:
  166. stren -= 1
  167. vital -= 1
  168. salo = 1
  169. else
  170. if Enable_nogameover = 0:
  171. over = 3
  172. gt 'gameover'
  173. exit
  174. else
  175. pl '<font color=red><B>You starved to death, but Cheat Mode keeps you Alive.</B></font>'
  176. salo = 1
  177. end
  178. end
  179. end
  180. killvar 'tempvct' & killvar 'salobustdo'
  181. !!This is the hip calcs, 80 is the center of the current max-min range (10 - 130)
  182. if normbuffpick = 2:
  183. vhtmp = (strenbuf - agilbuf) / 2
  184. else
  185. vhtmp = (salo - 80) / 2
  186. end
  187. if vhips > vhtmp: vhips -= 1
  188. if vhips < vhtmp: vhips += 1
  189. if (rost * hratio) / 100 + vhips > (rost * 72) / 100:
  190. vofat = ((rost * hratio) / 100 + vhips - (rost * 72) / 100) / 2
  191. vhips -= vofat * 2
  192. end
  193. !!This will trigger the warning notices in the bathing code (the +/- 12 should always be +/- 11 + the max change to salo w/ fat)
  194. if salolast > salo and salo <= 12 + (20 * (salocatnow - 1)): btwarn = 1
  195. if salolast < salo and salo >= (20 * (salocatnow + 1)) - 12: btwarn = 2
  196. !!This will trigger the dream for the option to use magic to increase bust
  197. !!Three nos at the dream will lock it out (1 yes resets the count)
  198. if magik >= 5 and MagikDostup = 0 and magf2bdo = 0:
  199. if salolast < salo and salo >= (20 * (salocatnow + 1)) - 11 and tits < 10:
  200. if mgf2bnocnt < 3:
  201. magf2bdo = 2
  202. else
  203. magf2bdo = 3 & killvar 'mgf2bnocnt'
  204. end
  205. end
  206. end
  207. !!This is to deal with the possibility that salocatnow changed by more than 1 (fat burners, vitamins, plastic surgery, etc.)
  208. if salocatnow < salocatlast: salocatlast -= 1
  209. if salocatnow > salocatlast: salocatlast += 1
  210. !!This is for use in the warning code
  211. if salolast > salo: salolast -= 1
  212. if salolast < salo: salolast += 1
  213. !!This accounts for higher Stats keeping the body shape stable and a bypass for resets (the plus/minus 5 is to give some working room)
  214. if salo + 5 < fat and sftrstflag = 0:
  215. if salo + 5 < fat - ((agilbuf + strenbuf + vitalbuf)/30):
  216. fat -= (agilbuf + strenbuf + vitalbuf)/30
  217. else
  218. fat = salo + 5
  219. end
  220. elseif salo - 5 > fat and sftrstflag = 0:
  221. if salo - 5 > fat + ((agilbuf + strenbuf + vitalbuf)/30):
  222. fat += (agilbuf + strenbuf + vitalbuf)/30
  223. else
  224. fat = salo - 5
  225. end
  226. end
  227. killvar 'vmeat' & killvar 'vfat' & killvar 'Kves' & killvar 'krost'
  228. killvar 'koefvesbt' & killvar 'koefbt'
  229. end
  230. if $ARGS[0] = 'softreset':
  231. !!This is for use in immediately updating shape if something has forced salo = fat by
  232. !!cycling the main code the number of times it would have normally w/ a change in fat
  233. sftrstflag = 1
  234. :resetloop
  235. if fat ! salo:
  236. if gmstrtflag = 1: salobustdo = 1
  237. gs 'body_shape'
  238. jump 'resetloop'
  239. end
  240. !!Updates vneshbase after a reset
  241. gs 'body_shape', 'basebeautycalc', 1
  242. !!Clears the warning and reset status flags if they were set
  243. sftrstflag = 0
  244. btwarn = 0
  245. end
  246. if $ARGS[0] = 'hardreset':
  247. !!This is primarily for canceling out "dounspell" and setting salo to whatever value will result in the current hip size then balancing everything out.
  248. !!Also could be built in as a means to in-game undo "dounspell", other than the cheat.
  249. if dounspell = 1 and dounsplkil > 0:
  250. fat = 12 & salo = 12
  251. agilbuf = agil & strenbuf = stren & vitalbuf = vital
  252. salobustdo = 1 & sftrstflag = 1 & normbuffpick = -1
  253. gs 'body_shape'
  254. salo = (bedra * 2) - ((rost * hratio) / 50) + 80
  255. fat = salo
  256. if salo < 10:
  257. salocatnow = 0
  258. else
  259. salocatnow = 1 + (salo - 10) / 20
  260. end
  261. salocatlast = salocatnow
  262. salolast = salo
  263. vhtmp = (salo - 80) / 2
  264. vhips = vhtmp
  265. if genbsize = 0 and nbsize > 0:
  266. If nbsize >= 27:
  267. genbsize = 27
  268. else
  269. genbsize = 2 + nbsize - nbsize mod 5
  270. end
  271. elseif genbsize = 0 and nbsize = 0 and silicone >= 20:
  272. genbsize = 12 & nbsize = 12 & silicone -= 10
  273. end
  274. sftrstflag = 0 & normbuffpick = 0 & btwarn = 0 & magf2bdo = 0
  275. killvar 'dounsplkil'
  276. newbdsp = 1
  277. dounspell = 0
  278. gs 'body_shape', 'basebeautycalc', 1
  279. gs 'body_shape'
  280. gs 'stat'
  281. else
  282. 'If you''re seeing this, something odd happened.'
  283. end
  284. end
  285. if $ARGS[0] = 'initial':
  286. if fat ! salo: fat = salo
  287. if fat <= 0: fat = 80
  288. if genbsize = 0:
  289. genbsize = 12 & nbsize = 12
  290. else
  291. nbsize = genbsize
  292. end
  293. agilbuf = agil & strenbuf = stren & vitalbuf = vital
  294. normbuffpick = -1 & gmstrtflag = 1
  295. salo = 0
  296. gs 'body_shape', 'softreset'
  297. salocatlast = salocatnow
  298. normbuffpick = 0 & magf2bdo = 0
  299. killvar 'gmstrtflag'
  300. newbdsp = 1
  301. gs 'stat'
  302. end
  303. !!This is the calculation for the base appearance
  304. if $args[0] = 'basebeautycalc':
  305. !! Setting vidagebonus
  306. vidagebonus = 100
  307. if vidage < 20: vidagebonus = 100 - 2 * (20 - vidage)
  308. if vidage > 30: vidagebonus = 100 - 2 * (vidage - 30)
  309. !! Setting Eyelashes bonus
  310. if resnic = 1:
  311. resnicbonus = 2
  312. elseif resnic = 2:
  313. resnicbonus = 5
  314. else
  315. resnicbonus = 0
  316. end
  317. !! Setting Eye Size bonus
  318. if glaraz = 1:
  319. glarazbonus = 1
  320. elseif glaraz = 2:
  321. glarazbonus = 3
  322. elseif glaraz = 3:
  323. glarazbonus = 2
  324. else
  325. glarazbonus = 0
  326. end
  327. !! Setting the Lip size bonus
  328. if lip = 0:
  329. lipbonus = -2
  330. elseif lip = 1:
  331. lipbonus = 0
  332. elseif lip = 2:
  333. lipbonus = 3
  334. elseif lip = 3:
  335. lipbonus = 5
  336. else
  337. lipbonus = 3
  338. end
  339. !! Preforming the calculation
  340. vneshtemp = vidagebonus * ((skinvan * 2 / 5) + (3 * (2 + bodykoef)) + (agil / 10) + (vital / 10) + resnicbonus + glarazbonus + lipbonus - (5 * zub)) / 100
  341. !! skinvan = skin condition, corrected to a 0 to 40 range; bodykoef set in main body_shape; zub is missing teeth or cosmetically improved teeth (-1)
  342. !! This is the first limiter
  343. if vneshtemp > 100: vneshtemp = 100
  344. !! This adds the supernatural vnesh bonus; currently Bimbo and Succubus
  345. vneshtemp += supnatvnesh
  346. !! This is the rate of change limiter
  347. if vneshbase > vneshtemp: vneshbase -= 1
  348. if vneshbase < vneshtemp: vneshbase += 1
  349. !! This is for use when a reset is called for by setting args[1] = 1
  350. if args[1] = 1: vneshbase = vneshtemp
  351. !! This is to clean up variables only used here
  352. killvar 'vidagebonus'
  353. killvar 'resnicbonus'
  354. killvar 'glarazbonus'
  355. killvar 'lipbonus'
  356. killvar 'vneshtemp'
  357. !! This is to unload old variables
  358. killvar 'CloNaturalBeauty'
  359. killvar 'CloBaseBeauty'
  360. killvar 'skin'
  361. killvar 'bimbobeauty'
  362. end
  363. --- body_shape ---------------------------------