Skip to content

Commit

Permalink
Elevator key check
Browse files Browse the repository at this point in the history
  • Loading branch information
He4eT committed Mar 29, 2020
1 parent 7099314 commit 73093d9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/item/elevator.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ elevatorDoor: LockableWithKey, Door
dobjFor (UnlockWith) {
action () {
inherited;
self.makeOpen(true);
" A few seconds later
the elevator arrived on the floor. ";
if (keyFitsLock(gIobj)) {
self.makeOpen(true);
" A few seconds later
the elevator arrived on the floor. ";
} else {
" You can't apply this to a card reader. ";
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions test/unlockElevatorWithWrongKey
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
>turn on the light
>w
>open locker
>take floss
>e
>s
>s
>take tape
>w
>open dumpster
>search cloth
>take key
>unlock elevator with tubular key

0 comments on commit 73093d9

Please sign in to comment.