Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] taking, dropping, taking

  • Loading branch information...
commit e831985429b53dfff1a8b100f892b5b2d1422b94 1 parent bfdb350
Carl Mäsak authored

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

  1. 18  bin/crypt
18  bin/crypt
@@ -763,6 +763,9 @@ class Adventure::Engine {
763 763
         when Adventure::PlayerTook {
764 764
             %!thing_rooms{.thing} = 'player inventory';
765 765
         }
  766
+        when Adventure::PlayerDropped {
  767
+            %!thing_rooms{.thing} = $!player_location;
  768
+        }
766 769
     }
767 770
 }
768 771
 
@@ -1598,6 +1601,21 @@ multi MAIN('test') {
1598 1601
             };
1599 1602
     }
1600 1603
 
  1604
+    {
  1605
+        my $engine = Adventure::Engine.new();
  1606
+
  1607
+        $engine.place_thing('box', 'saloon');
  1608
+        $engine.make_thing_carryable('box');
  1609
+        $engine.place_player('saloon');
  1610
+        $engine.take('box');
  1611
+        $engine.drop('box');
  1612
+        is $engine.take('box'),
  1613
+            Adventure::PlayerTook.new(
  1614
+                :thing<box>,
  1615
+            ),
  1616
+            'taking a thing (+) take, drop, take';
  1617
+    }
  1618
+
1601 1619
     done;
1602 1620
 }
1603 1621
 

0 notes on commit e831985

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