()
| 49 | } |
| 50 | |
| 51 | public update(): void{ |
| 52 | if(this.getQuestEnded() == false){ |
| 53 | // Test if the player won the quest, if so, end the quest and return |
| 54 | if(this.thePlayerWon()){ |
| 55 | this.endQuest(true); |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | // Test if the player is dead, if so, end the quest and return |
| 60 | if(this.getGame().getPlayer().shouldDie()){ |
| 61 | this.endQuest(false); |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | // Update entities |
| 66 | this.updateEntities(); |
| 67 | } |
| 68 | |
| 69 | // Draw |
| 70 | this.preDraw(); |
| 71 | this.getRenderArea().drawArray(Database.getAscii("places/quests/bridge/bridge"), this.getRealQuestPosition().x, this.getRealQuestPosition().y + 17); |
| 72 | this.drawEntities(); |
| 73 | this.drawAroundQuest(); |
| 74 | if(this.getQuestEnded() == false) this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestNoKeeping"); |
| 75 | else if(this.getQuestEndedAndWeWon() == false) this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestNoKeepingBecauseLose"); |
| 76 | else this.addExitQuestButton(new CallbackCollection(this.getGame().goToMainMap.bind(this.getGame())), "buttonExitQuestKeeping"); |
| 77 | this.postDraw(); |
| 78 | } |
| 79 | |
| 80 | // Private methods |
| 81 | private addBridgeFloor(): void{ |
nothing calls this directly
no test coverage detected