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 tilt floor by placing tiny disk

Not just moving it.
  • Loading branch information...
commit 8a48e3600e7901dc9f76810a551a80303c2d0777 1 parent e67c6b0
Carl Mäsak authored July 30, 2012

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

  1. 36  bin/crypt
36  bin/crypt
@@ -1388,6 +1388,13 @@ class Crypt::Game {
1388 1388
         my @events = $!engine.put_thing_on($thing, $on);
1389 1389
         if $thing eq 'tiny disk' && $on ~~ /^ (\w+) ' rod' $/ {
1390 1390
             @events.push: $!hanoi.add: $thing, ~$0;
  1391
+            for @events {
  1392
+                when Hanoi::AchievementUnlocked {
  1393
+                    push @events,
  1394
+                        $!engine.remark('floor-reveals-hole'),
  1395
+                        $!engine.connect(<hall cave>, 'down');
  1396
+                }
  1397
+            }
1391 1398
         }
1392 1399
         return @events;
1393 1400
     }
@@ -3131,6 +3138,35 @@ multi MAIN('test') {
3131 3138
             'can put tiny disk back after taking it';
3132 3139
     }
3133 3140
 
  3141
+    {
  3142
+        my $game = game_after_hanoi_is_solved();
  3143
+
  3144
+        $game.take('tiny disk');
  3145
+        $game.move('right', 'middle');
  3146
+        $game.move('middle', 'right');
  3147
+        is $game.put_thing_on('tiny disk', 'right rod'),
  3148
+            [
  3149
+                Adventure::PlayerPutOn.new(
  3150
+                    :thing('tiny disk'),
  3151
+                    :on('right rod'),
  3152
+                ),
  3153
+                Hanoi::DiskAdded.new(
  3154
+                    :disk('tiny disk'),
  3155
+                    :target('right'),
  3156
+                ),
  3157
+                Hanoi::AchievementUnlocked.new(
  3158
+                ),
  3159
+                Adventure::GameRemarked.new(
  3160
+                    :remark<floor-reveals-hole>,
  3161
+                ),
  3162
+                Adventure::TwoRoomsConnected.new(
  3163
+                    :rooms<hall cave>,
  3164
+                    :direction<down>,
  3165
+                ),
  3166
+            ],
  3167
+            'can unlock the game by putting the tiny rod back';
  3168
+    }
  3169
+
3134 3170
     done;
3135 3171
 }
3136 3172
 

0 notes on commit 8a48e36

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