gemwarrior 0.8.8 → 0.9.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/locations.yml +1 -1
- data/lib/gemwarrior/entities/items/arena_master.rb +3 -2
- data/lib/gemwarrior/entities/items/floor_tile.rb +4 -1
- data/lib/gemwarrior/entities/items/ladder.rb +3 -0
- data/lib/gemwarrior/entities/items/pedestal.rb +149 -0
- data/lib/gemwarrior/entities/items/rope.rb +3 -0
- data/lib/gemwarrior/entities/items/small_hole.rb +1 -1
- data/lib/gemwarrior/evaluator.rb +4 -0
- data/lib/gemwarrior/version.rb +1 -1
- metadata +7 -5
- data/lib/gemwarrior/entities/items/tower_switch.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bda7d7def18d2c9269e29addbe19238f1eb8c6b6
|
4
|
+
data.tar.gz: 4779a9b6f56d7312e8e73f400490d7c4bf08b854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 579de55cd563d14b6efa1a74289d9ad8c2f0fa3097ddffd9ddac2e573d685c5926b02ff831a29b7a5827670b1d89061f666f8d0eacd2a2ee3b69e2c864dadb6e
|
7
|
+
data.tar.gz: e8a8e153c8a442b11a6c8340783d3f69d591bf187993da3893c16a6b2eb27c293da213815a14f5e6da0e15a5d865ddea5a298c0995c8e6e0d63dbaef4a1de008
|
data/bin/gemwarrior
CHANGED
File without changes
|
data/data/locations.yml
CHANGED
@@ -6,7 +6,8 @@ require_relative '../item'
|
|
6
6
|
module Gemwarrior
|
7
7
|
class ArenaMaster < Item
|
8
8
|
# CONSTANTS
|
9
|
-
ARENA_FEE
|
9
|
+
ARENA_FEE = 50
|
10
|
+
ARENA_MASTER_NAME = 'Iolita'
|
10
11
|
|
11
12
|
def initialize
|
12
13
|
self.name = 'arena_master'
|
@@ -20,7 +21,7 @@ module Gemwarrior
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def use(player = nil)
|
23
|
-
puts
|
24
|
+
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."
|
24
25
|
puts
|
25
26
|
|
26
27
|
if player.rox >= 50
|
@@ -20,9 +20,12 @@ module Gemwarrior
|
|
20
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.'
|
21
21
|
puts
|
22
22
|
|
23
|
+
# stats
|
24
|
+
player.movements_made += 1
|
25
|
+
|
23
26
|
Animation::run({ :phrase => '*** SHOOOOOM ***' })
|
24
27
|
|
25
|
-
{:type => 'move', :data => 'Rock
|
28
|
+
{:type => 'move', :data => 'Rock Piles'}
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
@@ -20,6 +20,9 @@ module Gemwarrior
|
|
20
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.'
|
21
21
|
puts
|
22
22
|
|
23
|
+
# stats
|
24
|
+
player.movements_made += 1
|
25
|
+
|
23
26
|
Animation::run({ :phrase => '*** THUMP ***' })
|
24
27
|
|
25
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.'
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# lib/gemwarrior/entities/items/pedestal.rb
|
2
|
+
# Item::Pedestal
|
3
|
+
|
4
|
+
require_relative '../item'
|
5
|
+
|
6
|
+
module Gemwarrior
|
7
|
+
class Pedestal < Item
|
8
|
+
attr_accessor :switches
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
self.name = 'pedestal'
|
12
|
+
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.'
|
13
|
+
self.atk_lo = nil
|
14
|
+
self.atk_hi = nil
|
15
|
+
self.takeable = false
|
16
|
+
self.useable = true
|
17
|
+
self.equippable = false
|
18
|
+
self.equipped = false
|
19
|
+
self.switches = init_switches
|
20
|
+
end
|
21
|
+
|
22
|
+
def init_switches
|
23
|
+
self.switches = [
|
24
|
+
['iolita', jumble('iolita'), nil],
|
25
|
+
['rockney', jumble('rockney'), nil],
|
26
|
+
['emerald', jumble('emerald'), nil],
|
27
|
+
['ruby', jumble('ruby'), nil],
|
28
|
+
['amberoo', jumble('amberoo'), nil],
|
29
|
+
['alexandrat', jumble('alexandrat'), nil]
|
30
|
+
]
|
31
|
+
|
32
|
+
self.switches = self.switches.sort_by { rand }
|
33
|
+
end
|
34
|
+
|
35
|
+
def use(player = nil)
|
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.'
|
37
|
+
|
38
|
+
loop do
|
39
|
+
print_switches(self.switches)
|
40
|
+
|
41
|
+
puts
|
42
|
+
puts 'You can change the words themselves and you can push the large gem. What do you do?'
|
43
|
+
puts
|
44
|
+
puts '>> 1 Rearrange the letters in switch 1\'s word'
|
45
|
+
puts '>> 2 Rearrange the letters in switch 2\'s word'
|
46
|
+
puts '>> 3 Rearrange the letters in switch 3\'s word'
|
47
|
+
puts '>> 4 Rearrange the letters in switch 4\'s word'
|
48
|
+
puts '>> 5 Rearrange the letters in switch 5\'s word'
|
49
|
+
puts '>> 6 Rearrange the letters in switch 6\'s word'
|
50
|
+
puts '>> 7 Push the large gem into the pedestal'
|
51
|
+
puts '>> 8 Stop this nonsense'
|
52
|
+
puts
|
53
|
+
|
54
|
+
print '> '
|
55
|
+
choice = gets.chomp!
|
56
|
+
|
57
|
+
case choice
|
58
|
+
when '1'
|
59
|
+
switch1 = switches[0][2].nil? ? switches[0][1] : switches[0][2]
|
60
|
+
puts "Switch 1: #{switch1}"
|
61
|
+
puts 'What should the switch\'s word be set to?'
|
62
|
+
new_word = gets.chomp!
|
63
|
+
switches[0][2] = new_word
|
64
|
+
when '2'
|
65
|
+
switch2 = switches[1][2].nil? ? switches[1][1] : switches[1][2]
|
66
|
+
puts "Switch 2: #{switch2}"
|
67
|
+
puts 'What should the switch\'s word be set to?'
|
68
|
+
new_word = gets.chomp!
|
69
|
+
switches[1][2] = new_word
|
70
|
+
when '3'
|
71
|
+
switch3 = switches[2][2].nil? ? switches[2][1] : switches[2][2]
|
72
|
+
puts "Switch 3: #{switch3}"
|
73
|
+
puts 'What should the switch\'s word be set to?'
|
74
|
+
new_word = gets.chomp!
|
75
|
+
switches[2][2] = new_word
|
76
|
+
when '4'
|
77
|
+
switch4 = switches[3][2].nil? ? switches[3][1] : switches[3][2]
|
78
|
+
puts "Switch 4: #{switch4}"
|
79
|
+
puts 'What should the switch\'s word be set to?'
|
80
|
+
new_word = gets.chomp!
|
81
|
+
switches[3][2] = new_word
|
82
|
+
when '5'
|
83
|
+
switch5 = switches[4][2].nil? ? switches[4][1] : switches[4][2]
|
84
|
+
puts "Switch 5: #{switch5}"
|
85
|
+
puts 'What should the switch\'s word be set to?'
|
86
|
+
new_word = gets.chomp!
|
87
|
+
switches[4][2] = new_word
|
88
|
+
when '6'
|
89
|
+
switch6 = switches[5][2].nil? ? switches[5][1] : switches[5][2]
|
90
|
+
puts "Switch 6: #{switch6}"
|
91
|
+
puts 'What should the switch\'s word be set to?'
|
92
|
+
new_word = gets.chomp!
|
93
|
+
switches[5][2] = new_word
|
94
|
+
when '7'
|
95
|
+
pedestal_configured = true
|
96
|
+
|
97
|
+
for i in 0..switches.length-1 do
|
98
|
+
pedestal_configured = false unless switches[i][0].eql? switches[i][2]
|
99
|
+
end
|
100
|
+
|
101
|
+
if pedestal_configured
|
102
|
+
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)
|
103
|
+
|
104
|
+
# stats
|
105
|
+
player.movements_made += 1
|
106
|
+
|
107
|
+
Animation::run({ :phrase => '*** WHOOOOOSH ***' })
|
108
|
+
return {:type => 'move', :data => 'Sky Tower (Entryway)'}
|
109
|
+
else
|
110
|
+
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)
|
111
|
+
end
|
112
|
+
when '8'
|
113
|
+
puts 'You step away from the mysterious pedestal.'
|
114
|
+
return {:type => nil, :data => nil}
|
115
|
+
else
|
116
|
+
next
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
private
|
122
|
+
|
123
|
+
def print_switches(switches)
|
124
|
+
puts
|
125
|
+
|
126
|
+
switch1 = switches[0][2].nil? ? switches[0][1] : switches[0][2]
|
127
|
+
puts "Switch 1: #{switch1}"
|
128
|
+
|
129
|
+
switch2 = switches[1][2].nil? ? switches[1][1] : switches[1][2]
|
130
|
+
puts "Switch 2: #{switch2}"
|
131
|
+
|
132
|
+
switch3 = switches[2][2].nil? ? switches[2][1] : switches[2][2]
|
133
|
+
puts "Switch 3: #{switch3}"
|
134
|
+
|
135
|
+
switch4 = switches[3][2].nil? ? switches[3][1] : switches[3][2]
|
136
|
+
puts "Switch 4: #{switch4}"
|
137
|
+
|
138
|
+
switch5 = switches[4][2].nil? ? switches[4][1] : switches[4][2]
|
139
|
+
puts "Switch 5: #{switch5}"
|
140
|
+
|
141
|
+
switch6 = switches[5][2].nil? ? switches[5][1] : switches[5][2]
|
142
|
+
puts "Switch 6: #{switch6}"
|
143
|
+
end
|
144
|
+
|
145
|
+
def jumble(word)
|
146
|
+
word.split(//).sort_by { rand }.join('')
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -22,6 +22,9 @@ module Gemwarrior
|
|
22
22
|
|
23
23
|
puts 'After a few minutes you pull yourself up onto a field of pure driven snow. Without warning, the rope and opening in the floor vanish.'
|
24
24
|
puts
|
25
|
+
|
26
|
+
# stats
|
27
|
+
player.movements_made += 1
|
25
28
|
|
26
29
|
{:type => 'move', :data => 'Snow Fields (Southeast)'}
|
27
30
|
end
|
@@ -37,7 +37,7 @@ module Gemwarrior
|
|
37
37
|
puts
|
38
38
|
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.'
|
39
39
|
puts
|
40
|
-
puts '
|
40
|
+
puts 'Rockney\'s Hole in the Wall'
|
41
41
|
puts '--------------------------'
|
42
42
|
puts '(1) Herb - 10 rox'
|
43
43
|
puts '(2) Dagger - 150 rox'
|
data/lib/gemwarrior/evaluator.rb
CHANGED
@@ -226,6 +226,10 @@ module Gemwarrior
|
|
226
226
|
return ERROR_DEBUG_TELEPORT_PARAMS_INVALID
|
227
227
|
end
|
228
228
|
end
|
229
|
+
|
230
|
+
# stats
|
231
|
+
world.player.movements_made += 1
|
232
|
+
|
229
233
|
Animation::run({:phrase => '** TELEPORT! **', :speed => :insane})
|
230
234
|
return world.describe(world.location_by_coords(world.player.cur_coords))
|
231
235
|
end
|
data/lib/gemwarrior/version.rb
CHANGED
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.
|
4
|
+
version: 0.9.0
|
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-07-
|
11
|
+
date: 2015-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: os
|
@@ -226,6 +226,7 @@ files:
|
|
226
226
|
- lib/gemwarrior/entities/items/map.rb
|
227
227
|
- lib/gemwarrior/entities/items/massive_door.rb
|
228
228
|
- lib/gemwarrior/entities/items/opalaser.rb
|
229
|
+
- lib/gemwarrior/entities/items/pedestal.rb
|
229
230
|
- lib/gemwarrior/entities/items/pond.rb
|
230
231
|
- lib/gemwarrior/entities/items/rope.rb
|
231
232
|
- lib/gemwarrior/entities/items/small_hole.rb
|
@@ -236,7 +237,6 @@ files:
|
|
236
237
|
- lib/gemwarrior/entities/items/stonemite.rb
|
237
238
|
- lib/gemwarrior/entities/items/tent.rb
|
238
239
|
- lib/gemwarrior/entities/items/throne.rb
|
239
|
-
- lib/gemwarrior/entities/items/tower_switch.rb
|
240
240
|
- lib/gemwarrior/entities/items/tree.rb
|
241
241
|
- lib/gemwarrior/entities/items/waterfall.rb
|
242
242
|
- lib/gemwarrior/entities/location.rb
|
@@ -288,8 +288,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
version: '0'
|
289
289
|
requirements: []
|
290
290
|
rubyforge_project:
|
291
|
-
rubygems_version: 2.4.
|
291
|
+
rubygems_version: 2.4.8
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: RPG as RubyGem
|
295
|
-
test_files:
|
295
|
+
test_files:
|
296
|
+
- spec/rubywarrior_spec.rb
|
297
|
+
- spec/spec_helper.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# lib/gemwarrior/entities/items/tower_switch.rb
|
2
|
-
# Item::TowerSwitch
|
3
|
-
|
4
|
-
require_relative '../item'
|
5
|
-
|
6
|
-
module Gemwarrior
|
7
|
-
class TowerSwitch < Item
|
8
|
-
def initialize
|
9
|
-
self.name = 'tower_switch'
|
10
|
-
self.description = 'A pedestal about 4 feet in height rises up from the ground, a switch atop it. It is labeled "Tower" with choices for "Yes" and "No". It is set to "No".'
|
11
|
-
self.atk_lo = nil
|
12
|
-
self.atk_hi = nil
|
13
|
-
self.takeable = false
|
14
|
-
self.useable = true
|
15
|
-
self.equippable = false
|
16
|
-
self.equipped = false
|
17
|
-
end
|
18
|
-
|
19
|
-
def use(player = nil)
|
20
|
-
puts 'You move the switch from "No" to "Yes". Suddenly, a great wind picks up and you are gently lifted up by it. The ground moves away and your whole body begins to gently drift towards Emerald\'s compound high in the stratosphere.'
|
21
|
-
puts
|
22
|
-
|
23
|
-
Animation::run({ :phrase => '*** WHOOOOOSH ***' })
|
24
|
-
|
25
|
-
{:type => 'move', :data => 'Sky Tower (Entryway)'}
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|