body.qsrc 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  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 pcs_mass['preg'] > 0 and (recovH <= bodyVars['recovH'] and (pregChem < 800 or bodyVars['pchem_next'] - 1166400 >= (pregChem - 800)*(pregChem - 800))):
  268. pcs_mass['preg'] -= 1
  269. if rand(0, 1) = 0: pcs_mass['body'] += 1
  270. if pcs_mass['preg'] > 0:
  271. bodyVars['pchem_next'] -= 1166400 & !! 1080 * 1080
  272. bodyVars['recovH_next'] = bodyVars['recovH_next'] * (pcs_mass['preg'] - 1) / pcs_mass['preg']
  273. end
  274. elseif pcs_mass['preg'] <= 0:
  275. pcs_mass['preg'] = 0
  276. bodyVars['pchem_next'] = 0
  277. bodyVars['recovH_next'] = 0
  278. end
  279. if pregChem >= 800:
  280. if fat > (12 + vitalbuf / 25):
  281. pcs_mass['body'] += 1
  282. fat = 0
  283. elseif fat < -(7 + vitalbuf / 10):
  284. pcs_mass['body'] -= 1
  285. fat = 0
  286. else
  287. if fat < 0:
  288. fat = fat / 2
  289. else
  290. fat = fat / 6
  291. end
  292. end
  293. else
  294. if fat > (17 + vitalbuf / 25):
  295. pcs_mass['body'] += 1
  296. fat = 0
  297. elseif fat < -(2 + vitalbuf / 10):
  298. pcs_mass['body'] -= 1
  299. fat = 0
  300. else
  301. fat = fat / 4
  302. end
  303. end
  304. end
  305. !!This is the pcs_mass['body'] cap for the weight approximation
  306. if pcs_mass['body'] > 200: pcs_mass['body'] = 200
  307. !! All the ratios were rounded to 2 digits and there are divide 100s at the final calc points
  308. gs 'body', 'Find_waist_to_hip_ratio'
  309. gs 'body', 'Find_band_to_waist_ratio'
  310. gs 'body', 'Find_hip_to_height_ratio'
  311. salocatnow = func('body', 'Calc_salocat')
  312. gs 'body', 'Redistribute_Mass'
  313. !!This is if a Succubus has pcs_mass['body'] < 1
  314. if succubusflag = 1 and pcs_mass['body'] < 1:
  315. sucexcess -= 1
  316. pcs_mass['body'] += 3
  317. end
  318. !!This is if pcs_mass['body'] is still < 1
  319. if pcs_mass['body'] < 1:
  320. if fat >= 1:
  321. pcs_mass['body'] = 1
  322. fat -= 1
  323. elseif fat <= 0 and pcs_stren + pcs_vital > 0:
  324. stren_deg -= 1000
  325. vital_deg -= 1000
  326. pcs_mass['body'] = 1
  327. else
  328. if Enable_nogameover = 0:
  329. over = 3
  330. gt 'gameover'
  331. exit
  332. else
  333. pl '<font color=red><B>You starved to death, but Cheat Mode keeps you Alive.</B></font>'
  334. pcs_mass['body'] = 1
  335. end
  336. end
  337. end
  338. gs 'body', 'Update_vhips'
  339. salocatnow = func('body', 'Calc_salocat')
  340. !!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)
  341. ! if salolast > pcs_mass['body'] + pcs_mass['butt'] and pcs_mass['body'] + pcs_mass['butt'] <= (20 * (salocatnow - 1)) + 12:
  342. ! bodyVars['weight_warning'] = 1
  343. ! elseif salolast < pcs_mass['body'] + pcs_mass['butt'] and pcs_mass['body'] + pcs_mass['butt'] >= (20 * (salocatnow + 1)) - 12:
  344. ! bodyVars['weight_warning'] = 2
  345. ! end
  346. if pcs_mass['body'] < pcs_mass['body_message'] - 5:
  347. bodyVars['weight_warning'] = 1
  348. pcs_mass['body_message'] = pcs_mass['body']
  349. elseif pcs_mass['body'] > pcs_mass['body_message'] + 5:
  350. bodyVars['weight_warning'] = 2
  351. pcs_mass['body_message'] = pcs_mass['body']
  352. end
  353. !!This will trigger the dream for the option to use magic to increase bust
  354. !!Three nos at the dream will lock it out (1 yes resets the count)
  355. if pcs_magik >= 5 and MagikDostup = 0 and magf2bdo = 0:
  356. if tits < 10 and salolast < pcs_mass['body'] + pcs_mass['butt'] and pcs_mass['body'] + pcs_mass['butt'] >= (20 * (salocatnow + 1)) - 11:
  357. if mgf2bnocnt < 3:
  358. magf2bdo = 2
  359. else
  360. magf2bdo = 3 & killvar 'mgf2bnocnt'
  361. end
  362. end
  363. end
  364. !!This is to deal with the possibility that salocatnow changed by more than 1 (fat burners, vitamins, plastic surgery, etc.)
  365. if salocatnow < salocatlast: salocatlast -= 1
  366. if salocatnow > salocatlast: salocatlast += 1
  367. !!This is for use in the warning code and as part of the reset routines
  368. if salolast > pcs_mass['body'] + pcs_mass['butt']: salolast -= 1
  369. if salolast < pcs_mass['body'] + pcs_mass['butt']: salolast += 1
  370. !!Setting the pcs_apprnc bonus based on fat and strength
  371. temp_bmi = func('body', 'CalcBMI2')
  372. pcs_bmi[0] = temp_bmi / 10
  373. pcs_bmi[1] = temp_bmi mod 10
  374. killvar 'temp_bmi'
  375. !!This is to clean up unused variables
  376. killvar 'normbuffpick'
  377. killvar 'nrmbfpckct'
  378. killvar 'vmeat'
  379. killvar 'vfat'
  380. killvar 'Kves'
  381. killvar 'krost'
  382. killvar 'koefvesbt'
  383. killvar 'koefbt'
  384. end
  385. !!------------------------- BUFFS -------------------------!!
  386. if $ARGS[0] = 'Update_StatBuffs':
  387. !! This controls the gradual change in stat to -buf
  388. if strenbuf > pcs_stren:
  389. strenbuf -= 1
  390. elseif strenbuf < pcs_stren:
  391. strenbuf += 1
  392. end
  393. if vitalbuf > pcs_vital:
  394. vitalbuf -= 1
  395. elseif vitalbuf < pcs_vital:
  396. vitalbuf += 1
  397. end
  398. if agilbuf > pcs_agil:
  399. agilbuf -= 1
  400. elseif agilbuf < pcs_agil:
  401. agilbuf += 1
  402. end
  403. end
  404. if $ARGS[0] = 'Update_daily_body_other':
  405. if bodyVars['bust_other'] ! 0:
  406. if daystart mod 10 = 0:
  407. if bodyVars['bust_other'] > 0:
  408. bodyVars['bust_other'] -= 1
  409. else
  410. bodyVars['bust_other'] += 1
  411. end
  412. end
  413. end
  414. if bodyVars['butt_other'] ! 0:
  415. if daystart mod 15 = 0:
  416. if bodyVars['butt_other'] > 0:
  417. bodyVars['butt_other'] -= 1
  418. else
  419. bodyVars['butt_other'] += 1
  420. end
  421. end
  422. end
  423. gs 'drugs', 'breastcream', 'cikl'
  424. gs 'drugs', 'steroids', 'cikl'
  425. end
  426. !!------------------------- RATIOS -------------------------!!
  427. !! All the ratios were rounded to 2 digits and there are divide 100s at the final calc points
  428. ! Lies between 65 and 96
  429. if $ARGS[0] = 'Find_waist_to_hip_ratio':
  430. temp_wratio = (2 * vitalbuf + strenbuf + agilbuf) / 4
  431. !! Primary bodyVars['wratio'] handling
  432. if temp_wratio < 11:
  433. bodyVars['wratio'] = 85 + (11 - (vitalbuf + strenbuf + agilbuf) / 3)
  434. elseif temp_wratio < 20:
  435. bodyVars['wratio'] = 85
  436. elseif temp_wratio < 35:
  437. bodyVars['wratio'] = 85 - (temp_wratio - 20) / 3
  438. elseif temp_wratio < 55:
  439. bodyVars['wratio'] = 80 - (temp_wratio - 35) / 4
  440. elseif temp_wratio < 80:
  441. bodyVars['wratio'] = 75 - (temp_wratio - 55) / 5
  442. elseif temp_wratio >= 80:
  443. bodyVars['wratio'] = 70
  444. end
  445. !! High stat value edge case handling
  446. if (vitalbuf + strenbuf + agilbuf) / 3 > 100:
  447. bodyVars['wratio'] += (2 * agilbuf - vitalbuf - strenbuf) / 10
  448. end
  449. !! This is the oops and high stat gone overboard handling
  450. if bodyVars['wratio'] < 65: bodyVars['wratio'] = 65
  451. killvar 'temp_wratio'
  452. ! Lies between 105 and 125
  453. elseif $ARGS[0] = 'Find_band_to_waist_ratio':
  454. temp_bratio = (2 * strenbuf + vitalbuf + agilbuf) / 4
  455. if temp_bratio < 10:
  456. bodyVars['bratio'] = 105
  457. elseif temp_bratio <= 23:
  458. bodyVars['bratio'] = 106
  459. elseif temp_bratio <= 80:
  460. bodyVars['bratio'] = 106 + (temp_bratio - 23) / 3
  461. else
  462. bratio = 125
  463. end
  464. killvar 'temp_bratio'
  465. ! Lies between 56 and 60
  466. elseif $ARGS[0] = 'Find_hip_to_height_ratio':
  467. temp_hratio = (2 * agilbuf + vitalbuf + strenbuf) / 4
  468. if temp_hratio < 35:
  469. bodyVars['hratio'] = 60
  470. elseif temp_hratio < 45:
  471. bodyVars['hratio'] = 59
  472. elseif temp_hratio < 60:
  473. bodyVars['hratio'] = 58
  474. elseif temp_hratio < 80:
  475. bodyVars['hratio'] = 57
  476. else
  477. bodyVars['hratio'] = 56
  478. end
  479. killvar 'temp_hratio'
  480. end
  481. if $ARGS[0] = 'Calc_salocat':
  482. !!This calculates the current pcs_mass['body'] category; ranges are 20 points, seemed to balance best if the range is x10 the hip devisor
  483. if pcs_mass['body'] + pcs_mass['butt'] < 10:
  484. result = 0
  485. else
  486. result = (pcs_mass['body'] + pcs_mass['butt'] + 10) / 20
  487. end
  488. end
  489. if $ARGS[0] = 'Redistribute_Mass':
  490. !!This resets the genetic bust size (pcs_mass['bust_gen']) when the cheat is used to reduce breast size (maybe other things later)
  491. if titreduc = 1:
  492. killvar 'titreduc'
  493. if pcs_mass['bust_gen'] > pcs_mass['bust']:
  494. pcs_mass['bust_gen'] = pcs_mass['bust'] + 2 - pcs_mass['bust'] mod 5
  495. end
  496. end
  497. if assreduc = 1:
  498. killvar 'assreduc'
  499. if pcs_mass['butt_gen'] > pcs_mass['butt']:
  500. pcs_mass['butt_gen'] = pcs_mass['butt'] + 2 - pcs_mass['butt'] mod 5
  501. end
  502. end
  503. if salobustdo = 0 and bodyVars['cheat_staticAssets'] = 0:
  504. !!This controls the movement of pcs_mass['body'] to/from bust in order of precedence
  505. !!=============== MAGIC ===============!!
  506. if magikDostup = 0 and magf2bdo = 1 and daystart > pcs_mass['magic_day'] and pcs_mana >= manamax / 2:
  507. bodyVars['bust_magic'] += 1
  508. if pcs_mass['body'] >= 80: pcs_mass['body'] -= 3
  509. pcs_mass['magic_day'] = daystart + rand(7, 14)
  510. if bodyVars['bust_magic'] >= 2 + magtarcup * 5: magf2bdo = 0
  511. pcs_mana -= max(100, 2000 / pcs_magik)
  512. !! Old content
  513. !{
  514. elseif salocatnow < salocatlast:
  515. if magikDostup = 0 and bodyVars['bust_magic'] > 0 and salocatnow < 2:
  516. bodyVars['bust_magic'] -= 1
  517. pcs_mass['body'] += 3
  518. magf2bdo = 1
  519. end
  520. }
  521. end
  522. !!=============== Low Weight ===============!!
  523. if pcs_mass['body'] < 10:
  524. temp_diff = min(pcs_mass['bust'], 3)
  525. pcs_mass['bust'] -= temp_diff
  526. pcs_mass['body'] += temp_diff
  527. temp_diff = min(pcs_mass['butt'], 3)
  528. pcs_mass['butt'] -= temp_diff
  529. pcs_mass['body'] += temp_diff
  530. else
  531. temp_total_mass = pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']
  532. temp_tot_gen_mass = 60 + pcs_mass['bust_gen'] + pcs_mass['butt_gen']
  533. !!=============== Bust ===============!!
  534. temp_mass_bust = (pcs_mass['bust_gen'] * temp_total_mass) / temp_tot_gen_mass
  535. !!----------- Small -----------!!
  536. if temp_total_mass >= temp_tot_gen_mass - 10 and pcs_mass['bust'] < pcs_mass['bust_gen']:
  537. temp_diff = min(pcs_mass['bust_gen'] - pcs_mass['bust'], 2)
  538. pcs_mass['bust'] += temp_diff
  539. pcs_mass['body'] -= temp_diff
  540. 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']:
  541. !Keep bust at genetic level if pcs_mass['body'] >= 50 and pcs_mass['body'] <= 60
  542. !!----------- Growth -----------!!
  543. elseif temp_mass_bust > pcs_mass['bust']:
  544. pcs_mass['bust'] += 1
  545. pcs_mass['body'] -= 1
  546. !!----------- Shrink -----------!!
  547. elseif temp_mass_bust < pcs_mass['bust'] and pcs_mass['bust'] > 0:
  548. pcs_mass['bust'] -= 1
  549. pcs_mass['body'] += 1
  550. end
  551. !!=============== Ass ===============!!
  552. temp_mass_ass = (pcs_mass['butt_gen'] * temp_total_mass) / temp_tot_gen_mass
  553. !!----------- Small -----------!!
  554. if temp_total_mass >= temp_tot_gen_mass - 10 and pcs_mass['butt'] < pcs_mass['butt_gen']:
  555. temp_diff = min(pcs_mass['butt_gen'] - pcs_mass['butt'], 2)
  556. pcs_mass['butt'] += temp_diff
  557. pcs_mass['body'] -= temp_diff
  558. 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']:
  559. !Keep butt at genetic level if pcs_mass['body'] >= 50 and pcs_mass['body'] <= 60
  560. !!----------- Rest -----------!!
  561. elseif temp_mass_ass > pcs_mass['butt']:
  562. pcs_mass['butt'] += 1
  563. pcs_mass['body'] -= 1
  564. elseif temp_mass_ass < pcs_mass['butt'] and pcs_mass['butt'] > 0:
  565. pcs_mass['butt'] -= 1
  566. pcs_mass['body'] += 1
  567. end
  568. killvar 'temp_total_mass'
  569. killvar 'temp_tot_gen_mass'
  570. killvar 'temp_mass_bust'
  571. killvar 'temp_mass_ass'
  572. killvar 'temp_diff'
  573. end
  574. if bodyresetflag ! 0:
  575. pcs_mass['bust_message'] = pcs_mass['bust']
  576. pcs_mass['butt_message'] = pcs_mass['butt']
  577. else
  578. if pcs_mass['bust'] > pcs_mass['bust_message'] + 3:
  579. pcs_mass['bust_message'] = pcs_mass['bust']
  580. if pcs_mass['butt'] > pcs_mass['butt_message'] + 3:
  581. pcs_mass['butt_message'] = pcs_mass['butt']
  582. '<b>Your breasts and ass seem fuller</b>'
  583. elseif pcs_mass['butt'] < pcs_mass['butt_message'] - 3:
  584. pcs_mass['butt_message'] = pcs_mass['butt']
  585. '<b>Your breasts seem fuller and ass seems to be getting smaller</b>'
  586. else
  587. '<b>Your breasts seem fuller</b>'
  588. end
  589. elseif pcs_mass['bust'] < pcs_mass['bust_message'] - 3:
  590. pcs_mass['bust_message'] = pcs_mass['bust']
  591. if pcs_mass['butt'] > pcs_mass['butt_message'] + 3:
  592. pcs_mass['butt_message'] = pcs_mass['butt']
  593. '<b>Your breasts seem to be getting smaller and your ass seems fuller</b>'
  594. elseif pcs_mass['butt'] < pcs_mass['butt_message'] - 3:
  595. pcs_mass['butt_message'] = pcs_mass['butt']
  596. '<b>Your breasts and ass seem to be getting smaller</b>'
  597. else
  598. '<b>Your breasts seem to be getting smaller</b>'
  599. end
  600. else
  601. if pcs_mass['butt'] > pcs_mass['butt_message'] + 3:
  602. pcs_mass['butt_message'] = pcs_mass['butt']
  603. '<b>Your ass seems fuller</b>'
  604. elseif pcs_mass['butt'] < pcs_mass['butt_message'] - 3:
  605. pcs_mass['butt_message'] = pcs_mass['butt']
  606. '<b>Your ass seem to be getting smaller</b>'
  607. end
  608. end
  609. end
  610. end
  611. gs 'body', 'Update_vhips'
  612. killvar 'salobustdo'
  613. killvar 'temp_massbustchange'
  614. killvar 'temp_massasschange'
  615. end
  616. if $ARGS[0] = 'Reset_mass_distribution':
  617. total_mass = pcs_mass['body'] + pcs_mass['bust'] + pcs_mass['butt']
  618. total_gen_mass = 60 + pcs_mass['bust_gen'] + pcs_mass['butt_gen']
  619. if total_mass >= total_gen_mass - 10 and total_mass <= total_gen_mass:
  620. pcs_mass['bust'] = pcs_mass['bust_gen']
  621. pcs_mass['butt'] = pcs_mass['butt_gen']
  622. else
  623. pcs_mass['bust'] = (pcs_mass['bust_gen'] * total_mass) / total_gen_mass
  624. pcs_mass['butt'] = (pcs_mass['butt_gen'] * total_mass) / total_gen_mass
  625. end
  626. pcs_mass['body'] = total_mass - pcs_mass['bust'] - pcs_mass['butt']
  627. pcs_mass['bust_message'] = pcs_mass['bust']
  628. pcs_mass['butt_message'] = pcs_mass['butt']
  629. pcs_mass['body_message'] = pcs_mass['body']
  630. killvar 'total_mass'
  631. killvar 'total_gen_mass'
  632. gs 'body', 'Update_vhips'
  633. end
  634. if $ARGS[0] = 'Reset_preg_mass':
  635. bodyVars['pchem_next'] = 0
  636. pcs_mass['preg'] = 0
  637. :set_preg_body_loop
  638. if pregChem >= 800 and (pregChem - 800) * (pregChem - 800) >= bodyVars['pchem_next']:
  639. bodyVars['pchem_next'] += 1166400 & 1080 * 1080
  640. pcs_mass['preg'] += 1
  641. jump 'set_preg_body_loop'
  642. end
  643. end
  644. if $ARGS[0] = 'Set_mass_distribution_using_body':
  645. pcs_mass['body'] = ARGS[1]
  646. if ARGS[1] >= 50 and ARGS[1] <= 60:
  647. pcs_mass['bust'] = pcs_mass['bust_gen']
  648. pcs_mass['butt'] = pcs_mass['butt_gen']
  649. else
  650. pcs_mass['bust'] = (pcs_mass['bust_gen'] * ARGS[1]) / 60
  651. pcs_mass['butt'] = (pcs_mass['butt_gen'] * ARGS[1]) / 60
  652. end
  653. bodyVars['vhips'] = (pcs_mass['body'] + pcs_mass['butt'] - 80) / 2
  654. pcs_mass['bust_message'] = pcs_mass['bust']
  655. pcs_mass['butt_message'] = pcs_mass['butt']
  656. pcs_mass['body_message'] = pcs_mass['body']
  657. end
  658. !!------------------------- UPDATE vhips -------------------------!!
  659. if $ARGS[0] = 'Update_vhips':
  660. vhtmp = (pcs_mass['body'] + pcs_mass['butt'] - 80) / 2
  661. ! Because a reset should be updating hip size instantly (this set is a bit redundant anyway)
  662. if bodyresetflag = 1:
  663. bodyVars['vhips'] = vhtmp
  664. else
  665. if vhtmp < bodyVars['vhips']:
  666. bodyVars['vhips'] -= 1
  667. elseif vhtmp > bodyVars['vhips']:
  668. bodyVars['vhips'] += 1
  669. end
  670. end
  671. killvar 'vhtmp'
  672. !! Varies between 0 and 25 to 30 ish range
  673. !bodyVars['butt_bonus'] = max(0, pcs_mass['butt'] - max(0, bodyVars['vhips']))
  674. bodyVars['butt_bonus'] = (pcs_mass['butt'] - 20) / 3
  675. !! temp_vhips2 = vhips + (pcs_hgt * bodyVars['hratio'])/100 - (pcs_hgt * 72)/100
  676. !! temp_vhips2 = pcs_hips - (pcs_hgt * 72) / 1000
  677. temp_vhips2 = vhips - (pcs_hgt * (72 - bodyVars['hratio'])) / 100
  678. bodyVars['vofat'] = max(0, temp_vhips2 / 2)
  679. bodyVars['vhips'] -= 2 * bodyVars['vofat']
  680. !! vhips = vhips - max(0, temp_vhips2)
  681. !! vhips = vhips || vhips = (pcs_hgt * (72 - bodyVars['hratio'])) / 100
  682. killvar 'temp_vhips2'
  683. end
  684. !!==================================!!
  685. !! !!
  686. !! Skin Gain & Loss !!
  687. !! !!
  688. !!==================================!!
  689. if $ARGS[0] = 'SkinGain':
  690. if $ARGS[1] = 'CleanSelf' and lastShowerSkinGain ! daystart:
  691. lastShowerSkinGain = daystart
  692. skinDailyGain += 5
  693. !!needs to be changet to +3 when the bathLuffa in added.
  694. !!if bathLuffa = 1: skinDailyGain += 2
  695. elseif $ARGS[1] = 'Moisturizer':
  696. moisturizerDailyCount += 1
  697. if moisturizerDailyCount <= 2: skinDailyGain += 2
  698. end
  699. end
  700. if $ARGS[0] = 'SkinLoss':
  701. if $ARGS[1] = 'Smoke' and lastSmokeSkinPenalty ! daystart:
  702. lastSmokeSkinPenalty = daystart
  703. skinDailyPenalty += 1
  704. elseif $ARGS[1] = 'MakeUpSleep':
  705. skinDailyPenalty += 10
  706. end
  707. end
  708. !!==================================!!
  709. !! !!
  710. !! RESETS !!
  711. !! !!
  712. !!==================================!!
  713. if $ARGS[0] = 'softreset':
  714. !!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
  715. bodyresetflag = 1
  716. :resetloop
  717. if pcs_mass['body'] + pcs_mass['butt'] ! salolast:
  718. if gamestartflag = 1:
  719. salobustdo = 1
  720. end
  721. gs 'body', 'Update_Body'
  722. jump 'resetloop'
  723. end
  724. !!Updates pcs_apprncbase after a reset
  725. gs 'body', 'UpdateBodyMeasurement'
  726. gs 'body', 'Update_Appearance'
  727. !!Clears the warning and reset status flags if they were set
  728. bodyresetflag = 0
  729. bodyVars['weight_warning'] = 0
  730. end
  731. if $ARGS[0] = 'hardreset':
  732. !!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.
  733. !!Also could be built in as a means to in-game undo "dounspell", other than the cheat.
  734. if dounspell ! 1 or dounsplkil = 0:
  735. '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.'
  736. else
  737. pcs_mass['body'] = 12
  738. fat = 0
  739. agilbuf = pcs_agil
  740. strenbuf = pcs_stren
  741. vitalbuf = pcs_vital
  742. salobustdo = 1
  743. bodyresetflag = 1
  744. normbuffpick = -1
  745. gs 'body', 'Update_Body'
  746. pcs_mass['body'] = 60 + (2 * pcs_hips) - (pcs_hgt * bodyVars['hratio']) / 50
  747. if pcs_mass['body'] + pcs_mass['butt'] < 10:
  748. salocatnow = 0
  749. else
  750. salocatnow = 1 + (pcs_mass['body'] + pcs_mass['butt'] - 10) / 20
  751. end
  752. salocatlast = salocatnow
  753. salolast = pcs_mass['body'] + pcs_mass['butt']
  754. if pcs_mass['butt_gen'] = 0:
  755. pcs_mass['butt_gen'] = 20
  756. end
  757. bodyVars['vhips'] = (pcs_mass['body'] + pcs_mass['butt'] - 80) / 2
  758. if pcs_mass['bust_gen'] = 0:
  759. if pcs_mass['bust'] >= 27:
  760. pcs_mass['bust_gen'] = 27
  761. elseif pcs_mass['bust'] > 0:
  762. pcs_mass['bust_gen'] = 2 + pcs_mass['bust'] - pcs_mass['bust'] mod 5
  763. elseif bodyVars['bust_silicone'] >= 20:
  764. pcs_mass['bust_gen'] = 12
  765. pcs_mass['bust'] = 12
  766. bodyVars['bust_silicone'] -= 10
  767. end
  768. end
  769. pcs_mass['body_message'] = pcs_mass['body']
  770. pcs_mass['bust_message'] = pcs_mass['bust']
  771. pcs_mass['butt_message'] = pcs_mass['butt']
  772. gs 'body', 'reset_preg_mass'
  773. bodyresetflag = 0
  774. normbuffpick = 0
  775. bodyVars['weight_warning'] = 0
  776. magf2bdo = 0
  777. killvar 'dounsplkil'
  778. newbdsp = 1
  779. dounspell = 0
  780. gs 'body', 'Update_Appearance'
  781. gs 'body', 'Update_Body'
  782. gs 'stat'
  783. end
  784. end
  785. !!==================================!!
  786. !! !!
  787. !! INITIAL !!
  788. !! !!
  789. !!==================================!!
  790. if $ARGS[0] = 'initial':
  791. !! Sets the genetic bust size if it was not set in the start routines
  792. if pcs_mass['bust_gen'] = 0: pcs_mass['bust_gen'] = 12
  793. if pcs_mass['butt_gen'] = 0: pcs_mass['butt_gen'] = 20
  794. if pcs_mass['body'] >= 50 and pcs_mass['body'] <= 60:
  795. pcs_mass['bust'] = pcs_mass['bust_gen']
  796. pcs_mass['butt'] = pcs_mass['butt_gen']
  797. else
  798. gs 'body', 'Set_mass_distribution_using_body', pcs_mass['body']
  799. end
  800. strenbuf = pcs_stren
  801. agilbuf = pcs_agil
  802. vitalbuf = pcs_vital
  803. normbuffpick = -1
  804. gamestartflag = 1
  805. !! Calling soft reset will cause the main code to cycle up to the starting value of pcs_mass['body']
  806. gs 'body', 'softreset'
  807. !! This sets/resets the controler variables
  808. salocatnow = func('body', 'Calc_salocat')
  809. salocatlast = salocatlast
  810. normbuffpick = 0
  811. magf2bdo = 0
  812. killvar 'gamestartflag'
  813. newbdsp = 1
  814. !! This does all the body shape setting before the first stat call
  815. temp_bmi = func('body', 'CalcBMI2')
  816. pcs_bmi[0] = temp_bmi / 10
  817. pcs_bmi[1] = temp_bmi mod 10
  818. killvar 'temp_bmi'
  819. gs 'body', 'UpdateBodyImage'
  820. gs 'body', 'Update_Appearance'
  821. end
  822. --- body ---------------------------------