body.qsrc 31 KB

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