gemwarrior 0.15.4 → 0.15.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/README.md +44 -44
- data/bin/gemwarrior +6 -5
- data/data/default_world.yaml +66 -66
- data/data/fantasy_names.yaml +4223 -4223
- data/gemwarrior.gemspec +44 -43
- data/lib/gemwarrior/entities/entity.rb +1 -0
- data/lib/gemwarrior/entities/item.rb +3 -3
- data/lib/gemwarrior/entities/items/apple.rb +11 -0
- data/lib/gemwarrior/entities/items/cup.rb +5 -0
- data/lib/gemwarrior/entities/items/dehumidifier.rb +6 -1
- data/lib/gemwarrior/entities/items/feather.rb +5 -0
- data/lib/gemwarrior/entities/items/flower.rb +5 -0
- data/lib/gemwarrior/entities/items/keystone.rb +5 -0
- data/lib/gemwarrior/entities/items/pedestal.rb +20 -20
- data/lib/gemwarrior/entities/items/stonemite.rb +5 -0
- data/lib/gemwarrior/entities/people/arena_master.rb +49 -49
- data/lib/gemwarrior/entities/people/rockney.rb +2 -2
- data/lib/gemwarrior/entities/people/ware_hawker.rb +3 -3
- data/lib/gemwarrior/entities/person.rb +3 -2
- data/lib/gemwarrior/entities/player.rb +15 -11
- data/lib/gemwarrior/entities/weapon.rb +1 -1
- data/lib/gemwarrior/evaluator.rb +4 -3
- data/lib/gemwarrior/inventory.rb +11 -5
- data/lib/gemwarrior/misc/audio.rb +65 -36
- data/lib/gemwarrior/misc/audio_cues.rb +71 -7
- data/lib/gemwarrior/misc/bloops_cues.rb +63 -5
- data/lib/gemwarrior/misc/name_generator.rb +7 -7
- data/lib/gemwarrior/repl.rb +131 -17
- data/lib/gemwarrior/version.rb +1 -1
- data/tests/compare_versions.rb +18 -0
- data/tests/getch_test.rb +9 -0
- data/tests/hooch.rb +16 -0
- data/tests/item_hashes.rb +7 -0
- data/tests/json_api_call.rb +42 -0
- data/tests/module_hashes.rb +90 -0
- data/tests/test-class/test-class.rb +50 -0
- data/tests/test-feep/test-feep.rb +35 -0
- data/tests/test-save-load/save-load.rb +181 -0
- data/tests/test-save-load/save.conf +2 -0
- data/tests/test-singleton/game.rb +4 -0
- data/tests/test-singleton/game_options.rb +15 -0
- metadata +58 -33
@@ -6,7 +6,7 @@
|
|
6
6
|
require 'yaml'
|
7
7
|
|
8
8
|
class NameGenerator
|
9
|
-
attr_accessor :
|
9
|
+
attr_accessor :type, :name_set, :chain_cache
|
10
10
|
|
11
11
|
def initialize(type)
|
12
12
|
self.type = type
|
@@ -39,9 +39,9 @@ class NameGenerator
|
|
39
39
|
def generate_names(count = 1)
|
40
40
|
list = []
|
41
41
|
|
42
|
-
|
42
|
+
(1..count).each {
|
43
43
|
list.push(generate_name)
|
44
|
-
|
44
|
+
}
|
45
45
|
|
46
46
|
return list
|
47
47
|
end
|
@@ -117,11 +117,11 @@ class NameGenerator
|
|
117
117
|
chain.each do |key, subkey|
|
118
118
|
table_len[key] = 0
|
119
119
|
|
120
|
-
subkey.each do |
|
120
|
+
subkey.each do |subsubkey, value|
|
121
121
|
count = value
|
122
122
|
weighted = (count ** 1.3).floor
|
123
123
|
|
124
|
-
chain[key][
|
124
|
+
chain[key][subsubkey] = weighted
|
125
125
|
table_len[key] += weighted
|
126
126
|
end
|
127
127
|
end
|
@@ -136,7 +136,7 @@ class NameGenerator
|
|
136
136
|
parts = select_link(chain, 'parts')
|
137
137
|
names = []
|
138
138
|
|
139
|
-
|
139
|
+
(0..parts-1).each {
|
140
140
|
name_len = select_link(chain, 'name_len')
|
141
141
|
c = select_link(chain, 'initial')
|
142
142
|
name = c
|
@@ -148,7 +148,7 @@ class NameGenerator
|
|
148
148
|
last_c = c
|
149
149
|
end
|
150
150
|
names.push(name)
|
151
|
-
|
151
|
+
}
|
152
152
|
|
153
153
|
return names.join(' ')
|
154
154
|
end
|
data/lib/gemwarrior/repl.rb
CHANGED
@@ -6,7 +6,9 @@ require 'os'
|
|
6
6
|
require 'clocker'
|
7
7
|
require 'io/console'
|
8
8
|
require 'gems'
|
9
|
+
require 'ap'
|
9
10
|
|
11
|
+
require_relative 'misc/audio'
|
10
12
|
require_relative 'misc/timer'
|
11
13
|
require_relative 'misc/wordlist'
|
12
14
|
require_relative 'evaluator'
|
@@ -23,6 +25,7 @@ module Gemwarrior
|
|
23
25
|
SPLASH_MESSAGE = 'Welcome to *Jool*, where randomized fortune is just as likely as mayhem.'
|
24
26
|
GITHUB_NAME = 'michaelchadwick'
|
25
27
|
GITHUB_PROJECT = 'gemwarrior'
|
28
|
+
ERROR_SOUND_NOT_ENABLED = 'Sound is disabled! Enter \'x\' to exit'
|
26
29
|
|
27
30
|
attr_accessor :game, :world, :evaluator
|
28
31
|
|
@@ -58,7 +61,7 @@ module Gemwarrior
|
|
58
61
|
return [screen_width, SCREEN_WIDTH_MAX].min
|
59
62
|
end
|
60
63
|
end
|
61
|
-
|
64
|
+
|
62
65
|
def start(initial_command, extra_command, new_skip, resume_skip)
|
63
66
|
setup_screen(initial_command, extra_command, new_skip, resume_skip)
|
64
67
|
|
@@ -114,6 +117,14 @@ module Gemwarrior
|
|
114
117
|
Readline.readline(prompt_text, true).to_s
|
115
118
|
end
|
116
119
|
|
120
|
+
def get_save_file_name
|
121
|
+
if save_file_exist?
|
122
|
+
File.open(GameOptions.data['save_file_yaml_path'], 'r') do |f|
|
123
|
+
return YAML.load(f)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
117
128
|
def puts(s = '', width = GameOptions.data['wrap_width'])
|
118
129
|
super s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n") unless s.nil?
|
119
130
|
end
|
@@ -138,14 +149,14 @@ module Gemwarrior
|
|
138
149
|
noun2_values = WordList.new('noun-plural')
|
139
150
|
noun3_values = WordList.new('noun-plural')
|
140
151
|
|
141
|
-
puts "* Remember: #{noun1_values.get_random_value} and #{noun2_values.get_random_value} are the key to #{noun3_values.get_random_value} *\n\n"
|
152
|
+
puts "* Remember: #{noun1_values.get_random_value.colorize(:yellow)} and #{noun2_values.get_random_value.colorize(:yellow)} are the key to #{noun3_values.get_random_value.colorize(:yellow)} *\n\n"
|
142
153
|
puts
|
143
154
|
end
|
144
155
|
|
145
156
|
def print_about_text
|
146
157
|
puts 'Gem Warrior - A Game of Fortune and Mayhem'.colorize(:yellow)
|
147
158
|
puts '=========================================='.colorize(:yellow)
|
148
|
-
puts 'Gem Warrior is a text adventure roguelike-lite as a RubyGem created by Michael Chadwick (mike@
|
159
|
+
puts 'Gem Warrior is a text adventure roguelike-lite as a RubyGem created by Michael Chadwick (mike@neb.host) and released as open-source on Github. Take on the task set by Queen Ruby to defeat the evil Emerald and get back the ShinyThing(tm) he stole for terrible, dastardly reasons.'
|
149
160
|
puts
|
150
161
|
puts 'Explore the land of Jool with the power of text, fighting enemies to improve your station, grabbing curious items that may or may not come in handy, and finally defeating Mr. Emerald himself to win the game.'
|
151
162
|
end
|
@@ -209,7 +220,8 @@ module Gemwarrior
|
|
209
220
|
puts 'Sound System Selection'.colorize(:yellow)
|
210
221
|
puts '================================='.colorize(:yellow)
|
211
222
|
puts
|
212
|
-
|
223
|
+
win32 = ' (1) WIN32-SOUND '
|
224
|
+
OS.windows? ? (print win32) : (print win32.colorize(:light_black))
|
213
225
|
print '(SELECTED)'.colorize(:yellow) if GameOptions.data['sound_system'].eql?('win32-sound')
|
214
226
|
print "\n"
|
215
227
|
print ' (2) FEEP '
|
@@ -218,6 +230,9 @@ module Gemwarrior
|
|
218
230
|
print ' (3) BLOOPS '
|
219
231
|
print '(SELECTED)'.colorize(:yellow) if GameOptions.data['sound_system'].eql?('bloops')
|
220
232
|
print "\n"
|
233
|
+
print "\n"
|
234
|
+
print ' (T) TEST SOUND '
|
235
|
+
print "\n"
|
221
236
|
puts
|
222
237
|
puts ' WIN32-SOUND : good quality; Windows-only'
|
223
238
|
puts ' FEEP : cross-platform; VERY SLOW and BUGGY'
|
@@ -232,19 +247,34 @@ module Gemwarrior
|
|
232
247
|
puts 'Enter option number to select sound system, or any other key to exit.'
|
233
248
|
puts
|
234
249
|
print '[GW_OPTS]-[SOUND_SYSTEM]> '
|
250
|
+
|
235
251
|
answer = STDIN.getch.chomp.downcase
|
236
252
|
|
237
253
|
case answer
|
238
254
|
when '1'
|
239
|
-
|
255
|
+
if OS.windows?
|
256
|
+
puts answer
|
257
|
+
GameOptions.add 'sound_system', 'win32-sound'
|
258
|
+
else
|
259
|
+
puts
|
260
|
+
end
|
240
261
|
print_options_sound_sytem
|
241
262
|
when '2'
|
263
|
+
puts answer
|
242
264
|
GameOptions.add 'sound_system', 'feep'
|
243
265
|
print_options_sound_sytem
|
244
266
|
when '3'
|
267
|
+
puts answer
|
245
268
|
GameOptions.add 'sound_system', 'bloops'
|
246
269
|
print_options_sound_sytem
|
270
|
+
when 't'
|
271
|
+
puts answer
|
272
|
+
Audio.init
|
273
|
+
play_test_tune
|
274
|
+
print_errors
|
275
|
+
print_options_sound_sytem
|
247
276
|
else
|
277
|
+
puts
|
248
278
|
return
|
249
279
|
end
|
250
280
|
end
|
@@ -305,16 +335,62 @@ module Gemwarrior
|
|
305
335
|
end
|
306
336
|
end
|
307
337
|
|
338
|
+
def print_sound_test
|
339
|
+
puts
|
340
|
+
puts 'Gem Warrior Sound Test'.colorize(:yellow)
|
341
|
+
puts '================================='.colorize(:yellow)
|
342
|
+
|
343
|
+
if GameOptions.data['sound_enabled']
|
344
|
+
puts
|
345
|
+
puts 'Play all the sounds in Gemwarrior.'
|
346
|
+
puts
|
347
|
+
|
348
|
+
cues = Audio.get_cues
|
349
|
+
for cue in cues do
|
350
|
+
pp cue[0].to_s
|
351
|
+
end
|
352
|
+
|
353
|
+
puts
|
354
|
+
puts '================================='.colorize(:yellow)
|
355
|
+
puts
|
356
|
+
puts 'Enter sound id to play it, or enter "x" to return to the main menu.'
|
357
|
+
else
|
358
|
+
GameOptions.data['errors'] = ERROR_SOUND_NOT_ENABLED
|
359
|
+
end
|
360
|
+
|
361
|
+
print_errors
|
362
|
+
|
363
|
+
puts
|
364
|
+
print '[GW_SOUND_TEST]> '
|
365
|
+
|
366
|
+
answer = gets.chomp.downcase
|
367
|
+
|
368
|
+
# print answer
|
369
|
+
if answer.eql?('x')
|
370
|
+
return
|
371
|
+
else
|
372
|
+
Audio.play_synth(answer.to_sym)
|
373
|
+
print_sound_test
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
308
377
|
def print_main_menu
|
309
378
|
puts
|
310
379
|
puts " GW v#{Gemwarrior::VERSION}"
|
311
380
|
puts '======================='
|
312
|
-
|
381
|
+
|
382
|
+
save_file = get_save_file_name
|
383
|
+
if not save_file.nil?
|
384
|
+
recent_name = save_file.instance_variable_get(:@player).name
|
385
|
+
puts " #{'(R)esume Game'.colorize(:green)} as #{recent_name.colorize(:yellow)}"
|
386
|
+
end
|
387
|
+
|
313
388
|
puts ' (N)ew Game'
|
314
389
|
puts ' (A)bout'
|
315
390
|
puts ' (H)elp'
|
316
391
|
puts ' (O)ptions'
|
317
392
|
puts ' (L)og of Attempts'
|
393
|
+
puts ' (S)ound Test'
|
318
394
|
puts ' (C)heck for Updates'
|
319
395
|
puts ' (E)xit'.colorize(:red)
|
320
396
|
puts '======================='
|
@@ -349,6 +425,7 @@ module Gemwarrior
|
|
349
425
|
run_main_menu
|
350
426
|
else
|
351
427
|
print_errors
|
428
|
+
play_resume_tune
|
352
429
|
load_saved_world(result)
|
353
430
|
return
|
354
431
|
end
|
@@ -369,6 +446,10 @@ module Gemwarrior
|
|
369
446
|
puts choice
|
370
447
|
display_log_of_attempts
|
371
448
|
run_main_menu
|
449
|
+
when 's'
|
450
|
+
puts choice
|
451
|
+
print_sound_test
|
452
|
+
run_main_menu
|
372
453
|
when 'c'
|
373
454
|
puts choice
|
374
455
|
check_for_new_release
|
@@ -378,31 +459,52 @@ module Gemwarrior
|
|
378
459
|
puts MAIN_MENU_QUIT_MESSAGE
|
379
460
|
game.update_options_file
|
380
461
|
exit
|
381
|
-
|
382
|
-
|
462
|
+
when "\c?" # Backspace/Delete
|
463
|
+
refresh_menu
|
464
|
+
when "\e" # ANSI escape sequence
|
465
|
+
case STDIN.getch
|
466
|
+
when '[' # CSI
|
467
|
+
choice = STDIN.getch
|
468
|
+
puts choice
|
469
|
+
case choice
|
470
|
+
when 'A', 'B', 'C', 'D' # arrow keys
|
471
|
+
refresh_menu
|
472
|
+
end
|
473
|
+
end
|
474
|
+
else # All other invalid options
|
475
|
+
refresh_menu
|
383
476
|
end
|
384
477
|
end
|
385
478
|
|
479
|
+
# need this to handle any non-valid input at the main menu
|
480
|
+
def refresh_menu
|
481
|
+
clear_screen
|
482
|
+
print_logo
|
483
|
+
run_main_menu
|
484
|
+
end
|
485
|
+
|
386
486
|
def log_stats(duration, pl)
|
387
487
|
# display stats upon exit
|
388
488
|
Hr.print('#')
|
389
489
|
print 'Gem Warrior'.colorize(color: :white, background: :black)
|
390
490
|
print " v#{Gemwarrior::VERSION}".colorize(:yellow)
|
391
|
-
print " played for #{duration[:mins].to_s.colorize(color: :white, background: :black)} min(s)
|
392
|
-
print " #{duration[:secs].to_s.colorize(color: :white, background: :black)} sec(s)
|
393
|
-
print " and #{duration[:ms].to_s.colorize(color: :white, background: :black)} ms
|
491
|
+
print " played for #{duration[:mins].to_s.colorize(color: :white, background: :black)} min(s)"
|
492
|
+
print ", #{duration[:secs].to_s.colorize(color: :white, background: :black)} sec(s)"
|
493
|
+
# print ", and #{duration[:ms].to_s.colorize(color: :white, background: :black)} ms"
|
494
|
+
print "\n"
|
394
495
|
Hr.print('-')
|
395
|
-
print "#{pl.name.ljust(10)
|
496
|
+
print "#{pl.name.ljust(10).colorize(:green)} "
|
497
|
+
print "destroyed #{pl.monsters_killed.to_s.colorize(color: :yellow, background: :black)} monster(s)"
|
396
498
|
print "\n".ljust(12)
|
397
|
-
print "
|
499
|
+
print "destroyed #{pl.bosses_killed.to_s.colorize(color: :yellow, background: :black)} boss(es)"
|
398
500
|
print "\n".ljust(12)
|
399
501
|
print "picked up #{pl.items_taken.to_s.colorize(color: :yellow, background: :black)} item(s)"
|
400
502
|
print "\n".ljust(12)
|
401
|
-
print "traveled
|
503
|
+
print "traveled #{pl.movements_made.to_s.colorize(color: :yellow, background: :black)} time(s)"
|
402
504
|
print "\n".ljust(12)
|
403
|
-
print "rested
|
505
|
+
print "rested #{pl.rests_taken.to_s.colorize(color: :yellow, background: :black)} time(s)"
|
404
506
|
print "\n".ljust(12)
|
405
|
-
print "died
|
507
|
+
print "died #{pl.deaths.to_s.colorize(color: :yellow, background: :black)} time(s)"
|
406
508
|
print "\n"
|
407
509
|
Hr.print('#')
|
408
510
|
|
@@ -549,7 +651,9 @@ module Gemwarrior
|
|
549
651
|
|
550
652
|
def print_errors
|
551
653
|
if GameOptions.data['errors']
|
552
|
-
puts
|
654
|
+
puts "\n\n"
|
655
|
+
puts "Errors: #{GameOptions.data['errors'].colorize(:red)}"
|
656
|
+
GameOptions.data['errors'] = nil
|
553
657
|
end
|
554
658
|
end
|
555
659
|
|
@@ -557,6 +661,14 @@ module Gemwarrior
|
|
557
661
|
Audio.play_synth(:intro)
|
558
662
|
end
|
559
663
|
|
664
|
+
def play_resume_tune
|
665
|
+
Audio.play_synth(:resume_game)
|
666
|
+
end
|
667
|
+
|
668
|
+
def play_test_tune
|
669
|
+
Audio.play_synth(:test)
|
670
|
+
end
|
671
|
+
|
560
672
|
def prompt
|
561
673
|
prompt_template = "\n"
|
562
674
|
prompt_template += "[LV:%2s][XP:%3s][ROX:%3s][HP:%3s/%-3s] [".colorize(:yellow)
|
@@ -565,6 +677,8 @@ module Gemwarrior
|
|
565
677
|
prompt_template += "%s".colorize(:cyan)
|
566
678
|
prompt_template += "]".colorize(:yellow)
|
567
679
|
prompt_template += "[%s, %s, %s]".colorize(:yellow) if GameOptions.data['debug_mode']
|
680
|
+
prompt_template += "\n"
|
681
|
+
prompt_template += '[c:character][i:inventory][l:look][u:use][t:take]'
|
568
682
|
|
569
683
|
prompt_vars_arr = [
|
570
684
|
world.player.level,
|
data/lib/gemwarrior/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
new_release_available = false
|
2
|
+
|
3
|
+
puts 'Checking releases...'
|
4
|
+
|
5
|
+
remote_release = '0.10.3'
|
6
|
+
local_release = '0.10.3'
|
7
|
+
|
8
|
+
0.upto(2) do |i|
|
9
|
+
if remote_release.split('.')[i].to_i > local_release.split('.')[i].to_i
|
10
|
+
new_release_available = true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
status_text = new_release_available ? "New v#{remote_release} available!" : 'You have the latest version.'
|
15
|
+
|
16
|
+
puts "local_release: #{local_release}"
|
17
|
+
puts "remote_release #{remote_release}"
|
18
|
+
puts status_text
|
data/tests/getch_test.rb
ADDED
data/tests/hooch.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
s = 'I still can\'t believe I lost at the Arena! I was doing so well, and then a slippery citrinaga got a cheap shot on me.'
|
2
|
+
words = s.split(' ')
|
3
|
+
words_hooched = []
|
4
|
+
|
5
|
+
words.each do |w|
|
6
|
+
puts "w: #{w}"
|
7
|
+
if rand(0..100) > 45 and w.length > 1
|
8
|
+
w = w.split('')
|
9
|
+
w = w.insert(rand(0..w.length-1), '*HIC*')
|
10
|
+
w = w.join('')
|
11
|
+
end
|
12
|
+
words_hooched << w
|
13
|
+
end
|
14
|
+
|
15
|
+
puts
|
16
|
+
puts "Final sentence: #{words_hooched.join(' ')}"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'http'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
url = 'http://api.wordnik.com:80/v4/words.json/randomWords'
|
5
|
+
|
6
|
+
json_return = HTTP.get(
|
7
|
+
url,
|
8
|
+
:params => {
|
9
|
+
:hasDictionaryDef => true,
|
10
|
+
:includePartOfSpeech => 'noun-plural',
|
11
|
+
:minCorpusCount => 10,
|
12
|
+
:maxCorpusCount => -1,
|
13
|
+
:minDictionaryCount => 1,
|
14
|
+
:maxDictionaryCount => -1,
|
15
|
+
:minLength => 5,
|
16
|
+
:maxLength => 12,
|
17
|
+
:sortBy => 'alpha',
|
18
|
+
:sortOrder => 'asc',
|
19
|
+
:limit => 10,
|
20
|
+
:api_key => '63f5001dfacf2d619230e08591702875786da258b471becb6'
|
21
|
+
}
|
22
|
+
)
|
23
|
+
|
24
|
+
if json_return
|
25
|
+
json_data = JSON.parse(json_return.to_s)
|
26
|
+
|
27
|
+
if json_data.include?("type") && json_data.include?("message")
|
28
|
+
puts "wordnik error: #{json_data["message"]}"
|
29
|
+
else
|
30
|
+
word_list = []
|
31
|
+
json_data.map {|j| word_list.push(j["word"])}
|
32
|
+
if word_list.length > 0
|
33
|
+
p word_list
|
34
|
+
else
|
35
|
+
puts 'no words received'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
else
|
39
|
+
puts "json error: #{json_return.to_s}"
|
40
|
+
end
|
41
|
+
|
42
|
+
|
@@ -0,0 +1,90 @@
|
|
1
|
+
module AudioCues
|
2
|
+
def self.add key, val
|
3
|
+
@@cues ||= {}
|
4
|
+
@@cues[key] = val
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.cues
|
8
|
+
@@cues ||= {}
|
9
|
+
end
|
10
|
+
|
11
|
+
self.add :battle_start, {
|
12
|
+
synth: [
|
13
|
+
{ frequencies: 'G4', duration: 50 },
|
14
|
+
{ frequencies: 'G#4', duration: 50 },
|
15
|
+
{ frequencies: 'G4', duration: 50 },
|
16
|
+
{ frequencies: 'G#4', duration: 50 },
|
17
|
+
{ frequencies: 'G4', duration: 50 },
|
18
|
+
{ frequencies: 'G#4', duration: 50 }
|
19
|
+
],
|
20
|
+
sample: 'battle_start.wav'
|
21
|
+
}
|
22
|
+
|
23
|
+
self.add :battle_player_attack, {
|
24
|
+
synth: [{ frequencies: 'A4,E4,B5', duration: 75 }],
|
25
|
+
sample: 'battle_player_attack.wav'
|
26
|
+
}
|
27
|
+
|
28
|
+
self.add :battle_player_miss, {
|
29
|
+
synth: [{ frequencies: 'A4', duration: 75 }],
|
30
|
+
sample: 'battle_player_miss.wav'
|
31
|
+
}
|
32
|
+
|
33
|
+
self.add :battle_monster_attack, {
|
34
|
+
synth: [{ frequencies: 'B4,E#5,A5', duration: 75 }],
|
35
|
+
sample: 'battle_monster_attack.wav'
|
36
|
+
}
|
37
|
+
|
38
|
+
self.add :battle_monster_miss, {
|
39
|
+
synth: [{ frequencies: 'B4', duration: 75 }],
|
40
|
+
sample: 'battle_monster_miss.wav'
|
41
|
+
}
|
42
|
+
|
43
|
+
self.add :intro, {
|
44
|
+
synth: [
|
45
|
+
{ frequencies: 'A3,E4,C#5,E5', duration: 300 },
|
46
|
+
{ frequencies: 'A3,E4,C#5,F#5', duration: 600 }
|
47
|
+
],
|
48
|
+
sample: 'intro.wav'
|
49
|
+
}
|
50
|
+
|
51
|
+
self.add :player_resurrection, {
|
52
|
+
synth: [
|
53
|
+
{ frequencies: 'D#5', duration: 100 },
|
54
|
+
{ frequencies: 'A4', duration: 150 },
|
55
|
+
{ frequencies: 'F#4', duration: 200 },
|
56
|
+
{ frequencies: 'F4', duration: 1000 }
|
57
|
+
],
|
58
|
+
sample: 'player_resurrection.wav'
|
59
|
+
}
|
60
|
+
|
61
|
+
self.add :player_travel, {
|
62
|
+
synth: [
|
63
|
+
{ frequencies: 'C4', duration: 75 },
|
64
|
+
{ frequencies: 'D4', duration: 75 },
|
65
|
+
{ frequencies: 'E4', duration: 75 }
|
66
|
+
],
|
67
|
+
sample: 'player_travel.wav'
|
68
|
+
}
|
69
|
+
|
70
|
+
self.add :win_game, {
|
71
|
+
synth: [
|
72
|
+
{ frequencies: 'G3', duration: 250 },
|
73
|
+
{ frequencies: 'A3', duration: 50 },
|
74
|
+
{ frequencies: 'B3', duration: 50 },
|
75
|
+
{ frequencies: 'C4', duration: 50 },
|
76
|
+
{ frequencies: 'D4', duration: 250 },
|
77
|
+
{ frequencies: 'E4', duration: 50 },
|
78
|
+
{ frequencies: 'F#4', duration: 50 },
|
79
|
+
{ frequencies: 'G4', duration: 50 },
|
80
|
+
{ frequencies: 'A4', duration: 250 },
|
81
|
+
{ frequencies: 'B4', duration: 50 },
|
82
|
+
{ frequencies: 'C5', duration: 50 },
|
83
|
+
{ frequencies: 'D5', duration: 50 },
|
84
|
+
{ frequencies: 'E5', duration: 50 },
|
85
|
+
{ frequencies: 'F#5', duration: 50 },
|
86
|
+
{ frequencies: 'G5', duration: 1000 }
|
87
|
+
],
|
88
|
+
sample: 'win_game.wav'
|
89
|
+
}
|
90
|
+
end
|