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

Method update

code/main/FifthHouse.ts:33–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 }
32
33 private update(): void{
34 // Erase everything
35 this.renderArea.resetAllButSize();
36
37 // Back to the village button
38 this.addBackToTheVillageButton(this.renderArea, "fifthHouseBackToTheVillageButton");
39
40 // Draw the house
41 this.renderArea.drawArray(Database.getAscii("places/village/fifthHouse"), 0, 3);
42
43 // If we haven't defeated the rats yet
44 if(Saving.loadBool("cellarDone") == false){
45 // If we have a weapon
46 if(this.getGame().getSelectedEqItems()["weapon"] != null){
47 // Draw the speech
48 this.renderArea.drawSpeech(Database.getText("mapVillageFifthHouseWeaponSpeech"), 6, 44, 67, "fifthHouseSpeech", Database.getTranslatedText("mapVillageFifthHouseWeaponSpeech"));
49
50 // Add the button
51 this.renderArea.addAsciiRealButton(Database.getText("mapVillageFifthHouseAgree"), 69, 8, "mapVillageFifthHouseAgreeButton", Database.getTranslatedText("mapVillageFifthHouseAgree"), true);
52 this.renderArea.addLinkCall(".mapVillageFifthHouseAgreeButton", new CallbackCollection(this.beginQuest.bind(this)));
53 }
54 // Else, we don't have a weapon yet
55 else{
56 // Draw the speech
57 this.renderArea.drawSpeech(Database.getText("mapVillageFifthHouseNoWeaponSpeech"), 6, 44, 67, "fifthHouseSpeech", Database.getTranslatedText("mapVillageFifthHouseNoWeaponSpeech"));
58 }
59 }
60 // If we have defeated the rats
61 else{
62 // Draw the speech
63 this.renderArea.drawSpeech(Database.getText("mapVillageFifthHouseCellarDone"), 6, 44, 82, "fifthHouseSpeech", Database.getTranslatedText("mapVillageFifthHouseCellarDone"));
64
65 // Change the NPC mouth
66 this.renderArea.drawString("U", 52, 17);
67 }
68 }
69}

Callers 2

constructorMethod · 0.95
willBeDisplayedMethod · 0.95

Calls 12

resetAllButSizeMethod · 0.80
drawArrayMethod · 0.80
getAsciiMethod · 0.80
getSelectedEqItemsMethod · 0.80
addAsciiRealButtonMethod · 0.80
addLinkCallMethod · 0.80
bindMethod · 0.80
drawStringMethod · 0.80
getGameMethod · 0.45
drawSpeechMethod · 0.45
getTextMethod · 0.45

Tested by

no test coverage detected