(win: boolean)
| 524 | } |
| 525 | |
| 526 | public endQuest(win: boolean): void{ |
| 527 | // If the player won the quest |
| 528 | if(win){ |
| 529 | // Handle candies drops |
| 530 | // We add a message to the log to tell about the candies we found |
| 531 | this.getGame().getQuestLog().addMessage(new QuestLogMessage(this.getCandiesDropMessage())); |
| 532 | // We give him/her the candies found during the quest |
| 533 | this.candiesFound.transferTo(this.getGame().getCandies()); |
| 534 | // Handle chocolate bars drops |
| 535 | if(this.chocolateBarsFound.getCurrent() > 0){ |
| 536 | // We add a message to the log to tell about the chocolate bars we found |
| 537 | this.getGame().getQuestLog().addMessage(new QuestLogMessage(this.getChocolateBarsDropMessage(), null, true)); |
| 538 | // We give him/her the chocolate bars found during the quest |
| 539 | this.chocolateBarsFound.transferTo(this.getGame().getChocolateBars()); |
| 540 | } |
| 541 | // Handle items drops |
| 542 | for(var i = 0; i < this.itemsFound.length; i++){ |
| 543 | // We show the drop message |
| 544 | this.itemsFound[i].get(); |
| 545 | // We give him/her the item |
| 546 | this.getGame().gainItem(this.itemsFound[i].getSavingName()); |
| 547 | } |
| 548 | // We won |
| 549 | this.questEndedAndWeWon = true; |
| 550 | } |
| 551 | |
| 552 | // The quest ended ! |
| 553 | this.questEnded = true; |
| 554 | } |
| 555 | |
| 556 | public foundCandies(howMany: number): number{ |
| 557 | // We check all eqItems in case they want to change how many candies were found |
nothing calls this directly
no test coverage detected