gemwarrior 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 802e8eb109de45ef2c968edc3fb59a7cf7653ff5
|
4
|
+
data.tar.gz: fb8400dcd4e0fc1e877702c529ecc4e3ee3dd220
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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."
|
data/lib/gemwarrior/inventory.rb
CHANGED
@@ -29,12 +29,12 @@ module Gemwarrior
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
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
|
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
|
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
|
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
|
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
|
data/lib/gemwarrior/version.rb
CHANGED