Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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
Showing with 36 additions and 0 deletions.
  1. +36 −0 bin/crypt
36 bin/crypt
View
@@ -1388,6 +1388,13 @@ class Crypt::Game {
my @events = $!engine.put_thing_on($thing, $on);
if $thing eq 'tiny disk' && $on ~~ /^ (\w+) ' rod' $/ {
@events.push: $!hanoi.add: $thing, ~$0;
+ for @events {
+ when Hanoi::AchievementUnlocked {
+ push @events,
+ $!engine.remark('floor-reveals-hole'),
+ $!engine.connect(<hall cave>, 'down');
+ }
+ }
}
return @events;
}
@@ -3131,6 +3138,35 @@ multi MAIN('test') {
'can put tiny disk back after taking it';
}
+ {
+ my $game = game_after_hanoi_is_solved();
+
+ $game.take('tiny disk');
+ $game.move('right', 'middle');
+ $game.move('middle', 'right');
+ is $game.put_thing_on('tiny disk', 'right rod'),
+ [
+ Adventure::PlayerPutOn.new(
+ :thing('tiny disk'),
+ :on('right rod'),
+ ),
+ Hanoi::DiskAdded.new(
+ :disk('tiny disk'),
+ :target('right'),
+ ),
+ Hanoi::AchievementUnlocked.new(
+ ),
+ Adventure::GameRemarked.new(
+ :remark<floor-reveals-hole>,
+ ),
+ Adventure::TwoRoomsConnected.new(
+ :rooms<hall cave>,
+ :direction<down>,
+ ),
+ ],
+ 'can unlock the game by putting the tiny rod back';
+ }
+
done;
}
Please sign in to comment.
Something went wrong with that request. Please try again.