1
0

body.qsrc 29 KB

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