gemwarrior 0.6.0 → 0.6.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 +4 -4
- data/lib/gemwarrior/battle.rb +2 -2
- data/lib/gemwarrior/entities/player.rb +11 -11
- data/lib/gemwarrior/evaluator.rb +9 -6
- data/lib/gemwarrior/misc/version.rb +1 -1
- data/lib/gemwarrior/repl.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50941ec227940e27af92ca653ea154417e295516
|
4
|
+
data.tar.gz: e2bbb7864d50c2023b2bcf3a85dc09ef1edd8133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f1b1294d281883bb62d17efc7f2a3cb657b4dfe34c6d6a58fc596729a4d4bc48efee0b87cbf01602c08130fd8a8268ae92a8fa6847f0b91c5fabb71f5385b80
|
7
|
+
data.tar.gz: 1698f8d55b4a9ab5d53be2baf225c05d9f230ea1845026b350d6414a8fdba0dae007a5e692666b22f8e939df33833efcce63994a5f20cc53a684e477c5d800f1
|
data/lib/gemwarrior/battle.rb
CHANGED
@@ -37,8 +37,8 @@ module Gemwarrior
|
|
37
37
|
|
38
38
|
puts
|
39
39
|
puts "[Fight/Attack][Look][Run]".colorize(:color => :white, :background => :green)
|
40
|
-
puts "
|
41
|
-
puts "
|
40
|
+
puts "PLAYER :: #{player.hp_cur.to_s.rjust(3)} HP\n"
|
41
|
+
puts "MONSTER :: #{monster.hp_cur.to_s.rjust(3)} HP\n"
|
42
42
|
|
43
43
|
if player_near_death?
|
44
44
|
puts "You are almost dead!\n".colorize(:yellow)
|
@@ -62,17 +62,17 @@ module Gemwarrior
|
|
62
62
|
self.atk_hi = inventory.weapon.atk_hi
|
63
63
|
end
|
64
64
|
|
65
|
-
self_text = "NAME
|
66
|
-
self_text = "
|
67
|
-
self_text << "
|
68
|
-
self_text << "
|
69
|
-
self_text << "
|
70
|
-
self_text << "
|
71
|
-
self_text << "
|
72
|
-
self_text << "
|
73
|
-
self_text << "
|
74
|
-
self_text << "
|
75
|
-
self_text << "
|
65
|
+
self_text = "NAME : #{name}\n"
|
66
|
+
self_text = "POSITION : #{cur_coords.values.to_a}\n"
|
67
|
+
self_text << "WEAPON : #{cur_weapon_name}\n"
|
68
|
+
self_text << "LEVEL : #{level}\n"
|
69
|
+
self_text << "EXPERIENCE: #{xp}\n"
|
70
|
+
self_text << "HIT POINTS: #{hp_cur}/#{hp_max}\n"
|
71
|
+
self_text << "ATTACK : #{atk_lo}-#{atk_hi}\n"
|
72
|
+
self_text << "DEXTERITY : #{dexterity}\n"
|
73
|
+
self_text << "DEFENSE : #{defense}\n"
|
74
|
+
self_text << "GOD_MODE : #{god_mode}\n"
|
75
|
+
self_text << "BEAST_MODE: #{beast_mode}\n\n"
|
76
76
|
|
77
77
|
self_text << "#{description}\n\n"
|
78
78
|
|
data/lib/gemwarrior/evaluator.rb
CHANGED
@@ -11,6 +11,8 @@ module Gemwarrior
|
|
11
11
|
QUIT_MESSAGE = 'Thanks for playing the game. Until next time...'.colorize(:yellow)
|
12
12
|
RESUME_MESSAGE = 'Back to adventuring!'.colorize(:green)
|
13
13
|
SEPARATOR = '=========================================================================='
|
14
|
+
|
15
|
+
GO_PARAMS = 'Options: north, east, south, west'
|
14
16
|
CHANGE_PARAMS = 'Options: name'
|
15
17
|
LIST_PARAMS = 'Options: monsters, items, locations'
|
16
18
|
DEBUG_PARAMS = 'Options: vars, map, stat'
|
@@ -48,7 +50,7 @@ module Gemwarrior
|
|
48
50
|
'Display character information',
|
49
51
|
'Look in your inventory',
|
50
52
|
'List all the objects of a type that exist in the world',
|
51
|
-
'Take a load off and regain
|
53
|
+
'Take a load off and regain HP',
|
52
54
|
'Look around your current location',
|
53
55
|
'Take item',
|
54
56
|
'Drop item',
|
@@ -86,7 +88,7 @@ module Gemwarrior
|
|
86
88
|
when 'debug', 'db'
|
87
89
|
if param1.nil?
|
88
90
|
puts ERROR_DEBUG_PARAM_MISSING
|
89
|
-
|
91
|
+
DEBUG_PARAMS
|
90
92
|
else
|
91
93
|
case param1
|
92
94
|
when 'vars', 'v'
|
@@ -100,7 +102,7 @@ module Gemwarrior
|
|
100
102
|
when 'stat'
|
101
103
|
if param2.nil?
|
102
104
|
puts ERROR_DEBUG_STAT_PARAM_MISSING
|
103
|
-
|
105
|
+
DEBUG_STAT_PARAMS
|
104
106
|
else
|
105
107
|
case param2
|
106
108
|
when 'atk_lo'
|
@@ -160,7 +162,7 @@ module Gemwarrior
|
|
160
162
|
when 'list', 'ls'
|
161
163
|
if param1.nil?
|
162
164
|
puts ERROR_LIST_PARAM_MISSING
|
163
|
-
|
165
|
+
LIST_PARAMS
|
164
166
|
else
|
165
167
|
world.list(param1)
|
166
168
|
end
|
@@ -198,7 +200,8 @@ module Gemwarrior
|
|
198
200
|
end
|
199
201
|
when 'go', 'g'
|
200
202
|
if param1.nil?
|
201
|
-
ERROR_GO_PARAM_MISSING
|
203
|
+
puts ERROR_GO_PARAM_MISSING
|
204
|
+
GO_PARAMS
|
202
205
|
else
|
203
206
|
direction = param1
|
204
207
|
if world.can_move?(direction)
|
@@ -224,7 +227,7 @@ module Gemwarrior
|
|
224
227
|
when 'change', 'ch'
|
225
228
|
if param1.nil?
|
226
229
|
puts ERROR_CHANGE_PARAM_MISSING
|
227
|
-
|
230
|
+
CHANGE_PARAMS
|
228
231
|
else
|
229
232
|
case param1
|
230
233
|
when 'name'
|
data/lib/gemwarrior/repl.rb
CHANGED
@@ -67,12 +67,20 @@ module Gemwarrior
|
|
67
67
|
|
68
68
|
puts "* Remember: #{noun1_values.get_random_value} and #{noun2_values.get_random_value} are the key to #{noun3_values.get_random_value} *\n\n"
|
69
69
|
end
|
70
|
+
|
71
|
+
def print_help
|
72
|
+
puts '* Basic functions: look, go, character, inventory, attack *'
|
73
|
+
puts '* Type \'help\' for complete command list'
|
74
|
+
puts '* Most commands can be abbreviated to their first letter *'
|
75
|
+
puts
|
76
|
+
end
|
70
77
|
|
71
78
|
def setup_screen(initialCommand = nil)
|
72
79
|
# welcome player to game
|
73
80
|
clear_screen
|
74
81
|
print_splash_message
|
75
|
-
print_fortune
|
82
|
+
print_fortune
|
83
|
+
print_help
|
76
84
|
|
77
85
|
# hook to do something right off the bat
|
78
86
|
puts eval.evaluate(initialCommand) unless initialCommand.nil?
|
@@ -91,7 +99,7 @@ module Gemwarrior
|
|
91
99
|
world.player.name,
|
92
100
|
world.location_by_coords(world.player.cur_coords).name
|
93
101
|
]
|
94
|
-
puts (prompt_template % prompt_vars_arr).colorize(:
|
102
|
+
puts (prompt_template % prompt_vars_arr).colorize(:yellow)
|
95
103
|
end
|
96
104
|
|
97
105
|
def read_line
|