body.qsrc 28 KB

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