Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[bin/crypt] can now take the leaves

Also, added game descriptions for these.
  • Loading branch information...
commit 009372068ab4f87b6443b598b5e458ca67161550 1 parent fc16251
@masak authored
Showing with 24 additions and 1 deletion.
  1. +17 −1 bin/crypt
  2. +7 −0 game-data/descriptions
View
18 bin/crypt
@@ -714,7 +714,7 @@ class Adventure::Engine {
unless defined $!player_location;
die X::Adventure::PlayerAlreadyCarries.new(:$thing)
- if %!thing_rooms{$thing} eq 'player inventory';
+ if (%!thing_rooms{$thing} // '') eq 'player inventory';
die X::Adventure::NoSuchThingHere.new(:$thing)
unless self!is_thing_in($thing, $!player_location);
@@ -882,6 +882,11 @@ class Crypt::Game {
.on_examine('grass', { .unhide_thing('door') });
.on_examine('bushes', { .unhide_thing('door') });
.on_open('door', { .connect(<hill chamber>, 'south') });
+ .place_thing('trees', 'hill');
+ .make_thing_implicit('trees');
+ .place_thing('leaves', 'hill');
+ .make_thing_implicit('leaves');
+ .make_thing_carryable('leaves');
.place_player('clearing');
}
@@ -1922,6 +1927,17 @@ multi MAIN('test') {
'walking into the hill (+) after opening the door';
}
+ {
+ my $game = Crypt::Game.new();
+
+ $game.walk('east');
+ is $game.take('leaves'),
+ Adventure::PlayerTook.new(
+ :thing<leaves>,
+ ),
+ 'taking the leaves';
+ }
+
done;
}
View
7 game-data/descriptions
@@ -45,3 +45,10 @@ Those are some seriously uninteresting bushes.
== door
It's made of stone but covered with dirt and grass on top.
+
+== trees
+Autumn trees are just so lovely. They look like they're just about to drop
+all their leaves -- red, yellow, brown ones -- to the ground.
+
+== leaves
+They look like the kind of leaves that would love a good rustle.
Please sign in to comment.
Something went wrong with that request. Please try again.