gemwarrior 0.9.33 → 0.9.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/locations.yml +2 -0
- data/lib/gemwarrior/battle.rb +9 -1
- data/lib/gemwarrior/entities/items/dagger.rb +2 -2
- data/lib/gemwarrior/entities/items/gun.rb +3 -3
- data/lib/gemwarrior/entities/items/mace.rb +25 -0
- data/lib/gemwarrior/entities/items/opalaser.rb +2 -2
- data/lib/gemwarrior/entities/items/small_hole.rb +12 -8
- data/lib/gemwarrior/entities/items/spear.rb +25 -0
- data/lib/gemwarrior/entities/items/stone.rb +2 -2
- data/lib/gemwarrior/entities/items/ware_hawker.rb +91 -0
- data/lib/gemwarrior/entities/player.rb +5 -3
- data/lib/gemwarrior/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 523d98df545f5eaf8a9279b406d78dbfef8f24e3
|
4
|
+
data.tar.gz: bebad9e25fd49e38414971b4a00eae814ad47f30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0af08ecba64189fd0d0584e2083784aecca10fc9a19e988d986e4d7415f2867f3b129c9631db7377496b4d7819e5647e43ed49c4f3f59991c6877844e2f86d57
|
7
|
+
data.tar.gz: dc352fd0e448a78e6441a78601694a744afae6f3a3b62e18e2a9249bffe95d19bbff2d5ad40e762ca8593a40e956f59dc65f63b6684a3e57affed7bab024182e
|
data/data/locations.yml
CHANGED
data/lib/gemwarrior/battle.rb
CHANGED
@@ -181,7 +181,15 @@ module Gemwarrior
|
|
181
181
|
else
|
182
182
|
if entity.eql?(monster)
|
183
183
|
# base attack range
|
184
|
-
|
184
|
+
base_atk_lo = player.atk_lo
|
185
|
+
base_atk_hi = player.atk_hi
|
186
|
+
|
187
|
+
if player.has_weapon_equipped?
|
188
|
+
base_atk_lo += player.inventory.weapon.atk_lo
|
189
|
+
base_atk_hi += player.inventory.weapon.atk_hi
|
190
|
+
end
|
191
|
+
|
192
|
+
atk_range = base_atk_lo..base_atk_hi
|
185
193
|
|
186
194
|
# beast mode modifier
|
187
195
|
if player.beast_mode
|
@@ -8,8 +8,8 @@ module Gemwarrior
|
|
8
8
|
def initialize
|
9
9
|
self.name = 'dagger'
|
10
10
|
self.description = 'Flint that has been sharpened to a point, attached to a block of smooth granite by thin rope. Truly a work of art.'
|
11
|
-
self.atk_lo =
|
12
|
-
self.atk_hi =
|
11
|
+
self.atk_lo = 1
|
12
|
+
self.atk_hi = 3
|
13
13
|
self.takeable = true
|
14
14
|
self.useable = false
|
15
15
|
self.equippable = true
|
@@ -8,8 +8,8 @@ module Gemwarrior
|
|
8
8
|
def initialize
|
9
9
|
self.name = 'gun'
|
10
10
|
self.description = 'Pew pew goes this firearm, you suspect.'
|
11
|
-
self.atk_lo =
|
12
|
-
self.atk_hi =
|
11
|
+
self.atk_lo = 2
|
12
|
+
self.atk_hi = 4
|
13
13
|
self.takeable = true
|
14
14
|
self.useable = true
|
15
15
|
self.equippable = true
|
@@ -17,7 +17,7 @@ module Gemwarrior
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def use(player = nil)
|
20
|
-
puts 'You pull the trigger on the gun, but
|
20
|
+
puts 'You pull the trigger on the gun, but it does not fire. An inscription on the barrel reads: "Only shoots when pointed at a monster." How safe!'
|
21
21
|
{ type: nil, data: nil }
|
22
22
|
end
|
23
23
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# lib/gemwarrior/entities/items/mace.rb
|
2
|
+
# Item::Mace
|
3
|
+
|
4
|
+
require_relative '../item'
|
5
|
+
|
6
|
+
module Gemwarrior
|
7
|
+
class Mace < Item
|
8
|
+
def initialize
|
9
|
+
self.name = 'mace'
|
10
|
+
self.description = 'Sharp spikes atop a steel ball, affixed to a sturdy wooden handle. You could do damage with this.'
|
11
|
+
self.atk_lo = 4
|
12
|
+
self.atk_hi = 6
|
13
|
+
self.takeable = true
|
14
|
+
self.useable = true
|
15
|
+
self.consumable = false
|
16
|
+
self.equippable = true
|
17
|
+
self.equipped = false
|
18
|
+
end
|
19
|
+
|
20
|
+
def use(player = nil)
|
21
|
+
puts 'You swing the mace around a few times, really testing out its smashability.'
|
22
|
+
{ type: nil, data: nil }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -8,8 +8,8 @@ module Gemwarrior
|
|
8
8
|
def initialize
|
9
9
|
self.name = 'opalaser'
|
10
10
|
self.description = 'Gleaming with supernatural light, this object feels alien, yet familiar.'
|
11
|
-
self.atk_lo =
|
12
|
-
self.atk_hi =
|
11
|
+
self.atk_lo = 9
|
12
|
+
self.atk_hi = 11
|
13
13
|
self.takeable = true
|
14
14
|
self.useable = true
|
15
15
|
self.equippable = true
|
@@ -8,6 +8,8 @@ require_relative 'dagger'
|
|
8
8
|
module Gemwarrior
|
9
9
|
class SmallHole < Item
|
10
10
|
# CONSTANTS
|
11
|
+
PRICE_HERB = 10
|
12
|
+
PRICE_DAGGER = 150
|
11
13
|
PLAYER_ROX_INSUFFICIENT = '>> "Pity. You are a bit short on funds to purchase that item."'
|
12
14
|
PLAYER_ITEMS_ADDITIONAL = '>> "Anything else?"'
|
13
15
|
PLAYER_COMMAND_INVALID = '>> "Huh?"'
|
@@ -25,25 +27,26 @@ module Gemwarrior
|
|
25
27
|
|
26
28
|
def use(player = nil)
|
27
29
|
puts 'You lower yourself to the ground and attempt to peer in the hole in the wall. Just as you begin to think this is a fruitless endeavor, a pair of bright, beady eyes manifest, and an unexpectedly low voice begins speaking to you:'
|
28
|
-
|
30
|
+
puts
|
31
|
+
|
29
32
|
rat_shop(player)
|
30
33
|
end
|
31
|
-
|
34
|
+
|
32
35
|
def reuse(player = nil)
|
33
36
|
rat_shop(player)
|
34
37
|
end
|
35
|
-
|
38
|
+
|
36
39
|
def rat_shop(player)
|
37
40
|
items_purchased = []
|
38
|
-
|
41
|
+
|
39
42
|
puts '>> "Hello, wanderer. Welcome to my establishment, as it were. Are you in need of anything?"'
|
40
43
|
puts
|
41
44
|
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.'
|
42
45
|
puts
|
43
46
|
puts 'Rockney\'s Hole in the Wall'
|
44
47
|
puts '--------------------------'
|
45
|
-
puts
|
46
|
-
puts
|
48
|
+
puts "(1) Herb - #{PRICE_HERB} rox"
|
49
|
+
puts "(2) Dagger - #{PRICE_DAGGER} rox"
|
47
50
|
puts
|
48
51
|
puts '>> "What are you in need of?"'
|
49
52
|
|
@@ -51,9 +54,10 @@ module Gemwarrior
|
|
51
54
|
puts ' 1 - Herb'
|
52
55
|
puts ' 2 - Dagger'
|
53
56
|
puts ' x - leave'
|
54
|
-
|
57
|
+
print 'Option? '
|
58
|
+
|
55
59
|
choice = gets.chomp!
|
56
|
-
|
60
|
+
|
57
61
|
case choice
|
58
62
|
when '1'
|
59
63
|
if player.rox >= 10
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# lib/gemwarrior/entities/items/spear.rb
|
2
|
+
# Item::Spear
|
3
|
+
|
4
|
+
require_relative '../item'
|
5
|
+
|
6
|
+
module Gemwarrior
|
7
|
+
class Spear < Item
|
8
|
+
def initialize
|
9
|
+
self.name = 'spear'
|
10
|
+
self.description = 'Sharp spikes atop a steel ball, affixed to a sturdy wooden handle. You could do damage with this.'
|
11
|
+
self.atk_lo = 3
|
12
|
+
self.atk_hi = 7
|
13
|
+
self.takeable = true
|
14
|
+
self.useable = true
|
15
|
+
self.consumable = false
|
16
|
+
self.equippable = true
|
17
|
+
self.equipped = false
|
18
|
+
end
|
19
|
+
|
20
|
+
def use(player = nil)
|
21
|
+
puts 'This spear does, indeed, appear to strike fear upon that which is near.'
|
22
|
+
{ type: nil, data: nil }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -8,8 +8,8 @@ module Gemwarrior
|
|
8
8
|
def initialize
|
9
9
|
self.name = 'stone'
|
10
10
|
self.description = 'A small, sharp mega pebble, suitable for tossing in amusement, and perhaps combat.'
|
11
|
-
self.atk_lo =
|
12
|
-
self.atk_hi =
|
11
|
+
self.atk_lo = 1
|
12
|
+
self.atk_hi = 2
|
13
13
|
self.takeable = true
|
14
14
|
self.useable = false
|
15
15
|
self.equippable = true
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# lib/gemwarrior/entities/items/ware_hawker.rb
|
2
|
+
# Item::WareHawker
|
3
|
+
|
4
|
+
require_relative '../item'
|
5
|
+
require_relative 'herb'
|
6
|
+
require_relative 'dagger'
|
7
|
+
|
8
|
+
module Gemwarrior
|
9
|
+
class WareHawker < Item
|
10
|
+
# CONSTANTS
|
11
|
+
PRICE_MACE = 200
|
12
|
+
PRICE_SPEAR = 250
|
13
|
+
PLAYER_ROX_INSUFFICIENT = '>> "Are you seriously wasting my time? You are testing me, human."'
|
14
|
+
PLAYER_ITEMS_ADDITIONAL = '>> "Will there be something else?"'
|
15
|
+
PLAYER_COMMAND_INVALID = '>> "That means nothing to me."'
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
self.name = 'ware_hawker'
|
19
|
+
self.description = 'A literal anthropomorphic hawk has set up shop behind a crudely-made table. Some wares are scattered atop its surface, seemingly within anyone\'s grasp, but the hawk\'s piercing eyes seem to belie this observation.'
|
20
|
+
self.atk_lo = nil
|
21
|
+
self.atk_hi = nil
|
22
|
+
self.takeable = false
|
23
|
+
self.useable = true
|
24
|
+
self.equippable = false
|
25
|
+
self.equipped = false
|
26
|
+
end
|
27
|
+
|
28
|
+
def use(player = nil)
|
29
|
+
puts 'You greet the hawk, mentioning that you are interested in the objects presented. The hawk speaks in a beautiful, yet commanding, tone:'
|
30
|
+
puts
|
31
|
+
|
32
|
+
hawk_shop(player)
|
33
|
+
end
|
34
|
+
|
35
|
+
def reuse(player = nil)
|
36
|
+
hawk_shop(player)
|
37
|
+
end
|
38
|
+
|
39
|
+
def hawk_shop(player)
|
40
|
+
items_purchased = []
|
41
|
+
|
42
|
+
puts '>> "I hope you have rox, human. My time is amenable to business transactions, not idle chit chat. What do you want?"'
|
43
|
+
puts
|
44
|
+
puts 'A feathered arm quickly moves across the table in an arc suggesting to you that a choice is to be made. Each object has a price tag underneath it, painstakingly written in ink.'
|
45
|
+
puts
|
46
|
+
puts "(1) Mace - #{PRICE_MACE} rox"
|
47
|
+
puts "(2) Spear - #{PRICE_SPEAR} rox"
|
48
|
+
puts
|
49
|
+
puts '>> "Choose. Now.'
|
50
|
+
|
51
|
+
loop do
|
52
|
+
puts ' 1 - Mace'
|
53
|
+
puts ' 2 - Spear'
|
54
|
+
puts ' x - leave'
|
55
|
+
print 'Option? '
|
56
|
+
choice = gets.chomp!
|
57
|
+
|
58
|
+
case choice
|
59
|
+
when '1'
|
60
|
+
if player.rox >= PRICE_MACE
|
61
|
+
player.rox -= PRICE_MACE
|
62
|
+
items_purchased.push(Mace.new)
|
63
|
+
puts '>> "Yes, fine."'
|
64
|
+
puts PLAYER_ITEMS_ADDITIONAL
|
65
|
+
next
|
66
|
+
else
|
67
|
+
puts PLAYER_ROX_INSUFFICIENT
|
68
|
+
next
|
69
|
+
end
|
70
|
+
when '2'
|
71
|
+
if player.rox >= PRICE_SPEAR
|
72
|
+
player.rox -= PRICE_SPEAR
|
73
|
+
items_purchased.push(Spear.new)
|
74
|
+
puts '>> "Hmph. Very well, then."'
|
75
|
+
puts PLAYER_ITEMS_ADDITIONAL
|
76
|
+
next
|
77
|
+
else
|
78
|
+
puts PLAYER_ROX_INSUFFICIENT
|
79
|
+
next
|
80
|
+
end
|
81
|
+
when 'x'
|
82
|
+
puts '>> "Our business is complete then."'
|
83
|
+
return { type: 'purchase', data: items_purchased }
|
84
|
+
else
|
85
|
+
puts PLAYER_COMMAND_INVALID
|
86
|
+
next
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -66,10 +66,12 @@ module Gemwarrior
|
|
66
66
|
end
|
67
67
|
|
68
68
|
weapon_slot = ''
|
69
|
+
atk_lo = self.atk_lo
|
70
|
+
atk_hi = self.atk_hi
|
69
71
|
if has_weapon_equipped?
|
70
72
|
weapon_slot = inventory.weapon.name
|
71
|
-
|
72
|
-
|
73
|
+
atk_lo += inventory.weapon.atk_lo
|
74
|
+
atk_hi += inventory.weapon.atk_hi
|
73
75
|
else
|
74
76
|
weapon_slot = '(unarmed)'
|
75
77
|
end
|
@@ -86,7 +88,7 @@ module Gemwarrior
|
|
86
88
|
self_text << "LEVEL : #{self.level}\n"
|
87
89
|
self_text << "EXPERIENCE: #{self.xp}\n"
|
88
90
|
self_text << "HIT POINTS: #{self.hp_cur}/#{self.hp_max}\n"
|
89
|
-
self_text << "ATTACK : #{
|
91
|
+
self_text << "ATTACK : #{atk_lo}-#{atk_hi}\n"
|
90
92
|
self_text << "DEXTERITY : #{self.dexterity}\n"
|
91
93
|
self_text << "DEFENSE : #{self.defense}\n"
|
92
94
|
self_text << "ABILITIES : #{abilities}\n"
|
data/lib/gemwarrior/version.rb
CHANGED
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.
|
4
|
+
version: 0.9.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Chadwick
|
@@ -252,6 +252,7 @@ files:
|
|
252
252
|
- lib/gemwarrior/entities/items/keystone.rb
|
253
253
|
- lib/gemwarrior/entities/items/ladder.rb
|
254
254
|
- lib/gemwarrior/entities/items/letter.rb
|
255
|
+
- lib/gemwarrior/entities/items/mace.rb
|
255
256
|
- lib/gemwarrior/entities/items/map.rb
|
256
257
|
- lib/gemwarrior/entities/items/massive_door.rb
|
257
258
|
- lib/gemwarrior/entities/items/opalaser.rb
|
@@ -261,12 +262,14 @@ files:
|
|
261
262
|
- lib/gemwarrior/entities/items/small_hole.rb
|
262
263
|
- lib/gemwarrior/entities/items/snowman.rb
|
263
264
|
- lib/gemwarrior/entities/items/sparklything.rb
|
265
|
+
- lib/gemwarrior/entities/items/spear.rb
|
264
266
|
- lib/gemwarrior/entities/items/stalactite.rb
|
265
267
|
- lib/gemwarrior/entities/items/stone.rb
|
266
268
|
- lib/gemwarrior/entities/items/stonemite.rb
|
267
269
|
- lib/gemwarrior/entities/items/tent.rb
|
268
270
|
- lib/gemwarrior/entities/items/throne.rb
|
269
271
|
- lib/gemwarrior/entities/items/tree.rb
|
272
|
+
- lib/gemwarrior/entities/items/ware_hawker.rb
|
270
273
|
- lib/gemwarrior/entities/items/waterfall.rb
|
271
274
|
- lib/gemwarrior/entities/location.rb
|
272
275
|
- lib/gemwarrior/entities/monster.rb
|