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

Method constructor

code/main/Forge.ts:21–45  ·  view source on GitHub ↗
(game: Game)

Source from the content-addressed store, hash-verified

19
20 // Constructor
21 constructor(game: Game){
22 super(game);
23
24 // If...
25 // We didn't buy one of the first three items
26 if((Saving.loadBool("forgeBoughtWoodenSword") == false || Saving.loadBool("forgeBoughtIronAxe") == false || Saving.loadBool("forgeBoughtPolishedSilverSword") == false)
27 || // OR
28 // We didn't buy the armour and we made the cave entrance
29 (Saving.loadBool("forgeBoughtLightweightBodyArmour") == false && Saving.loadBool("mainMapDoneCaveEntrance") == true)
30 || // OR
31 // We didn't buy the scythe and the dragon is done
32 (Saving.loadBool("forgeBoughtScythe") == false && Saving.loadBool("dragonDone") == true)
33 ){
34 // We set the normal introduction speech
35 this.currentSpeech = "mapVillageForgeIntroductionSpeech";
36 }
37 // Else
38 else{
39 // We set the no more to sell introduction speech
40 this.currentSpeech = "mapVillageForgeIntroductionSpeechNoMoreToSell";
41 }
42
43 this.renderArea.resizeFromArray(Database.getAscii("places/village/forge"), 0, 3);
44 this.update();
45 }
46
47 // getRenderArea()
48 public getRenderArea(): RenderArea{

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
resizeFromArrayMethod · 0.80
getAsciiMethod · 0.80

Tested by

no test coverage detected