MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / endQuest

Method endQuest

code/main/Cellar.ts:35–50  ·  view source on GitHub ↗
(win: boolean)

Source from the content-addressed store, hash-verified

33
34 // Public methods
35 public endQuest(win: boolean): void{
36 // We add some messages
37 if(win){
38 this.getGame().getQuestLog().addMessage(new QuestLogMessage("You managed to kill all the rats!"));
39 Saving.saveBool("cellarDone", true);
40
41 // We gain the main map
42 this.getGame().gainItem("gridItemPossessedMainMap");
43 }
44 else{
45 this.getGame().getQuestLog().addMessage(new QuestLogMessage("You died in the cellar. Rats are probably going to eat your body."));
46 }
47
48 // We call the endQuest method of our mother class
49 super.endQuest(win);
50 }
51
52 public update(): void{
53 if(this.getQuestEnded() == false){

Callers 1

updateMethod · 0.95

Calls 4

addMessageMethod · 0.80
getQuestLogMethod · 0.80
gainItemMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected