Permalink
Browse files

[bin/crypt] add a descriptions file

  • Loading branch information...
1 parent 2efa9e7 commit a36b8dd89fce10613c0aaf75e21636cf06fd1a3d @masak committed Jul 3, 2012
Showing with 10 additions and 1 deletion.
  1. +7 −1 bin/crypt
  2. +3 −0 game-data/descriptions
View
@@ -250,6 +250,12 @@ multi MAIN() {
say "";
my $game = Crypt::Game.new();
+ my %descriptions;
+ for slurp("game-data/descriptions").split(/\n\n/) {
+ /^^ '== ' (\N+) \n (.*)/
+ or die "Could not parse 'descriptions' file: $_";
+ %descriptions{$0} = ~$1;
+ }
loop {
my $command = prompt('> ');
@@ -266,7 +272,7 @@ multi MAIN() {
my @events = $game.look();
for @events {
when Crypt::PlayerLooked {
- say "<{.description_of}>";
+ say %descriptions{.description_of};
}
}
}
@@ -0,0 +1,3 @@
+== clearing
+The forest road stops here, and the gaps between the trees widen into a
+patch of un-forest. The sky above is clear apart from a few harmless clouds.

0 comments on commit a36b8dd

Please sign in to comment.