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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d94daeb7b63846e552aca0539eecf7b6e5a65c36
4
- data.tar.gz: a4851194fdfcfe7b584e9c812c18a871aebc7f3f
3
+ metadata.gz: e8acc1c9ce2018d794446c702f93efb774610129
4
+ data.tar.gz: 51f0de0a987f87a73a2bc14ab8ab284aedcd8a30
5
5
  SHA512:
6
- metadata.gz: 43ede2cace45ccb180f3f1aa8e57a9e1d9f420a515cfd3eb565fc54a5b4880625265f1bda9399413cb92a1ff4783059b09bd2a83f5b60d0b63974acf26c7c867
7
- data.tar.gz: 26d2cbd926ad916ef4fdb28f0b53a4ca4cf3fe4c2dc57ab472a0db72c7df82a1a0a1cd8fe6c0d8c6b4b635e76299201806f22fdbc740e0b5a71d5ac70e83e7a0
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
- unless random_monster.is_boss || !self.monster_level_range.include?(random_monster.level)
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
 
@@ -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
@@ -2,5 +2,5 @@
2
2
  # Version of Gem Warrior
3
3
 
4
4
  module Gemwarrior
5
- VERSION = "0.7.7"
5
+ VERSION = "0.7.8"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemwarrior
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Chadwick