Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] rope and flashlight can be take from car

  • Loading branch information...
commit 9f3040392660ebf6cff869db5a1c9a54155c30c8 1 parent afd7967
Carl Mäsak authored July 18, 2012

Showing 1 changed file with 25 additions and 1 deletion. Show diff stats Hide diff stats

  1. 26  bin/crypt
26  bin/crypt
@@ -821,7 +821,7 @@ class Adventure::Engine {
821 821
 }
822 822
 
823 823
 class Crypt::Game {
824  
-    has $!engine handles <walk save open examine>;
  824
+    has $!engine handles <walk save open examine take>;
825 825
 
826 826
     submethod BUILD() {
827 827
         $!engine = Adventure::Engine.new();
@@ -839,7 +839,9 @@ class Crypt::Game {
839 839
             });
840 840
             .place_thing('car', 'clearing');
841 841
             .place_thing('flashlight', 'contents:car');
  842
+            .make_thing_carryable('flashlight');
842 843
             .place_thing('rope', 'contents:car');
  844
+            .make_thing_carryable('rope');
843 845
             .make_thing_openable('car');
844 846
             .place_player('clearing');
845 847
         }
@@ -1734,6 +1736,28 @@ multi MAIN('test') {
1734 1736
             'looking inside the car';
1735 1737
     }
1736 1738
 
  1739
+    {
  1740
+        my $game = Crypt::Game.new();
  1741
+
  1742
+        $game.open('car');
  1743
+        is $game.take('flashlight'),
  1744
+            Adventure::PlayerTook.new(
  1745
+                :thing<flashlight>,
  1746
+            ),
  1747
+            'taking the flashlight from the car';
  1748
+    }
  1749
+
  1750
+    {
  1751
+        my $game = Crypt::Game.new();
  1752
+
  1753
+        $game.open('car');
  1754
+        is $game.take('rope'),
  1755
+            Adventure::PlayerTook.new(
  1756
+                :thing<rope>,
  1757
+            ),
  1758
+            'taking the rope from the car';
  1759
+    }
  1760
+
1737 1761
     done;
1738 1762
 }
1739 1763
 

0 notes on commit 9f30403

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