havana_crossfit_funcs.qsrc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. # havana_crossfit_funcs
  2. !! set up wods
  3. if $ARGS[0] = 'setup_wod':
  4. killvar '$crossfit_wods'
  5. killvar 'wod_min_score'
  6. killvar 'wod_max_score'
  7. killvar '$wod_type'
  8. killvar '$wod_video'
  9. gs 'havana_crossfit_funcs', 'add_wod', 'Fran', 120, 600, 'for_time', 'pullup'
  10. gs 'havana_crossfit_funcs', 'add_wod', 'Nancy', 600, 1200, 'for_time', 'ohs'
  11. gs 'havana_crossfit_funcs', 'add_wod', 'Isabel', 90, 600, 'for_time', 'snatch'
  12. gs 'havana_crossfit_funcs', 'add_wod', 'Open 17.1', 600, 1200, 'for_time', 'dumbbell_snatch'
  13. gs 'havana_crossfit_funcs', 'add_wod', 'Open 16.1', 1300, 100, 'for_rounds', 'overhead_lunge'
  14. gs 'havana_crossfit_funcs', 'add_wod', 'Karen', 300, 720, 'for_time', 'wallball'
  15. end
  16. if $ARGS[0] = 'Fran':
  17. '- Thruster 65 lbs'
  18. '- Pull-ups'
  19. '21-15-9 repetitions each, for time'
  20. end
  21. if $ARGS[0] = 'Nancy':
  22. '- 400 meter run'
  23. '- Overhead squat 65 lbs x 15'
  24. '5 rounds for time'
  25. end
  26. if $ARGS[0] = 'Isabel':
  27. '- Snatch 95 pounds'
  28. '30 repetitions for time'
  29. end
  30. if $ARGS[0] = 'Open 17.1':
  31. ' - 10 dumbbell snatches'
  32. ' - 15 burpee box jump-overs'
  33. ' - 20 dumbbell snatches'
  34. ' - 15 burpee box jump-overs'
  35. ' - 30 dumbbell snatches'
  36. ' - 15 burpee box jump-overs'
  37. ' - 40 dumbbell snatches'
  38. ' - 15 burpee box jump-overs'
  39. ' - 50 dumbbell snatches'
  40. ' - 15 burpee box jump-overs'
  41. 'For time'
  42. end
  43. if $ARGS[0] = 'Open 16.1':
  44. ' - 25-ft. overhead walking lunge'
  45. ' - 8 burpees'
  46. ' - 25-ft. overhead walking lunge'
  47. ' - 8 chest-to-bar pull-ups'
  48. 'Complete as many rounds and reps as possible in 20 minutes'
  49. end
  50. if $ARGS[0] = 'Karen':
  51. '- 150 wallball shots'
  52. 'For time'
  53. end
  54. if $ARGS[0] = 'add_wod':
  55. $crossfit_wods[] = $ARGS[1]
  56. wod_min_score[$ARGS[1]] = ARGS[2]
  57. wod_max_score[$ARGS[1]] = ARGS[3]
  58. $wod_type[$ARGS[1]] = $ARGS[4]
  59. $wod_video[$ARGS[1]] = $ARGS[5]
  60. end
  61. if $ARGS[0] = 'recordstring':
  62. if ARGS[2] = 0:
  63. $result = 'No score yet'
  64. else
  65. wod_score = wod_min_score[$ARGS[1]] + (wod_max_score[$ARGS[1]] - wod_min_score[$ARGS[1]]) * ARGS[2] / 100
  66. if $wod_type[$ARGS[1]] = 'for_time':
  67. $result = '<<wod_score/60>> minutes and <<wod_score - (wod_score/60)*60>> seconds'
  68. end
  69. if $wod_type[$ARGS[1]] = 'for_rounds':
  70. $result = '<<wod_score/100>> rounds and <<wod_score - (wod_score/100)*100>>% of the last one'
  71. end
  72. end
  73. end
  74. if $ARGS[0] = 'update_box_records':
  75. if last_box_record_update = 0 or last_box_record_update + 30 < daystart:
  76. number_of_box_record_updates = 30
  77. else
  78. number_of_box_record_updates = daystart - last_box_record_update
  79. end
  80. last_box_record_update = daystart
  81. current_record_update_count = 0
  82. :recordupdateloop
  83. if current_record_update_count < number_of_box_record_updates:
  84. gs 'havana_crossfit_funcs', 'box_records'
  85. current_record_update_count += 1
  86. jump 'recordupdateloop'
  87. end
  88. killvar 'current_record_update_count'
  89. killvar 'number_of_box_record_updates'
  90. end
  91. if $ARGS[0] = 'box_records':
  92. crossfit_record_it = 0
  93. :recordgeneratorloop
  94. if crossfit_record_it < arrsize('$crossfit_wods'):
  95. $crossfit_wod = $crossfit_wods[crossfit_record_it]
  96. new_record_wod_time = max(1, (100 - (100 * (rand(40,100) + rand(0,100) + rand(0,100) + rand(0,100)) / 400)))
  97. if box_wod_record[$crossfit_wod] = 0 or box_wod_record[$crossfit_wod] > new_record_wod_time:
  98. box_wod_record[$crossfit_wod] = new_record_wod_time
  99. !! record holder changes only in 1/3rd of the cases from previous holder, or if sveta is record holder
  100. if rand(0, 2) = 0 OR $box_wod_record_holder[$crossfit_wod] = '' OR $box_wod_record_holder[$crossfit_wod] = $pcs_nickname:
  101. gs 'npcrnamefile', 'rusFemale'
  102. $box_wod_record_holder[$crossfit_wod] = $npctempgn[1]
  103. end
  104. end
  105. crossfit_record_it += 1
  106. jump 'recordgeneratorloop'
  107. end
  108. killvar 'crossfit_record_it'
  109. killvar 'new_record_wod_time'
  110. killvar '$crossfit_wod'
  111. end
  112. --- havana_crossfit_funcs ---------------------------------