gemwarrior 0.9.30 → 0.9.31
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d55fe04a8f5043e88e3190a89d1769ab83303ee0
|
4
|
+
data.tar.gz: 076226766021189d922d10f5775c3ddef13dd283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91fa430b80846bde16f61f33997cd227c80f436c4efe17ed47398477045f199c0ce47a4e9216cf02fb36fde3a74c52955790561d79a643913c1f69d13f62a4ca
|
7
|
+
data.tar.gz: 9d71ed1c86feed2ac58a35345bb0c074c19924e1bef42752e53a98b4ecf34cb73649f033990d85fa606f15cbcadbdf7c3e34c5c0312902beeb67a2d01c3fd529
|
data/data/locations.yml
CHANGED
@@ -18,7 +18,8 @@ module Gemwarrior
|
|
18
18
|
|
19
19
|
def use(player = nil)
|
20
20
|
if player.at_full_hp?
|
21
|
-
puts 'You
|
21
|
+
puts 'You "sit" on the impossibly soft surface of the furniture, but even after a few minutes of this seemingly heavenly hedonism you don\'t feel significantly better and decide to get up again.'
|
22
|
+
{ type: nil, data: nil }
|
22
23
|
else
|
23
24
|
puts 'Your body comes to rest somewhere below the surface of the cloudy apparatus, almost as if it were floating *amongst* the couch. The feeling is heavenly, and you actually feel somewhat better after getting back up.'
|
24
25
|
puts '>> You regain a hit point.'
|
@@ -6,9 +6,12 @@ require_relative 'herb'
|
|
6
6
|
require_relative 'dagger'
|
7
7
|
|
8
8
|
module Gemwarrior
|
9
|
-
PLAYER_ROX_INSUFFICIENT = 'You do not have enough rox to purchase that item.'
|
10
|
-
|
11
9
|
class SmallHole < Item
|
10
|
+
# CONSTANTS
|
11
|
+
PLAYER_ROX_INSUFFICIENT = '>> "Pity. You are a bit short on funds to purchase that item."'
|
12
|
+
PLAYER_ITEMS_ADDITIONAL = '>> "Anything else?"'
|
13
|
+
PLAYER_COMMAND_INVALID = '>> "Huh?"'
|
14
|
+
|
12
15
|
def initialize
|
13
16
|
self.name = 'small_hole'
|
14
17
|
self.description = 'Amongst the rubble of the alcove, a small hole, barely big enough for a rodent, exists in an absently-minded way near the bottom of the wall.'
|
@@ -33,7 +36,7 @@ module Gemwarrior
|
|
33
36
|
def rat_shop(player)
|
34
37
|
items_purchased = []
|
35
38
|
|
36
|
-
puts '>>"Hello, wanderer. Welcome to my establishment, as it were. Are you in need of anything?"'
|
39
|
+
puts '>> "Hello, wanderer. Welcome to my establishment, as it were. Are you in need of anything?"'
|
37
40
|
puts
|
38
41
|
puts 'The creature gently shoves a small slip of paper out of his hole and towards you. You take a peek and notice it has a list of things with prices on it.'
|
39
42
|
puts
|
@@ -42,7 +45,7 @@ module Gemwarrior
|
|
42
45
|
puts '(1) Herb - 10 rox'
|
43
46
|
puts '(2) Dagger - 150 rox'
|
44
47
|
puts
|
45
|
-
puts '>>"What are you in need of?"'
|
48
|
+
puts '>> "What are you in need of?"'
|
46
49
|
|
47
50
|
loop do
|
48
51
|
puts ' 1 - Herb'
|
@@ -56,8 +59,8 @@ module Gemwarrior
|
|
56
59
|
if player.rox >= 10
|
57
60
|
player.rox -= 10
|
58
61
|
items_purchased.push(Herb.new)
|
59
|
-
puts '>>"Excellent choice."'
|
60
|
-
puts
|
62
|
+
puts '>> "Excellent choice."'
|
63
|
+
puts PLAYER_ITEMS_ADDITIONAL
|
61
64
|
next
|
62
65
|
else
|
63
66
|
puts PLAYER_ROX_INSUFFICIENT
|
@@ -67,18 +70,18 @@ module Gemwarrior
|
|
67
70
|
if player.rox >= 150
|
68
71
|
player.rox -= 150
|
69
72
|
items_purchased.push(Dagger.new)
|
70
|
-
puts '>>"A fine blade, indeed."'
|
71
|
-
puts
|
73
|
+
puts '>> "A fine blade, indeed."'
|
74
|
+
puts PLAYER_ITEMS_ADDITIONAL
|
72
75
|
next
|
73
76
|
else
|
74
77
|
puts PLAYER_ROX_INSUFFICIENT
|
75
78
|
next
|
76
79
|
end
|
77
80
|
when 'x'
|
78
|
-
puts '>>"If you need anything further, I\'m always in this hole..."'
|
81
|
+
puts '>> "If you need anything further, I\'m always in this hole..."'
|
79
82
|
return { type: 'purchase', data: items_purchased }
|
80
83
|
else
|
81
|
-
puts
|
84
|
+
puts PLAYER_COMMAND_INVALID
|
82
85
|
next
|
83
86
|
end
|
84
87
|
end
|
@@ -141,22 +141,29 @@ module Gemwarrior
|
|
141
141
|
|
142
142
|
if tent_uses > 0
|
143
143
|
if self.at_full_hp?
|
144
|
-
|
144
|
+
return 'Despite feeling just fine, health-wise, you decide to set up camp for the ni--well, actually, after a few minutes you realize you don\'t need to sleep and pack things up again, ready to go.'
|
145
145
|
else
|
146
146
|
Animation::run(phrase: REST_NOT_FULL_TEXT)
|
147
|
-
puts "You brandish the 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."
|
148
147
|
self.hp_cur = self.hp_max
|
148
|
+
|
149
|
+
status_text = "You brandish the 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."
|
150
|
+
status_text << "\n>> You regain all of your hit points."
|
151
|
+
|
152
|
+
return status_text
|
149
153
|
end
|
150
154
|
else
|
151
155
|
if self.at_full_hp?
|
152
156
|
Animation::run(phrase: REST_FULL_TEXT)
|
153
|
-
|
157
|
+
return 'You sit down on the ground, make some notes on the back of your hand, test the air, and then return to standing, back at it all again.'
|
154
158
|
else
|
155
159
|
Animation::run(phrase: REST_NOT_FULL_TEXT)
|
156
|
-
puts "You lie down somewhere quasi-flat and after a few moments, due to extreme exhaustion, you fall into a deep, yet troubled, slumber. Approximately #{hours} #{hours_text}, #{minutes} #{mins_text}, and #{seconds} #{secs_text} later, you wake up with a start. Upon getting to your feet you look around, notice you feel somewhat better, and wonder why you dreamt about #{WordList.new(world.use_wordnik, 'noun-plural').get_random_value}."
|
157
|
-
|
158
160
|
self.hp_cur = self.hp_cur.to_i + rand(10..15)
|
159
161
|
self.hp_cur = self.hp_max if self.hp_cur > self.hp_max
|
162
|
+
|
163
|
+
status_text = "You lie down somewhere quasi-flat and after a few moments, due to extreme exhaustion, you fall into a deep, yet troubled, slumber. Approximately #{hours} #{hours_text}, #{minutes} #{mins_text}, and #{seconds} #{secs_text} later, you wake up with a start. Upon getting to your feet you look around, notice you feel somewhat better, and wonder why you dreamt about #{WordList.new(world.use_wordnik, 'noun-plural').get_random_value}."
|
164
|
+
status_text << "\n>> You regain a few hit points."
|
165
|
+
|
166
|
+
return status_text
|
160
167
|
end
|
161
168
|
end
|
162
169
|
end
|
data/lib/gemwarrior/evaluator.rb
CHANGED
@@ -287,7 +287,7 @@ module Gemwarrior
|
|
287
287
|
tent_uses = i.number_of_uses
|
288
288
|
i.number_of_uses -= 1
|
289
289
|
|
290
|
-
puts "
|
290
|
+
puts ">> tent can be used when resting #{i.number_of_uses} more time(s)."
|
291
291
|
end
|
292
292
|
end
|
293
293
|
end
|
@@ -299,7 +299,7 @@ module Gemwarrior
|
|
299
299
|
tent_uses = i.number_of_uses
|
300
300
|
i.number_of_uses -= 1
|
301
301
|
|
302
|
-
puts "
|
302
|
+
puts ">> tent can be used when resting #{i.number_of_uses} more time(s)."
|
303
303
|
end
|
304
304
|
end
|
305
305
|
end
|
@@ -309,6 +309,8 @@ module Gemwarrior
|
|
309
309
|
|
310
310
|
if result.eql?('death')
|
311
311
|
player_death_resurrection
|
312
|
+
else
|
313
|
+
result
|
312
314
|
end
|
313
315
|
when 'look', 'l'
|
314
316
|
if param1
|
@@ -347,9 +349,9 @@ module Gemwarrior
|
|
347
349
|
if i.number_of_uses > 0
|
348
350
|
result = i.use(world.player)
|
349
351
|
i.number_of_uses -= 1
|
350
|
-
puts "#{i.name} can be used #{i.number_of_uses} more time(s)."
|
352
|
+
puts ">> #{i.name} can be used #{i.number_of_uses} more time(s)."
|
351
353
|
else
|
352
|
-
return "#{i.name} cannot be used anymore."
|
354
|
+
return ">> #{i.name} cannot be used anymore."
|
353
355
|
end
|
354
356
|
elsif i.consumable
|
355
357
|
result = i.use(world.player)
|
@@ -370,9 +372,9 @@ module Gemwarrior
|
|
370
372
|
if i.number_of_uses > 0
|
371
373
|
result = i.use(world.player)
|
372
374
|
i.number_of_uses -= 1
|
373
|
-
puts "#{i.name} can be used #{i.number_of_uses} more time(s)."
|
375
|
+
puts ">> #{i.name} can be used #{i.number_of_uses} more time(s)."
|
374
376
|
else
|
375
|
-
return "#{i.name} cannot be used anymore."
|
377
|
+
return ">> #{i.name} cannot be used anymore."
|
376
378
|
end
|
377
379
|
elsif i.consumable
|
378
380
|
result = i.use(world.player)
|
@@ -430,6 +432,7 @@ module Gemwarrior
|
|
430
432
|
result[:data].each do |i|
|
431
433
|
world.player.inventory.items.push(i)
|
432
434
|
end
|
435
|
+
return
|
433
436
|
else
|
434
437
|
return
|
435
438
|
end
|
data/lib/gemwarrior/version.rb
CHANGED