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

Method chooseGift

code/main/WishingWell.ts:59–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 }
58
59 private chooseGift(): void{
60 switch(this.selectedGiftId){
61 case "wishingWellGiftPower":
62 Saving.saveNumber("gameGiftPower", Saving.loadNumber("gameGiftPower") + 1);
63 break;
64 case "wishingWellGiftHealth":
65 Saving.saveNumber("gameGiftHealth", Saving.loadNumber("gameGiftHealth") + 1);
66 break;
67 case "wishingWellGiftMagic":
68 Saving.saveNumber("gameGiftMagic", Saving.loadNumber("gameGiftMagic") + 1);
69 break;
70 }
71
72 // We're not pain au chocolating anymore
73 Saving.saveBool("wishingWellWeArePainAuChocolating", false);
74
75 // Set the speech
76 this.currentSpeech = "wishingWellGiftDoneSpeech";
77
78 // Re calc max hp
79 this.getGame().getPlayer().reCalcMaxHp();
80
81 // Update
82 this.update();
83 this.getGame().updatePlace();
84 }
85
86 private createPossibleEnchantments(): void{
87 // We empty the array

Callers

nothing calls this directly

Calls 5

updateMethod · 0.95
reCalcMaxHpMethod · 0.80
getPlayerMethod · 0.80
updatePlaceMethod · 0.80
getGameMethod · 0.45

Tested by

no test coverage detected