Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] putting out the fire with water

  • Loading branch information...
commit 00f8e1f6943229fb99b07f7a15a6afe0e4343ec0 1 parent 59cb5df
Carl Mäsak authored July 25, 2012
39  bin/crypt
@@ -1112,6 +1112,18 @@ class Crypt::Game {
1112 1112
             .make_thing_carryable: 'helmet';
1113 1113
             .make_thing_a_container: 'helmet';
1114 1114
 
  1115
+            # Things in cave
  1116
+            .place_thing: 'fire', 'cave';
  1117
+            .make_thing_a_container: 'fire';
  1118
+            .on_put:
  1119
+                'fire',
  1120
+                -> $_ {
  1121
+                    when 'water' {
  1122
+                        $!engine.remark('fire-dies'),
  1123
+                        $!engine.place_thing('fire', 'nowhere');
  1124
+                    }
  1125
+                };
  1126
+
1115 1127
             .place_player: $!player_location = 'clearing';
1116 1128
         }
1117 1129
 
@@ -2539,6 +2551,33 @@ multi MAIN('test') {
2539 2551
             'putting water into the car';
2540 2552
     }
2541 2553
 
  2554
+    {
  2555
+        my $game = game_after_hanoi_is_solved();
  2556
+
  2557
+        $game.take('helmet');
  2558
+        $game.walk('north');
  2559
+        $game.walk('north');
  2560
+        $game.put_thing_in('water', 'helmet');
  2561
+        $game.walk('south');
  2562
+        $game.walk('south');
  2563
+        $game.walk('down');
  2564
+        is $game.put_thing_in('water', 'fire'),
  2565
+            [
  2566
+                Adventure::PlayerPutIn.new(
  2567
+                    :thing<water>,
  2568
+                    :in<fire>,
  2569
+                ),
  2570
+                Adventure::GameRemarked.new(
  2571
+                    :remark<fire-dies>,
  2572
+                ),
  2573
+                Adventure::ThingPlaced.new(
  2574
+                    :thing<fire>,
  2575
+                    :room<nowhere>,
  2576
+                ),
  2577
+            ],
  2578
+            'putting out the fire with water';
  2579
+    }
  2580
+
2542 2581
     done;
2543 2582
 }
2544 2583
 
3  game-data/descriptions
@@ -84,3 +84,6 @@ Your bare hands aren't very good at carrying water.
84 84
 == remark:car-is-now-wet
85 85
 What doesn't discolor the seats collects in miserable little puddles on the
86 86
 floor mats.
  87
+
  88
+== remark:fire-dies
  89
+The fire wanes and dies out.

0 notes on commit 00f8e1f

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