Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[bin/crypt] add a descriptions file

  • Loading branch information...
commit a36b8dd89fce10613c0aaf75e21636cf06fd1a3d 1 parent 2efa9e7
@masak authored
Showing with 10 additions and 1 deletion.
  1. +7 −1 bin/crypt
  2. +3 −0  game-data/descriptions
View
8 bin/crypt
@@ -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};
}
}
}
View
3  game-data/descriptions
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.