gemwarrior 0.10.8 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/bin/gemwarrior +0 -0
  3. data/data/default_world.yaml +282 -436
  4. data/gemwarrior.gemspec +1 -1
  5. data/lib/gemwarrior/arena.rb +17 -17
  6. data/lib/gemwarrior/battle.rb +146 -77
  7. data/lib/gemwarrior/entities/armor.rb +34 -0
  8. data/lib/gemwarrior/entities/armor/iron_helmet.rb +17 -0
  9. data/lib/gemwarrior/entities/creature.rb +81 -4
  10. data/lib/gemwarrior/entities/creatures/cow.rb +24 -0
  11. data/lib/gemwarrior/entities/{items → creatures}/goat.rb +9 -11
  12. data/lib/gemwarrior/entities/creatures/pig.rb +24 -0
  13. data/lib/gemwarrior/entities/entity.rb +59 -5
  14. data/lib/gemwarrior/entities/item.rb +10 -22
  15. data/lib/gemwarrior/entities/items/apple.rb +2 -5
  16. data/lib/gemwarrior/entities/items/arena_door.rb +2 -6
  17. data/lib/gemwarrior/entities/items/bed.rb +7 -11
  18. data/lib/gemwarrior/entities/items/bookcase.rb +57 -0
  19. data/lib/gemwarrior/entities/items/bullet.rb +25 -0
  20. data/lib/gemwarrior/entities/items/couch.rb +6 -10
  21. data/lib/gemwarrior/entities/items/cup.rb +2 -5
  22. data/lib/gemwarrior/entities/items/dehumidifier.rb +3 -6
  23. data/lib/gemwarrior/entities/items/feather.rb +2 -5
  24. data/lib/gemwarrior/entities/items/floor_tile.rb +6 -10
  25. data/lib/gemwarrior/entities/items/flower.rb +1 -4
  26. data/lib/gemwarrior/entities/items/herb.rb +12 -13
  27. data/lib/gemwarrior/entities/items/keystone.rb +2 -5
  28. data/lib/gemwarrior/entities/items/ladder.rb +7 -11
  29. data/lib/gemwarrior/entities/items/letter.rb +20 -23
  30. data/lib/gemwarrior/entities/items/map.rb +3 -6
  31. data/lib/gemwarrior/entities/items/massive_door.rb +3 -7
  32. data/lib/gemwarrior/entities/items/pedestal.rb +6 -10
  33. data/lib/gemwarrior/entities/items/pond.rb +4 -8
  34. data/lib/gemwarrior/entities/items/rope.rb +4 -8
  35. data/lib/gemwarrior/entities/items/small_hole.rb +15 -77
  36. data/lib/gemwarrior/entities/items/snowman.rb +5 -9
  37. data/lib/gemwarrior/entities/items/sparkly_thing.rb +3 -7
  38. data/lib/gemwarrior/entities/items/stonemite.rb +2 -6
  39. data/lib/gemwarrior/entities/items/tent.rb +3 -6
  40. data/lib/gemwarrior/entities/items/throne.rb +7 -6
  41. data/lib/gemwarrior/entities/items/tree.rb +2 -6
  42. data/lib/gemwarrior/entities/items/waterfall.rb +9 -8
  43. data/lib/gemwarrior/entities/location.rb +49 -43
  44. data/lib/gemwarrior/entities/monster.rb +34 -28
  45. data/lib/gemwarrior/entities/monsters/alexandrat.rb +3 -3
  46. data/lib/gemwarrior/entities/monsters/amberoo.rb +3 -3
  47. data/lib/gemwarrior/entities/monsters/amethystle.rb +3 -3
  48. data/lib/gemwarrior/entities/monsters/apatiger.rb +3 -3
  49. data/lib/gemwarrior/entities/monsters/aquamarine.rb +3 -3
  50. data/lib/gemwarrior/entities/monsters/bloodstorm.rb +3 -3
  51. data/lib/gemwarrior/entities/monsters/bosses/emerald.rb +12 -27
  52. data/lib/gemwarrior/entities/monsters/bosses/garynetty.rb +17 -5
  53. data/lib/gemwarrior/entities/monsters/bosses/jaspern.rb +66 -0
  54. data/lib/gemwarrior/entities/monsters/citrinaga.rb +3 -3
  55. data/lib/gemwarrior/entities/monsters/coraliz.rb +3 -3
  56. data/lib/gemwarrior/entities/monsters/cubicat.rb +3 -3
  57. data/lib/gemwarrior/entities/monsters/diaman.rb +3 -3
  58. data/lib/gemwarrior/entities/{items → people}/arena_master.rb +8 -13
  59. data/lib/gemwarrior/entities/{items → people}/drunk_man.rb +14 -35
  60. data/lib/gemwarrior/entities/people/queen_ruby.rb +71 -0
  61. data/lib/gemwarrior/entities/people/rockney.rb +132 -0
  62. data/lib/gemwarrior/entities/{items → people}/shifty_woman.rb +7 -12
  63. data/lib/gemwarrior/entities/{items → people}/thin_man.rb +9 -14
  64. data/lib/gemwarrior/entities/people/ware_hawker.rb +153 -0
  65. data/lib/gemwarrior/entities/person.rb +20 -0
  66. data/lib/gemwarrior/entities/player.rb +102 -60
  67. data/lib/gemwarrior/entities/weapon.rb +38 -0
  68. data/lib/gemwarrior/entities/{items → weapons}/dagger.rb +5 -7
  69. data/lib/gemwarrior/entities/{items → weapons}/gun.rb +8 -10
  70. data/lib/gemwarrior/entities/{items → weapons}/mace.rb +6 -9
  71. data/lib/gemwarrior/entities/{items → weapons}/opalaser.rb +5 -7
  72. data/lib/gemwarrior/entities/weapons/spear.rb +23 -0
  73. data/lib/gemwarrior/entities/{items → weapons}/stalactite.rb +5 -7
  74. data/lib/gemwarrior/entities/weapons/stone.rb +23 -0
  75. data/lib/gemwarrior/evaluator.rb +111 -107
  76. data/lib/gemwarrior/game.rb +61 -29
  77. data/lib/gemwarrior/game_assets.rb +76 -0
  78. data/lib/gemwarrior/inventory.rb +77 -43
  79. data/lib/gemwarrior/misc/animation.rb +17 -13
  80. data/lib/gemwarrior/misc/{music.rb → audio.rb} +15 -7
  81. data/lib/gemwarrior/misc/audio_cues.rb +133 -0
  82. data/lib/gemwarrior/misc/formatting.rb +9 -9
  83. data/lib/gemwarrior/misc/player_levels.rb +21 -0
  84. data/lib/gemwarrior/repl.rb +32 -31
  85. data/lib/gemwarrior/version.rb +1 -1
  86. data/lib/gemwarrior/world.rb +155 -134
  87. metadata +34 -22
  88. data/lib/gemwarrior/entities/items/cow.rb +0 -26
  89. data/lib/gemwarrior/entities/items/pig.rb +0 -26
  90. data/lib/gemwarrior/entities/items/queen_ruby.rb +0 -62
  91. data/lib/gemwarrior/entities/items/spear.rb +0 -26
  92. data/lib/gemwarrior/entities/items/stone.rb +0 -25
  93. data/lib/gemwarrior/entities/items/ware_hawker.rb +0 -93
@@ -0,0 +1,25 @@
1
+ # lib/gemwarrior/entities/items/bullet.rb
2
+ # Entity::Item::Bullet
3
+
4
+ require_relative '../item'
5
+
6
+ module Gemwarrior
7
+ class Bullet < Item
8
+ # CONSTANTS
9
+ USE_TEXT = '** ZZZZZ **'
10
+
11
+ def initialize
12
+ super
13
+
14
+ self.name = 'bullet'
15
+ self.name_display = 'Bullet'
16
+ self.description = 'Gunpowder packed into a small metallic tube, ready to be fired from...something.'
17
+ self.takeable = true
18
+ end
19
+
20
+ def use(world)
21
+ puts 'You could throw this at a monster, but somehow the force of it would be less than desired.'
22
+ { type: nil, data: nil }
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/couch.rb
2
- # Item::Couch
2
+ # Entity::Item::Couch
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -9,22 +9,18 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'couch'
12
+ self.name_display = 'Couch'
12
13
  self.description = 'Ever wanted to sit on a cloud? Now is your chance.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
- self.takeable = false
16
- self.useable = true
17
- self.equippable = false
18
14
  end
19
15
 
20
- def use(player = nil)
21
- if player.at_full_hp?
16
+ def use(world)
17
+ if world.player.at_full_hp?
22
18
  puts 'You "sit" on the impossibly soft surface of the furniture, but even after a few minutes of this seemingly heavenly hedonism you don\'t feel significantly better and decide to get up again.'
23
19
  { type: nil, data: nil }
24
20
  else
25
21
  puts 'Your body comes to rest somewhere below the surface of the cloudy apparatus, almost as if it were floating *amongst* the couch. The feeling is heavenly, and you actually feel somewhat better after getting back up.'
26
- puts '>> You regain a hit point.'
27
- { type: 'rest', data: 1 }
22
+ puts '>> You regain a few hit points.'.colorize(:green)
23
+ { type: 'rest', data: 4 }
28
24
  end
29
25
  end
30
26
  end
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/cup.rb
2
- # Item::Cup
2
+ # Entity::Item::Cup
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -9,12 +9,9 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'cup'
12
+ self.name_display = 'Cup'
12
13
  self.description = 'A nice stone mug, perfect for putting things into and then using to carry such things from place to place.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
14
  self.takeable = true
16
- self.useable = false
17
- self.equippable = false
18
15
  end
19
16
  end
20
17
  end
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/dehumidifier.rb
2
- # Item::Dehumidifier
2
+ # Entity::Item::Dehumidifier
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -9,12 +9,9 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'dehumidifier'
12
- self.description = 'Petals the color of clear sky and a stem of bright white. A most curious plant.'
13
- self.atk_lo = 2
14
- self.atk_hi = 4
12
+ self.name_display = 'Dehumidifier'
13
+ self.description = 'Humidity stands approximately zero chance when its presence.'
15
14
  self.takeable = true
16
- self.useable = false
17
- self.equippable = true
18
15
  end
19
16
  end
20
17
  end
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/feather.rb
2
- # Item::Feather
2
+ # Entity::Item::Feather
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -9,12 +9,9 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'feather'
12
+ self.name_display = 'Feather'
12
13
  self.description = 'A blue and green feather. It is soft and tender, unlike the craven bird that probably shed it.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
14
  self.takeable = true
16
- self.useable = false
17
- self.equippable = false
18
15
  end
19
16
  end
20
17
  end
@@ -1,33 +1,29 @@
1
1
  # lib/gemwarrior/entities/items/floor_tile.rb
2
- # Item::FloorTile
2
+ # Entity::Item::FloorTile
3
3
 
4
4
  require_relative '../item'
5
5
 
6
6
  module Gemwarrior
7
7
  class FloorTile < Item
8
8
  # CONSTANTS
9
- MOVE_TEXT = '*** SHOOOOOM ***'
9
+ MOVE_TEXT = '** SHOOOOOM **'
10
10
 
11
11
  def initialize
12
12
  super
13
13
 
14
14
  self.name = 'floor_tile'
15
+ self.name_display = 'Floor Tile'
15
16
  self.description = 'One of the floor tiles, rough-hewn but immaculate, looks...off. Pressable, even.'
16
- self.atk_lo = nil
17
- self.atk_hi = nil
18
- self.takeable = false
19
- self.useable = true
20
- self.equippable = false
21
17
  end
22
18
 
23
- def use(player = nil)
19
+ def use(world)
24
20
  puts 'You slowly lower your foot onto the tile, and then gently depress it, through the floor. Your whole body begins to feel light, lifeless. You black out.'
25
21
  puts
26
22
 
27
23
  # stats
28
- player.movements_made += 1
24
+ world.player.movements_made += 1
29
25
 
30
- Animation::run(phrase: MOVE_TEXT)
26
+ Animation.run(phrase: MOVE_TEXT)
31
27
 
32
28
  { type: 'move', data: 'Rock Piles' }
33
29
  end
@@ -9,12 +9,9 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'flower'
12
+ self.name_display = 'Flower'
12
13
  self.description = 'Petals the color of clear sky and a stem of bright white. A most curious plant.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
14
  self.takeable = true
16
- self.useable = false
17
- self.equippable = false
18
15
  end
19
16
  end
20
17
  end
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/herb.rb
2
- # Item::Herb
2
+ # Entity::Item::Herb
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -8,24 +8,23 @@ module Gemwarrior
8
8
  def initialize
9
9
  super
10
10
 
11
- self.name = 'herb'
12
- self.description = 'Green and leafy, this wild herb looks edible.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
- self.takeable = true
16
- self.useable = true
17
- self.consumable = true
18
- self.equippable = false
11
+ self.name = 'herb'
12
+ self.name_display = 'Herb'
13
+ self.description = 'Green and leafy, this wild herb looks edible.'
14
+ self.takeable = true
15
+ self.consumable = true
16
+ self.useable_battle = true
19
17
  end
20
18
 
21
- def use(player = nil)
19
+ def use(world)
22
20
  puts 'You place the entire, smallish plant in your mouth, testing its texture. The mysterious herb is easily chewable, and you are able to swallow it without much effort. Slight tingles travel up and down your spine.'
23
- if player.at_full_hp?
21
+ if world.player.at_full_hp?
24
22
  puts '>> The herb has no medicinal effect, as you already feel perfectly healthy, but it was kind of tasty.'
25
23
  { type: nil, data: nil }
26
24
  else
27
- puts '>> You regain a few hit points.'
28
- { type: 'health', data: rand(3..5) }
25
+ hp_healed = rand(3..5)
26
+ puts ">> You regain #{hp_healed} hit points.".colorize(:green)
27
+ { type: 'health', data: hp_healed }
29
28
  end
30
29
  end
31
30
  end
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/keystone.rb
2
- # Item::Keystone
2
+ # Entity::Item::Keystone
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -9,12 +9,9 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'keystone'
12
+ self.name_display = 'Keystone'
12
13
  self.description = 'Certainly greater than the sum of its parts, this smallish stone glows faintly and feels slick to the touch.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
14
  self.takeable = true
16
- self.useable = false
17
- self.equippable = false
18
15
  end
19
16
  end
20
17
  end
@@ -1,38 +1,34 @@
1
1
  # lib/gemwarrior/entities/items/ladder.rb
2
- # Item::Ladder
2
+ # Entity::Item::Ladder
3
3
 
4
4
  require_relative '../item'
5
5
 
6
6
  module Gemwarrior
7
7
  class Ladder < Item
8
8
  # CONSTANTS
9
- USE_TEXT = '*** THUMP ***'
9
+ USE_TEXT = '** THUMP **'
10
10
 
11
11
  def initialize
12
12
  super
13
13
 
14
14
  self.name = 'ladder'
15
+ self.name_display = 'Ladder'
15
16
  self.description = 'Rickety and crudely-fashioned, this ladder descends down into the dropoff, hopefully heading towards something...anything.'
16
- self.atk_lo = nil
17
- self.atk_hi = nil
18
- self.takeable = false
19
- self.useable = true
20
- self.equippable = false
21
17
  end
22
18
 
23
- def use(player = nil)
19
+ def use(world)
24
20
  puts 'You grab onto the shaky, rough-hewn, wooden ladder with all your might and start to descend, being extra careful not to loose your grip, which with every moment becomes shakier and shakier.'
25
21
  puts
26
22
 
27
23
  # stats
28
- player.movements_made += 1
24
+ world.player.movements_made += 1
29
25
 
30
- Animation::run(phrase: USE_TEXT)
26
+ Animation.run(phrase: USE_TEXT)
31
27
 
32
28
  puts 'The last couple of steps are more slippery than you anticipated, so you end up fumbling them, falling a few feet onto the hard ground below. When you regain your composure, you notice your conveyance for descending is now far above you and it is, unfortunately, your closest known exit.'
33
29
  puts
34
30
 
35
- { type: 'move_dangerous', data: 'Metal Tunnel (South Entrance)' }
31
+ { type: 'move_dangerous', data: 'metal_tunnel-south_entrance' }
36
32
  end
37
33
  end
38
34
  end
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/letter.rb
2
- # Item::Letter
2
+ # Entity::Item::Letter
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -9,15 +9,12 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'letter'
12
+ self.name_display = 'Letter'
12
13
  self.description = 'A single page of thin paper, folded at the middle, with some excellent penmanship impressed upon it.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
14
  self.takeable = true
16
- self.useable = true
17
- self.equippable = false
18
15
  end
19
16
 
20
- def use(player = nil)
17
+ def use(world)
21
18
  if self.used
22
19
  print 'Do you want to read the letter again? (y/n) '
23
20
  answer = gets.chomp.downcase
@@ -41,28 +38,28 @@ module Gemwarrior
41
38
  def print_letter(player)
42
39
  puts 'The words of the queen echo in your head as you read the royal note sent to you again:'
43
40
  puts
44
- Animation::run(phrase: " Dear #{player.name},", speed: :insane)
41
+ Animation.run(phrase: " Dear #{world.player.name},", speed: :insane)
45
42
  puts
46
- Animation::run(phrase: ' Oh, my! Jool is in trouble! The evil wizard/sorceror/conjuror/rocksmith/wily ', speed: :insane)
47
- Animation::run(phrase: " Emerald has absconded with our ShinyThing(tm)! It is vital that you, #{player.name}, ", speed: :insane)
48
- Animation::run(phrase: ' go to his tower in the sky in order to retrieve it before he does something', speed: :insane)
49
- Animation::run(phrase: ' terrible with it!', speed: :insane)
43
+ Animation.run(phrase: ' Oh, my! Jool is in trouble! The evil wizard/sorceror/conjuror/rocksmith/wily ', speed: :insane)
44
+ Animation.run(phrase: " Emerald has absconded with our ShinyThing(tm)! It is vital that you, #{world.player.name}, ", speed: :insane)
45
+ Animation.run(phrase: ' go to his tower in the sky in order to retrieve it before he does something', speed: :insane)
46
+ Animation.run(phrase: ' terrible with it!', speed: :insane)
50
47
  puts
51
- Animation::run(phrase: ' Remember that one time you came to the castle, trying to sell stones you', speed: :insane)
52
- Animation::run(phrase: ' pilfered from a nearby cave? Remember how I laughed and told you to leave', speed: :insane)
53
- Animation::run(phrase: ' at once or I\'d have the royal guard take your head off? Ha!', speed: :insane)
48
+ Animation.run(phrase: ' Remember that one time you came to the castle, trying to sell stones you', speed: :insane)
49
+ Animation.run(phrase: ' pilfered from a nearby cave? Remember how I laughed and told you to leave', speed: :insane)
50
+ Animation.run(phrase: ' at once or I\'d have the royal guard take your head off? Ha!', speed: :insane)
54
51
  puts
55
- Animation::run(phrase: ' What a fool I was to cast such a special person out, as a mysterious stranger', speed: :insane)
56
- Animation::run(phrase: " in the night told me, before mysteriously disappearing, that you, #{player.name},", speed: :insane)
57
- Animation::run(phrase: ' are actually the only one who can save us (for some reason, but that\'s', speed: :insane)
58
- Animation::run(phrase: ' mysterious strangers for you, right?)!', speed: :insane)
52
+ Animation.run(phrase: ' What a fool I was to cast such a special person out, as a mysterious stranger', speed: :insane)
53
+ Animation.run(phrase: " in the night told me, before mysteriously disappearing, that you, #{world.player.name},", speed: :insane)
54
+ Animation.run(phrase: ' are actually the only one who can save us (for some reason, but that\'s', speed: :insane)
55
+ Animation.run(phrase: ' mysterious strangers for you, right?)!', speed: :insane)
59
56
  puts
60
- Animation::run(phrase: ' Please, I beg of you, save Jool from the potential terror that Emerald could', speed: :insane)
61
- Animation::run(phrase: " possibly wreak on all of us before it is too late! If you do, you, #{player.name},", speed: :insane)
62
- Animation::run(phrase: ' will be rewarded handsomely!', speed: :insane)
57
+ Animation.run(phrase: ' Please, I beg of you, save Jool from the potential terror that Emerald could', speed: :insane)
58
+ Animation.run(phrase: " possibly wreak on all of us before it is too late! If you do, you, #{world.player.name},", speed: :insane)
59
+ Animation.run(phrase: ' will be rewarded handsomely!', speed: :insane)
63
60
  puts
64
- Animation::run(phrase: ' Sincerely,', speed: :insane);
65
- Animation::run(phrase: ' Queen Ruby', speed: :insane);
61
+ Animation.run(phrase: ' Sincerely,', speed: :insane);
62
+ Animation.run(phrase: ' Queen Ruby', speed: :insane);
66
63
  end
67
64
  end
68
65
  end
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/map.rb
2
- # Item::Map
2
+ # Entity::Item::Map
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -9,15 +9,12 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'map'
12
+ self.name_display = 'Map'
12
13
  self.description = 'The land of Jool is contained on this piece of canvas, in a useful, if not very detailed, manner.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
14
  self.takeable = true
16
- self.useable = true
17
- self.equippable = false
18
15
  end
19
16
 
20
- def use(player = nil)
17
+ def use(world)
21
18
  puts 'You unfold the piece of worn canvas, and study the markings upon it.'
22
19
 
23
20
  { type: 'action', data: 'map' }
@@ -1,5 +1,5 @@
1
1
  # lib/gemwarrior/entities/items/massive_door.rb
2
- # Item::MassiveDoor
2
+ # Entity::Item::MassiveDoor
3
3
 
4
4
  require_relative '../item'
5
5
 
@@ -9,17 +9,13 @@ module Gemwarrior
9
9
  super
10
10
 
11
11
  self.name = 'massive_door'
12
+ self.name_display = 'Massive Door'
12
13
  self.description = 'Translucent, but not transparent, this door constructed of condensed water vapor is like nothing you have ever seen. It has no keyhole, but it does have a stone-shaped depression floating centrally within it.'
13
- self.atk_lo = nil
14
- self.atk_hi = nil
15
- self.takeable = false
16
- self.useable = true
17
- self.equippable = false
18
14
  end
19
15
 
20
16
  def use(player = nil)
21
17
  puts 'You attempt to open the seriously massive door that separates you from Emerald himself.'
22
- if player.inventory.contains_item?('keystone')
18
+ if world.player.inventory.contains_item?('keystone')
23
19
  puts 'The keystone in your inventory glows as you approach the incredibly titanic-sized door, so you naturally pull it out and thrust it into the stone-shaped depression within the cloudy obstruction. The door "opens" in a way and you can now pass through.'
24
20
  { type: 'move', data: 'Sky Tower (Throne Room)' }
25
21
  else
@@ -1,12 +1,12 @@
1
1
  # lib/gemwarrior/entities/items/pedestal.rb
2
- # Item::Pedestal
2
+ # Entity::Item::Pedestal
3
3
 
4
4
  require_relative '../item'
5
5
 
6
6
  module Gemwarrior
7
7
  class Pedestal < Item
8
8
  # CONSTANTS
9
- USE_TEXT = '*** WHOOOOOSH ***'
9
+ USE_TEXT = '** WHOOOOOSH **'
10
10
 
11
11
  attr_accessor :switches
12
12
 
@@ -14,12 +14,8 @@ module Gemwarrior
14
14
  super
15
15
 
16
16
  self.name = 'pedestal'
17
+ self.name_display = 'Pedestal'
17
18
  self.description = 'A pedestal about 4 feet in height rises up from the ground, with six switches arranged vertically above a large gem affixed to the top. The switches each have a word next to them in some language that looks familiar yet strange. Each letter is made of some kind of ink crudely splashed on stone, and each can be moved to arrange them in a different fashion than they are now. The large gem glitters with utter brilliance.'
18
- self.atk_lo = nil
19
- self.atk_hi = nil
20
- self.takeable = false
21
- self.useable = true
22
- self.equippable = false
23
19
  self.switches = init_switches
24
20
  end
25
21
 
@@ -36,7 +32,7 @@ module Gemwarrior
36
32
  self.switches = self.switches.sort_by { rand }
37
33
  end
38
34
 
39
- def use(player = nil)
35
+ def use(world)
40
36
  puts 'You look at the pedestal and its switches. The raised gem beckons you to push it and, deductively, you believe that pressing it will do something. However, those switches probably have something to do with the result.'
41
37
 
42
38
  loop do
@@ -100,9 +96,9 @@ module Gemwarrior
100
96
  puts 'You push the large gem into the pedestal and it descends without a hitch, almost as if it were meant to be. The pedestal begins to violently shake and a strong gust of wind picks you up off the ground. You feel completely taken aback and unsettled, but you have no choice: you are being whisked away somewhere into the sky, destination unknown.'.colorize(:yellow)
101
97
 
102
98
  # stats
103
- player.movements_made += 1
99
+ world.player.player.movements_made += 1
104
100
 
105
- Animation::run(phrase: USE_TEXT)
101
+ Animation.run(phrase: USE_TEXT)
106
102
  return { type: 'move', data: 'Sky Tower (Entryway)' }
107
103
  else
108
104
  puts 'You attempt to push the large gem, but it puts up quite the resistance, and nothing much else happens. Your attention once again returns to the pedestal and its switches.'.colorize(:red)