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 now take the leaves

Also, added game descriptions for these.
  • Loading branch information...
commit 009372068ab4f87b6443b598b5e458ca67161550 1 parent fc16251
Carl Mäsak authored July 19, 2012
18  bin/crypt
@@ -714,7 +714,7 @@ class Adventure::Engine {
714 714
             unless defined $!player_location;
715 715
 
716 716
         die X::Adventure::PlayerAlreadyCarries.new(:$thing)
717  
-            if %!thing_rooms{$thing} eq 'player inventory';
  717
+            if (%!thing_rooms{$thing} // '') eq 'player inventory';
718 718
 
719 719
         die X::Adventure::NoSuchThingHere.new(:$thing)
720 720
             unless self!is_thing_in($thing, $!player_location);
@@ -882,6 +882,11 @@ class Crypt::Game {
882 882
             .on_examine('grass', { .unhide_thing('door') });
883 883
             .on_examine('bushes', { .unhide_thing('door') });
884 884
             .on_open('door', { .connect(<hill chamber>, 'south') });
  885
+            .place_thing('trees', 'hill');
  886
+            .make_thing_implicit('trees');
  887
+            .place_thing('leaves', 'hill');
  888
+            .make_thing_implicit('leaves');
  889
+            .make_thing_carryable('leaves');
885 890
 
886 891
             .place_player('clearing');
887 892
         }
@@ -1922,6 +1927,17 @@ multi MAIN('test') {
1922 1927
             'walking into the hill (+) after opening the door';
1923 1928
     }
1924 1929
 
  1930
+    {
  1931
+        my $game = Crypt::Game.new();
  1932
+
  1933
+        $game.walk('east');
  1934
+        is $game.take('leaves'),
  1935
+            Adventure::PlayerTook.new(
  1936
+                :thing<leaves>,
  1937
+            ),
  1938
+            'taking the leaves';
  1939
+    }
  1940
+
1925 1941
     done;
1926 1942
 }
1927 1943
 
7  game-data/descriptions
@@ -45,3 +45,10 @@ Those are some seriously uninteresting bushes.
45 45
 
46 46
 == door
47 47
 It's made of stone but covered with dirt and grass on top.
  48
+
  49
+== trees
  50
+Autumn trees are just so lovely. They look like they're just about to drop
  51
+all their leaves -- red, yellow, brown ones -- to the ground.
  52
+
  53
+== leaves
  54
+They look like the kind of leaves that would love a good rustle.

0 notes on commit 0093720

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