Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[bin/crypt] taking the butterfly triggers an alarm

commit cf18e6e8b457feb3a459fd9f5e45d3e93a08673f 1 parent 5255b46
@masak authored
Showing with 41 additions and 0 deletions.
  1. +38 −0 bin/crypt
  2. +3 −0  game-data/descriptions
View
38 bin/crypt
@@ -556,6 +556,9 @@ class Adventure::Engine {
if %!containers{$thing}
&& (!%!openable_things{$thing} || %!open_things{$thing})
&& self.thing_is_in($sought, "contents:$thing");
+ return True
+ if %!platforms{$thing}
+ && self.thing_is_in($sought, "contents:$thing");
}
return False;
}
@@ -1206,6 +1209,19 @@ class Crypt::Game {
}
};
+ # Things in crypt
+ .place_thing: 'pedestal', 'crypt';
+ .make_thing_a_platform: 'pedestal';
+ .on_remove_from:
+ 'pedestal',
+ -> $_ {
+ when 'butterfly' | 'small disk' {
+ $!engine.remark('alarm-starts');
+ }
+ };
+ .place_thing: 'butterfly', 'contents:pedestal';
+ .make_thing_carryable: 'butterfly';
+
.place_player: $!player_location = 'clearing';
}
@@ -2746,6 +2762,28 @@ multi MAIN('test') {
'putting out a fuse so it does not activate';
}
+ sub game_from_crypt {
+ my $game = game_after_putting_out_the_water();
+
+ $game.walk('northwest');
+ return $game;
+ }
+
+ {
+ my $game = game_from_crypt();
+
+ is $game.take('butterfly'),
+ [
+ Adventure::PlayerTook.new(
+ :thing<butterfly>,
+ ),
+ Adventure::GameRemarked.new(
+ :remark<alarm-starts>,
+ ),
+ ],
+ 'taking the butterfly triggers an alarm';
+ }
+
done;
}
View
3  game-data/descriptions
@@ -98,3 +98,6 @@ The fire wanes and dies out.
== remark:walk-past-fire-too-hot
You try to walk past the fire, but it's too hot!
+
+== remark:alarm-starts
+An alarm starts sounding in the whole cavern.
Please sign in to comment.
Something went wrong with that request. Please try again.