diff --git a/src/ui/components/game-screen.js b/src/ui/components/game-screen.js index b86b8c3f..0f827015 100644 --- a/src/ui/components/game-screen.js +++ b/src/ui/components/game-screen.js @@ -27,12 +27,12 @@ export default class App extends Component { get didWin() { return isCurrRoomCompleted(this.state) } - get isDead() { - return this.state.player.currentHealth < 1 - } get didWinEntireGame() { return isDungeonCompleted(this.state) } + get isDead() { + return this.state.player.currentHealth < 1 + } constructor() { super() @@ -46,7 +46,7 @@ export default class App extends Component { this.playCard = this.playCard.bind(this) this.handlePlayerReward = this.handlePlayerReward.bind(this) this.handleCampfireChoice = this.handleCampfireChoice.bind(this) - this.goToNextRoom = this.goToNextRoom.bind(this) + this.continueRoom = this.continueRoom.bind(this) this.toggleOverlay = this.toggleOverlay.bind(this) this.handleMapMove = this.handleMapMove.bind(this) } @@ -228,7 +228,7 @@ stw.dealCards()`) this.game.enqueue({type: 'addCardToDeck', card}) this.setState({didPickCard: card}) this.update() - this.goToNextRoom() + this.continueRoom() } handleCampfireChoice(choice, reward) { @@ -247,15 +247,16 @@ stw.dealCards()`) this.game.enqueue({type: 'makeCampfireChoice', choice, reward}) // Update twice (because two actions were enqueued) this.update(this.update) - this.goToNextRoom() + this.continueRoom() } - goToNextRoom() { + continueRoom() { console.log('Go to next room, toggling map') this.toggleOverlay('#Map') } handleMapMove(move) { + console.log('handleMapMove', move) this.toggleOverlay('#Map') this.setState({didPickCard: false}) this.game.enqueue({type: 'move', move}) @@ -279,6 +280,7 @@ stw.dealCards()`) if (!state.player) return const room = getCurrRoom(state) const showCombat = room.type === 'monster' + const showVictory = room.type === 'monster' && this.didWin && !this.didWinEntireGame return html`