gemwarrior 0.10.7 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/gemwarrior +2 -2
- data/data/default_world.yaml +44 -11
- data/gemwarrior.gemspec +2 -2
- data/lib/gemwarrior/battle.rb +9 -25
- data/lib/gemwarrior/entities/item.rb +7 -8
- data/lib/gemwarrior/entities/items/queen_ruby.rb +62 -0
- data/lib/gemwarrior/entities/items/{sparklything.rb → sparkly_thing.rb} +1 -1
- data/lib/gemwarrior/entities/items/throne.rb +1 -1
- data/lib/gemwarrior/entities/monster.rb +19 -20
- data/lib/gemwarrior/entities/monsters/bosses/emerald.rb +68 -20
- data/lib/gemwarrior/entities/player.rb +13 -7
- data/lib/gemwarrior/evaluator.rb +11 -1
- data/lib/gemwarrior/game.rb +2 -1
- data/lib/gemwarrior/repl.rb +3 -1
- data/lib/gemwarrior/version.rb +1 -1
- data/lib/gemwarrior/world.rb +1 -1
- metadata +9 -11
- data/lib/gemwarrior/entities/boss.rb +0 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d718994a9f914e593cfd757f77a1794583c2a805
|
|
4
|
+
data.tar.gz: 710b04151af8c0fe27d7fe38c8c3881202a154a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70792929d8361fa56fdebe0b037866e2009c3313b9a84c879306fa77bdb55f1e033332658761917fe65bfb61450da2ed36525763e605c5f896181471595d7667
|
|
7
|
+
data.tar.gz: a40fc1a74bf7791469b59b79c3dcec586299067dfdb981e51369da85b980b837582a522e12a2f3942d1f7ebccfae420e1740fd9abb825501d5f4434d6988cb25
|
data/bin/gemwarrior
CHANGED
|
@@ -81,8 +81,8 @@ def parse_options_cli
|
|
|
81
81
|
options[:use_wordnik] = true
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
-
opts.on('-x', '--extra COMMAND', 'Run a command immediately upon beginning the game') do |xc|
|
|
85
|
-
options[:extra_command] = xc.
|
|
84
|
+
opts.on('-x', '--extra COMMAND,PARAM1,PARAM2,PARAM3', String, 'Run a command, with optional params, immediately upon beginning the game') do |xc|
|
|
85
|
+
options[:extra_command] = xc.gsub(',',' ')
|
|
86
86
|
end
|
|
87
87
|
end
|
|
88
88
|
|
data/data/default_world.yaml
CHANGED
|
@@ -232,7 +232,7 @@ monsters:
|
|
|
232
232
|
consumable: false
|
|
233
233
|
used: false
|
|
234
234
|
number_of_uses:
|
|
235
|
-
name:
|
|
235
|
+
name: sparkly_thing
|
|
236
236
|
description: The sparkling that this thing does is unimaginably brilliant.
|
|
237
237
|
atk_lo:
|
|
238
238
|
atk_hi:
|
|
@@ -249,6 +249,7 @@ monsters:
|
|
|
249
249
|
Warrior\e[0m!\nYou decide to ignore \e[0;31;49mQueen Ruby\e[0m and take your spoils
|
|
250
250
|
back home\nwhere you live out the rest of your days staring at it, wondering\nwhat
|
|
251
251
|
it was all about.\n\nThank you for playing. Goodbye.\n<^><^><^><^><^><^><^><^><^><^>\n"
|
|
252
|
+
is_dead: false
|
|
252
253
|
- !ruby/object:Gemwarrior::Garynetty
|
|
253
254
|
name: Garynetty
|
|
254
255
|
description: Conservative, yet odd, the Garynetty is not messing around.
|
|
@@ -2240,7 +2241,8 @@ locations:
|
|
|
2240
2241
|
number_of_uses:
|
|
2241
2242
|
name: throne
|
|
2242
2243
|
description: Made of what appears to be unfulfilled desires and latent, flawed
|
|
2243
|
-
happiness, the well-crafted seat still looks kinda comfy.
|
|
2244
|
+
happiness, the well-crafted seat still looks kinda comfy. The wizard Emerald
|
|
2245
|
+
sits in it, glaring at you.
|
|
2244
2246
|
atk_lo:
|
|
2245
2247
|
atk_hi:
|
|
2246
2248
|
takeable: false
|
|
@@ -2250,8 +2252,9 @@ locations:
|
|
|
2250
2252
|
bosses_abounding:
|
|
2251
2253
|
- !ruby/object:Gemwarrior::Emerald
|
|
2252
2254
|
name: Emerald
|
|
2253
|
-
description: A wily, beefy, tower of a man,
|
|
2254
|
-
|
|
2255
|
+
description: A wily, beefy, tower of a man, Emerald looks to be a champion of
|
|
2256
|
+
both wisdom, from what you've heard, AND strength, from what you plainly see.
|
|
2257
|
+
He sports a permanent scowl as he faces you, dead-on.
|
|
2255
2258
|
face: gleaming
|
|
2256
2259
|
hands: tantalizing
|
|
2257
2260
|
mood: enraged
|
|
@@ -2269,7 +2272,7 @@ locations:
|
|
|
2269
2272
|
consumable: false
|
|
2270
2273
|
used: false
|
|
2271
2274
|
number_of_uses:
|
|
2272
|
-
name:
|
|
2275
|
+
name: sparkly_thing
|
|
2273
2276
|
description: The sparkling that this thing does is unimaginably brilliant.
|
|
2274
2277
|
atk_lo:
|
|
2275
2278
|
atk_hi:
|
|
@@ -2279,13 +2282,10 @@ locations:
|
|
|
2279
2282
|
weapon:
|
|
2280
2283
|
rox: 35
|
|
2281
2284
|
xp: 22
|
|
2282
|
-
battlecry: '
|
|
2285
|
+
battlecry: 'You have come for the SparklyThing(tm), I see. To that I say: Ha ha
|
|
2286
|
+
ha ha ha! Prepare yourself fool: today your whole life crumbles!'
|
|
2283
2287
|
is_boss: true
|
|
2284
|
-
|
|
2285
|
-
receive the \e[0;35;49mSparklyThing(tm)\e[0m and become the true \e[0;33;49mGem
|
|
2286
|
-
Warrior\e[0m!\nYou decide to ignore \e[0;31;49mQueen Ruby\e[0m and take your
|
|
2287
|
-
spoils back home\nwhere you live out the rest of your days staring at it, wondering\nwhat
|
|
2288
|
-
it was all about.\n\nThank you for playing. Goodbye.\n<^><^><^><^><^><^><^><^><^><^>\n"
|
|
2288
|
+
is_dead: false
|
|
2289
2289
|
checked_for_monsters: false
|
|
2290
2290
|
- !ruby/object:Gemwarrior::Location
|
|
2291
2291
|
name: Sky Tower (Lounge)
|
|
@@ -2391,6 +2391,37 @@ locations:
|
|
|
2391
2391
|
monsters_abounding: []
|
|
2392
2392
|
bosses_abounding: []
|
|
2393
2393
|
checked_for_monsters: false
|
|
2394
|
+
- !ruby/object:Gemwarrior::Location
|
|
2395
|
+
name: Queen Room
|
|
2396
|
+
description: Your surroundings contain four walls with no windows, a vaulted ceiling above, and a tile floor below, all immaculately decorated. A small throne lies before you with a woman sitting on it. You must be in the presence of Queen Ruby herself.
|
|
2397
|
+
coords:
|
|
2398
|
+
:x: 5
|
|
2399
|
+
:y: 5
|
|
2400
|
+
:z: 2
|
|
2401
|
+
locs_connected:
|
|
2402
|
+
:north: false
|
|
2403
|
+
:east: false
|
|
2404
|
+
:south: false
|
|
2405
|
+
:west: false
|
|
2406
|
+
danger_level: :none
|
|
2407
|
+
monster_level_range:
|
|
2408
|
+
items:
|
|
2409
|
+
- !ruby/object:Gemwarrior::QueenRuby
|
|
2410
|
+
equipped: false
|
|
2411
|
+
consumable: false
|
|
2412
|
+
used: false
|
|
2413
|
+
number_of_uses:
|
|
2414
|
+
name: queen_ruby
|
|
2415
|
+
description: Queen Ruby glimmers like she was made from the substance of her name. She wears a wan smile, and her hands are delicately intertwined as she sits patiently.
|
|
2416
|
+
atk_lo:
|
|
2417
|
+
atk_hi:
|
|
2418
|
+
takeable: false
|
|
2419
|
+
useable: true
|
|
2420
|
+
equippable: false
|
|
2421
|
+
talkable: true
|
|
2422
|
+
monsters_abounding: []
|
|
2423
|
+
bosses_abounding: []
|
|
2424
|
+
checked_for_monsters: false
|
|
2394
2425
|
player: !ruby/object:Gemwarrior::Player
|
|
2395
2426
|
name: Player
|
|
2396
2427
|
description: |-
|
|
@@ -2416,8 +2447,10 @@ player: !ruby/object:Gemwarrior::Player
|
|
|
2416
2447
|
cur_coords: *2
|
|
2417
2448
|
special_abilities: []
|
|
2418
2449
|
monsters_killed: 0
|
|
2450
|
+
bosses_killed: 0
|
|
2419
2451
|
items_taken: 0
|
|
2420
2452
|
movements_made: 0
|
|
2421
2453
|
rests_taken: 0
|
|
2422
2454
|
deaths: 0
|
|
2455
|
+
emerald_beaten: false
|
|
2423
2456
|
duration:
|
data/gemwarrior.gemspec
CHANGED
|
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
|
|
|
23
23
|
spec.add_runtime_dependency 'http', '~> 0.8.10'
|
|
24
24
|
spec.add_runtime_dependency 'json', '~> 1.8.2'
|
|
25
25
|
spec.add_runtime_dependency 'colorize', '~> 0.7.7'
|
|
26
|
-
spec.add_runtime_dependency 'matrext', '~> 0.4.
|
|
27
|
-
spec.add_runtime_dependency 'clocker', '~> 0.1.
|
|
26
|
+
spec.add_runtime_dependency 'matrext', '~> 0.4.9'
|
|
27
|
+
spec.add_runtime_dependency 'clocker', '~> 0.1.6'
|
|
28
28
|
spec.add_runtime_dependency 'win32-sound', '~> 0.6.0'
|
|
29
29
|
spec.add_runtime_dependency 'feep', '~> 0.1.3'
|
|
30
30
|
spec.add_runtime_dependency 'gems', '~> 0.8.3'
|
data/lib/gemwarrior/battle.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
require_relative 'misc/player_levels'
|
|
5
5
|
require_relative 'game_options'
|
|
6
|
+
require_relative 'entities/items/sparkly_thing'
|
|
6
7
|
|
|
7
8
|
module Gemwarrior
|
|
8
9
|
class Battle
|
|
@@ -212,7 +213,7 @@ module Gemwarrior
|
|
|
212
213
|
who_gets_wounded_start = ''
|
|
213
214
|
|
|
214
215
|
if entity.eql?(monster)
|
|
215
|
-
who_gets_wounded_start = " > You wound #{monster.name} for "
|
|
216
|
+
who_gets_wounded_start = " > You wound #{monster.name} for ".colorize(:green)
|
|
216
217
|
who_gets_wounded_end = " point(s)!\n".colorize(:green)
|
|
217
218
|
else
|
|
218
219
|
who_gets_wounded_start = ' > You are wounded for '.colorize(:red)
|
|
@@ -265,35 +266,16 @@ module Gemwarrior
|
|
|
265
266
|
def monster_death
|
|
266
267
|
puts " YOU HAVE DEFEATED #{monster.name.upcase}!\n".colorize(:green)
|
|
267
268
|
|
|
268
|
-
# stats
|
|
269
|
-
world.player.monsters_killed += 1
|
|
270
|
-
|
|
271
269
|
if monster.is_boss
|
|
270
|
+
world.player.bosses_killed += 1
|
|
272
271
|
# end game boss!
|
|
273
272
|
if monster.name.eql?('Emerald')
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{ frequencies: 'A3', duration: 50 },
|
|
277
|
-
{ frequencies: 'B3', duration: 50 },
|
|
278
|
-
{ frequencies: 'C4', duration: 50 },
|
|
279
|
-
{ frequencies: 'D4', duration: 250 },
|
|
280
|
-
{ frequencies: 'E4', duration: 50 },
|
|
281
|
-
{ frequencies: 'F#4', duration: 50 },
|
|
282
|
-
{ frequencies: 'G4', duration: 50 },
|
|
283
|
-
{ frequencies: 'A4', duration: 250 },
|
|
284
|
-
{ frequencies: 'B4', duration: 50 },
|
|
285
|
-
{ frequencies: 'C5', duration: 50 },
|
|
286
|
-
{ frequencies: 'D5', duration: 50 },
|
|
287
|
-
{ frequencies: 'E5', duration: 50 },
|
|
288
|
-
{ frequencies: 'F#5', duration: 50 },
|
|
289
|
-
{ frequencies: 'G5', duration: 1000 }
|
|
290
|
-
])
|
|
291
|
-
|
|
292
|
-
puts monster.defeated_text
|
|
293
|
-
gets
|
|
294
|
-
return 'exit'
|
|
273
|
+
# game ending: initiate
|
|
274
|
+
return monster.initiate_ending(world)
|
|
295
275
|
else
|
|
296
276
|
puts ' You just beat a boss monster. Way to go!'
|
|
277
|
+
puts
|
|
278
|
+
puts ' You get the following spoils of war:'
|
|
297
279
|
puts " XP : #{monster.xp}".colorize(:green)
|
|
298
280
|
puts " ROX: #{monster.rox}".colorize(:green)
|
|
299
281
|
print_battle_line
|
|
@@ -301,6 +283,8 @@ module Gemwarrior
|
|
|
301
283
|
world.location_by_coords(player.cur_coords).remove_monster(monster.name)
|
|
302
284
|
end
|
|
303
285
|
else
|
|
286
|
+
world.player.monsters_killed += 1
|
|
287
|
+
|
|
304
288
|
puts ' You get the following spoils of war:'
|
|
305
289
|
puts " XP : #{monster.xp}".colorize(:green)
|
|
306
290
|
puts " ROX : #{monster.rox}".colorize(:green)
|
|
@@ -23,15 +23,14 @@ module Gemwarrior
|
|
|
23
23
|
def describe
|
|
24
24
|
status_text = name.upcase.colorize(:green)
|
|
25
25
|
status_text << "\n#{description} \n".colorize(:white)
|
|
26
|
-
status_text << "ATTACK:
|
|
27
|
-
status_text << "TAKEABLE?
|
|
28
|
-
status_text << "USEABLE?
|
|
29
|
-
status_text << "USED?
|
|
30
|
-
status_text << "EQUIPPABLE?
|
|
31
|
-
status_text << "CONSUMABLE?
|
|
26
|
+
status_text << "ATTACK: #{atk_lo}-#{atk_hi} \n".colorize(:white) unless atk_lo.nil?
|
|
27
|
+
status_text << "TAKEABLE? #{takeable}\n".colorize(:white)
|
|
28
|
+
status_text << "USEABLE? #{useable}\n".colorize(:white)
|
|
29
|
+
status_text << "USED? #{used}\n".colorize(:white)
|
|
30
|
+
status_text << "EQUIPPABLE? #{equippable}\n".colorize(:white)
|
|
31
|
+
status_text << "CONSUMABLE? #{consumable}\n".colorize(:white)
|
|
32
32
|
status_text << "NUMBER OF USES? #{number_of_uses}\n".colorize(:white) unless number_of_uses.nil?
|
|
33
|
-
status_text << "TALKABLE?
|
|
34
|
-
status_text << "\n"
|
|
33
|
+
status_text << "TALKABLE? #{talkable}\n".colorize(:white)
|
|
35
34
|
end
|
|
36
35
|
end
|
|
37
36
|
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# lib/gemwarrior/entities/items/queen_ruby.rb
|
|
2
|
+
# Item::QueenRuby
|
|
3
|
+
|
|
4
|
+
require_relative '../item'
|
|
5
|
+
require_relative '../../misc/animation'
|
|
6
|
+
|
|
7
|
+
module Gemwarrior
|
|
8
|
+
class QueenRuby < Item
|
|
9
|
+
# CONSTANTS
|
|
10
|
+
MOVE_TEXT = '*** WHOOOOOOSH ***'
|
|
11
|
+
|
|
12
|
+
def initialize
|
|
13
|
+
super
|
|
14
|
+
|
|
15
|
+
self.name = 'queen_ruby'
|
|
16
|
+
self.description = 'Queen Ruby glimmers like she was made from the substance of her name. She wears a wan smile, and her hands are delicately intertwined as she sits patiently.'
|
|
17
|
+
self.atk_lo = nil
|
|
18
|
+
self.atk_hi = nil
|
|
19
|
+
self.takeable = true
|
|
20
|
+
self.useable = true
|
|
21
|
+
self.equippable = false
|
|
22
|
+
self.talkable = true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def use(player = nil)
|
|
26
|
+
puts '>> "Thank you for bringing back the ShinyThing(tm)! The land of Jool is saved!"'
|
|
27
|
+
STDIN.getch
|
|
28
|
+
puts ">> \"Please, #{player.name}, hand the ShinyThing(tm) to me, before all is lost!\""
|
|
29
|
+
puts
|
|
30
|
+
print 'Hand over the ShinyThing(tm)? (y/n) '
|
|
31
|
+
answer = gets.chomp.downcase
|
|
32
|
+
|
|
33
|
+
case answer
|
|
34
|
+
when 'y', 'yes'
|
|
35
|
+
player.inventory.remove_item('sparkly_thing')
|
|
36
|
+
print '>> "Oh, thank you! Now that the evil Emerald is defeated, and I, Queen Ruby, have the ShinyThing(tm) again, peace can come to the land of Jool. Your reward is...'
|
|
37
|
+
STDIN.getch
|
|
38
|
+
Animation::run(phrase: '...', oneline: true)
|
|
39
|
+
STDIN.getch
|
|
40
|
+
Animation::run(phrase: '...', oneline: true)
|
|
41
|
+
STDIN.getch
|
|
42
|
+
Animation::run(phrase: '...my thanks!"', oneline: true)
|
|
43
|
+
STDIN.getch
|
|
44
|
+
puts
|
|
45
|
+
puts '>> "Now, be a dear and run on home."'
|
|
46
|
+
puts
|
|
47
|
+
STDIN.getch
|
|
48
|
+
puts 'And with that, she waves her arm in a tired, yet mystical, manner. Your mind and sight go blank, and you "poof" out of existence.'
|
|
49
|
+
puts
|
|
50
|
+
|
|
51
|
+
Animation::run(phrase: MOVE_TEXT)
|
|
52
|
+
{ type: 'move', data: 'Home' }
|
|
53
|
+
when 'n', 'no'
|
|
54
|
+
puts '>> "No? No??? Well, you are not leaving this room until you do, so think long and hard about that."'
|
|
55
|
+
{ type: nil, data: nil }
|
|
56
|
+
else
|
|
57
|
+
puts '>> "Take your time and let me know when you are going to give me the ShinyThing(tm), all right?"'
|
|
58
|
+
{ type: nil, data: nil }
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -9,7 +9,7 @@ module Gemwarrior
|
|
|
9
9
|
super
|
|
10
10
|
|
|
11
11
|
self.name = 'throne'
|
|
12
|
-
self.description = 'Made of what appears to be unfulfilled desires and latent, flawed happiness, the well-crafted seat still looks kinda comfy.'
|
|
12
|
+
self.description = 'Made of what appears to be unfulfilled desires and latent, flawed happiness, the well-crafted seat still looks kinda comfy. The wizard Emerald sits in it, glaring at you.'
|
|
13
13
|
self.atk_lo = nil
|
|
14
14
|
self.atk_hi = nil
|
|
15
15
|
self.takeable = false
|
|
@@ -8,7 +8,7 @@ module Gemwarrior
|
|
|
8
8
|
class Monster < Creature
|
|
9
9
|
INVENTORY_ITEMS_DEFAULT = [Herb.new]
|
|
10
10
|
|
|
11
|
-
attr_accessor :inventory, :battlecry, :is_boss
|
|
11
|
+
attr_accessor :inventory, :battlecry, :is_boss, :is_dead
|
|
12
12
|
|
|
13
13
|
def initialize
|
|
14
14
|
if [true, false].sample
|
|
@@ -19,25 +19,24 @@ module Gemwarrior
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def describe
|
|
22
|
-
status_text = name.upcase.
|
|
23
|
-
status_text <<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
status_text << "
|
|
30
|
-
status_text << "HP: #{hp_cur
|
|
31
|
-
status_text << "ATK: #{atk_lo
|
|
32
|
-
status_text << "DEF: #{defense
|
|
33
|
-
status_text << "DEX: #{dexterity
|
|
34
|
-
status_text << "ROX: #{rox
|
|
35
|
-
status_text << "XP: #{xp
|
|
36
|
-
status_text << "\n".
|
|
37
|
-
status_text << "
|
|
38
|
-
status_text << "
|
|
39
|
-
status_text << "
|
|
40
|
-
status_text << "INV: #{inventory.list_contents}".colorize(:white)
|
|
22
|
+
status_text = name.upcase.colorize(:green)
|
|
23
|
+
status_text << '(BOSS)'.ljust(13).colorize(:yellow) if is_boss
|
|
24
|
+
status_text << "\n"
|
|
25
|
+
status_text << "#{description}".colorize(:white)
|
|
26
|
+
status_text << "\n"
|
|
27
|
+
|
|
28
|
+
status_text << "DEAD? #{is_dead}\n" unless is_dead.nil?
|
|
29
|
+
status_text << "LVL : #{level}\n".colorize(:white)
|
|
30
|
+
status_text << "HP : #{hp_cur}/#{hp_max}\n".colorize(:white)
|
|
31
|
+
status_text << "ATK : #{atk_lo}-#{atk_hi}\n".colorize(:white)
|
|
32
|
+
status_text << "DEF : #{defense}\n".colorize(:white)
|
|
33
|
+
status_text << "DEX : #{dexterity}\n".colorize(:white)
|
|
34
|
+
status_text << "ROX : #{rox}\n".colorize(:white)
|
|
35
|
+
status_text << "XP : #{xp}\n".colorize(:white)
|
|
36
|
+
status_text << "FACE : #{face}\n".colorize(:white)
|
|
37
|
+
status_text << "HANDS: #{hands}\n".colorize(:white)
|
|
38
|
+
status_text << "MOOD : #{mood}\n".colorize(:white)
|
|
39
|
+
status_text << "INV : #{inventory.list_contents}".colorize(:white)
|
|
41
40
|
status_text << "\n"
|
|
42
41
|
end
|
|
43
42
|
end
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
# Emerald boss monster
|
|
3
3
|
|
|
4
4
|
require_relative '../../monster'
|
|
5
|
-
require_relative '../../items/
|
|
5
|
+
require_relative '../../items/sparkly_thing'
|
|
6
|
+
require_relative '../../../misc/music'
|
|
6
7
|
|
|
7
8
|
module Gemwarrior
|
|
8
9
|
class Emerald < Monster
|
|
9
|
-
|
|
10
|
+
# CONSTANTS
|
|
11
|
+
MOVE_TEXT = '*** WHOOOOOOSH ***'
|
|
10
12
|
|
|
11
13
|
def initialize
|
|
12
14
|
self.name = 'Emerald'
|
|
13
|
-
self.description = 'A wily, beefy, tower of a man, champion of both wisdom
|
|
15
|
+
self.description = 'A wily, beefy, tower of a man, Emerald looks to be a champion of both wisdom, from what you\'ve heard, AND strength, from what you plainly see. He sports a constant glint in his eyes as he faces you, dead-on.'
|
|
14
16
|
self.face = 'gleaming'
|
|
15
17
|
self.hands = 'tantalizing'
|
|
16
18
|
self.mood = 'enraged'
|
|
@@ -27,26 +29,72 @@ module Gemwarrior
|
|
|
27
29
|
self.rox = rand((level * 2)..(level * 3))
|
|
28
30
|
self.xp = rand(level..(level * 2))
|
|
29
31
|
|
|
30
|
-
self.battlecry = 'Ha ha ha ha ha! Prepare yourself: today your whole life crumbles!'
|
|
32
|
+
self.battlecry = 'You\'ve come for the SparklyThing(tm), I see. To that I say: Ha ha ha ha ha! Prepare yourself fool: today your whole life crumbles!'
|
|
31
33
|
self.is_boss = true
|
|
32
|
-
self.
|
|
34
|
+
self.is_dead = false
|
|
33
35
|
end
|
|
36
|
+
|
|
37
|
+
def initiate_ending(world)
|
|
38
|
+
# fanfare!
|
|
39
|
+
Music::cue([
|
|
40
|
+
{ frequencies: 'G3', duration: 250 },
|
|
41
|
+
{ frequencies: 'A3', duration: 50 },
|
|
42
|
+
{ frequencies: 'B3', duration: 50 },
|
|
43
|
+
{ frequencies: 'C4', duration: 50 },
|
|
44
|
+
{ frequencies: 'D4', duration: 250 },
|
|
45
|
+
{ frequencies: 'E4', duration: 50 },
|
|
46
|
+
{ frequencies: 'F#4', duration: 50 },
|
|
47
|
+
{ frequencies: 'G4', duration: 50 },
|
|
48
|
+
{ frequencies: 'A4', duration: 250 },
|
|
49
|
+
{ frequencies: 'B4', duration: 50 },
|
|
50
|
+
{ frequencies: 'C5', duration: 50 },
|
|
51
|
+
{ frequencies: 'D5', duration: 50 },
|
|
52
|
+
{ frequencies: 'E5', duration: 50 },
|
|
53
|
+
{ frequencies: 'F#5', duration: 50 },
|
|
54
|
+
{ frequencies: 'G5', duration: 1000 }
|
|
55
|
+
])
|
|
34
56
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
# get reference to throne room, emerald monster, and throne item
|
|
58
|
+
throne_room = world.location_by_coords(world.location_coords_by_name('Sky Tower (Throne Room)'))
|
|
59
|
+
emerald = throne_room.bosses_abounding[0]
|
|
60
|
+
throne = throne_room.items.each { |i| i.name == 'throne' }[0]
|
|
61
|
+
|
|
62
|
+
# emerald is dead, so room and items change
|
|
63
|
+
emerald.is_dead = true
|
|
64
|
+
emerald.face = 'sullen'
|
|
65
|
+
emerald.hands = 'limp'
|
|
66
|
+
emerald.mood = 'blank'
|
|
67
|
+
emerald.hp_cur = 0
|
|
68
|
+
emerald.rox = 0
|
|
69
|
+
emerald.description = 'Emerald slumps over in his chair, completely lifeless. The color has drained from his eyes and a pallor has been cast over his face. His reign is no more.'
|
|
70
|
+
throne_room.description = 'Emerald\'s throne room feels much less imposing now that you have defeated him in mortal combat. Who knew?'
|
|
71
|
+
throne_room.danger_level = :none
|
|
72
|
+
throne_room.monster_level_range = nil
|
|
73
|
+
throne_room.monsters_abounding = []
|
|
74
|
+
throne.description = 'The grim spectacle of Emerald\'s dead body drooping blankly in his chosen seat really brings down the market value of it, you guess.'
|
|
75
|
+
|
|
76
|
+
# world knows you beat emerald
|
|
77
|
+
world.emerald_beaten = true
|
|
78
|
+
|
|
79
|
+
# remove sparkly_thing from emerald
|
|
80
|
+
emerald.inventory.remove_item('sparkly_thing')
|
|
81
|
+
# give player sparkly_thing
|
|
82
|
+
world.player.inventory.items.push(SparklyThing.new)
|
|
83
|
+
|
|
84
|
+
# ending text
|
|
85
|
+
puts '<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>'
|
|
86
|
+
puts "You beat #{name}! You win! You receive the #{"SparklyThing(tm)".colorize(:magenta)} and become the true #{"Gem Warrior".colorize(:yellow)}!"
|
|
87
|
+
puts '<^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^><^>'
|
|
88
|
+
STDIN.getc
|
|
89
|
+
|
|
90
|
+
puts 'Suddenly, an icy feeling shoots up your back. You feel lighter than air. Blackness takes over.'
|
|
91
|
+
STDIN.getc
|
|
92
|
+
|
|
93
|
+
# onto the queen
|
|
94
|
+
Animation::run(phrase: MOVE_TEXT)
|
|
95
|
+
puts
|
|
96
|
+
|
|
97
|
+
return { type: 'move', data: 'Queen Room'}
|
|
50
98
|
end
|
|
51
99
|
end
|
|
52
100
|
end
|
|
@@ -20,7 +20,7 @@ module Gemwarrior
|
|
|
20
20
|
include Formatting
|
|
21
21
|
|
|
22
22
|
attr_accessor :stam_cur, :stam_max, :cur_coords, :special_abilities,
|
|
23
|
-
:monsters_killed, :items_taken, :movements_made,
|
|
23
|
+
:monsters_killed, :bosses_killed, :items_taken, :movements_made,
|
|
24
24
|
:rests_taken, :deaths
|
|
25
25
|
|
|
26
26
|
def generate_name
|
|
@@ -214,12 +214,18 @@ module Gemwarrior
|
|
|
214
214
|
end
|
|
215
215
|
|
|
216
216
|
def attack(world, monster)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
217
|
+
if monster.is_dead
|
|
218
|
+
{ type: 'message', data: 'That monster is now dead forever and cannot be attacked. You must have done them a good one.' }
|
|
219
|
+
else
|
|
220
|
+
battle = Battle.new(world: world, player: self, monster: monster)
|
|
221
|
+
result = battle.start
|
|
222
|
+
if result.eql?('death')
|
|
223
|
+
return 'death'
|
|
224
|
+
elsif result.eql?('exit')
|
|
225
|
+
return 'exit'
|
|
226
|
+
else
|
|
227
|
+
return result
|
|
228
|
+
end
|
|
223
229
|
end
|
|
224
230
|
end
|
|
225
231
|
|
data/lib/gemwarrior/evaluator.rb
CHANGED
|
@@ -282,7 +282,7 @@ module Gemwarrior
|
|
|
282
282
|
case command
|
|
283
283
|
when 'character', 'c'
|
|
284
284
|
# bypass puts so it prints out with newlines properly
|
|
285
|
-
print world.player.check_self
|
|
285
|
+
print world.player.check_self
|
|
286
286
|
when 'inventory', 'i'
|
|
287
287
|
if param1
|
|
288
288
|
world.player.inventory.describe_item(param1)
|
|
@@ -572,6 +572,16 @@ module Gemwarrior
|
|
|
572
572
|
elsif result.eql?('exit')
|
|
573
573
|
return 'exit'
|
|
574
574
|
end
|
|
575
|
+
|
|
576
|
+
unless result.nil?
|
|
577
|
+
case result[:type]
|
|
578
|
+
when 'message'
|
|
579
|
+
result[:data]
|
|
580
|
+
when 'move'
|
|
581
|
+
world.player.cur_coords = world.location_coords_by_name(result[:data])
|
|
582
|
+
world.describe(world.location_by_coords(world.player.cur_coords))
|
|
583
|
+
end
|
|
584
|
+
end
|
|
575
585
|
else
|
|
576
586
|
ERROR_ATTACK_PARAM_INVALID
|
|
577
587
|
end
|
data/lib/gemwarrior/game.rb
CHANGED
|
@@ -39,7 +39,7 @@ module Gemwarrior
|
|
|
39
39
|
|
|
40
40
|
# create new world based on default template
|
|
41
41
|
self.world = init_world
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
# update some player aspects to make more dynamic
|
|
44
44
|
world.player.name = world.player.generate_name
|
|
45
45
|
world.player.face = world.player.generate_face
|
|
@@ -49,6 +49,7 @@ module Gemwarrior
|
|
|
49
49
|
world.player.rox = GameOptions.data['debug_mode'] ? ROX_DEBUG : ROX_DEFAULT
|
|
50
50
|
|
|
51
51
|
world.duration = { mins: 0, secs: 0, ms: 0 }
|
|
52
|
+
world.emerald_beaten = false
|
|
52
53
|
|
|
53
54
|
# create options file if not existing
|
|
54
55
|
update_options_file
|
data/lib/gemwarrior/repl.rb
CHANGED
|
@@ -331,6 +331,8 @@ module Gemwarrior
|
|
|
331
331
|
puts '----------------------------------------------------------------------'
|
|
332
332
|
print "#{pl.name.ljust(10)} killed #{pl.monsters_killed.to_s.colorize(color: :white, background: :black)} monster(s)"
|
|
333
333
|
print "\n".ljust(12)
|
|
334
|
+
print "killed #{pl.bosses_killed.to_s.colorize(color: :white, background: :black)} boss(es)"
|
|
335
|
+
print "\n".ljust(12)
|
|
334
336
|
print "picked up #{pl.items_taken.to_s.colorize(color: :white, background: :black)} item(s)"
|
|
335
337
|
print "\n".ljust(12)
|
|
336
338
|
print "traveled #{pl.movements_made.to_s.colorize(color: :white, background: :black)} time(s)"
|
|
@@ -343,7 +345,7 @@ module Gemwarrior
|
|
|
343
345
|
|
|
344
346
|
# log stats to file in home directory
|
|
345
347
|
File.open(GameOptions.data['log_file_path'], 'a') do |f|
|
|
346
|
-
f.write "#{Time.now} #{pl.name.rjust(10)} - V:#{Gemwarrior::VERSION} LV:#{pl.level} XP:#{pl.xp} $:#{pl.rox}
|
|
348
|
+
f.write "#{Time.now} #{pl.name.rjust(10)} - V:#{Gemwarrior::VERSION} LV:#{pl.level} XP:#{pl.xp} $:#{pl.rox} MK:#{pl.monsters_killed} BK:#{pl.bosses_killed} ITM:#{pl.items_taken} MOV:#{pl.movements_made} RST:#{pl.rests_taken} DTH:#{pl.deaths}\n"
|
|
347
349
|
end
|
|
348
350
|
end
|
|
349
351
|
|
data/lib/gemwarrior/version.rb
CHANGED
data/lib/gemwarrior/world.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Gemwarrior
|
|
|
16
16
|
WORLD_DIM_WIDTH = 10
|
|
17
17
|
WORLD_DIM_HEIGHT = 10
|
|
18
18
|
|
|
19
|
-
attr_accessor :monsters, :locations, :player, :duration
|
|
19
|
+
attr_accessor :monsters, :locations, :player, :duration, :emerald_beaten
|
|
20
20
|
|
|
21
21
|
def print_vars
|
|
22
22
|
puts "======================\n"
|
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.10.
|
|
4
|
+
version: 0.10.8
|
|
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-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: os
|
|
@@ -78,28 +78,28 @@ dependencies:
|
|
|
78
78
|
requirements:
|
|
79
79
|
- - "~>"
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: 0.4.
|
|
81
|
+
version: 0.4.9
|
|
82
82
|
type: :runtime
|
|
83
83
|
prerelease: false
|
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
|
86
86
|
- - "~>"
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: 0.4.
|
|
88
|
+
version: 0.4.9
|
|
89
89
|
- !ruby/object:Gem::Dependency
|
|
90
90
|
name: clocker
|
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
|
93
93
|
- - "~>"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: 0.1.
|
|
95
|
+
version: 0.1.6
|
|
96
96
|
type: :runtime
|
|
97
97
|
prerelease: false
|
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
|
100
100
|
- - "~>"
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: 0.1.
|
|
102
|
+
version: 0.1.6
|
|
103
103
|
- !ruby/object:Gem::Dependency
|
|
104
104
|
name: win32-sound
|
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -274,7 +274,6 @@ files:
|
|
|
274
274
|
- gemwarrior.gemspec
|
|
275
275
|
- lib/gemwarrior/arena.rb
|
|
276
276
|
- lib/gemwarrior/battle.rb
|
|
277
|
-
- lib/gemwarrior/entities/boss.rb
|
|
278
277
|
- lib/gemwarrior/entities/creature.rb
|
|
279
278
|
- lib/gemwarrior/entities/entity.rb
|
|
280
279
|
- lib/gemwarrior/entities/item.rb
|
|
@@ -304,11 +303,12 @@ files:
|
|
|
304
303
|
- lib/gemwarrior/entities/items/pedestal.rb
|
|
305
304
|
- lib/gemwarrior/entities/items/pig.rb
|
|
306
305
|
- lib/gemwarrior/entities/items/pond.rb
|
|
306
|
+
- lib/gemwarrior/entities/items/queen_ruby.rb
|
|
307
307
|
- lib/gemwarrior/entities/items/rope.rb
|
|
308
308
|
- lib/gemwarrior/entities/items/shifty_woman.rb
|
|
309
309
|
- lib/gemwarrior/entities/items/small_hole.rb
|
|
310
310
|
- lib/gemwarrior/entities/items/snowman.rb
|
|
311
|
-
- lib/gemwarrior/entities/items/
|
|
311
|
+
- lib/gemwarrior/entities/items/sparkly_thing.rb
|
|
312
312
|
- lib/gemwarrior/entities/items/spear.rb
|
|
313
313
|
- lib/gemwarrior/entities/items/stalactite.rb
|
|
314
314
|
- lib/gemwarrior/entities/items/stone.rb
|
|
@@ -375,6 +375,4 @@ rubygems_version: 2.4.8
|
|
|
375
375
|
signing_key:
|
|
376
376
|
specification_version: 4
|
|
377
377
|
summary: RubyGem text adventure
|
|
378
|
-
test_files:
|
|
379
|
-
- spec/gemwarrior_spec.rb
|
|
380
|
-
- spec/spec_helper.rb
|
|
378
|
+
test_files: []
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# lib/gemwarrior/entities/boss.rb
|
|
2
|
-
# Boss monster
|
|
3
|
-
|
|
4
|
-
require_relative 'monster'
|
|
5
|
-
|
|
6
|
-
module Gemwarrior
|
|
7
|
-
class Boss < Monster
|
|
8
|
-
attr_reader :win_text
|
|
9
|
-
|
|
10
|
-
def win_text
|
|
11
|
-
win_text = "You beat #{name}! You win!"
|
|
12
|
-
win_text << 'You become the true Gem Warrior, marry Queen Ruby, and have many fine, sparkling children. '
|
|
13
|
-
win_text << 'Thank you for playing. Goodbye.'
|
|
14
|
-
puts win_text
|
|
15
|
-
exit(0)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|