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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bbc1cea21340d6f201df93b5bedcec926abf6ba
4
- data.tar.gz: 805f497d5ea72852d423db7ceb2d40fff0bc61f3
3
+ metadata.gz: 94628a3d356ed158ed51481416e444b112791db7
4
+ data.tar.gz: cdbdbba0955d78638e3e20cd37ad146465edf5ac
5
5
  SHA512:
6
- metadata.gz: 0bcd871ce8cbd6ecec2f4e125b7d722df99f658484d507b28f125c6b167f51abce918250abdd9ce88e70d1c585150e6e0c9bc9853eaaec2b5474d1f6559a42ef
7
- data.tar.gz: 3fbb5bb7ce1e33788a99d7a746618f65374d05351fbaf1deea3c0fd35cfdd0d60c8009c4f04792292cbfe69688677bca85c2e421715f23ed01c8ba6916f405e6
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
- `> c` - character check for visual identity
30
- `> i [object]` - check your inventory (or an individual item within)
31
- `> r` - take a load off and replenish hp
32
- `> l [object]` - look at current location and its items and monsters
33
- `> t [object]` - take an item from a location
34
- `> u [object]` - use an item from your inventory or current location
35
- `> d [object]` - drop an item from your inventory
36
- `> e [object]` - equip an item in your inventory as a weapon
37
- `> ue [object]` - unequip an item in your inventory
38
- `> g [direction]` - go in a direction, if possible
39
- `> a [monster]` - attack a monster
40
- `> ch [attribute]` - change some things about yourself
41
- `> h` - display available commands
42
- `> q` - quit this nonsense w/ prompt
43
- `> qq` - quit this nonsense w/o prompt
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
 
@@ -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 e ue g a ch h q qq)
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', 'e'
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
- if world.can_move?(direction)
458
- world.player.go(world.locations, param1, world.sound)
459
- world.location_by_coords(world.player.cur_coords).checked_for_monsters = false
460
- world.describe(world.location_by_coords(world.player.cur_coords))
461
- else
462
- ERROR_GO_PARAM_INVALID
463
- end
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
@@ -2,5 +2,5 @@
2
2
  # Version of Gem Warrior
3
3
 
4
4
  module Gemwarrior
5
- VERSION = '0.9.20'
5
+ VERSION = '0.9.21'
6
6
  end
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.20
4
+ version: 0.9.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Chadwick