body.qsrc 28 KB

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