gemwarrior 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/bin/gemwarrior +15 -9
  3. data/gemwarrior.gemspec +1 -0
  4. data/lib/gemwarrior/arena.rb +10 -10
  5. data/lib/gemwarrior/battle.rb +41 -36
  6. data/lib/gemwarrior/entities/item.rb +2 -2
  7. data/lib/gemwarrior/entities/items/arena_master.rb +4 -4
  8. data/lib/gemwarrior/entities/items/bed.rb +1 -1
  9. data/lib/gemwarrior/entities/items/couch.rb +1 -1
  10. data/lib/gemwarrior/entities/items/floor_tile.rb +3 -3
  11. data/lib/gemwarrior/entities/items/gun.rb +1 -1
  12. data/lib/gemwarrior/entities/items/herb.rb +1 -1
  13. data/lib/gemwarrior/entities/items/ladder.rb +2 -2
  14. data/lib/gemwarrior/entities/items/map.rb +2 -2
  15. data/lib/gemwarrior/entities/items/massive_door.rb +1 -1
  16. data/lib/gemwarrior/entities/items/opalaser.rb +1 -1
  17. data/lib/gemwarrior/entities/items/pond.rb +2 -2
  18. data/lib/gemwarrior/entities/items/rope.rb +2 -2
  19. data/lib/gemwarrior/entities/items/snowman.rb +1 -1
  20. data/lib/gemwarrior/entities/items/sparklything.rb +1 -1
  21. data/lib/gemwarrior/entities/items/tent.rb +1 -1
  22. data/lib/gemwarrior/entities/items/tower_switch.rb +1 -1
  23. data/lib/gemwarrior/entities/items/waterfall.rb +1 -1
  24. data/lib/gemwarrior/entities/location.rb +19 -19
  25. data/lib/gemwarrior/entities/monster.rb +2 -2
  26. data/lib/gemwarrior/entities/monsters/alexandrat.rb +3 -3
  27. data/lib/gemwarrior/entities/monsters/amberoo.rb +3 -3
  28. data/lib/gemwarrior/entities/monsters/amethystle.rb +3 -3
  29. data/lib/gemwarrior/entities/monsters/apatiger.rb +2 -2
  30. data/lib/gemwarrior/entities/monsters/aquamarine.rb +3 -3
  31. data/lib/gemwarrior/entities/monsters/bloodstorm.rb +3 -3
  32. data/lib/gemwarrior/entities/monsters/bosses/emerald.rb +4 -4
  33. data/lib/gemwarrior/entities/monsters/bosses/garynetty.rb +2 -2
  34. data/lib/gemwarrior/entities/monsters/citrinaga.rb +3 -3
  35. data/lib/gemwarrior/entities/monsters/coraliz.rb +3 -3
  36. data/lib/gemwarrior/entities/monsters/cubicat.rb +3 -3
  37. data/lib/gemwarrior/entities/monsters/diaman.rb +3 -3
  38. data/lib/gemwarrior/entities/player.rb +275 -263
  39. data/lib/gemwarrior/evaluator.rb +448 -448
  40. data/lib/gemwarrior/game.rb +5 -5
  41. data/lib/gemwarrior/inventory.rb +14 -10
  42. data/lib/gemwarrior/misc/animation.rb +1 -1
  43. data/lib/gemwarrior/misc/music.rb +1 -1
  44. data/lib/gemwarrior/misc/name_generator.rb +8 -8
  45. data/lib/gemwarrior/misc/player_levels.rb +1 -1
  46. data/lib/gemwarrior/misc/timer.rb +50 -0
  47. data/lib/gemwarrior/misc/wordlist.rb +7 -7
  48. data/lib/gemwarrior/repl.rb +55 -21
  49. data/lib/gemwarrior/version.rb +1 -1
  50. data/lib/gemwarrior/world.rb +21 -21
  51. metadata +17 -2
@@ -2,5 +2,5 @@
2
2
  # Version of Gem Warrior
3
3
 
4
4
  module Gemwarrior
5
- VERSION = "0.8.6"
5
+ VERSION = "0.8.7"
6
6
  end
@@ -12,13 +12,13 @@ module Gemwarrior
12
12
  LOCATION_DATA_FILE = "data/locations.yml"
13
13
  WORLD_DIM_WIDTH = 10
14
14
  WORLD_DIM_HEIGHT = 10
15
-
15
+
16
16
  ## ERRORS
17
17
  ERROR_LIST_PARAM_INVALID = 'That is not something that can be listed.'
18
18
  ERROR_LOCATION_DESCRIBE_ENTITY_INVALID = 'You do not see that here.'
19
-
19
+
20
20
  attr_accessor :monsters, :locations, :player, :debug_mode, :use_wordnik, :sound
21
-
21
+
22
22
  def initialize
23
23
  self.monsters = init_monsters
24
24
  self.locations = init_locations
@@ -129,7 +129,7 @@ module Gemwarrior
129
129
  end
130
130
  return nil
131
131
  end
132
-
132
+
133
133
  def location_coords_by_name(name)
134
134
  locations.each do |l|
135
135
  if l.name.downcase.eql?(name.downcase)
@@ -138,33 +138,33 @@ module Gemwarrior
138
138
  end
139
139
  return nil
140
140
  end
141
-
141
+
142
142
  def describe(point)
143
143
  desc_text = ""
144
144
  desc_text << "[ #{point.name} ]".colorize(:green)
145
-
145
+
146
146
  if debug_mode
147
147
  desc_text << " DL[#{point.danger_level.to_s}] MLR[#{point.monster_level_range.to_s}]".colorize(:yellow)
148
148
  end
149
-
149
+
150
150
  desc_text << "\n"
151
151
  desc_text << point.description
152
-
152
+
153
153
  point.populate_monsters(self.monsters) unless point.checked_for_monsters?
154
-
154
+
155
155
  desc_text << "\n >> Curious object(s): #{point.list_items.join(', ')}" unless point.list_items.empty?
156
156
  desc_text << "\n >> Monster(s) abound: #{point.list_monsters.join(', ')}" unless point.list_monsters.empty?
157
157
  desc_text << "\n >> Boss(es) abound: #{point.list_bosses.join(', ')}" unless point.list_bosses.empty?
158
158
  desc_text << "\n >> Paths: #{point.list_paths.join(', ')}"
159
-
159
+
160
160
  if debug_mode
161
161
  desc_text << "\n >>> Actionable words: "
162
162
  desc_text << point.list_actionable_words.colorize(:white)
163
163
  end
164
-
164
+
165
165
  return desc_text
166
166
  end
167
-
167
+
168
168
  def describe_entity(point, entity_name)
169
169
  if point.has_item?(entity_name)
170
170
  point.items.each do |i|
@@ -204,11 +204,11 @@ module Gemwarrior
204
204
  ERROR_LOCATION_DESCRIBE_ENTITY_INVALID
205
205
  end
206
206
  end
207
-
207
+
208
208
  def can_move?(direction)
209
209
  location_by_coords(player.cur_coords).has_loc_to_the?(direction)
210
210
  end
211
-
211
+
212
212
  def has_monster_to_attack?(monster_name)
213
213
  possible_combatants = location_by_coords(player.cur_coords).monsters_abounding.map(&:name) | location_by_coords(player.cur_coords).bosses_abounding.map(&:name)
214
214
 
@@ -217,10 +217,10 @@ module Gemwarrior
217
217
  return true
218
218
  end
219
219
  end
220
-
220
+
221
221
  return false
222
222
  end
223
-
223
+
224
224
  private
225
225
 
226
226
  def create_item_objects(item_names)
@@ -242,7 +242,7 @@ module Gemwarrior
242
242
  end
243
243
  return bosses
244
244
  end
245
-
245
+
246
246
  def init_monsters
247
247
  Dir.glob('lib/gemwarrior/entities/monsters/*.rb').each do |item|
248
248
  require_relative item[item.index('/', item.index('/')+1)+1..item.length]
@@ -250,7 +250,7 @@ module Gemwarrior
250
250
  Dir.glob('lib/gemwarrior/entities/monsters/bosses/*.rb').each do |item|
251
251
  require_relative item[item.index('/', item.index('/')+1)+1..item.length]
252
252
  end
253
-
253
+
254
254
  self.monsters = [
255
255
  Alexandrat.new,
256
256
  Amberoo.new,
@@ -271,11 +271,11 @@ module Gemwarrior
271
271
  Dir.glob('lib/gemwarrior/entities/items/*.rb').each do |item|
272
272
  require_relative item[item.index('/', item.index('/')+1)+1..item.length]
273
273
  end
274
-
274
+
275
275
  locations = []
276
276
 
277
277
  location_data = YAML.load_file(LOCATION_DATA_FILE)
278
-
278
+
279
279
  location_data.each {|l|
280
280
  locations.push(Location.new({
281
281
  :name => l["name"],
@@ -297,7 +297,7 @@ module Gemwarrior
297
297
  :bosses_abounding => create_boss_objects(l["bosses_abounding"])
298
298
  }))
299
299
  }
300
-
300
+
301
301
  return locations
302
302
  end
303
303
  end
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.8.6
4
+ version: 0.8.7
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-02 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: os
@@ -100,6 +100,20 @@ dependencies:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 0.1.3
103
+ - !ruby/object:Gem::Dependency
104
+ name: clocker
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 0.1.2
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: 0.1.2
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: pry-byebug
105
119
  requirement: !ruby/object:Gem::Requirement
@@ -245,6 +259,7 @@ files:
245
259
  - lib/gemwarrior/misc/music.rb
246
260
  - lib/gemwarrior/misc/name_generator.rb
247
261
  - lib/gemwarrior/misc/player_levels.rb
262
+ - lib/gemwarrior/misc/timer.rb
248
263
  - lib/gemwarrior/misc/wordlist.rb
249
264
  - lib/gemwarrior/repl.rb
250
265
  - lib/gemwarrior/version.rb