Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[bin/crypt] taking, dropping, taking

  • Loading branch information...
commit e831985429b53dfff1a8b100f892b5b2d1422b94 1 parent bfdb350
Carl Mäsak authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 bin/crypt
18 bin/crypt
View
@@ -763,6 +763,9 @@ class Adventure::Engine {
when Adventure::PlayerTook {
%!thing_rooms{.thing} = 'player inventory';
}
+ when Adventure::PlayerDropped {
+ %!thing_rooms{.thing} = $!player_location;
+ }
}
}
@@ -1598,6 +1601,21 @@ multi MAIN('test') {
};
}
+ {
+ my $engine = Adventure::Engine.new();
+
+ $engine.place_thing('box', 'saloon');
+ $engine.make_thing_carryable('box');
+ $engine.place_player('saloon');
+ $engine.take('box');
+ $engine.drop('box');
+ is $engine.take('box'),
+ Adventure::PlayerTook.new(
+ :thing<box>,
+ ),
+ 'taking a thing (+) take, drop, take';
+ }
+
done;
}
Please sign in to comment.
Something went wrong with that request. Please try again.