gemwarrior 0.3.1 → 0.3.2
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/creature.rb +53 -47
- data/lib/gemwarrior/{constants.rb → defaults.rb} +103 -158
- data/lib/gemwarrior/evaluator.rb +165 -151
- data/lib/gemwarrior/game.rb +52 -42
- data/lib/gemwarrior/inventory.rb +65 -61
- data/lib/gemwarrior/item.rb +24 -28
- data/lib/gemwarrior/location.rb +110 -101
- data/lib/gemwarrior/monster.rb +44 -48
- data/lib/gemwarrior/player.rb +193 -185
- data/lib/gemwarrior/repl.rb +95 -92
- data/lib/gemwarrior/version.rb +1 -1
- data/lib/gemwarrior/world.rb +328 -269
- metadata +4 -6
data/lib/gemwarrior/repl.rb
CHANGED
@@ -1,92 +1,95 @@
|
|
1
|
-
# lib/gemwarrior/repl.rb
|
2
|
-
# My own, simple, Read Evaluate Print Loop module
|
3
|
-
|
4
|
-
require 'readline'
|
5
|
-
require 'os'
|
6
|
-
|
7
|
-
require_relative '
|
8
|
-
require_relative '
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
def
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
]
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
1
|
+
# lib/gemwarrior/repl.rb
|
2
|
+
# My own, simple, Read Evaluate Print Loop module
|
3
|
+
|
4
|
+
require 'readline'
|
5
|
+
require 'os'
|
6
|
+
|
7
|
+
require_relative 'version'
|
8
|
+
require_relative 'evaluator'
|
9
|
+
|
10
|
+
module Gemwarrior
|
11
|
+
class Repl
|
12
|
+
# CONSTANTS
|
13
|
+
## MESSAGES
|
14
|
+
SPLASH_MESSAGE = 'Welcome to Gem Warrior, where randomized fortune is just as likely as mayhem.'
|
15
|
+
|
16
|
+
attr_accessor :world, :eval
|
17
|
+
|
18
|
+
def initialize(world, evaluator)
|
19
|
+
self.world = world
|
20
|
+
self.eval = evaluator
|
21
|
+
end
|
22
|
+
|
23
|
+
def start(initialCommand = nil)
|
24
|
+
setup_screen(initialCommand)
|
25
|
+
|
26
|
+
# main loop
|
27
|
+
loop do
|
28
|
+
prompt
|
29
|
+
begin
|
30
|
+
input = read_line
|
31
|
+
puts eval.evaluate(input)
|
32
|
+
rescue Interrupt
|
33
|
+
puts
|
34
|
+
puts QUIT_MESSAGE
|
35
|
+
exit(0)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def clear_screen
|
43
|
+
if OS.windows?
|
44
|
+
system('cls')
|
45
|
+
else
|
46
|
+
system('clear')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def print_splash_message
|
51
|
+
0.upto(SPLASH_MESSAGE.length-1) do print "=" end
|
52
|
+
print "\n"
|
53
|
+
puts SPLASH_MESSAGE
|
54
|
+
0.upto(SPLASH_MESSAGE.length-1) do print "=" end
|
55
|
+
print "\n"
|
56
|
+
end
|
57
|
+
|
58
|
+
def print_fortune
|
59
|
+
noun1_vals = ["abutments", "bains", "crocuses", "chapes", "civility", "fingering", "gabardines", "nooks", "scalawags", "squiggles"]
|
60
|
+
noun2_vals = ["asterisms", "deniers", "diastoles", "extremities", "payments", "specters", "splats", "thalamuses", "wallets", "xylophones"]
|
61
|
+
noun3_vals = ["blebs", "blowholes", "dancers", "dinges", "dualism", "ebullitions", "gullets", "knops", "phaetons", "snickers"]
|
62
|
+
|
63
|
+
puts "* Remember: #{noun1_vals[rand(0..9)]} and #{noun2_vals[rand(0..9)]} are the key to #{noun3_vals[rand(0..9)]} *\n\n"
|
64
|
+
end
|
65
|
+
|
66
|
+
def setup_screen(initialCommand = nil)
|
67
|
+
# welcome player to game
|
68
|
+
clear_screen
|
69
|
+
print_splash_message
|
70
|
+
print_fortune
|
71
|
+
|
72
|
+
# hook to do something right off the bat
|
73
|
+
puts eval.evaluate(initialCommand) unless initialCommand.nil?
|
74
|
+
end
|
75
|
+
|
76
|
+
def prompt
|
77
|
+
prompt_template = "\n[LV:%3s][XP:%3s][HP:%3s|%-3s][STM:%2s|%-2s] -- [%s @ %s]"
|
78
|
+
prompt_vars_arr = [
|
79
|
+
world.player.level,
|
80
|
+
world.player.xp,
|
81
|
+
world.player.hp_cur,
|
82
|
+
world.player.hp_max,
|
83
|
+
world.player.stam_cur,
|
84
|
+
world.player.stam_max,
|
85
|
+
world.player.name,
|
86
|
+
world.player.cur_loc.name
|
87
|
+
]
|
88
|
+
puts (prompt_template % prompt_vars_arr)
|
89
|
+
end
|
90
|
+
|
91
|
+
def read_line
|
92
|
+
Readline.readline(' GW> ', true).to_s
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
data/lib/gemwarrior/version.rb
CHANGED
data/lib/gemwarrior/world.rb
CHANGED
@@ -1,269 +1,328 @@
|
|
1
|
-
# lib/gemwarrior/world.rb
|
2
|
-
# World where the locations, monsters, items, etc. exist
|
3
|
-
|
4
|
-
require_relative '
|
5
|
-
require_relative 'monster'
|
6
|
-
require_relative 'item'
|
7
|
-
require_relative 'location'
|
8
|
-
|
9
|
-
module Gemwarrior
|
10
|
-
class World
|
11
|
-
|
12
|
-
|
13
|
-
include Entities::Monsters
|
14
|
-
include Entities::Items
|
15
|
-
include Entities::Locations
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
)
|
88
|
-
)
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
'
|
94
|
-
'
|
95
|
-
'
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
)
|
136
|
-
)
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
end
|
234
|
-
|
235
|
-
def
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
1
|
+
# lib/gemwarrior/world.rb
|
2
|
+
# World where the locations, monsters, items, etc. exist
|
3
|
+
|
4
|
+
require_relative 'defaults'
|
5
|
+
require_relative 'monster'
|
6
|
+
require_relative 'item'
|
7
|
+
require_relative 'location'
|
8
|
+
|
9
|
+
module Gemwarrior
|
10
|
+
class World
|
11
|
+
# CONSTANTS
|
12
|
+
## DEFAULTS
|
13
|
+
include Entities::Monsters
|
14
|
+
include Entities::Items
|
15
|
+
include Entities::Locations
|
16
|
+
|
17
|
+
## ERRORS
|
18
|
+
ERROR_LIST_PARAM_INVALID = 'That isn\'t something that can be listed.'
|
19
|
+
|
20
|
+
attr_accessor :monsters, :items, :locations, :player
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
self.monsters = init_monsters
|
24
|
+
self.items = init_items
|
25
|
+
self.locations = init_locations
|
26
|
+
self.player = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
def list(param)
|
30
|
+
case param
|
31
|
+
when "monsters"
|
32
|
+
return "The world's monsters consist of #{@monsters.map(&:name).join(', ')}"
|
33
|
+
when "items"
|
34
|
+
return "The world's items consist of #{@items.map(&:name).join(', ')}"
|
35
|
+
when "locations"
|
36
|
+
return "The world consists of #{@locations.map(&:name).join(', ')}"
|
37
|
+
else
|
38
|
+
ERROR_LIST_PARAM_INVALID
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def mob_by_id(id)
|
43
|
+
monsters.each do |mob|
|
44
|
+
if mob.id.to_i.equal? id
|
45
|
+
return mob
|
46
|
+
end
|
47
|
+
end
|
48
|
+
return nil
|
49
|
+
end
|
50
|
+
|
51
|
+
def item_by_id(id)
|
52
|
+
items.each do |item|
|
53
|
+
if item.id.to_i.equal? id
|
54
|
+
return item
|
55
|
+
end
|
56
|
+
end
|
57
|
+
return nil
|
58
|
+
end
|
59
|
+
|
60
|
+
def loc_by_id(id)
|
61
|
+
locations.each do |loc|
|
62
|
+
if loc.id.to_i.equal? id
|
63
|
+
return loc
|
64
|
+
end
|
65
|
+
end
|
66
|
+
return nil
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
def init_monsters
|
72
|
+
monsters = []
|
73
|
+
monsters.push(Monster.new(
|
74
|
+
MOB_ID_ALEXANDRAT,
|
75
|
+
MOB_NAME_ALEXANDRAT,
|
76
|
+
MOB_DESC_ALEXANDRAT,
|
77
|
+
'ugly',
|
78
|
+
'gnarled',
|
79
|
+
'unsurprisingly unchipper',
|
80
|
+
MOB_LEVEL_ALEXANDRAT,
|
81
|
+
MOB_LEVEL_ALEXANDRAT * 5,
|
82
|
+
MOB_LEVEL_ALEXANDRAT * 5,
|
83
|
+
MOB_LEVEL_ALEXANDRAT * 2,
|
84
|
+
MOB_LEVEL_ALEXANDRAT * 2,
|
85
|
+
Inventory.new,
|
86
|
+
rand(0..10)
|
87
|
+
)
|
88
|
+
)
|
89
|
+
monsters.push(Monster.new(
|
90
|
+
MOB_ID_AMBEROO,
|
91
|
+
MOB_NAME_AMBEROO,
|
92
|
+
MOB_DESC_AMBEROO,
|
93
|
+
'punchy',
|
94
|
+
'balled',
|
95
|
+
'jumpy',
|
96
|
+
MOB_LEVEL_AMBEROO,
|
97
|
+
MOB_LEVEL_AMBEROO * 5,
|
98
|
+
MOB_LEVEL_AMBEROO * 5,
|
99
|
+
MOB_LEVEL_AMBEROO * 2,
|
100
|
+
MOB_LEVEL_AMBEROO * 2,
|
101
|
+
Inventory.new,
|
102
|
+
rand(0..10)
|
103
|
+
)
|
104
|
+
)
|
105
|
+
monsters.push(Monster.new(
|
106
|
+
MOB_ID_AMETHYSTLE,
|
107
|
+
MOB_NAME_AMETHYSTLE,
|
108
|
+
MOB_DESC_AMETHYSTLE,
|
109
|
+
'sharp',
|
110
|
+
'loose',
|
111
|
+
'mesmerizing',
|
112
|
+
MOB_LEVEL_AMETHYSTLE,
|
113
|
+
MOB_LEVEL_AMETHYSTLE * 5,
|
114
|
+
MOB_LEVEL_AMETHYSTLE * 5,
|
115
|
+
MOB_LEVEL_AMETHYSTLE * 2,
|
116
|
+
MOB_LEVEL_AMETHYSTLE * 2,
|
117
|
+
Inventory.new,
|
118
|
+
rand(0..10)
|
119
|
+
)
|
120
|
+
)
|
121
|
+
monsters.push(Monster.new(
|
122
|
+
MOB_ID_AQUAMARINE,
|
123
|
+
MOB_NAME_AQUAMARINE,
|
124
|
+
MOB_DESC_AQUAMARINE,
|
125
|
+
'strained',
|
126
|
+
'hairy',
|
127
|
+
'tempered',
|
128
|
+
MOB_LEVEL_AQUAMARINE,
|
129
|
+
MOB_LEVEL_AQUAMARINE * 5,
|
130
|
+
MOB_LEVEL_AQUAMARINE * 5,
|
131
|
+
MOB_LEVEL_AQUAMARINE * 2,
|
132
|
+
MOB_LEVEL_AQUAMARINE * 2,
|
133
|
+
Inventory.new,
|
134
|
+
rand(0..10)
|
135
|
+
)
|
136
|
+
)
|
137
|
+
monsters.push(Monster.new(
|
138
|
+
MOB_ID_APATIGER,
|
139
|
+
MOB_NAME_APATIGER,
|
140
|
+
MOB_DESC_APATIGER,
|
141
|
+
'calloused',
|
142
|
+
'soft',
|
143
|
+
'apathetic',
|
144
|
+
MOB_LEVEL_APATIGER,
|
145
|
+
MOB_LEVEL_APATIGER * 5,
|
146
|
+
MOB_LEVEL_APATIGER * 5,
|
147
|
+
MOB_LEVEL_APATIGER * 2,
|
148
|
+
MOB_LEVEL_APATIGER * 2,
|
149
|
+
Inventory.new,
|
150
|
+
rand(0..10)
|
151
|
+
)
|
152
|
+
)
|
153
|
+
monsters.push(Monster.new(
|
154
|
+
MOB_ID_BLOODSTORM,
|
155
|
+
MOB_NAME_BLOODSTORM,
|
156
|
+
MOB_DESC_BLOODSTORM,
|
157
|
+
'bloody',
|
158
|
+
'bloody',
|
159
|
+
'boiling',
|
160
|
+
MOB_LEVEL_BLOODSTORM,
|
161
|
+
MOB_LEVEL_BLOODSTORM * 5,
|
162
|
+
MOB_LEVEL_BLOODSTORM * 5,
|
163
|
+
MOB_LEVEL_BLOODSTORM * 2,
|
164
|
+
MOB_LEVEL_BLOODSTORM * 2,
|
165
|
+
Inventory.new,
|
166
|
+
rand(0..10)
|
167
|
+
)
|
168
|
+
)
|
169
|
+
monsters.push(Monster.new(
|
170
|
+
MOB_ID_CITRINAGA,
|
171
|
+
MOB_NAME_CITRINAGA,
|
172
|
+
MOB_DESC_CITRINAGA,
|
173
|
+
'shiny',
|
174
|
+
'glistening',
|
175
|
+
'staid',
|
176
|
+
MOB_LEVEL_CITRINAGA,
|
177
|
+
MOB_LEVEL_CITRINAGA * 5,
|
178
|
+
MOB_LEVEL_CITRINAGA * 5,
|
179
|
+
MOB_LEVEL_CITRINAGA * 2,
|
180
|
+
MOB_LEVEL_CITRINAGA * 2,
|
181
|
+
Inventory.new,
|
182
|
+
rand(0..10)
|
183
|
+
)
|
184
|
+
)
|
185
|
+
monsters.push(Monster.new(
|
186
|
+
MOB_ID_CORALIZ,
|
187
|
+
MOB_NAME_CORALIZ,
|
188
|
+
MOB_DESC_CORALIZ,
|
189
|
+
'spotted',
|
190
|
+
'slippery',
|
191
|
+
'emotionless',
|
192
|
+
MOB_LEVEL_CORALIZ,
|
193
|
+
MOB_LEVEL_CORALIZ * 5,
|
194
|
+
MOB_LEVEL_CORALIZ * 5,
|
195
|
+
MOB_LEVEL_CORALIZ * 2,
|
196
|
+
MOB_LEVEL_CORALIZ * 2,
|
197
|
+
Inventory.new,
|
198
|
+
rand(0..10)
|
199
|
+
)
|
200
|
+
)
|
201
|
+
monsters.push(Monster.new(
|
202
|
+
MOB_ID_CUBICAT,
|
203
|
+
MOB_NAME_CUBICAT,
|
204
|
+
MOB_DESC_CUBICAT,
|
205
|
+
'striking',
|
206
|
+
'grippy',
|
207
|
+
'salacious',
|
208
|
+
MOB_LEVEL_CUBICAT,
|
209
|
+
MOB_LEVEL_CUBICAT * 5,
|
210
|
+
MOB_LEVEL_CUBICAT * 5,
|
211
|
+
MOB_LEVEL_CUBICAT * 2,
|
212
|
+
MOB_LEVEL_CUBICAT * 2,
|
213
|
+
Inventory.new,
|
214
|
+
rand(0..10)
|
215
|
+
)
|
216
|
+
)
|
217
|
+
monsters.push(Monster.new(
|
218
|
+
MOB_ID_DIAMAN,
|
219
|
+
MOB_NAME_DIAMAN,
|
220
|
+
MOB_DESC_DIAMAN,
|
221
|
+
'bright',
|
222
|
+
'jagged',
|
223
|
+
'adamant',
|
224
|
+
MOB_LEVEL_DIAMAN,
|
225
|
+
MOB_LEVEL_DIAMAN * 5,
|
226
|
+
MOB_LEVEL_DIAMAN * 5,
|
227
|
+
MOB_LEVEL_DIAMAN * 2,
|
228
|
+
MOB_LEVEL_DIAMAN * 2,
|
229
|
+
Inventory.new,
|
230
|
+
rand(0..10)
|
231
|
+
)
|
232
|
+
)
|
233
|
+
end
|
234
|
+
|
235
|
+
def init_items
|
236
|
+
items = []
|
237
|
+
items.push(Item.new(
|
238
|
+
ITEM_ID_STONE,
|
239
|
+
ITEM_NAME_STONE,
|
240
|
+
ITEM_DESC_STONE,
|
241
|
+
true
|
242
|
+
)
|
243
|
+
)
|
244
|
+
items.push(Item.new(
|
245
|
+
ITEM_ID_BED,
|
246
|
+
ITEM_NAME_BED,
|
247
|
+
ITEM_DESC_BED,
|
248
|
+
false
|
249
|
+
)
|
250
|
+
)
|
251
|
+
items.push(Item.new(
|
252
|
+
ITEM_ID_STALACTITE,
|
253
|
+
ITEM_NAME_STALACTITE,
|
254
|
+
ITEM_DESC_STALACTITE,
|
255
|
+
true
|
256
|
+
)
|
257
|
+
)
|
258
|
+
items.push(Item.new(
|
259
|
+
ITEM_ID_FEATHER,
|
260
|
+
ITEM_NAME_FEATHER,
|
261
|
+
ITEM_DESC_FEATHER,
|
262
|
+
true
|
263
|
+
)
|
264
|
+
)
|
265
|
+
items.push(Item.new(
|
266
|
+
ITEM_ID_GUN,
|
267
|
+
ITEM_NAME_GUN,
|
268
|
+
ITEM_DESC_GUN,
|
269
|
+
true
|
270
|
+
)
|
271
|
+
)
|
272
|
+
end
|
273
|
+
|
274
|
+
def init_locations
|
275
|
+
locations = []
|
276
|
+
locations.push(Location.new(
|
277
|
+
LOC_ID_HOME,
|
278
|
+
LOC_NAME_HOME,
|
279
|
+
LOC_DESC_HOME,
|
280
|
+
LOC_CONNECTIONS_HOME,
|
281
|
+
:none,
|
282
|
+
[item_by_id(0), item_by_id(1)],
|
283
|
+
monsters
|
284
|
+
)
|
285
|
+
)
|
286
|
+
locations.push(Location.new(
|
287
|
+
LOC_ID_CAVE_ENTRANCE,
|
288
|
+
LOC_NAME_CAVE_ENTRANCE,
|
289
|
+
LOC_DESC_CAVE_ENTRANCE,
|
290
|
+
LOC_CONNECTIONS_CAVE_ENTRANCE,
|
291
|
+
:low,
|
292
|
+
[],
|
293
|
+
monsters
|
294
|
+
)
|
295
|
+
)
|
296
|
+
locations.push(Location.new(
|
297
|
+
LOC_ID_CAVE_ROOM1,
|
298
|
+
LOC_NAME_CAVE_ROOM1,
|
299
|
+
LOC_DESC_CAVE_ROOM1,
|
300
|
+
LOC_CONNECTIONS_CAVE_ROOM1,
|
301
|
+
:moderate,
|
302
|
+
[item_by_id(2)],
|
303
|
+
monsters
|
304
|
+
)
|
305
|
+
)
|
306
|
+
locations.push(Location.new(
|
307
|
+
LOC_ID_FOREST,
|
308
|
+
LOC_NAME_FOREST,
|
309
|
+
LOC_DESC_FOREST,
|
310
|
+
LOC_CONNECTIONS_FOREST,
|
311
|
+
:low,
|
312
|
+
[item_by_id(3)],
|
313
|
+
monsters
|
314
|
+
)
|
315
|
+
)
|
316
|
+
locations.push(Location.new(
|
317
|
+
LOC_ID_SKYTOWER,
|
318
|
+
LOC_NAME_SKYTOWER,
|
319
|
+
LOC_DESC_SKYTOWER,
|
320
|
+
LOC_CONNECTIONS_SKYTOWER,
|
321
|
+
:assured,
|
322
|
+
[item_by_id(4)],
|
323
|
+
monsters
|
324
|
+
)
|
325
|
+
)
|
326
|
+
end
|
327
|
+
end
|
328
|
+
end
|