gemwarrior 0.9.20 → 0.9.21
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/README.md +15 -15
- data/lib/gemwarrior/evaluator.rb +43 -10
- data/lib/gemwarrior/version.rb +1 -1
- 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: 94628a3d356ed158ed51481416e444b112791db7
|
4
|
+
data.tar.gz: cdbdbba0955d78638e3e20cd37ad146465edf5ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7eb29f7a90ec1d667a35a14a4a51ee77f9562601184ca2b1f9b27632b3493b26ac3f1265691cb463fadb4eb1882217525ceecca1bf7a36a06e7651610f3c2d11
|
7
|
+
data.tar.gz: eebf77c6e7c393394be3a430817b084169d6a53d900c590cb1b4ea474276408c813844434e04802dd72db7f5fbad33ed1d980222c15f6aec337f708e2676a46d
|
data/README.md
CHANGED
@@ -26,21 +26,21 @@ Run the commands above and you'll be whisked away to Jool, ready to start or con
|
|
26
26
|
|
27
27
|
## Main Commands
|
28
28
|
|
29
|
-
`>
|
30
|
-
`>
|
31
|
-
`>
|
32
|
-
`>
|
33
|
-
`>
|
34
|
-
`>
|
35
|
-
`>
|
36
|
-
`>
|
37
|
-
`>
|
38
|
-
`>
|
39
|
-
`>
|
40
|
-
`>
|
41
|
-
`>
|
42
|
-
`>
|
43
|
-
`>
|
29
|
+
`> character` - character check for visual identity
|
30
|
+
`> inventory [object]` - check your inventory (or an individual item within)
|
31
|
+
`> rest` - take a load off and replenish hp
|
32
|
+
`> look [object]` - look at current location and its items and monsters
|
33
|
+
`> take [object]` - take an item from a location
|
34
|
+
`> use [object]` - use an item from your inventory or current location
|
35
|
+
`> drop [object]` - drop an item from your inventory
|
36
|
+
`> equip [object]` - designate an item in your inventory your weapon
|
37
|
+
`> unequip [object]` - stop using an item in your inventory as your weapon
|
38
|
+
`> go [direction]` - go in a direction, if possible (north|east|south|west work as shortcuts)
|
39
|
+
`> attack [monster]` - attack a monster
|
40
|
+
`> change [attribute]` - change some things about yourself
|
41
|
+
`> help` - display available commands
|
42
|
+
`> quit` - quit this nonsense w/ prompt
|
43
|
+
`> quit!` - quit this nonsense w/o prompt
|
44
44
|
|
45
45
|
## In Progress, Yanno
|
46
46
|
|
data/lib/gemwarrior/evaluator.rb
CHANGED
@@ -22,6 +22,7 @@ module Gemwarrior
|
|
22
22
|
ERROR_LOOK_AT_PARAM_MISSING = 'You cannot just "look at". You gotta choose something to look at.'
|
23
23
|
ERROR_GO_PARAM_MISSING = 'Just wander aimlessly? A direction would be nice.'
|
24
24
|
ERROR_GO_PARAM_INVALID = 'The place in that direction is far, far, FAR too dangerous. You should try a different way.'
|
25
|
+
ERROR_DIRECTION_PARAM_INVALID = 'You cannot go to that place.'
|
25
26
|
ERROR_ATTACK_PARAM_MISSING = 'You cannot just "attack". You gotta choose something to attack.'
|
26
27
|
ERROR_ATTACK_PARAM_INVALID = 'That monster does not exist here or can\'t be attacked.'
|
27
28
|
ERROR_TAKE_PARAM_MISSING = 'You cannot just "take". You gotta choose something to take.'
|
@@ -64,8 +65,8 @@ module Gemwarrior
|
|
64
65
|
'Rest, but ensure battle for testing'
|
65
66
|
]
|
66
67
|
|
67
|
-
self.commands = %w(character inventory rest look take use drop equip unequip go attack change help quit quit!)
|
68
|
-
self.aliases = %w(c i r l t u d
|
68
|
+
self.commands = %w(character inventory rest look take use drop equip unequip go north east south west attack change help quit quit!)
|
69
|
+
self.aliases = %w(c i r l t u d eq ue g n e s w a ch h q qq)
|
69
70
|
self.extras = %w(exit exit! x xx fight f)
|
70
71
|
self.cmd_descriptions = [
|
71
72
|
'Display character information',
|
@@ -78,6 +79,10 @@ module Gemwarrior
|
|
78
79
|
'Equip item',
|
79
80
|
'Unequip item',
|
80
81
|
'Go in a direction',
|
82
|
+
'Go north (shortcut)',
|
83
|
+
'Go east (shortcut)',
|
84
|
+
'Go south (shortcut)',
|
85
|
+
'Go west (shortcut)',
|
81
86
|
'Attack a monster',
|
82
87
|
'Change something',
|
83
88
|
'This help menu',
|
@@ -436,7 +441,7 @@ module Gemwarrior
|
|
436
441
|
else
|
437
442
|
world.player.inventory.drop_item(param1)
|
438
443
|
end
|
439
|
-
when 'equip', '
|
444
|
+
when 'equip', 'eq'
|
440
445
|
if param1.nil?
|
441
446
|
ERROR_EQUIP_PARAM_MISSING
|
442
447
|
else
|
@@ -454,13 +459,31 @@ module Gemwarrior
|
|
454
459
|
GO_PARAMS
|
455
460
|
else
|
456
461
|
direction = param1
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
462
|
+
try_to_move_player(direction)
|
463
|
+
end
|
464
|
+
when 'n'
|
465
|
+
if param1
|
466
|
+
ERROR_DIRECTION_PARAM_INVALID
|
467
|
+
else
|
468
|
+
try_to_move_player('north')
|
469
|
+
end
|
470
|
+
when 'e'
|
471
|
+
if param1
|
472
|
+
ERROR_DIRECTION_PARAM_INVALID
|
473
|
+
else
|
474
|
+
try_to_move_player('east')
|
475
|
+
end
|
476
|
+
when 's'
|
477
|
+
if param1
|
478
|
+
ERROR_DIRECTION_PARAM_INVALID
|
479
|
+
else
|
480
|
+
try_to_move_player('south')
|
481
|
+
end
|
482
|
+
when 'w'
|
483
|
+
if param1
|
484
|
+
ERROR_DIRECTION_PARAM_INVALID
|
485
|
+
else
|
486
|
+
try_to_move_player('west')
|
464
487
|
end
|
465
488
|
when 'attack', 'a', 'fight', 'f'
|
466
489
|
if param1.nil?
|
@@ -511,6 +534,16 @@ module Gemwarrior
|
|
511
534
|
|
512
535
|
private
|
513
536
|
|
537
|
+
def try_to_move_player(direction)
|
538
|
+
if world.can_move?(direction)
|
539
|
+
world.player.go(world.locations, direction, world.sound)
|
540
|
+
world.location_by_coords(world.player.cur_coords).checked_for_monsters = false
|
541
|
+
world.describe(world.location_by_coords(world.player.cur_coords))
|
542
|
+
else
|
543
|
+
return ERROR_GO_PARAM_INVALID
|
544
|
+
end
|
545
|
+
end
|
546
|
+
|
514
547
|
def player_death_resurrection
|
515
548
|
puts 'Somehow, though, your adventure does not end here. Instead, you are whisked back home via some magical force, a bit worse for the weary and somewhat poorer, but ALIVE!'.colorize(:yellow)
|
516
549
|
world.player.hp_cur = 1
|
data/lib/gemwarrior/version.rb
CHANGED