gemwarrior 0.9.0 → 0.9.1

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: bda7d7def18d2c9269e29addbe19238f1eb8c6b6
4
- data.tar.gz: 4779a9b6f56d7312e8e73f400490d7c4bf08b854
3
+ metadata.gz: 802e8eb109de45ef2c968edc3fb59a7cf7653ff5
4
+ data.tar.gz: fb8400dcd4e0fc1e877702c529ecc4e3ee3dd220
5
5
  SHA512:
6
- metadata.gz: 579de55cd563d14b6efa1a74289d9ad8c2f0fa3097ddffd9ddac2e573d685c5926b02ff831a29b7a5827670b1d89061f666f8d0eacd2a2ee3b69e2c864dadb6e
7
- data.tar.gz: e8a8e153c8a442b11a6c8340783d3f69d591bf187993da3893c16a6b2eb27c293da213815a14f5e6da0e15a5d865ddea5a298c0995c8e6e0d63dbaef4a1de008
6
+ metadata.gz: e1c9a822d15ff61e3867d2829be1bfd8127603201e69396afca0fb68deded08e11d32ade379a9d07ba5a90ce363c2dccb34420bbcf733294c26cf1be38e5da80
7
+ data.tar.gz: d15377a5acae4b68cf4518b8290fd0ce5e5664d02d581026c4be30d81cdc404db9ed4fc6d7eda3254177c5245ef2c8295d7bf671c6865523c0392b35a95533af
@@ -18,7 +18,7 @@ module Gemwarrior
18
18
 
19
19
  def use(player = nil)
20
20
  puts 'You attempt to open the seriously massive door that separates you from Emerald himself.'
21
- if player.inventory.has_item?('keystone')
21
+ if player.inventory.contains_item?('keystone')
22
22
  puts 'The keystone in your inventory glows as you approach the incredibly titanic-sized door, so you naturally pull it out and thrust it into the stone-shaped depression within the cloudy obstruction. The door "opens" in a way and you can now pass through.'
23
23
  {:type => 'move', :data => 'Sky Tower (Throne Room)'}
24
24
  else
@@ -108,7 +108,7 @@ module Gemwarrior
108
108
 
109
109
  Animation::run({:phrase => '** Zzzzz **'})
110
110
 
111
- if self.inventory.has_item?('tent') || world.location_by_coords(cur_coords).has_item?('tent')
111
+ if self.inventory.contains_item?('tent') || world.location_by_coords(cur_coords).has_item?('tent')
112
112
  self.hp_cur = self.hp_max
113
113
 
114
114
  return "You brandish your trusty magical canvas, and with a flick of the wrist your home for the evening is set up. Approximately #{hours} #{hours_text}, #{minutes} #{mins_text}, and #{seconds} #{secs_text} later, you wake up, fully rested, ready for adventure."
@@ -29,12 +29,12 @@ module Gemwarrior
29
29
  end
30
30
  end
31
31
 
32
- def has_item?(item_name)
32
+ def contains_item?(item_name)
33
33
  items.map(&:name).include?(item_name)
34
34
  end
35
35
 
36
36
  def describe_item(item_name)
37
- if has_item?(item_name)
37
+ if contains_item?(item_name)
38
38
  items.each do |i|
39
39
  if i.name.eql?(item_name)
40
40
  return i.description
@@ -46,7 +46,7 @@ module Gemwarrior
46
46
  end
47
47
 
48
48
  def equip_item(item_name)
49
- if has_item?(item_name)
49
+ if contains_item?(item_name)
50
50
  items.each do |i|
51
51
  if i.name.eql?(item_name)
52
52
  if i.equippable
@@ -64,7 +64,7 @@ module Gemwarrior
64
64
  end
65
65
 
66
66
  def unequip_item(item_name)
67
- if has_item?(item_name)
67
+ if contains_item?(item_name)
68
68
  items.each do |i|
69
69
  if i.name.eql?(item_name)
70
70
  if i.equippable
@@ -101,8 +101,11 @@ module Gemwarrior
101
101
  end
102
102
 
103
103
  def remove_item(item_name)
104
- if has_item?(item_name)
104
+ if contains_item?(item_name)
105
105
  items.reject! { |item| item.name == item_name }
106
+
107
+ self.weapon = nil if self.weapon.name.eql?(item_name)
108
+
106
109
  return "The #{item_name} has been thrown on the ground, but far out of reach, and you're much too lazy to go get it now, so it's as good as gone."
107
110
  else
108
111
  ERROR_ITEM_REMOVE_INVALID
@@ -2,5 +2,5 @@
2
2
  # Version of Gem Warrior
3
3
 
4
4
  module Gemwarrior
5
- VERSION = "0.9.0"
5
+ VERSION = "0.9.1"
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.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Chadwick