Created
July 30, 2016 14:48
-
-
Save JeremyLikness/cf861efa68da1d9f2d208b122c5c4439 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const checkGet: (dungeon: Dungeon) => IAction = (dungeon: Dungeon) => { | |
| if (dungeon.currentRoom.things.length < 1) { | |
| return { | |
| type: ACTION_TEXT, | |
| text: 'You get down.' | |
| } as ITextAction; | |
| } | |
| let invCount = dungeon.inventory.length + 1; | |
| if (dungeon.trophyCount === invCount) { | |
| return { | |
| type: ACTION_WON, | |
| item: dungeon.currentRoom.things[0], | |
| room: dungeon.currentRoom | |
| } as IWonAction; | |
| } | |
| return { | |
| type: ACTION_GET, | |
| item: dungeon.currentRoom.things[0], | |
| room: dungeon.currentRoom | |
| } as IInventoryAction; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment