body.qsrc 29 KB

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