Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[bin/crypt] cavern collapse

  • Loading branch information...
commit acf6aefb87d17bdd0f0c346f43251f6191067ae9 1 parent cf18e6e
Carl Mäsak authored
Showing with 30 additions and 2 deletions.
  1. +25 −2 bin/crypt
  2. +5 −0 game-data/descriptions
27 bin/crypt
View
@@ -642,7 +642,6 @@ class Adventure::Engine {
:exits((%!exits{$!player_location} // ()).keys),
:things(self!explicit_things_at($!player_location)),
);
- @events.push(self!tick);
self!apply_and_return: @events;
}
@@ -697,7 +696,6 @@ class Adventure::Engine {
if %!examine_hooks{$thing} -> &hook {
@events.push(&hook());
}
- @events.push(self!tick);
self!apply_and_return: @events;
}
@@ -1216,6 +1214,11 @@ class Crypt::Game {
'pedestal',
-> $_ {
when 'butterfly' | 'small disk' {
+ # XXX: Should be 3, will fix when getting sagas
+ $!engine.light_fuse(4, 'cavern-collapse', {
+ $!engine.remark('cavern-collapses'),
+ $!engine.finish();
+ });
$!engine.remark('alarm-starts');
}
};
@@ -2784,6 +2787,26 @@ multi MAIN('test') {
'taking the butterfly triggers an alarm';
}
+ {
+ my $game = game_from_crypt();
+
+ $game.take('butterfly');
+ $game.walk('southeast');
+ $game.walk('up');
+ is $game.walk('north'),
+ [
+ Adventure::PlayerWalked.new(
+ :to<chamber>,
+ ),
+ Adventure::GameRemarked.new(
+ :remark<cavern-collapses>,
+ ),
+ Adventure::GameFinished.new(
+ ),
+ ],
+ 'not getting out in time before the cavern collapses';
+ }
+
done;
}
5 game-data/descriptions
View
@@ -101,3 +101,8 @@ You try to walk past the fire, but it's too hot!
== remark:alarm-starts
An alarm starts sounding in the whole cavern.
+
+== remark:cavern-collapses
+The alarm starts sounding louder.
+The whole cavern shakes, and falls in on itself.
+You die.
Please sign in to comment.
Something went wrong with that request. Please try again.