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't see the helmet in darkness

  • Loading branch information...
commit 0287a471826dbb117408fe4bad00a01966d6550b 1 parent ecf3cab
Carl Mäsak authored July 24, 2012

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

  1. 21  bin/crypt
21  bin/crypt
@@ -643,6 +643,12 @@ class Adventure::Engine {
643 643
         die X::Adventure::PlayerNowhere.new()
644 644
             unless defined $!player_location;
645 645
 
  646
+        my $pitch_black = %!dark_rooms{$!player_location}
  647
+            && !self!shining_thing_here($!player_location);
  648
+
  649
+        die X::Adventure::PitchBlack.new(:action<see>)
  650
+            if $pitch_black;
  651
+
646 652
         die X::Adventure::NoSuchThingHere.new(:$thing)
647 653
             unless self!is_thing_in($thing, $!player_location);
648 654
 
@@ -2383,6 +2389,21 @@ multi MAIN('test') {
2383 2389
             };
2384 2390
     }
2385 2391
 
  2392
+    {
  2393
+        my $game = game_from_hall();
  2394
+
  2395
+        throws_exception
  2396
+            { $game.examine('helmet') },
  2397
+            X::Adventure::PitchBlack,
  2398
+            'examining the helmet (-) pitch black',
  2399
+            {
  2400
+                is .action, 'see', '.action attribute';
  2401
+                is .message,
  2402
+                    "You cannot see anything, because it is pitch black",
  2403
+                    '.message attribute';
  2404
+            };
  2405
+    }
  2406
+
2386 2407
     done;
2387 2408
 }
2388 2409
 

0 notes on commit 0287a47

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