gemwarrior 0.10.8 → 0.11.0
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/data/default_world.yaml +282 -436
- data/gemwarrior.gemspec +1 -1
- data/lib/gemwarrior/arena.rb +17 -17
- data/lib/gemwarrior/battle.rb +146 -77
- data/lib/gemwarrior/entities/armor.rb +34 -0
- data/lib/gemwarrior/entities/armor/iron_helmet.rb +17 -0
- data/lib/gemwarrior/entities/creature.rb +81 -4
- data/lib/gemwarrior/entities/creatures/cow.rb +24 -0
- data/lib/gemwarrior/entities/{items → creatures}/goat.rb +9 -11
- data/lib/gemwarrior/entities/creatures/pig.rb +24 -0
- data/lib/gemwarrior/entities/entity.rb +59 -5
- data/lib/gemwarrior/entities/item.rb +10 -22
- data/lib/gemwarrior/entities/items/apple.rb +2 -5
- data/lib/gemwarrior/entities/items/arena_door.rb +2 -6
- data/lib/gemwarrior/entities/items/bed.rb +7 -11
- data/lib/gemwarrior/entities/items/bookcase.rb +57 -0
- data/lib/gemwarrior/entities/items/bullet.rb +25 -0
- data/lib/gemwarrior/entities/items/couch.rb +6 -10
- data/lib/gemwarrior/entities/items/cup.rb +2 -5
- data/lib/gemwarrior/entities/items/dehumidifier.rb +3 -6
- data/lib/gemwarrior/entities/items/feather.rb +2 -5
- data/lib/gemwarrior/entities/items/floor_tile.rb +6 -10
- data/lib/gemwarrior/entities/items/flower.rb +1 -4
- data/lib/gemwarrior/entities/items/herb.rb +12 -13
- data/lib/gemwarrior/entities/items/keystone.rb +2 -5
- data/lib/gemwarrior/entities/items/ladder.rb +7 -11
- data/lib/gemwarrior/entities/items/letter.rb +20 -23
- data/lib/gemwarrior/entities/items/map.rb +3 -6
- data/lib/gemwarrior/entities/items/massive_door.rb +3 -7
- data/lib/gemwarrior/entities/items/pedestal.rb +6 -10
- data/lib/gemwarrior/entities/items/pond.rb +4 -8
- data/lib/gemwarrior/entities/items/rope.rb +4 -8
- data/lib/gemwarrior/entities/items/small_hole.rb +15 -77
- data/lib/gemwarrior/entities/items/snowman.rb +5 -9
- data/lib/gemwarrior/entities/items/sparkly_thing.rb +3 -7
- data/lib/gemwarrior/entities/items/stonemite.rb +2 -6
- data/lib/gemwarrior/entities/items/tent.rb +3 -6
- data/lib/gemwarrior/entities/items/throne.rb +7 -6
- data/lib/gemwarrior/entities/items/tree.rb +2 -6
- data/lib/gemwarrior/entities/items/waterfall.rb +9 -8
- data/lib/gemwarrior/entities/location.rb +49 -43
- data/lib/gemwarrior/entities/monster.rb +34 -28
- data/lib/gemwarrior/entities/monsters/alexandrat.rb +3 -3
- data/lib/gemwarrior/entities/monsters/amberoo.rb +3 -3
- data/lib/gemwarrior/entities/monsters/amethystle.rb +3 -3
- data/lib/gemwarrior/entities/monsters/apatiger.rb +3 -3
- data/lib/gemwarrior/entities/monsters/aquamarine.rb +3 -3
- data/lib/gemwarrior/entities/monsters/bloodstorm.rb +3 -3
- data/lib/gemwarrior/entities/monsters/bosses/emerald.rb +12 -27
- data/lib/gemwarrior/entities/monsters/bosses/garynetty.rb +17 -5
- data/lib/gemwarrior/entities/monsters/bosses/jaspern.rb +66 -0
- data/lib/gemwarrior/entities/monsters/citrinaga.rb +3 -3
- data/lib/gemwarrior/entities/monsters/coraliz.rb +3 -3
- data/lib/gemwarrior/entities/monsters/cubicat.rb +3 -3
- data/lib/gemwarrior/entities/monsters/diaman.rb +3 -3
- data/lib/gemwarrior/entities/{items → people}/arena_master.rb +8 -13
- data/lib/gemwarrior/entities/{items → people}/drunk_man.rb +14 -35
- data/lib/gemwarrior/entities/people/queen_ruby.rb +71 -0
- data/lib/gemwarrior/entities/people/rockney.rb +132 -0
- data/lib/gemwarrior/entities/{items → people}/shifty_woman.rb +7 -12
- data/lib/gemwarrior/entities/{items → people}/thin_man.rb +9 -14
- data/lib/gemwarrior/entities/people/ware_hawker.rb +153 -0
- data/lib/gemwarrior/entities/person.rb +20 -0
- data/lib/gemwarrior/entities/player.rb +102 -60
- data/lib/gemwarrior/entities/weapon.rb +38 -0
- data/lib/gemwarrior/entities/{items → weapons}/dagger.rb +5 -7
- data/lib/gemwarrior/entities/{items → weapons}/gun.rb +8 -10
- data/lib/gemwarrior/entities/{items → weapons}/mace.rb +6 -9
- data/lib/gemwarrior/entities/{items → weapons}/opalaser.rb +5 -7
- data/lib/gemwarrior/entities/weapons/spear.rb +23 -0
- data/lib/gemwarrior/entities/{items → weapons}/stalactite.rb +5 -7
- data/lib/gemwarrior/entities/weapons/stone.rb +23 -0
- data/lib/gemwarrior/evaluator.rb +111 -107
- data/lib/gemwarrior/game.rb +61 -29
- data/lib/gemwarrior/game_assets.rb +76 -0
- data/lib/gemwarrior/inventory.rb +77 -43
- data/lib/gemwarrior/misc/animation.rb +17 -13
- data/lib/gemwarrior/misc/{music.rb → audio.rb} +15 -7
- data/lib/gemwarrior/misc/audio_cues.rb +133 -0
- data/lib/gemwarrior/misc/formatting.rb +9 -9
- data/lib/gemwarrior/misc/player_levels.rb +21 -0
- data/lib/gemwarrior/repl.rb +32 -31
- data/lib/gemwarrior/version.rb +1 -1
- data/lib/gemwarrior/world.rb +155 -134
- metadata +34 -22
- data/lib/gemwarrior/entities/items/cow.rb +0 -26
- data/lib/gemwarrior/entities/items/pig.rb +0 -26
- data/lib/gemwarrior/entities/items/queen_ruby.rb +0 -62
- data/lib/gemwarrior/entities/items/spear.rb +0 -26
- data/lib/gemwarrior/entities/items/stone.rb +0 -25
- data/lib/gemwarrior/entities/items/ware_hawker.rb +0 -93
@@ -1,5 +1,5 @@
|
|
1
1
|
# lib/gemwarrior/entities/monsters/coraliz.rb
|
2
|
-
# Coraliz
|
2
|
+
# Entity::Creature::Monster::Coraliz
|
3
3
|
|
4
4
|
require_relative '../monster'
|
5
5
|
|
@@ -9,7 +9,9 @@ module Gemwarrior
|
|
9
9
|
super
|
10
10
|
|
11
11
|
self.name = 'coraliz'
|
12
|
+
self.name_display = 'Coraliz'
|
12
13
|
self.description = 'Small blue lizard that slithers around, nipping at your ankles.'
|
14
|
+
self.battlecry = 'Where am I? You\'ll never guess!'
|
13
15
|
self.face = 'spotted'
|
14
16
|
self.hands = 'slippery'
|
15
17
|
self.mood = 'emotionless'
|
@@ -24,8 +26,6 @@ module Gemwarrior
|
|
24
26
|
|
25
27
|
self.rox = rand((level * 2)..(level * 3))
|
26
28
|
self.xp = rand(level..(level * 3))
|
27
|
-
|
28
|
-
self.battlecry = 'Where am I? You\'ll never guess!'
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# lib/gemwarrior/entities/monsters/cubicat.rb
|
2
|
-
# Cubicat
|
2
|
+
# Entity::Creature::Monster::Cubicat
|
3
3
|
|
4
4
|
require_relative '../monster'
|
5
5
|
|
@@ -9,7 +9,9 @@ module Gemwarrior
|
|
9
9
|
super
|
10
10
|
|
11
11
|
self.name = 'cubicat'
|
12
|
+
self.name_display = 'Cubicat'
|
12
13
|
self.description = 'Perfectly geometrically cubed feline, fresh from its woven enclosure, claws at the ready.'
|
14
|
+
self.battlecry = 'I don\'t really care, as long as you die!'
|
13
15
|
self.face = 'striking'
|
14
16
|
self.hands = 'grippy'
|
15
17
|
self.mood = 'salacious'
|
@@ -24,8 +26,6 @@ module Gemwarrior
|
|
24
26
|
|
25
27
|
self.rox = rand((level * 2)..(level * 3))
|
26
28
|
self.xp = rand(level..(level * 2))
|
27
|
-
|
28
|
-
self.battlecry = 'I don\'t really care, as long as you die!'
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# lib/gemwarrior/entities/monsters/diaman.rb
|
2
|
-
# Diaman
|
2
|
+
# Entity::Creature::Monster::Diaman
|
3
3
|
|
4
4
|
require_relative '../monster'
|
5
5
|
|
@@ -9,7 +9,9 @@ module Gemwarrior
|
|
9
9
|
super
|
10
10
|
|
11
11
|
self.name = 'diaman'
|
12
|
+
self.name_display = 'Diaman'
|
12
13
|
self.description = 'Crystalline structure in the form of a man, lumbering toward you, with outstretched, edged pincers.'
|
14
|
+
self.battlecry = 'Precious human, prepare to be lost to the annals of time!'
|
13
15
|
self.face = 'bright'
|
14
16
|
self.hands = 'jagged'
|
15
17
|
self.mood = 'adamant'
|
@@ -24,8 +26,6 @@ module Gemwarrior
|
|
24
26
|
|
25
27
|
self.rox = rand((level * 2)..(level * 3))
|
26
28
|
self.xp = rand(level..(level * 2))
|
27
|
-
|
28
|
-
self.battlecry = 'Precious human, prepare to be lost to the annals of time!'
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
# lib/gemwarrior/entities/
|
2
|
-
#
|
1
|
+
# lib/gemwarrior/entities/people/arena_master.rb
|
2
|
+
# Entity::Creature::Person::ArenaMaster
|
3
3
|
|
4
|
-
require_relative '../
|
4
|
+
require_relative '../person'
|
5
5
|
|
6
6
|
module Gemwarrior
|
7
|
-
class ArenaMaster <
|
7
|
+
class ArenaMaster < Person
|
8
8
|
# CONSTANTS
|
9
9
|
ARENA_FEE = 50
|
10
10
|
ARENA_MASTER_NAME = 'Iolita'
|
@@ -13,26 +13,21 @@ module Gemwarrior
|
|
13
13
|
super
|
14
14
|
|
15
15
|
self.name = 'arena_master'
|
16
|
+
self.name_display = 'Arena Master'
|
16
17
|
self.description = 'She wears simple clothing, but carries herself with an air of authority. You think she may be the person to talk with if you want to engage in battle.'
|
17
|
-
self.atk_lo = nil
|
18
|
-
self.atk_hi = nil
|
19
|
-
self.takeable = false
|
20
|
-
self.useable = true
|
21
|
-
self.equippable = false
|
22
|
-
self.talkable = true
|
23
18
|
end
|
24
19
|
|
25
|
-
def use(
|
20
|
+
def use(world)
|
26
21
|
puts "You approach #{ARENA_MASTER_NAME.colorize(color: :white, background: :black)}, the Arena Master, and ask to prove your mettle in the arena. She snickers to herself, but sees you have a good spirit about you."
|
27
22
|
puts
|
28
23
|
|
29
|
-
if player.rox >=
|
24
|
+
if world.player.rox >= ARENA_FEE
|
30
25
|
print "She asks for the requisite payment: #{ARENA_FEE} rox. Do you pay up? (y/n) "
|
31
26
|
answer = gets.chomp.downcase
|
32
27
|
|
33
28
|
case answer
|
34
29
|
when 'y', 'yes'
|
35
|
-
player.rox -=
|
30
|
+
world.player.rox -= ARENA_FEE
|
36
31
|
puts
|
37
32
|
puts 'She pockets the money and motions toward the center of the arena. She reminds you that you will be facing an ever-worsening onslaught of monsters. Each one you dispatch nets you a bonus cache of rox in addition to whatever the monster gives you. You will also become more experienced the longer you last. Finally, you can give up at any time between battles.'
|
38
33
|
puts
|
@@ -1,27 +1,22 @@
|
|
1
|
-
# lib/gemwarrior/entities/
|
2
|
-
#
|
1
|
+
# lib/gemwarrior/entities/people/drunk_man.rb
|
2
|
+
# Entity::Creature::Person::DrunkMan
|
3
3
|
|
4
|
-
require_relative '../
|
4
|
+
require_relative '../person'
|
5
5
|
require_relative '../../misc/formatting'
|
6
6
|
|
7
7
|
module Gemwarrior
|
8
|
-
class DrunkMan <
|
8
|
+
class DrunkMan < Person
|
9
9
|
include Formatting
|
10
10
|
|
11
11
|
def initialize
|
12
12
|
super
|
13
13
|
|
14
14
|
self.name = 'drunk_man'
|
15
|
+
self.name_display = 'Drunk Man'
|
15
16
|
self.description = 'Some supernatural force is surely keeping this obviously smashed individual from toppling over to the ground. The inebriated fellow somehow continues to stumble about in a small circle near a smattering of shipping crates, looking simultaneously dazed and cheerful.'
|
16
|
-
self.atk_lo = nil
|
17
|
-
self.atk_hi = nil
|
18
|
-
self.takeable = false
|
19
|
-
self.useable = true
|
20
|
-
self.equippable = false
|
21
|
-
self.talkable = true
|
22
17
|
end
|
23
18
|
|
24
|
-
def use(
|
19
|
+
def use(world)
|
25
20
|
choose_blurting
|
26
21
|
|
27
22
|
self.used = [true, false].sample
|
@@ -29,39 +24,23 @@ module Gemwarrior
|
|
29
24
|
{ type: nil, data: nil }
|
30
25
|
end
|
31
26
|
|
27
|
+
private
|
28
|
+
|
32
29
|
def choose_blurting
|
33
30
|
choice = [1, 2, 3, 4].sample
|
34
31
|
|
35
32
|
case choice
|
36
33
|
when 1
|
37
|
-
|
38
|
-
|
39
|
-
print '"'
|
40
|
-
print "\n"
|
41
|
-
print '>> "'
|
42
|
-
print to_hooch('Ehhh. Someday I\'ll be back and I\'ll be victorious. That smarmy Arena Master ain\'t gettin\' the last word!')
|
43
|
-
print '"'
|
44
|
-
print "\n"
|
34
|
+
speak(to_hooch('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.'))
|
35
|
+
speak(to_hooch('Ehhh. Someday I\'ll be back and I\'ll be victorious. That smarmy Arena Master ain\'t gettin\' the last word!'))
|
45
36
|
when 2
|
46
|
-
|
47
|
-
print to_hooch('Maybe I just needed a better weapon that last fight in the arena. Yeah! That must be it.')
|
48
|
-
print '"'
|
49
|
-
print "\n"
|
37
|
+
speak(to_hooch('Maybe I just needed a better weapon that last fight in the arena. Yeah! That must be it.'))
|
50
38
|
when 3
|
51
|
-
|
52
|
-
|
53
|
-
print '"'
|
54
|
-
print "\n"
|
55
|
-
print '>> "'
|
56
|
-
print to_hooch('I should probably get something else to drink.')
|
57
|
-
print '"'
|
58
|
-
print "\n\n"
|
39
|
+
speak(to_hooch('Man, my head really hurts. I\'m not sure if it\'s because of the fighting or the booze.'))
|
40
|
+
speak(to_hooch('I should probably get something else to drink.'))
|
59
41
|
puts 'The man looks like he has thought of something genius for a moment, but then scratches his head while stumbling around in his well-worn circle again.'
|
60
42
|
when 4
|
61
|
-
|
62
|
-
print to_hooch('Ahhhhhhhhhhhhhhhhhhhh!')
|
63
|
-
print '"'
|
64
|
-
print "\n\n"
|
43
|
+
speak(to_hooch('Ahhhhhhhhhhhhhhhhhhhh!'))
|
65
44
|
puts 'He begins to quickly become frantic as he notices you approaching, and then falls over, crumpled to the floor.'
|
66
45
|
puts
|
67
46
|
puts 'You approach to check if he\'s still breathing. As you get closer, he gets back up, hardly noticing you, and begins his spiral once again.'
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# lib/gemwarrior/entities/people/queen_ruby.rb
|
2
|
+
# Entity::Creature::Person::QueenRuby
|
3
|
+
|
4
|
+
require_relative '../person'
|
5
|
+
require_relative '../../misc/animation'
|
6
|
+
|
7
|
+
module Gemwarrior
|
8
|
+
class QueenRuby < Person
|
9
|
+
# CONSTANTS
|
10
|
+
MOVE_TEXT = '** WHOOOOOOSH **'
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
super
|
14
|
+
|
15
|
+
self.name = 'queen_ruby'
|
16
|
+
self.name_display = 'Queen Ruby'
|
17
|
+
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.'
|
18
|
+
end
|
19
|
+
|
20
|
+
def use(world)
|
21
|
+
speak('Thank you for bringing back the ShinyThing(tm)! The land of Jool is saved!')
|
22
|
+
STDIN.getc
|
23
|
+
speak("Please, #{world.player.name}, hand the ShinyThing(tm) to me, before all is lost!")
|
24
|
+
|
25
|
+
print 'Hand over the ShinyThing(tm)? (y/n) '
|
26
|
+
answer = gets.chomp.downcase
|
27
|
+
|
28
|
+
case answer
|
29
|
+
when 'y', 'yes'
|
30
|
+
if world.player.inventory.contains_item?('sparkly_thing')
|
31
|
+
world.player.inventory.remove_item('sparkly_thing')
|
32
|
+
speak('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.')
|
33
|
+
speak('Your reward is', no_end_quote = true, no_line_feed = true)
|
34
|
+
Animation.run(phrase: '......', oneline: true, speed: :slow, color: :yellow, numeric: false, alpha: false)
|
35
|
+
Animation.run(phrase: 'my thanks!', oneline: true, speed: :insane, color: :yellow)
|
36
|
+
print '"'.colorize(:yellow)
|
37
|
+
print "\n"
|
38
|
+
STDIN.getc
|
39
|
+
puts 'You feel an audible groan spill out of your mouth, but Queen Ruby doesn\'t seem to notice.'
|
40
|
+
STDIN.getc
|
41
|
+
speak('Now, be a dear and run on home.')
|
42
|
+
STDIN.getc
|
43
|
+
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.'
|
44
|
+
puts
|
45
|
+
|
46
|
+
Animation.run(phrase: MOVE_TEXT)
|
47
|
+
puts
|
48
|
+
return { type: 'move', data: 'home' }
|
49
|
+
else
|
50
|
+
speak('Hold on a minute!', no_end_quote = false, no_line_feed = true)
|
51
|
+
STDIN.getc
|
52
|
+
speak('You don\'t even have the SparklyThing(tm)!', no_end_quote = false, no_line_feed = true)
|
53
|
+
STDIN.getc
|
54
|
+
speak('How on earth did you even get here without unknowningly being transported after acquiring it?', no_end_quote = false, no_line_feed = true)
|
55
|
+
STDIN.getc
|
56
|
+
speak('...', no_end_quote = false, no_line_feed = true)
|
57
|
+
STDIN.getc
|
58
|
+
speak('...are you a wizard?!')
|
59
|
+
|
60
|
+
return { type: nil, data: nil }
|
61
|
+
end
|
62
|
+
when 'n', 'no'
|
63
|
+
speak('No? No??? Well, you are not leaving this room until you do, so think long and hard about that.')
|
64
|
+
return { type: nil, data: nil }
|
65
|
+
else
|
66
|
+
speak('Hmm. I see. Take your time and let me know when you are going to give me the ShinyThing(tm), all right?')
|
67
|
+
return { type: nil, data: nil }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# lib/gemwarrior/entities/people/rockney.rb
|
2
|
+
# Entity::Creature::Person::Rockney
|
3
|
+
|
4
|
+
require_relative '../item'
|
5
|
+
require_relative '../items/herb'
|
6
|
+
require_relative '../weapons/dagger'
|
7
|
+
|
8
|
+
module Gemwarrior
|
9
|
+
class Rockney < Item
|
10
|
+
# CONSTANTS
|
11
|
+
PRICE_HERB = 10
|
12
|
+
PRICE_DAGGER = 150
|
13
|
+
PLAYER_ROX_INSUFFICIENT = 'Pity. You are a bit short on funds to purchase that item.'
|
14
|
+
PLAYER_ITEMS_ADDITIONAL = 'Anything else?'
|
15
|
+
PLAYER_COMMAND_INVALID = 'Huh?'
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
super
|
19
|
+
|
20
|
+
self.name = 'rockney'
|
21
|
+
self.name_display = 'Rockney'
|
22
|
+
self.description = 'The rat with a name looks at you, not with malice, but with kindness. Odd for a rodent hiding in a hole in a dark, metal tunnel.'
|
23
|
+
self.talkable = true
|
24
|
+
end
|
25
|
+
|
26
|
+
def use(world)
|
27
|
+
if !self.used
|
28
|
+
puts 'You\'re not sure what to expect when you confront the small animal living in the crevice, but you figure it\'s this or doing anything else at all, so...'
|
29
|
+
puts
|
30
|
+
end
|
31
|
+
|
32
|
+
rat_shop(player)
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def rat_shop(player)
|
38
|
+
player_rox_remaining = player.rox
|
39
|
+
amount_spent = 0
|
40
|
+
items_purchased = []
|
41
|
+
|
42
|
+
herb = Herb.new
|
43
|
+
dagger = Dagger.new
|
44
|
+
|
45
|
+
speak('Hello, wanderer. Welcome to my establishment, as it were. Are you in need of anything?')
|
46
|
+
puts
|
47
|
+
puts 'The creature gently shoves a small slip of paper out of his hole and towards you. You take a peek and notice it has a list of things with prices on it.'
|
48
|
+
puts
|
49
|
+
puts 'Rockney\'s Hole in the Wall'.colorize(:cyan)
|
50
|
+
puts '--------------------------'
|
51
|
+
puts "(1) #{'Herb'.colorize(:yellow)} - #{PRICE_HERB} rox"
|
52
|
+
puts " #{herb.description}"
|
53
|
+
puts "(2) #{'Dagger'.colorize(:yellow)} - #{PRICE_DAGGER} rox"
|
54
|
+
puts " #{dagger.description}"
|
55
|
+
puts " Attack: +#{dagger.atk_lo}-#{dagger.atk_hi} (current: #{player.atk_lo}-#{player.atk_hi})"
|
56
|
+
puts
|
57
|
+
speak('What are you in need of?')
|
58
|
+
|
59
|
+
loop do
|
60
|
+
puts " 1 - Herb #{PRICE_HERB}"
|
61
|
+
puts " 2 - Dagger #{PRICE_DAGGER}"
|
62
|
+
print ' x - leave'
|
63
|
+
if items_purchased.length > 0
|
64
|
+
print ", and buy items\n"
|
65
|
+
else
|
66
|
+
print "\n"
|
67
|
+
end
|
68
|
+
puts
|
69
|
+
print 'REMAINING GOLD: '
|
70
|
+
Animation.run(phrase: player_rox_remaining.to_s, oneline: true)
|
71
|
+
print "\n"
|
72
|
+
display_shopping_cart(items_purchased)
|
73
|
+
print '[ROCKNEY]>? '
|
74
|
+
|
75
|
+
choice = gets.chomp.downcase
|
76
|
+
|
77
|
+
case choice
|
78
|
+
when '1'
|
79
|
+
if player_rox_remaining >= PRICE_HERB
|
80
|
+
player_rox_remaining -= PRICE_HERB
|
81
|
+
items_purchased.push(Herb.new)
|
82
|
+
amount_spent += PRICE_HERB
|
83
|
+
|
84
|
+
speak('Excellent choice.')
|
85
|
+
speak(PLAYER_ITEMS_ADDITIONAL)
|
86
|
+
next
|
87
|
+
else
|
88
|
+
speak(PLAYER_ROX_INSUFFICIENT)
|
89
|
+
next
|
90
|
+
end
|
91
|
+
when '2'
|
92
|
+
if player.rox >= PRICE_DAGGER
|
93
|
+
player.rox -= PRICE_DAGGER
|
94
|
+
items_purchased.push(Dagger.new)
|
95
|
+
amount_spent += PRICE_DAGGER
|
96
|
+
|
97
|
+
display_shopping_cart(items_purchased)
|
98
|
+
speak('A fine blade, indeed.')
|
99
|
+
speak(PLAYER_ITEMS_ADDITIONAL)
|
100
|
+
next
|
101
|
+
else
|
102
|
+
speak(PLAYER_ROX_INSUFFICIENT)
|
103
|
+
next
|
104
|
+
end
|
105
|
+
when 'x'
|
106
|
+
if items_purchased.length > 0
|
107
|
+
display_shopping_cart(items_purchased)
|
108
|
+
speak('Are you certain you wish to buy these things? (y/n)')
|
109
|
+
print '[ROCKNEY]> '
|
110
|
+
|
111
|
+
answer = gets.chomp.downcase
|
112
|
+
|
113
|
+
return_type = nil
|
114
|
+
case answer
|
115
|
+
when 'y', 'yes'
|
116
|
+
player.rox -= amount_spent
|
117
|
+
speak('Enjoy!')
|
118
|
+
return_type = { type: 'purchase', data: items_purchased }
|
119
|
+
else
|
120
|
+
return_type = { type: nil, data: nil }
|
121
|
+
end
|
122
|
+
end
|
123
|
+
speak('If you need anything further, I\'m always in this hole...')
|
124
|
+
return return_type
|
125
|
+
else
|
126
|
+
speak(PLAYER_COMMAND_INVALID)
|
127
|
+
next
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -1,24 +1,19 @@
|
|
1
|
-
# lib/gemwarrior/entities/
|
2
|
-
#
|
1
|
+
# lib/gemwarrior/entities/people/shifty_woman.rb
|
2
|
+
# Entity::Creature::Person::ShiftyWoman
|
3
3
|
|
4
|
-
require_relative '../
|
4
|
+
require_relative '../person'
|
5
5
|
|
6
6
|
module Gemwarrior
|
7
|
-
class ShiftyWoman <
|
7
|
+
class ShiftyWoman < Person
|
8
8
|
def initialize
|
9
9
|
super
|
10
10
|
|
11
11
|
self.name = 'shifty_woman'
|
12
|
+
self.name_display = 'Shifty Woman'
|
12
13
|
self.description = 'Sharply dressed with impeccable style, you still can\'t shake the feeling that this otherwise ordinary woman is up to something. It might be the way she almost impulsively looks back and forth along the town street while rubbing her hands together menacingly.'
|
13
|
-
self.atk_lo = nil
|
14
|
-
self.atk_hi = nil
|
15
|
-
self.takeable = true
|
16
|
-
self.useable = true
|
17
|
-
self.equippable = false
|
18
|
-
self.talkable = true
|
19
14
|
end
|
20
15
|
|
21
|
-
def use(
|
16
|
+
def use(world)
|
22
17
|
if self.used
|
23
18
|
puts 'Attempting a friendly overture again, the woman turns and looks directly at you. Her brown eyes glint in the sun, almost turning an ochre hue. Her look burns you to the core, causing you to physically recoil a little.'
|
24
19
|
puts
|
@@ -28,7 +23,7 @@ module Gemwarrior
|
|
28
23
|
|
29
24
|
self.used = true
|
30
25
|
end
|
31
|
-
|
26
|
+
|
32
27
|
{ type: nil, data: nil }
|
33
28
|
end
|
34
29
|
end
|