Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[bin/crypt] can open door and walk south

  • Loading branch information...
commit dcd529a43f048194854113291357a99e38ca9326 1 parent a2c7c9e
@masak authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 bin/crypt
View
24 bin/crypt
@@ -846,6 +846,8 @@ class Crypt::Game {
.alias_direction('hill', 'in', 'south');
.alias_direction('chamber', 'out', 'north');
.connect(<chamber hall>, 'south');
+ .alias_direction('chamber', 'in', 'south');
+ .alias_direction('cave', 'out', 'north');
.connect(<hall cave>, 'down');
.connect(<cave crypt>, 'northwest');
.on_try_exit('cave', 'northwest', {
@@ -872,6 +874,9 @@ class Crypt::Game {
.on_examine('grass', { $!engine.unhide_thing('door') });
.on_examine('bushes', { $!engine.unhide_thing('door') });
+ # yes, this is cheat. will fix in the next commit.
+ .connect(<hill chamber>, 'south');
+
.place_player('clearing');
}
}
@@ -1872,6 +1877,25 @@ multi MAIN('test') {
'opening the door (+) bushes work too';
}
+ {
+ my $game = Crypt::Game.new();
+
+ $game.walk('east');
+ $game.examine('bushes');
+ $game.open('door');
+ is $game.walk('in'),
+ [
+ Adventure::PlayerWalked.new(
+ :to<chamber>,
+ ),
+ Adventure::PlayerLooked.new(
+ :room<chamber>,
+ :exits<south north>,
+ ),
+ ],
+ 'walking into the hill (+) after opening the door';
+ }
+
done;
}
Please sign in to comment.
Something went wrong with that request. Please try again.