gemwarrior 0.9.16 → 0.9.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gemwarrior +0 -0
- data/lib/gemwarrior/battle.rb +8 -8
- data/lib/gemwarrior/entities/boss.rb +1 -1
- data/lib/gemwarrior/entities/items/letter.rb +11 -11
- data/lib/gemwarrior/entities/items/small_hole.rb +3 -3
- data/lib/gemwarrior/entities/monsters/bosses/emerald.rb +6 -6
- data/lib/gemwarrior/entities/player.rb +7 -6
- data/lib/gemwarrior/evaluator.rb +3 -2
- data/lib/gemwarrior/repl.rb +8 -5
- data/lib/gemwarrior/version.rb +1 -1
- data/lib/gemwarrior/world.rb +18 -18
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 237a4374aad8afccab2b19c7ba07355cf2ff7a6d
|
4
|
+
data.tar.gz: 6f64794688e51689323fe53a820c387d87622102
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12e7864b02068273f8e4a264ff053f5b3ad31c335578ba9d5d6634766524ae306a1b0a992b95d0d341db0b38a23be06b6b10d34248c31f2920f181ca0e3bfdfe
|
7
|
+
data.tar.gz: d558dd3c63779c500c7b82e9ccbd639b45e87613f99bf9b26b3b9a47b7637a935e9d6b926ae3b9ddde370dd1f4a0ee8a10f4215d9a320a37c1b30f3c2051abff
|
data/bin/gemwarrior
CHANGED
File without changes
|
data/lib/gemwarrior/battle.rb
CHANGED
@@ -75,9 +75,9 @@ module Gemwarrior
|
|
75
75
|
if world.debug_mode || player.special_abilities.include?(:rocking_vision)
|
76
76
|
print "#{monster.hp_cur.to_s.rjust(3)}"
|
77
77
|
else
|
78
|
-
print
|
78
|
+
print '???'
|
79
79
|
end
|
80
|
-
print
|
80
|
+
print ' HP'
|
81
81
|
if world.debug_mode
|
82
82
|
print " (LVL: #{monster.level})"
|
83
83
|
end
|
@@ -117,7 +117,7 @@ module Gemwarrior
|
|
117
117
|
return
|
118
118
|
end
|
119
119
|
else
|
120
|
-
puts
|
120
|
+
puts 'You miss entirely!'.colorize(:yellow)
|
121
121
|
end
|
122
122
|
when 'defend', 'd'
|
123
123
|
puts 'You dig in and defend this round.'
|
@@ -129,7 +129,7 @@ module Gemwarrior
|
|
129
129
|
print " (#{monster.hp_cur}/#{monster.hp_max} HP): #{monster.description}\n"
|
130
130
|
puts "It has some distinguishing features, too: face is #{monster.face}, hands are #{monster.hands}, and general mood is #{monster.mood}."
|
131
131
|
if world.debug_mode
|
132
|
-
puts
|
132
|
+
puts 'If defeated, will receive:'
|
133
133
|
puts " >> XP : #{monster.xp}"
|
134
134
|
puts " >> ROX : #{monster.rox}"
|
135
135
|
puts " >> ITEMS: #{monster.inventory.list_contents}"
|
@@ -142,7 +142,7 @@ module Gemwarrior
|
|
142
142
|
print_escape_text
|
143
143
|
return 'escaped'
|
144
144
|
else
|
145
|
-
puts
|
145
|
+
puts 'You were not able to run away! :-('.colorize(:yellow)
|
146
146
|
end
|
147
147
|
else
|
148
148
|
puts ERROR_ATTACK_OPTION_INVALID
|
@@ -192,7 +192,7 @@ module Gemwarrior
|
|
192
192
|
if entity.eql?(monster)
|
193
193
|
who_gets_wounded = "> You wound #{monster.name} for "
|
194
194
|
else
|
195
|
-
who_gets_wounded =
|
195
|
+
who_gets_wounded = '> You are wounded for '
|
196
196
|
end
|
197
197
|
|
198
198
|
print who_gets_wounded
|
@@ -241,7 +241,7 @@ module Gemwarrior
|
|
241
241
|
|
242
242
|
if monster.is_boss
|
243
243
|
# end game boss!
|
244
|
-
if monster.name.eql?(
|
244
|
+
if monster.name.eql?('Emerald')
|
245
245
|
Music::cue([
|
246
246
|
{:freq_or_note => 'G3', :duration => 50},
|
247
247
|
{:freq_or_note => 'A3', :duration => 50},
|
@@ -310,7 +310,7 @@ module Gemwarrior
|
|
310
310
|
# STATUS TEXT
|
311
311
|
|
312
312
|
def print_escape_text
|
313
|
-
Animation::run({ :phrase =>
|
313
|
+
Animation::run({ :phrase => '** POOF **', :oneline => true })
|
314
314
|
end
|
315
315
|
|
316
316
|
def print_battle_line
|
@@ -8,7 +8,7 @@ module Gemwarrior
|
|
8
8
|
attr_reader :win_text
|
9
9
|
|
10
10
|
def win_text
|
11
|
-
win_text =
|
11
|
+
win_text = "You beat #{name}! You win!"
|
12
12
|
win_text << 'You become the true Gem Warrior, marry Queen Ruby, and have many fine, sparkling children. '
|
13
13
|
win_text << 'Thank you for playing. Goodbye.'
|
14
14
|
puts win_text
|
@@ -45,23 +45,23 @@ module Gemwarrior
|
|
45
45
|
puts
|
46
46
|
Animation::run({phrase: " Dear #{player.name},", speed: :insane})
|
47
47
|
puts
|
48
|
-
Animation::run({phrase:
|
48
|
+
Animation::run({phrase: ' Oh, my! Jool is in trouble! The evil wizard/sorceror/conjuror/rocksmith/wily ', speed: :insane})
|
49
49
|
Animation::run({phrase: " Emerald has absconded with our ShinyThing(tm)! It is vital that you, #{player.name}, ", speed: :insane})
|
50
|
-
Animation::run({phrase:
|
51
|
-
Animation::run({phrase:
|
50
|
+
Animation::run({phrase: ' go to his tower in the sky in order to retrieve it before he does something', speed: :insane})
|
51
|
+
Animation::run({phrase: ' terrible with it!', speed: :insane})
|
52
52
|
puts
|
53
|
-
Animation::run({phrase:
|
54
|
-
Animation::run({phrase:
|
55
|
-
Animation::run({phrase:
|
53
|
+
Animation::run({phrase: ' Remember that one time you came to the castle, trying to sell stones you', speed: :insane})
|
54
|
+
Animation::run({phrase: ' pilfered from a nearby cave? Remember how I laughed and told you to leave', speed: :insane})
|
55
|
+
Animation::run({phrase: ' at once or I\'d have the royal guard take your head off? Ha!', speed: :insane})
|
56
56
|
puts
|
57
|
-
Animation::run({phrase:
|
57
|
+
Animation::run({phrase: ' What a fool I was to cast such a special person out, as a mysterious stranger', speed: :insane})
|
58
58
|
Animation::run({phrase: " in the night told me, before mysteriously disappearing, that you, #{player.name},", speed: :insane})
|
59
|
-
Animation::run({phrase:
|
60
|
-
Animation::run({phrase:
|
59
|
+
Animation::run({phrase: ' are actually the only one who can save us (for some reason, but that\'s', speed: :insane})
|
60
|
+
Animation::run({phrase: ' mysterious strangers for you, right?)!', speed: :insane})
|
61
61
|
puts
|
62
|
-
Animation::run({phrase:
|
62
|
+
Animation::run({phrase: ' Please, I beg of you, save Jool from the potential terror that Emerald could', speed: :insane})
|
63
63
|
Animation::run({phrase: " possibly wreak on all of us before it is too late! If you do, you, #{player.name},", speed: :insane})
|
64
|
-
Animation::run({phrase:
|
64
|
+
Animation::run({phrase: ' will be rewarded handsomely!', speed: :insane})
|
65
65
|
puts
|
66
66
|
Animation::run({phrase: ' Sincerely,', speed: :insane});
|
67
67
|
Animation::run({phrase: ' Queen Ruby', speed: :insane});
|
@@ -35,13 +35,13 @@ module Gemwarrior
|
|
35
35
|
def defeated_text
|
36
36
|
text = "<^><^><^><^><^><^><^><^><^><^>\n"
|
37
37
|
text << "You beat #{name}! You win!\n"
|
38
|
-
text <<
|
39
|
-
text <<
|
40
|
-
text <<
|
41
|
-
text <<
|
38
|
+
text << 'You receive the '
|
39
|
+
text << 'SparklyThing(tm)'.colorize(:magenta)
|
40
|
+
text << ' and become the true '
|
41
|
+
text << 'Gem Warrior'.colorize(:yellow)
|
42
42
|
text << "!\n"
|
43
|
-
text <<
|
44
|
-
text <<
|
43
|
+
text << 'You decide to ignore '
|
44
|
+
text << 'Queen Ruby'.colorize(:red)
|
45
45
|
text << " and take your spoils back home\n"
|
46
46
|
text << "where you live out the rest of your days staring at it, wondering\n"
|
47
47
|
text << "what it was all about.\n\n"
|
@@ -15,7 +15,7 @@ module Gemwarrior
|
|
15
15
|
|
16
16
|
attr_accessor :stam_cur, :stam_max, :cur_coords,
|
17
17
|
:god_mode, :beast_mode, :use_wordnik, :special_abilities,
|
18
|
-
:monsters_killed, :items_taken, :movements_made, :rests_taken
|
18
|
+
:monsters_killed, :items_taken, :movements_made, :rests_taken, :deaths
|
19
19
|
|
20
20
|
def initialize(options)
|
21
21
|
self.name = generate_name
|
@@ -52,6 +52,7 @@ module Gemwarrior
|
|
52
52
|
self.items_taken = 0
|
53
53
|
self.movements_made = 0
|
54
54
|
self.rests_taken = 0
|
55
|
+
self.deaths = 0
|
55
56
|
end
|
56
57
|
|
57
58
|
def check_self(debug_mode = false, show_pic = true)
|
@@ -124,9 +125,9 @@ module Gemwarrior
|
|
124
125
|
minutes = rand(1..59)
|
125
126
|
seconds = rand(1..59)
|
126
127
|
|
127
|
-
hours_text = hours == 1 ?
|
128
|
-
mins_text = minutes == 1 ?
|
129
|
-
secs_text = seconds == 1 ?
|
128
|
+
hours_text = hours == 1 ? 'hour' : 'hours'
|
129
|
+
mins_text = minutes == 1 ? 'minute' : 'minutes'
|
130
|
+
secs_text = seconds == 1 ? 'second' : 'seconds'
|
130
131
|
|
131
132
|
Animation::run({:phrase => '** Zzzzz **'})
|
132
133
|
|
@@ -147,7 +148,7 @@ module Gemwarrior
|
|
147
148
|
end
|
148
149
|
|
149
150
|
def modify_name
|
150
|
-
print
|
151
|
+
print 'Enter new name: '
|
151
152
|
|
152
153
|
new_name = gets.chomp!
|
153
154
|
|
@@ -309,7 +310,7 @@ module Gemwarrior
|
|
309
310
|
|
310
311
|
# CHARACTER
|
311
312
|
def print_char_pic
|
312
|
-
char_pic =
|
313
|
+
char_pic = ''
|
313
314
|
char_pic << "************\n"
|
314
315
|
char_pic << "* () *\n"
|
315
316
|
char_pic << "* \\-||-/ *\n"
|
data/lib/gemwarrior/evaluator.rb
CHANGED
@@ -89,7 +89,7 @@ module Gemwarrior
|
|
89
89
|
def evaluate(input)
|
90
90
|
case input
|
91
91
|
# Ctrl-D or empty command
|
92
|
-
when nil,
|
92
|
+
when nil, ''
|
93
93
|
return
|
94
94
|
# real command
|
95
95
|
else
|
@@ -519,6 +519,7 @@ module Gemwarrior
|
|
519
519
|
end
|
520
520
|
world.player.cur_coords = world.location_coords_by_name('Home')
|
521
521
|
world.describe(world.location_by_coords(world.player.cur_coords))
|
522
|
+
world.player.deaths += 1
|
522
523
|
end
|
523
524
|
|
524
525
|
def print_separator
|
@@ -535,7 +536,7 @@ module Gemwarrior
|
|
535
536
|
print_separator
|
536
537
|
|
537
538
|
if world.debug_mode
|
538
|
-
puts
|
539
|
+
puts ' DEBUG COMMANDS'
|
539
540
|
print_separator
|
540
541
|
i = 0
|
541
542
|
devcommands.each do |cmd|
|
data/lib/gemwarrior/repl.rb
CHANGED
@@ -45,7 +45,7 @@ module Gemwarrior
|
|
45
45
|
begin
|
46
46
|
input = read_line
|
47
47
|
result = eval.evaluate(input)
|
48
|
-
if result.eql?(
|
48
|
+
if result.eql?('exit')
|
49
49
|
exit
|
50
50
|
else
|
51
51
|
puts result
|
@@ -72,9 +72,9 @@ module Gemwarrior
|
|
72
72
|
])
|
73
73
|
end
|
74
74
|
|
75
|
-
puts
|
75
|
+
puts '/-+-+-+ +-+-+-+-+-+-+-\\'.colorize(:yellow)
|
76
76
|
puts '|G|E|M| |W|A|R|R|I|O|R|'.colorize(:yellow)
|
77
|
-
puts
|
77
|
+
puts '\\-+-+-+ +-+-+-+-+-+-+-/'.colorize(:yellow)
|
78
78
|
puts '[[[[[[[DEBUGGING]]]]]]]'.colorize(:white) if world.debug_mode
|
79
79
|
end
|
80
80
|
|
@@ -112,6 +112,7 @@ module Gemwarrior
|
|
112
112
|
end
|
113
113
|
|
114
114
|
def print_main_menu
|
115
|
+
puts " GW v#{Gemwarrior::VERSION}"
|
115
116
|
puts '======================='
|
116
117
|
puts ' (N)ew Game'
|
117
118
|
puts ' (A)bout'
|
@@ -166,7 +167,7 @@ module Gemwarrior
|
|
166
167
|
def display_log
|
167
168
|
if File.exists?(get_log_file_path)
|
168
169
|
File.open(get_log_file_path).readlines.each do |line|
|
169
|
-
|
170
|
+
print "#{line}"
|
170
171
|
end
|
171
172
|
else
|
172
173
|
puts 'No attempts made yet!'
|
@@ -185,12 +186,14 @@ module Gemwarrior
|
|
185
186
|
print "traveled #{pl.movements_made.to_s.colorize(:color => :white, :background => :black)} time(s)"
|
186
187
|
print "\n".ljust(8)
|
187
188
|
print "rested #{pl.rests_taken.to_s.colorize(:color => :white, :background => :black)} time(s)"
|
189
|
+
print "\n".ljust(8)
|
190
|
+
print "died #{pl.deaths.to_s.colorize(:color => :white, :background => :black)} time(s)"
|
188
191
|
print "\n"
|
189
192
|
puts '######################################################################'
|
190
193
|
|
191
194
|
# log stats to file in home directory
|
192
195
|
File.open(get_log_file_path, 'a') do |f|
|
193
|
-
f.write "#{Time.now} #{pl.name.rjust(10)} - LV:#{pl.level} XP:#{pl.xp} $:#{pl.rox} KIL:#{pl.monsters_killed} ITM:#{pl.items_taken} MOV:#{pl.movements_made} RST:#{pl.rests_taken}\n"
|
196
|
+
f.write "#{Time.now} #{pl.name.rjust(10)} - LV:#{pl.level} XP:#{pl.xp} $:#{pl.rox} KIL:#{pl.monsters_killed} ITM:#{pl.items_taken} MOV:#{pl.movements_made} RST:#{pl.rests_taken} DTH:#{pl.deaths}\n"
|
194
197
|
end
|
195
198
|
end
|
196
199
|
|
data/lib/gemwarrior/version.rb
CHANGED
data/lib/gemwarrior/world.rb
CHANGED
@@ -29,10 +29,10 @@ module Gemwarrior
|
|
29
29
|
puts "======================\n"
|
30
30
|
puts "All Variables in World\n"
|
31
31
|
puts "======================\n"
|
32
|
-
puts "#{list(
|
33
|
-
puts "#{list(
|
34
|
-
puts "#{list(
|
35
|
-
puts "#{list(
|
32
|
+
puts "#{list('players', true)}\n"
|
33
|
+
puts "#{list('monsters', true)}\n\n"
|
34
|
+
puts "#{list('items', true)}\n\n"
|
35
|
+
puts "#{list('locations', true)}\n"
|
36
36
|
end
|
37
37
|
|
38
38
|
def print_map(floor)
|
@@ -144,7 +144,7 @@ module Gemwarrior
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def describe(point)
|
147
|
-
desc_text =
|
147
|
+
desc_text = ''
|
148
148
|
desc_text << "[ #{point.name} ]".colorize(:green)
|
149
149
|
|
150
150
|
if debug_mode
|
@@ -282,23 +282,23 @@ module Gemwarrior
|
|
282
282
|
|
283
283
|
location_data.each {|l|
|
284
284
|
locations.push(Location.new({
|
285
|
-
:name => l[
|
286
|
-
:description => l[
|
287
|
-
:danger_level => l[
|
288
|
-
:monster_level_range => l[
|
285
|
+
:name => l['name'],
|
286
|
+
:description => l['description'],
|
287
|
+
:danger_level => l['danger_level'],
|
288
|
+
:monster_level_range => l['monster_level_range'].nil? ? nil : l['monster_level_range']['lo']..l['monster_level_range']['hi'],
|
289
289
|
:coords => {
|
290
|
-
:x => l[
|
291
|
-
:y => l[
|
292
|
-
:z => l[
|
290
|
+
:x => l['coords']['x'],
|
291
|
+
:y => l['coords']['y'],
|
292
|
+
:z => l['coords']['z']
|
293
293
|
},
|
294
294
|
:locs_connected => {
|
295
|
-
:north => l[
|
296
|
-
:east => l[
|
297
|
-
:south => l[
|
298
|
-
:west => l[
|
295
|
+
:north => l['locs_connected']['north'],
|
296
|
+
:east => l['locs_connected']['east'],
|
297
|
+
:south => l['locs_connected']['south'],
|
298
|
+
:west => l['locs_connected']['west']
|
299
299
|
},
|
300
|
-
:items => create_item_objects(l[
|
301
|
-
:bosses_abounding => create_boss_objects(l[
|
300
|
+
:items => create_item_objects(l['items']),
|
301
|
+
:bosses_abounding => create_boss_objects(l['bosses_abounding'])
|
302
302
|
}))
|
303
303
|
}
|
304
304
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemwarrior
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Chadwick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: os
|
@@ -294,4 +294,6 @@ rubygems_version: 2.4.8
|
|
294
294
|
signing_key:
|
295
295
|
specification_version: 4
|
296
296
|
summary: RubyGem text adventure
|
297
|
-
test_files:
|
297
|
+
test_files:
|
298
|
+
- spec/rubywarrior_spec.rb
|
299
|
+
- spec/spec_helper.rb
|