1
0

body.qsrc 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. # body
  2. !!bodyVars['wratio'] = waist to hips ratio set in body_shape
  3. !!bodyVars['bratio'] = band to waist ratio set in body_shape
  4. !!bodyVars['hratio'] = hip to height ratio set in body_shape
  5. !!bodyVars['vofat'] = used as a place to put extra pcs_mass['body'] at extreme high values (i.e. really, really fat) set in body_shape
  6. !!
  7. !!pcs_mass['butt'] = starts at a set genetic butt size, but can be adjusted down if pcs_mass['body'] drops too low
  8. !!pcs_mass['butt_gen'] = the set genetic bust size
  9. !!bodyVars['vhips'] = derived from pcs_mass['body'] and pcs_mass['butt'] in body_shape
  10. !!vhtmp = slows the change to vhips in body_shape
  11. !!
  12. !!pcs_mass['bust'] = starts at a set genetic bust size, but can be adjusted down if pcs_mass['body'] drops too low
  13. !!pcs_mass['bust_gen'] = the set genetic bust size
  14. !!bodyVars['bust_magic'] = set in body_shape for the fat moved to bust
  15. !!bodyVars['bust_other'] = other additions to bust-size, including breast creams
  16. !!
  17. !!magf2bdo = flag for magic bust increase; 0, ready; 1, do it; 2, ask; 3, no
  18. !!mgf2bnocnt = used to count the number of times a bust increase was turned down and stop asking after 3
  19. !!magtarcup = set in the dream code as the target cup size
  20. !!bodyVars['weight_warning'] = used to flag if to display the gaining/losing weight message when bathing
  21. !!bodyresetflag = used to prevent a code chunk from firing on a soft or hard reset
  22. !!Image set variables
  23. !! cheatVars['fix_bodyimg'] = flag to indicate set control override, 0 is use the formula to pick a set, 1 is use a fixed set
  24. !! cheatVars['fix_bi_set'] = the identification number of the fixed image set
  25. !! 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
  26. !! Pregnancy weight gain:
  27. !! Weight gain in the first 5 weeks (roughly pregChem < 800. -> Pregtime = pregchem / 24) is negligable
  28. !! Afterwards we approximate the weight gain as mass = ((pregChem - 800)^2 * 33 / (7000 - 800)^2) approx (pregChem - 800)^2 / (1080)^2
  29. if $ARGS[0] = 'RegularUpdate':
  30. if dounspell = 0:
  31. gs 'body', 'UpdateBodyMeasurement'
  32. temp_weight = func('body', 'CalcWeight2')
  33. pcs_weight[0] = temp_weight / 10
  34. pcs_weight[1] = temp_weight mod 10
  35. temp_bmi = func('body', 'CalcBMI2')
  36. pcs_bmi[0] = temp_bmi / 10
  37. pcs_bmi[1] = temp_bmi mod 10
  38. killvar 'temp_weight'
  39. killvar 'temp_bmi'
  40. end
  41. if pcs_skin > 1000:
  42. pcs_skin = 1000
  43. elseif pcs_skin < 0:
  44. pcs_skin = 0
  45. end
  46. end
  47. if $ARGS[0] = 'UpdateBodyMeasurement':
  48. pcs_hips = (pcs_hgt * bodyVars['hratio']) / 100 + bodyVars['vhips']
  49. pcs_waist = (pcs_hips * bodyVars['wratio']) / 100 + bodyVars['vofat']
  50. pcs_band = (pcs_waist * bodyVars['bratio']) / 100 + bodyVars['vofat']
  51. pcs_bust = (pcs_waist * bodyVars['bratio']) / 100 + pcs_mass['bust'] + bodyVars['bust_bonus'] + bodyVars['bust_silicone'] + max(-10, min(bodyVars['bust_other'], 10)) + bodyVars['bust_magic'] + pcs_mass['preg'] / 5 + bodyVars['bust_lact']
  52. pcs_butt = (pcs_hgt * bodyVars['hratio']) / 100 + min(pcs_mass['butt'], 50) + bodyVars['butt_bonus'] + bodyVars['butt_silicone'] + max(-10, min(bodyVars['butt_other'], 10)) + pcs_butt_tr
  53. !! pcs_cupsize = pcs_mass['bust'] + bodyVars['bust_bonus'] + bodyVars['bust_silicone'] + max(-10, min(bodyVars['bust_other'], 10)) + bodyVars['bust_magic'] + pcs_mass['preg'] / 5 + bodyVars['bust_lact'] - bodyVars['vofat']
  54. pcs_cupsize = pcs_bust - pcs_band
  55. !! pcs_buttsize = min(pcs_mass['butt'], 50) + bodyVars['butt_bonus'] + bodyVars['butt_silicone'] + max(-10, min(bodyVars['butt_other'], 10)) + pcs_butt_tr - bodyVars['vofat']
  56. pcs_buttsize = pcs_butt - pcs_hips
  57. end
  58. if $ARGS[0] = 'CalcWeight':
  59. !{pcs_weight: Svetas weight in kg
  60. Optimal Weight (170cm): 60kg, 60 pcs_mass['body']
  61. This is an approximation, so that a sveta with a different height has the same BMI for the same pcs_mass['body'] values.
  62. 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.}
  63. result = (2820 + 33 * (pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt'] + pcs_mass['preg']) + 70 * (pcs_hgt - 165)) / 100
  64. !{Do not remove (julzor)
  65. This is the old more complex function, but it doesn''t work correctly.
  66. 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.
  67. 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}
  68. !result = (pcs_hgt * 62 / 170) + (vhips + (bodyVars['vofat'] * 2)) / 4 + tits
  69. end
  70. if $ARGS[0] = 'CalcWeight2':
  71. !! weight2 = 10 * weight
  72. result = (2820 + 33 * (pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt'] + pcs_mass['preg']) + 70 * (pcs_hgt - 165)) / 10
  73. !result = (pcs_hgt * 62 / 17) + (10 * (vhips + (bodyVars['vofat'] * 2))) / 4 + 10 * tits
  74. end
  75. if $ARGS[0] = 'CalcBMI':
  76. !! BMI = weight [kg] / (height [m])^2 = 100^2 * weight [kg] / (height [cm])^2
  77. result = (1000 * (10 * pcs_weight[0] + pcs_weight[1])) / (pcs_hgt * pcs_hgt)
  78. end
  79. if $ARGS[0] = 'CalcBMI2':
  80. !! BMI2 = 10 * BMI
  81. result = (10000 * (10 * pcs_weight[0] + pcs_weight[1])) / (pcs_hgt * pcs_hgt)
  82. end
  83. if $ARGS[0] = 'CalcOptBodyMass':
  84. if ARGS[1] = 0: ARGS[1] = 225
  85. result = ((pcs_hgt * pcs_hgt * ARGS[1]) - 2820000 - 70000 * (pcs_hgt - 165)) / (550 * (60 + pcs_mass['bust_gen'] + pcs_mass['butt_gen']))
  86. end
  87. !!===================================================!!
  88. !! !!
  89. !! Daily Update !!
  90. !! !!
  91. !!===================================================!!
  92. if $ARGS[0] = 'DailyUpdate':
  93. !!Update once a day and called from cikl
  94. if dounspell ! 1:
  95. gs 'body', 'Update_Body'
  96. else
  97. if strenbuf > 90:
  98. strenbuf -= 2
  99. elseif strenbuf > 80:
  100. strenbuf -= 1
  101. end
  102. if vitalbuf > 90:
  103. vitalbuf -= 2
  104. elseif vitalbuf > 80:
  105. vitalbuf -= 1
  106. end
  107. gs 'body', 'Update_StatBuffs'
  108. end
  109. gs 'body', 'RegularUpdate'
  110. gs 'body', 'Update_daily_body_other'
  111. gs 'body', 'Update_Eyelashes'
  112. gs 'body', 'Update_Hair'
  113. gs 'body', 'Update_Pubes_and_leghair'
  114. if mc_inventory['scrunchies'] > 0 and rand(1, 100) <= 8:
  115. mc_inventory['scrunchies'] -= 1
  116. end
  117. if pcs_skin <= 300:
  118. pcs_skin += min(skinDailyGain * 2, 20) - skinDailyPenalty - 1
  119. elseif pcs_skin <= 600:
  120. pcs_skin += min(skinDailyGain, 10) - skinDailyPenalty - 1
  121. elseif pcs_skin <= 800:
  122. pcs_skin += min(skinDailyGain / 2, 5) - skinDailyPenalty - 1
  123. elseif pcs_skin <= 900:
  124. pcs_skin += min(skinDailyGain / 3, 3) - skinDailyPenalty - 1
  125. elseif pcs_skin <= 1000:
  126. pcs_skin += min(skinDailyGain / 5, 2) - skinDailyPenalty - 1
  127. end
  128. gs 'body', 'Update_Teeth'
  129. gs 'AppearanceSystem', 'UpdateBaseAppearance'
  130. gs 'body', 'Update_Appearance'
  131. gs 'body', 'UpdateBodyImage'
  132. !skin variable reset
  133. killvar 'moisturizerDailyCount'
  134. killvar 'skinDailyGain'
  135. killvar 'skinDailyPenalty'
  136. end
  137. if $ARGS[0] = 'Update_Appearance':
  138. gs 'AppearanceSystem'
  139. gs 'body_desc'
  140. end
  141. !!------------------------- UPDATE images -------------------------!!
  142. if $ARGS[0] = 'UpdateBodyImage':
  143. !Update body image set
  144. $bodyVars['desc'] = func('body_structure', 'body_desc')
  145. $bodyVars['bmi_desc'] = func('body_structure', 'bmi_desc')
  146. $bodyVars['img'] = func('body_structure', 'body_img')
  147. end
  148. !!------------------------- UPDATE eyelashes, hair, pubes, teeth -------------------------!!
  149. if $ARGS[0] = 'Update_Eyelashes':
  150. !!---- Calculation of lash extension degradation and false lash removal
  151. if pcs_lashes > 2:
  152. if lashextensionstyle >= 1:
  153. lashextensionduration -= 1
  154. if lashextensionduration >= 1 and lashextensionduration <= 4:
  155. 'It''s time for you to do your maintenance on your lash extensions; you should go to the salon or you risk growing them all out.'
  156. end
  157. if lashextensionduration <= 0:
  158. 'You waited too long to do maintenance on your lash extensions; there''s too little there to notice or work with at this point.'
  159. pcs_lashes = pcs_naturallashes
  160. killvar 'lashextensionstyle'
  161. killvar 'lashextensionduration'
  162. killvar 'lashextensionnew'
  163. end
  164. end
  165. if false_lashes > 0:
  166. false_lashes -= 1
  167. if false_lashes = 0:
  168. 'Your false lashes came off in the night; there''s no recovering them now.'
  169. pcs_lashes = pcs_naturallashes
  170. else
  171. 'Somehow, your lashes managed to stay attached throughout the night. You might be able to get away with wearing them another day straight.'
  172. end
  173. end
  174. end
  175. end
  176. if $ARGS[0] = 'Update_Hair':
  177. !! Max. Hair length 600mm, or 60cm, which should be somewhere in the lower back area.
  178. !! Hair grows 1mm each day, it takes 20 months (1 month = 30 days) to regrow the hair from 0.
  179. if pcs_hairlng <= 1000 and hairgrowcht = 0: pcs_hairlng += 1
  180. ! Hair colour change
  181. if pcs_haircol ! nathcol and dyefade > 0:
  182. dyefade -= 1
  183. end
  184. !! daily reduction of braids
  185. if hbraids > 0: hbraids -= 1
  186. !! loss of updo if hair too long
  187. if pcs_hairlng > 400 and hpingripw = 1:
  188. hpingripw = 0
  189. end
  190. !! loss of pigtails if hair too long
  191. if pcs_hairlng > 800 and hscrunchw = 2 = 1:
  192. hpigtail = 0
  193. hscrunchw = 0
  194. end
  195. end
  196. if $ARGS[0] = 'Update_Pubes_and_leghair':
  197. !!pubic hair colouring
  198. !! pcs_pubecol[0] = natural colour
  199. !! pcs_pubecol[1] = flag for saveupdate
  200. !! pcs_pubecol[2] = actual colour
  201. !! pcs_pubecol[3] = countdown timer for dye
  202. if pcs_pubecol[2] ! pcs_pubecol[0]:
  203. if pcs_pubecol[3] > 0: pcs_pubecol[3] -= 1
  204. if pcs_pubecol[3] = 0: pcs_pubecol[2] = pcs_pubecol[0]
  205. end
  206. if pcs_pubes < 2: pcs_pubecol[2] = pcs_pubecol[0]
  207. !! 33% change to shrink leghair if underage? Simulate slower growth?
  208. if age < 18 and rand(0, 2) = 0 and pcs_leghair > 0:
  209. pcs_leghair -= 1
  210. end
  211. ! Leg and pubes hair growth
  212. ! disabled for testing hourly growth instead
  213. !!{if lashair ! 1:
  214. pcs_leghair += 1
  215. !!Pubic hair growth at 1/2 per night
  216. if pcs_pubes['growth'] > 1:
  217. pcs_pubes['growth'] = 0
  218. pcs_pubes += 1
  219. end
  220. pcs_pubes['growth'] += 1
  221. gs 'body_desc', 'pube_desc_update'
  222. end}
  223. end
  224. if $ARGS[0] = 'Update_Teeth':
  225. if pcs_teeth < 0:
  226. !! Daly degradation of perfect white teeth
  227. tempteeth = 1
  228. if teeth['caffe_or_tea'] > 8: tempteeth += 1
  229. if teeth['smoked'] > 1: tempteeth += 1
  230. tempteeth -= min(teeth['brushed'], 3)
  231. teeth['degradation'] += max(0, tempteeth)
  232. killvar 'tempteeth'
  233. teeth['caffe_or_tea'] = 0
  234. teeth['smoked'] = 0
  235. teeth['brushed'] = 0
  236. if teeth['degradation'] > 60:
  237. !! After a certain time of not taking care of your teeth you will loose you perfect white smile.
  238. teeth['degradation'] = 0
  239. pcs_teeth = 0
  240. elseif teeth['degradation'] < 0:
  241. teeth['degradation'] = 0
  242. end
  243. end
  244. end
  245. !!===================================!!
  246. !! !!
  247. !! Update Body !!
  248. !! !!
  249. !!===================================!!
  250. if $ARGS[0] = 'Update_Body':
  251. gs 'body', 'Update_StatBuffs'
  252. pcs_mass['body_last'] = pcs_mass['body']
  253. !!pcs_mass['body'] Handling; the first part is because during a reset fat is not used and should be cleared
  254. if bodyresetflag = 1 or cheatVars['fat'] = 1:
  255. fat = 0
  256. else
  257. if pregChem >= 800 and (pregChem - 800)*(pregChem - 800) >= bodyVars['pchem_next']:
  258. pcs_mass['preg'] += 1
  259. bodyVars['pchem_next'] += 1166400 & !! 1080 * 1080
  260. elseif pcs_mass['preg'] > 0 and (recovH <= bodyVars['recovH'] and (pregChem < 800 or bodyVars['pchem_next'] - 1166400 >= (pregChem - 800)*(pregChem - 800))):
  261. pcs_mass['preg'] -= 1
  262. if rand(0, 1) = 0: pcs_mass['body'] += 1
  263. if pcs_mass['preg'] > 0:
  264. bodyVars['pchem_next'] -= 1166400 & !! 1080 * 1080
  265. bodyVars['recovH_next'] = bodyVars['recovH_next'] * (pcs_mass['preg'] - 1) / pcs_mass['preg']
  266. end
  267. elseif pcs_mass['preg'] <= 0:
  268. pcs_mass['preg'] = 0
  269. bodyVars['pchem_next'] = 0
  270. bodyVars['recovH_next'] = 0
  271. end
  272. if pregChem >= 800:
  273. if fat > (12 + vitalbuf / 25):
  274. pcs_mass['body'] += 1
  275. fat = 0
  276. elseif fat < -(7 + vitalbuf / 10):
  277. pcs_mass['body'] -= 1
  278. fat = 0
  279. else
  280. if fat < 0:
  281. fat = fat / 2
  282. else
  283. fat = fat / 6
  284. end
  285. end
  286. else
  287. if fat > (17 + vitalbuf / 25):
  288. pcs_mass['body'] += 1
  289. fat = 0
  290. elseif fat < -(2 + vitalbuf / 10):
  291. pcs_mass['body'] -= 1
  292. fat = 0
  293. else
  294. fat = fat / 4
  295. end
  296. end
  297. end
  298. !!This is the pcs_mass['body'] cap for the weight approximation
  299. if pcs_mass['body'] > 200: pcs_mass['body'] = 200
  300. !! All the ratios were rounded to 2 digits and there are divide 100s at the final calc points
  301. gs 'body', 'Find_waist_to_hip_ratio'
  302. gs 'body', 'Find_band_to_waist_ratio'
  303. gs 'body', 'Find_hip_to_height_ratio'
  304. gs 'body', 'Redistribute_Mass'
  305. !!This is if a Succubus has pcs_mass['body'] < 1
  306. if succubusflag = 1 and pcs_mass['body'] < 1:
  307. sucexcess -= 1
  308. pcs_mass['body'] += 3
  309. end
  310. !!This is if pcs_mass['body'] is still < 1
  311. if pcs_mass['body'] < 1:
  312. if fat >= 1:
  313. pcs_mass['body'] = 1
  314. fat -= 1
  315. elseif fat <= 0 and pcs_stren + pcs_vital > 0:
  316. stren_deg -= 1000
  317. vital_deg -= 1000
  318. pcs_mass['body'] = 1
  319. else
  320. gs 'gameover', 'check', 3
  321. pl '<font color=red><B>You starved to death, but Cheat Mode keeps you Alive.</B></font>'
  322. pcs_mass['body'] = 1
  323. end
  324. end
  325. gs 'body', 'Update_vhips'
  326. !!This will trigger the warning notices in the bathing code (the +/- 12 should always be +/- 11 + the max change to pcs_mass['body'] w/ fat)
  327. temp_total_mass = pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']
  328. if temp_total_mass <= pcs_mass['body_message'] - 6:
  329. bodyVars['weight_warning'] = 1
  330. pcs_mass['body_message'] = temp_total_mass
  331. elseif temp_total_mass => pcs_mass['body_message'] + 6:
  332. bodyVars['weight_warning'] = 2
  333. pcs_mass['body_message'] = temp_total_mass
  334. end
  335. killvar 'temp_total_mass'
  336. !!Setting the pcs_apprnc bonus based on fat and strength
  337. temp_bmi = func('body', 'CalcBMI2')
  338. pcs_bmi[0] = temp_bmi / 10
  339. pcs_bmi[1] = temp_bmi mod 10
  340. killvar 'temp_bmi'
  341. !!This will trigger the dream for the option to use magic to increase bust
  342. !!Three nos at the dream will lock it out (1 yes resets the count)
  343. if pcs_magik >= 5 and MagikDostup = 0 and magf2bdo = 0:
  344. if tits < 10 and pcs_mass['body'] > pcs_mass['body_last'] and pcs_bmi > 17:
  345. if mgf2bnocnt < 3:
  346. magf2bdo = 2
  347. else
  348. magf2bdo = 3 & killvar 'mgf2bnocnt'
  349. end
  350. end
  351. end
  352. !!This is to clean up unused variables
  353. killvar 'normbuffpick'
  354. killvar 'nrmbfpckct'
  355. killvar 'vmeat'
  356. killvar 'vfat'
  357. killvar 'Kves'
  358. killvar 'krost'
  359. killvar 'koefvesbt'
  360. killvar 'koefbt'
  361. end
  362. !!------------------------- BUFFS -------------------------!!
  363. if $ARGS[0] = 'Update_StatBuffs':
  364. !! This controls the gradual change in stat to -buf
  365. if strenbuf > pcs_stren:
  366. strenbuf -= 1
  367. elseif strenbuf < pcs_stren:
  368. strenbuf += 1
  369. end
  370. if vitalbuf > pcs_vital:
  371. vitalbuf -= 1
  372. elseif vitalbuf < pcs_vital:
  373. vitalbuf += 1
  374. end
  375. if agilbuf > pcs_agil:
  376. agilbuf -= 1
  377. elseif agilbuf < pcs_agil:
  378. agilbuf += 1
  379. end
  380. end
  381. if $ARGS[0] = 'Update_daily_body_other':
  382. if bodyVars['bust_other'] ! 0:
  383. if daystart mod 10 = 0:
  384. if bodyVars['bust_other'] > 0:
  385. bodyVars['bust_other'] -= 1
  386. else
  387. bodyVars['bust_other'] += 1
  388. end
  389. end
  390. end
  391. if bodyVars['butt_other'] ! 0:
  392. if daystart mod 15 = 0:
  393. if bodyVars['butt_other'] > 0:
  394. bodyVars['butt_other'] -= 1
  395. else
  396. bodyVars['butt_other'] += 1
  397. end
  398. end
  399. end
  400. gs 'drugs', 'breastcream', 'cikl'
  401. gs 'drugs', 'steroids', 'cikl'
  402. end
  403. !!------------------------- RATIOS -------------------------!!
  404. !! All the ratios were rounded to 2 digits and there are divide 100s at the final calc points
  405. ! Lies between 65 and 96
  406. if $ARGS[0] = 'Find_waist_to_hip_ratio':
  407. temp_wratio = (2 * vitalbuf + strenbuf + agilbuf) / 4
  408. !! Primary bodyVars['wratio'] handling
  409. if temp_wratio < 11:
  410. bodyVars['wratio'] = 85 + (11 - (vitalbuf + strenbuf + agilbuf) / 3)
  411. elseif temp_wratio < 20:
  412. bodyVars['wratio'] = 85
  413. elseif temp_wratio < 35:
  414. bodyVars['wratio'] = 85 - (temp_wratio - 20) / 3
  415. elseif temp_wratio < 55:
  416. bodyVars['wratio'] = 80 - (temp_wratio - 35) / 4
  417. elseif temp_wratio < 80:
  418. bodyVars['wratio'] = 75 - (temp_wratio - 55) / 5
  419. elseif temp_wratio >= 80:
  420. bodyVars['wratio'] = 70
  421. end
  422. !! High stat value edge case handling
  423. if (vitalbuf + strenbuf + agilbuf) / 3 > 100:
  424. bodyVars['wratio'] += (2 * agilbuf - vitalbuf - strenbuf) / 10
  425. end
  426. !! This is the oops and high stat gone overboard handling
  427. if bodyVars['wratio'] < 65: bodyVars['wratio'] = 65
  428. killvar 'temp_wratio'
  429. ! Lies between 105 and 125
  430. elseif $ARGS[0] = 'Find_band_to_waist_ratio':
  431. temp_bratio = (2 * strenbuf + vitalbuf + agilbuf) / 4
  432. if temp_bratio < 10:
  433. bodyVars['bratio'] = 105
  434. elseif temp_bratio <= 23:
  435. bodyVars['bratio'] = 106
  436. elseif temp_bratio <= 80:
  437. bodyVars['bratio'] = 106 + (temp_bratio - 23) / 3
  438. else
  439. bratio = 125
  440. end
  441. killvar 'temp_bratio'
  442. ! Lies between 56 and 60
  443. elseif $ARGS[0] = 'Find_hip_to_height_ratio':
  444. temp_hratio = (2 * agilbuf + vitalbuf + strenbuf) / 4
  445. if temp_hratio < 35:
  446. bodyVars['hratio'] = 60
  447. elseif temp_hratio < 45:
  448. bodyVars['hratio'] = 59
  449. elseif temp_hratio < 60:
  450. bodyVars['hratio'] = 58
  451. elseif temp_hratio < 80:
  452. bodyVars['hratio'] = 57
  453. else
  454. bodyVars['hratio'] = 56
  455. end
  456. killvar 'temp_hratio'
  457. end
  458. !! Depricated
  459. if $ARGS[0] = 'Calc_salocat':
  460. !!This calculates the current pcs_mass['body'] category; ranges are 20 points, seemed to balance best if the range is x10 the hip devisor
  461. if pcs_mass['body'] + pcs_mass['butt'] < 10:
  462. result = 0
  463. else
  464. result = (pcs_mass['body'] + pcs_mass['butt'] + 10) / 20
  465. end
  466. end
  467. if $ARGS[0] = 'Redistribute_Mass':
  468. !!This resets the genetic bust size (pcs_mass['bust_gen']) when the cheat is used to reduce breast size (maybe other things later)
  469. if titreduc = 1:
  470. killvar 'titreduc'
  471. if pcs_mass['bust_gen'] > pcs_mass['bust']:
  472. pcs_mass['bust_gen'] = pcs_mass['bust'] + 2 - pcs_mass['bust'] mod 5
  473. end
  474. end
  475. if assreduc = 1:
  476. killvar 'assreduc'
  477. if pcs_mass['butt_gen'] > pcs_mass['butt']:
  478. pcs_mass['butt_gen'] = pcs_mass['butt'] + 2 - pcs_mass['butt'] mod 5
  479. end
  480. end
  481. if salobustdo = 0 and cheatVars['body_staticAssets'] = 0:
  482. !!This controls the movement of pcs_mass['body'] to/from bust in order of precedence
  483. !!=============== MAGIC ===============!!
  484. if magikDostup = 0 and magf2bdo = 1 and daystart > pcs_mass['magic_day'] and pcs_mana >= manamax / 2:
  485. bodyVars['bust_magic'] += 1
  486. if pcs_mass['body'] >= 80: pcs_mass['body'] -= 3
  487. pcs_mass['magic_day'] = daystart + rand(7, 14)
  488. if bodyVars['bust_magic'] >= 2 + magtarcup * 5: magf2bdo = 0
  489. pcs_mana -= max(100, 2000 / pcs_magik)
  490. end
  491. !!=============== Low Weight ===============!!
  492. if pcs_mass['body'] < 10:
  493. temp_diff = min(pcs_mass['bust'], 3)
  494. pcs_mass['bust'] -= temp_diff
  495. pcs_mass['body'] += temp_diff
  496. temp_diff = min(pcs_mass['butt'], 3)
  497. pcs_mass['butt'] -= temp_diff
  498. pcs_mass['body'] += temp_diff
  499. else
  500. temp_total_mass = pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']
  501. temp_tot_gen_mass = 60 + pcs_mass['bust_gen'] + pcs_mass['butt_gen']
  502. !!=============== Bust ===============!!
  503. temp_mass_bust = (pcs_mass['bust_gen'] * temp_total_mass) / temp_tot_gen_mass
  504. !!----------- Small -----------!!
  505. if temp_total_mass >= temp_tot_gen_mass - 10 and pcs_mass['bust'] < pcs_mass['bust_gen']:
  506. temp_diff = min(pcs_mass['bust_gen'] - pcs_mass['bust'], 2)
  507. pcs_mass['bust'] += temp_diff
  508. pcs_mass['body'] -= temp_diff
  509. elseif temp_total_mass >= temp_tot_gen_mass - 10 and temp_total_mass <= temp_tot_gen_mass and pcs_mass['bust'] = pcs_mass['bust_gen']:
  510. !Keep bust at genetic level if pcs_mass['body'] >= 50 and pcs_mass['body'] <= 60
  511. !!----------- Growth -----------!!
  512. elseif temp_mass_bust > pcs_mass['bust']:
  513. pcs_mass['bust'] += 1
  514. pcs_mass['body'] -= 1
  515. !!----------- Shrink -----------!!
  516. elseif temp_mass_bust < pcs_mass['bust'] and pcs_mass['bust'] > 0:
  517. pcs_mass['bust'] -= 1
  518. pcs_mass['body'] += 1
  519. end
  520. !!=============== Ass ===============!!
  521. temp_mass_ass = (pcs_mass['butt_gen'] * temp_total_mass) / temp_tot_gen_mass
  522. !!----------- Small -----------!!
  523. if temp_total_mass >= temp_tot_gen_mass - 10 and pcs_mass['butt'] < pcs_mass['butt_gen']:
  524. temp_diff = min(pcs_mass['butt_gen'] - pcs_mass['butt'], 2)
  525. pcs_mass['butt'] += temp_diff
  526. pcs_mass['body'] -= temp_diff
  527. elseif temp_total_mass >= temp_tot_gen_mass - 10 and temp_total_mass <= temp_tot_gen_mass and pcs_mass['butt'] = pcs_mass['butt_gen']:
  528. !Keep butt at genetic level if pcs_mass['body'] >= 50 and pcs_mass['body'] <= 60
  529. !!----------- Rest -----------!!
  530. elseif temp_mass_ass > pcs_mass['butt']:
  531. pcs_mass['butt'] += 1
  532. pcs_mass['body'] -= 1
  533. elseif temp_mass_ass < pcs_mass['butt'] and pcs_mass['butt'] > 0:
  534. pcs_mass['butt'] -= 1
  535. pcs_mass['body'] += 1
  536. end
  537. killvar 'temp_total_mass'
  538. killvar 'temp_tot_gen_mass'
  539. killvar 'temp_mass_bust'
  540. killvar 'temp_mass_ass'
  541. killvar 'temp_diff'
  542. end
  543. if bodyresetflag ! 0:
  544. pcs_mass['bust_message'] = pcs_mass['bust']
  545. pcs_mass['butt_message'] = pcs_mass['butt']
  546. else
  547. if pcs_mass['bust'] > pcs_mass['bust_message'] + 3:
  548. pcs_mass['bust_message'] = pcs_mass['bust']
  549. if pcs_mass['butt'] > pcs_mass['butt_message'] + 3:
  550. pcs_mass['butt_message'] = pcs_mass['butt']
  551. '<b>Your breasts and ass seem fuller</b>'
  552. elseif pcs_mass['butt'] < pcs_mass['butt_message'] - 3:
  553. pcs_mass['butt_message'] = pcs_mass['butt']
  554. '<b>Your breasts seem fuller and ass seems to be getting smaller</b>'
  555. else
  556. '<b>Your breasts seem fuller</b>'
  557. end
  558. elseif pcs_mass['bust'] < pcs_mass['bust_message'] - 3:
  559. pcs_mass['bust_message'] = pcs_mass['bust']
  560. if pcs_mass['butt'] > pcs_mass['butt_message'] + 3:
  561. pcs_mass['butt_message'] = pcs_mass['butt']
  562. '<b>Your breasts seem to be getting smaller and your ass seems fuller</b>'
  563. elseif pcs_mass['butt'] < pcs_mass['butt_message'] - 3:
  564. pcs_mass['butt_message'] = pcs_mass['butt']
  565. '<b>Your breasts and ass seem to be getting smaller</b>'
  566. else
  567. '<b>Your breasts seem to be getting smaller</b>'
  568. end
  569. else
  570. if pcs_mass['butt'] > pcs_mass['butt_message'] + 3:
  571. pcs_mass['butt_message'] = pcs_mass['butt']
  572. '<b>Your ass seems fuller</b>'
  573. elseif pcs_mass['butt'] < pcs_mass['butt_message'] - 3:
  574. pcs_mass['butt_message'] = pcs_mass['butt']
  575. '<b>Your ass seem to be getting smaller</b>'
  576. end
  577. end
  578. end
  579. end
  580. gs 'body', 'Update_vhips'
  581. killvar 'salobustdo'
  582. killvar 'temp_massbustchange'
  583. killvar 'temp_massasschange'
  584. end
  585. if $ARGS[0] = 'Reset_mass_distribution':
  586. temp_total_mass = pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']
  587. temp_total_gen_mass = 60 + pcs_mass['bust_gen'] + pcs_mass['butt_gen']
  588. if temp_total_mass >= temp_total_gen_mass - 10 and temp_total_mass <= temp_total_gen_mass:
  589. pcs_mass['bust'] = pcs_mass['bust_gen']
  590. pcs_mass['butt'] = pcs_mass['butt_gen']
  591. else
  592. pcs_mass['bust'] = (pcs_mass['bust_gen'] * temp_total_mass) / temp_total_gen_mass
  593. pcs_mass['butt'] = (pcs_mass['butt_gen'] * temp_total_mass) / temp_total_gen_mass
  594. end
  595. pcs_mass['body'] = temp_total_mass - pcs_mass['bust'] - pcs_mass['butt']
  596. pcs_mass['body_message'] = temp_total_mass
  597. pcs_mass['bust_message'] = pcs_mass['bust']
  598. pcs_mass['butt_message'] = pcs_mass['butt']
  599. bodyVars['vhips'] = (pcs_mass['body'] + pcs_mass['butt'] - 80) / 2
  600. killvar 'temp_total_mass'
  601. killvar 'temp_total_gen_mass'
  602. end
  603. if $ARGS[0] = 'Reset_preg_mass':
  604. bodyVars['pchem_next'] = 0
  605. pcs_mass['preg'] = 0
  606. :set_preg_body_loop
  607. if pregChem >= 800 and (pregChem - 800) * (pregChem - 800) >= bodyVars['pchem_next']:
  608. bodyVars['pchem_next'] += 1166400 & 1080 * 1080
  609. pcs_mass['preg'] += 1
  610. jump 'set_preg_body_loop'
  611. end
  612. end
  613. if $ARGS[0] = 'Set_mass_distribution_using_body':
  614. pcs_mass['body'] = ARGS[1]
  615. if ARGS[1] >= 50 and ARGS[1] <= 60:
  616. pcs_mass['bust'] = pcs_mass['bust_gen']
  617. pcs_mass['butt'] = pcs_mass['butt_gen']
  618. else
  619. pcs_mass['bust'] = (pcs_mass['bust_gen'] * pcs_mass['body']) / 60
  620. pcs_mass['butt'] = (pcs_mass['butt_gen'] * pcs_mass['body']) / 60
  621. end
  622. bodyVars['vhips'] = (pcs_mass['body'] + pcs_mass['butt'] - 80) / 2
  623. pcs_mass['body_message'] = pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']
  624. pcs_mass['bust_message'] = pcs_mass['bust']
  625. pcs_mass['butt_message'] = pcs_mass['butt']
  626. if dounspell = 0:
  627. temp_weight = func('body', 'CalcWeight2')
  628. pcs_weight[0] = temp_weight / 10
  629. pcs_weight[1] = temp_weight mod 10
  630. temp_bmi = func('body', 'CalcBMI2')
  631. pcs_bmi[0] = temp_bmi / 10
  632. pcs_bmi[1] = temp_bmi mod 10
  633. killvar 'temp_weight'
  634. killvar 'temp_bmi'
  635. end
  636. gs 'body', 'Update_vhips'
  637. gs 'AppearanceSystem', 'UpdateBaseAppearance'
  638. gs 'body', 'Update_Appearance'
  639. gs 'body', 'UpdateBodyImage'
  640. end
  641. !!------------------------- UPDATE vhips -------------------------!!
  642. if $ARGS[0] = 'Update_vhips':
  643. vhtmp = (pcs_mass['body'] + pcs_mass['butt'] - 80) / 2
  644. ! Because a reset should be updating hip size instantly (this set is a bit redundant anyway)
  645. if bodyresetflag = 1:
  646. bodyVars['vhips'] = vhtmp
  647. else
  648. if vhtmp < bodyVars['vhips']:
  649. bodyVars['vhips'] -= 1
  650. elseif vhtmp > bodyVars['vhips']:
  651. bodyVars['vhips'] += 1
  652. end
  653. end
  654. killvar 'vhtmp'
  655. !! temp_vhips2 = bodyVars['vhips'] + (pcs_hgt * bodyVars['hratio'])/100 - (pcs_hgt * 72)/100
  656. !! temp_vhips2 = pcs_hips - (pcs_hgt * 72) / 100
  657. temp_vhips2 = bodyVars['vhips'] - (pcs_hgt * (72 - bodyVars['hratio'])) / 100
  658. bodyVars['vofat'] = max(0, temp_vhips2 / 2)
  659. bodyVars['vhips'] -= 2 * bodyVars['vofat']
  660. !! vhips = max(bodyVars['vhips'], (pcs_hgt * (72 - bodyVars['hratio'])) / 100)
  661. killvar 'temp_vhips2'
  662. end
  663. !!==================================!!
  664. !! !!
  665. !! Skin Gain & Loss !!
  666. !! !!
  667. !!==================================!!
  668. if $ARGS[0] = 'SkinGain':
  669. if $ARGS[1] = 'CleanSelf' and lastShowerSkinGain ! daystart:
  670. lastShowerSkinGain = daystart
  671. skinDailyGain += 5
  672. !!needs to be changet to +3 when the bathLuffa in added.
  673. !!if bathLuffa = 1: skinDailyGain += 2
  674. elseif $ARGS[1] = 'Moisturizer':
  675. moisturizerDailyCount += 1
  676. if moisturizerDailyCount <= 2: skinDailyGain += 2
  677. end
  678. end
  679. if $ARGS[0] = 'SkinLoss':
  680. if $ARGS[1] = 'Smoke' and lastSmokeSkinPenalty ! daystart:
  681. lastSmokeSkinPenalty = daystart
  682. skinDailyPenalty += 1
  683. elseif $ARGS[1] = 'MakeUpSleep':
  684. skinDailyPenalty += 10
  685. end
  686. end
  687. !!==================================!!
  688. !! !!
  689. !! RESETS !!
  690. !! !!
  691. !!==================================!!
  692. if $ARGS[0] = 'softreset':
  693. !!This is for use in immediately updating shape if something has caused a large change in pcs_mass['body'], primarily fat burners and plastic surgery
  694. bodyresetflag = 1
  695. body_sr_counter = 0
  696. :resetloop
  697. if body_sr_counter < 10 and pcs_mass['body'] ! pcs_mass['body_last']:
  698. if gamestartflag = 1:
  699. salobustdo = 1
  700. end
  701. gs 'body', 'Update_Body'
  702. jump 'resetloop'
  703. end
  704. !!Updates pcs_apprncbase after a reset
  705. gs 'body', 'UpdateBodyMeasurement'
  706. gs 'body', 'Update_Appearance'
  707. !!Clears the warning and reset status flags if they were set
  708. bodyresetflag = 0
  709. bodyVars['weight_warning'] = 0
  710. end
  711. if $ARGS[0] = 'hardreset':
  712. !!This is primarily for canceling out "dounspell" and setting pcs_mass['body'] to whatever value will result in the current hip size then balancing everything out.
  713. !!Also could be built in as a means to in-game undo "dounspell", other than the cheat.
  714. if dounspell ! 1 or dounsplkil = 0:
  715. 'If you''re seeing this, something odd happened. Please make a bug report that the body shape hard reset improperly triggered and what you were doing.'
  716. else
  717. pcs_mass['body'] = 12
  718. fat = 0
  719. agilbuf = pcs_agil
  720. strenbuf = pcs_stren
  721. vitalbuf = pcs_vital
  722. salobustdo = 1
  723. bodyresetflag = 1
  724. normbuffpick = -1
  725. gs 'body', 'Update_Body'
  726. pcs_mass['body'] = 60 + (2 * pcs_hips) - (pcs_hgt * bodyVars['hratio']) / 50
  727. if pcs_mass['butt_gen'] = 0:
  728. pcs_mass['butt_gen'] = 20
  729. end
  730. bodyVars['vhips'] = (pcs_mass['body'] + pcs_mass['butt'] - 80) / 2
  731. if pcs_mass['bust_gen'] = 0:
  732. if pcs_mass['bust'] >= 27:
  733. pcs_mass['bust_gen'] = 27
  734. elseif pcs_mass['bust'] > 0:
  735. pcs_mass['bust_gen'] = 2 + pcs_mass['bust'] - pcs_mass['bust'] mod 5
  736. elseif bodyVars['bust_silicone'] >= 20:
  737. pcs_mass['bust_gen'] = 12
  738. pcs_mass['bust'] = 12
  739. bodyVars['bust_silicone'] -= 10
  740. end
  741. end
  742. pcs_mass['body_message'] = pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']
  743. pcs_mass['bust_message'] = pcs_mass['bust']
  744. pcs_mass['butt_message'] = pcs_mass['butt']
  745. gs 'body', 'reset_preg_mass'
  746. bodyresetflag = 0
  747. normbuffpick = 0
  748. bodyVars['weight_warning'] = 0
  749. magf2bdo = 0
  750. killvar 'dounsplkil'
  751. newbdsp = 1
  752. dounspell = 0
  753. gs 'body', 'Update_Appearance'
  754. gs 'body', 'Update_Body'
  755. gs 'stat'
  756. end
  757. end
  758. !!==================================!!
  759. !! !!
  760. !! INITIAL !!
  761. !! !!
  762. !!==================================!!
  763. if $ARGS[0] = 'initial':
  764. !! Sets the genetic bust size if it was not set in the start routines
  765. if pcs_mass['bust_gen'] = 0: pcs_mass['bust_gen'] = 12
  766. if pcs_mass['butt_gen'] = 0: pcs_mass['butt_gen'] = 20
  767. if pcs_mass['body'] >= 50 and pcs_mass['body'] <= 60:
  768. pcs_mass['bust'] = pcs_mass['bust_gen']
  769. pcs_mass['butt'] = pcs_mass['butt_gen']
  770. else
  771. gs 'body', 'Set_mass_distribution_using_body', pcs_mass['body']
  772. end
  773. strenbuf = pcs_stren
  774. agilbuf = pcs_agil
  775. vitalbuf = pcs_vital
  776. normbuffpick = -1
  777. gamestartflag = 1
  778. !! Calling soft reset will cause the main code to cycle up to the starting value of pcs_mass['body']
  779. gs 'body', 'softreset'
  780. !! This sets/resets the controler variables
  781. normbuffpick = 0
  782. magf2bdo = 0
  783. killvar 'gamestartflag'
  784. newbdsp = 1
  785. !! This does all the body shape setting before the first stat call
  786. temp_bmi = func('body', 'CalcBMI2')
  787. pcs_bmi[0] = temp_bmi / 10
  788. pcs_bmi[1] = temp_bmi mod 10
  789. killvar 'temp_bmi'
  790. gs 'body', 'Update_Appearance'
  791. gs 'body', 'UpdateBodyImage'
  792. end
  793. --- body ---------------------------------