Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] can open door and walk south

  • Loading branch information...
commit dcd529a43f048194854113291357a99e38ca9326 1 parent a2c7c9e
Carl Mäsak authored July 18, 2012

Showing 1 changed file with 24 additions and 0 deletions. Show diff stats Hide diff stats

  1. 24  bin/crypt
24  bin/crypt
@@ -846,6 +846,8 @@ class Crypt::Game {
846 846
             .alias_direction('hill', 'in', 'south');
847 847
             .alias_direction('chamber', 'out', 'north');
848 848
             .connect(<chamber hall>, 'south');
  849
+            .alias_direction('chamber', 'in', 'south');
  850
+            .alias_direction('cave', 'out', 'north');
849 851
             .connect(<hall cave>, 'down');
850 852
             .connect(<cave crypt>, 'northwest');
851 853
             .on_try_exit('cave', 'northwest', {
@@ -872,6 +874,9 @@ class Crypt::Game {
872 874
             .on_examine('grass', { $!engine.unhide_thing('door') });
873 875
             .on_examine('bushes', { $!engine.unhide_thing('door') });
874 876
 
  877
+            # yes, this is cheat. will fix in the next commit.
  878
+            .connect(<hill chamber>, 'south');
  879
+
875 880
             .place_player('clearing');
876 881
         }
877 882
     }
@@ -1872,6 +1877,25 @@ multi MAIN('test') {
1872 1877
             'opening the door (+) bushes work too';
1873 1878
     }
1874 1879
 
  1880
+    {
  1881
+        my $game = Crypt::Game.new();
  1882
+
  1883
+        $game.walk('east');
  1884
+        $game.examine('bushes');
  1885
+        $game.open('door');
  1886
+        is $game.walk('in'),
  1887
+            [
  1888
+                Adventure::PlayerWalked.new(
  1889
+                    :to<chamber>,
  1890
+                ),
  1891
+                Adventure::PlayerLooked.new(
  1892
+                    :room<chamber>,
  1893
+                    :exits<south north>,
  1894
+                ),
  1895
+            ],
  1896
+            'walking into the hill (+) after opening the door';
  1897
+    }
  1898
+
1875 1899
     done;
1876 1900
 }
1877 1901
 

0 notes on commit dcd529a

Please sign in to comment.
Something went wrong with that request. Please try again.