body.qsrc 29 KB

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