body.qsrc 31 KB

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