crossfit_north_box.qsrc 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # crossfit_north_box
  2. menu_off = 0
  3. gs 'shortgs', 'setloc', 'crossfit_north_box', $ARGS[0]
  4. $sexloc = 'crossfit_north_box'
  5. $location_type = 'public_indoors'
  6. $crossfit_north_image_dir = 'images/locations/city/citycenter/gym/crossfit/'
  7. if $ARGS[0] = 'box':
  8. act 'Leave': gt 'fit', 'dressing_room'
  9. if crossfit_random_choice < daystart OR $todays_crossfit_wod = '':
  10. gs 'crossfit_north_wod', 'setup_wod'
  11. $todays_crossfit_wod = $crossfit_wods[rand(0, ARRSIZE('$crossfit_wods') - 1)]
  12. crossfit_random_choice = daystart
  13. end
  14. if $previous_record_holder ! '' and pcs_lover < 3 and last_crossfit_workout < daystart:
  15. gt 'crossfit_north_girlmeet', 'start'
  16. end
  17. '<center><b><font color="maroon">Crossfit North St. Petersburg</font></b></center>'
  18. '<center><img <<$set_imgh>> src="<<$crossfit_north_image_dir>>start.jpg"></center>'
  19. 'This crossfit box might not look like it, but is said to be one of the best ones in the region.'
  20. 'Today''s exercise is <<$todays_crossfit_wod>>.'
  21. 'It consists of:'
  22. gs 'crossfit_north_wod', $todays_crossfit_wod
  23. if crossfit_first = 1:
  24. act 'Check personal records':
  25. cla
  26. menu_off = 1
  27. gt 'crossfit_north_record', 'view_records'
  28. end
  29. end
  30. if pcs_energy >= 20 and pcs_stam >= stammax / 5:
  31. act 'Start the exercise':
  32. menu_off = 1
  33. if last_crossfit_workout = daystart:
  34. msg'<b><font color = red>You already did this workout today. That''s enough for one day.</font></b>'
  35. else
  36. *clr & cla
  37. last_crossfit_workout = daystart
  38. crossfit_first = 1
  39. abonement -= 1
  40. 'You start with the workout.'
  41. gs 'crossfit_north_wod', $todays_crossfit_wod
  42. gs 'exercise', 'tier4', 20, 'stren', 'vital', 'agil'
  43. '<center><video autoplay loop src="<<$crossfit_north_image_dir>><<$wod_video[$todays_crossfit_wod]>>.mp4"></video></center>'
  44. current_wod_score = max(1,(100 - ((100 * pcs_health * (rand(40,100) + pcs_sleep + pcs_vital + pcs_agil + pcs_stren))/ (healthmax * 500))))
  45. cla
  46. act 'Check your score':
  47. cla
  48. $resultstring = func('crossfit_north_record', 'recordstring', $todays_crossfit_wod, current_wod_score)
  49. 'You successfully finish the workout <<$pcs_nickname>> in <<$resultstring>>'
  50. if personal_wod_record[$todays_crossfit_wod] = 0:
  51. personal_wod_record[$todays_crossfit_wod] = current_wod_score
  52. elseif current_wod_score < personal_wod_record[$todays_crossfit_wod]:
  53. 'This is a new personal record!'
  54. personal_wod_record[$todays_crossfit_wod] = current_wod_score
  55. end
  56. if box_wod_record[$todays_crossfit_wod] = 0:
  57. box_wod_record[$todays_crossfit_wod] = current_wod_score
  58. $box_wod_record_holder[$todays_crossfit_wod] = $pcs_nickname
  59. elseif current_wod_score < box_wod_record[$todays_crossfit_wod]:
  60. 'Not only that, it''s also a new best record for the whole box!'
  61. $prevrecordstring = func('crossfit_north_record', 'recordstring', $todays_crossfit_wod, box_wod_record[$todays_crossfit_wod])
  62. if $box_wod_record_holder[$todays_crossfit_wod] ! $pcs_nickname:
  63. $previous_record_holder = $box_wod_record_holder[$todays_crossfit_wod]
  64. 'You beat <<$previous_record_holder>>''s record of <<$prevrecordstring>>'
  65. else
  66. 'You beat your own old box record of <<$prevrecordstring>>'
  67. end
  68. killvar '$prevrecordstring'
  69. box_wod_record[$todays_crossfit_wod] = current_wod_score
  70. $box_wod_record_holder[$todays_crossfit_wod] = $pcs_nickname
  71. end
  72. killvar 'current_wod_score'
  73. act 'Finish and go to the changing room':
  74. gt 'fit', 'dressing_room'
  75. end
  76. end
  77. end
  78. end
  79. elseif pcs_stam >= stammax / 5:
  80. act 'Start the exercise': '<br><font color="red">You feel too hungry to do this exercise now.</font>'
  81. else
  82. act 'Start the exercise': '<br><font color="red">You are to exhausted to do this. Recover your stamina before trying to do this exercise.</font>'
  83. end
  84. end
  85. --- crossfit_north_box ---------------------------------