gemwarrior 0.7.7 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gemwarrior/entities/location.rb +10 -5
- data/lib/gemwarrior/evaluator.rb +8 -3
- data/lib/gemwarrior/misc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8acc1c9ce2018d794446c702f93efb774610129
|
4
|
+
data.tar.gz: 51f0de0a987f87a73a2bc14ab8ab284aedcd8a30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad25daf8fff7a7c32ca98991183d4f4b7f0fb4b170dbcdd3d5eb59edf1640728edb7a3537ed25986d08c84a76555456b334ba36a4b1b0839b3d45b2d15fa2c5
|
7
|
+
data.tar.gz: d74d03c9e9941c7061ca5ac720c9700adc1fbe8672b79cffdeb7fa4995f77687a07b356eed65ba89767565632539b989cb43175d3df059fa397fdd2693086bdb
|
@@ -137,17 +137,22 @@ module Gemwarrior
|
|
137
137
|
actionable_words.join(', ')
|
138
138
|
end
|
139
139
|
|
140
|
-
def populate_monsters(monsters_available)
|
141
|
-
if has_monster?
|
142
|
-
self.checked_for_monsters = true
|
143
|
-
self.monsters_abounding = []
|
140
|
+
def populate_monsters(monsters_available, spawn = false)
|
141
|
+
if has_monster? || spawn
|
142
|
+
self.checked_for_monsters = true unless spawn
|
143
|
+
self.monsters_abounding = [] unless spawn
|
144
144
|
random_monster = nil
|
145
145
|
|
146
146
|
# get random non-boss monster
|
147
147
|
loop do
|
148
148
|
random_monster = monsters_available[rand(0..monsters_available.length-1)]
|
149
|
-
|
149
|
+
|
150
|
+
if spawn
|
150
151
|
break
|
152
|
+
else
|
153
|
+
unless random_monster.is_boss || !self.monster_level_range.include?(random_monster.level)
|
154
|
+
break
|
155
|
+
end
|
151
156
|
end
|
152
157
|
end
|
153
158
|
|
data/lib/gemwarrior/evaluator.rb
CHANGED
@@ -46,8 +46,8 @@ module Gemwarrior
|
|
46
46
|
def initialize(world)
|
47
47
|
self.world = world
|
48
48
|
|
49
|
-
self.devcommands = %w(god beast list vars map stat teleport)
|
50
|
-
self.devaliases = %w(gd bs ls v m s tp)
|
49
|
+
self.devcommands = %w(god beast list vars map stat teleport spawn)
|
50
|
+
self.devaliases = %w(gd bs ls v m s tp sp)
|
51
51
|
self.devextras = %w(st)
|
52
52
|
self.devcmd_descriptions = [
|
53
53
|
'Toggle god mode (i.e. invincible)',
|
@@ -56,7 +56,8 @@ module Gemwarrior
|
|
56
56
|
'List all the variables in the world',
|
57
57
|
'Show a map of the world',
|
58
58
|
'Change player stat',
|
59
|
-
'Teleport to coordinates (5 0) or location name (\'Home\')'
|
59
|
+
'Teleport to coordinates (5 0 0) or location name (\'Home\')',
|
60
|
+
'Spawn random monster'
|
60
61
|
]
|
61
62
|
|
62
63
|
self.commands = %w(character inventory rest look take use drop equip unequip go attack change help quit quit!)
|
@@ -173,6 +174,10 @@ module Gemwarrior
|
|
173
174
|
return ERROR_DEBUG_STAT_PARAM_INVALID
|
174
175
|
end
|
175
176
|
end
|
177
|
+
when 'spawn', 'sp'
|
178
|
+
cur_loc = world.location_by_coords(world.player.cur_coords)
|
179
|
+
cur_loc.populate_monsters(world.monsters, true)
|
180
|
+
return world.describe(cur_loc)
|
176
181
|
when 'teleport', 'tp'
|
177
182
|
if param1.nil?
|
178
183
|
return ERROR_DEBUG_TELEPORT_PARAMS_MISSING
|