Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. custom_require.call(%w(common common-travel))
  2.  
  3. class Performance
  4.  
  5. include DRC
  6. include DRCT
  7.  
  8. def initialize
  9. no_pause_all
  10. startTime = Time.new.to_i
  11.  
  12. @settings = get_settings()
  13. @song_list = get_data('perform').perform_options
  14. UserVars.song = @song_list.first.first unless UserVars.song
  15. start_script('magic') if DRStats.bard?
  16. fput('release ecry') if DRStats.bard?
  17. if play_song
  18. loop do
  19. runTime = Time.new.to_i - startTime
  20. return if runTime > 600
  21. return if DRSkill.getxp('Performance') > 30
  22. line = get
  23. pause 0.05 unless line
  24. case line
  25. when /You begin (.*)/, /You continue (.*)/, /You find yourself relaxing (.*)/, /You concentrate on your sense of rhythm (.*)/, /You continue (.*)/
  26. if DRSkill.getxp('Performance') > 30
  27. fput('stop play')
  28. exit
  29. end
  30. when /You finish (.*)/
  31. if DRSkill.getxp('Performance') <= 30
  32. play_song
  33. else
  34. exit
  35. end
  36. when /Perhaps you should find somewhere drier/
  37. exit
  38. end
  39. end
  40. end
  41. stop_script('magic') if Script.running?('magic')
  42. end
  43.  
  44. def play_song
  45. @did_play = true
  46. result = bput("play #{UserVars.song}", 'dirtiness may affect your performance', 'slightest hint of difficulty', 'fumble slightly', 'Your zills is submerged in the water','You begin a', 'You struggle to begin', 'You\'re already playing a song', 'You effortlessly begin', 'You begin some', 'You cannot play', 'Play on what instrument', 'now isn\'t the best time to be playing', 'Perhaps you should find somewhere drier before trying to play')
  47. echo result
  48. case result
  49. when 'Play on what instrument'
  50. fput('get zills')
  51. fput('wear zills')
  52. @no_instrument = true
  53. return false
  54. when 'now isn\'t the best time to be playing', 'Perhaps you should find somewhere drier before trying to play'
  55. return false
  56. when 'You\'re already playing a song'
  57. echo "Already playing"
  58. fput('stop play')
  59. return play_song
  60. when 'You cannot play'
  61. wait_for_script_to_complete('safe-room')
  62. when 'dirtiness may affect your performance'
  63. if DRSkill.getrank('Performance') < 20
  64. echo "Skipping cleaning of zills due to low rank of Performance: #{DRSkill.getrank('Performance')}" if UserVars.crossing_trainer_debug
  65. return true
  66. end
  67. stop_play
  68. clean_zills
  69. return play_song
  70. when 'slightest hint of difficulty', 'fumble slightly'
  71. echo "Good"
  72. return true
  73. when 'You begin a', 'You effortlessly begin', 'You begin some'
  74. echo "Next song"
  75. stop_play
  76. UserVars.song = @song_list[UserVars.song] || @song_list.first.first
  77. return play_song
  78. when 'You struggle to begin'
  79. if UserVars.song != @song_list.first.first
  80. stop_play
  81. UserVars.song = @song_list.first.first
  82. return play_song
  83. else
  84. return true
  85. end
  86.  
  87.  
  88. end
  89. return
  90. end
  91.  
  92. def stop_play
  93. return unless @did_play
  94. return if @no_instrument
  95. @did_play = false
  96. bput('stop play', 'You stop playing your song', 'In the name of', "But you're not performing")
  97. Flags['ct-song'] = true
  98. end
  99.  
  100. def clean_zills
  101. cloth = @settings.cleaning_cloth
  102. bput('remove my zills', 'You slide')
  103. bput("get my #{cloth}", 'You get')
  104.  
  105. loop do
  106. case bput("wipe my zills with my #{cloth}", 'Roundtime', 'not in need of drying', 'You should be sitting up')
  107. when 'not in need of drying'
  108. break
  109. when 'You should be sitting up'
  110. fix_standing
  111. next
  112. end
  113. pause 1
  114. waitrt?
  115.  
  116. until /you wring a dry/i =~ bput("wring my #{cloth}", 'You wring a dry', 'You wring out')
  117. pause 1
  118. waitrt?
  119. end
  120. end
  121.  
  122. until /not in need of cleaning/i =~ bput("clean my zills with my #{cloth}", 'Roundtime', 'not in need of cleaning')
  123. pause 1
  124. waitrt?
  125. end
  126.  
  127. bput('wear my zills', 'You slide')
  128. bput("stow my #{cloth}", 'You put')
  129. end
  130.  
  131. end
  132.  
  133. Performance.new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement