PageSourceSearch

https://candybox2.github.io/candybox/scripts/mountGoblin.js

js candybox2.github.io collected 2026-10-03 08:45:28 UTC 2,981 bytes, 49 lines download raw bytes

1var mountGoblin = {
2
3    // Variables
4    basicChestProbability : 50,
5
6    // Functions
7    onload : function(){
8        land.addLand("Mount Goblin", 28, 1, this.load.bind(this), this.getText.bind(this));
9    },
10    
11    setBasicChestProbability : function(value){
12        this.basicChestProbability = value;
13    },
14    
15    load : function(){
16        for(var i = 1; i < quest.things.length; i++){
17            if(random.flipACoin()){
18                // If we're not at the top of the mount
19                if(i < 12 || i > 15){
20                    // 1 chance out of x we spawn a CHS (chest !!)
21                    if(random.oneChanceOutOf(this.basicChestProbability)){
22                        this.setBasicChestProbability(this.basicChestProbability + 50);
23                        quest.things[i] = quest.makeBasicChest();
24                    }
25                    // 1 chance out of 7 we spaw a GSB
26                    else if(random.oneChanceOutOf(7)) quest.things[i] = land.createMob("GSB", 20, 5 + random.getRandomIntUpTo(5), "claws", "A sick goblin. It smells.", [drops.createDrop("candies", 3 + random.getRandomIntUpTo(3))]);
27                    // Else we spawn a GOB
28                    else quest.things[i] = land.createMob("GOB", 20, 20, "claws", "A nasty goblin.", [drops.createDrop("candies", 3 + random.getRandomIntUpTo(3))]);
29                }
30                else{
31                    quest.things[i] = land.createMob("GTB", 30, 30, "dagger", "A tenacious goblin. Oh, he has a dagger, too.", [drops.createDrop("candies", 9 + random.getRandomIntUpTo(9)), drops.createDrop("object", "key", random.oneChanceOutOf(2)), drops.createDrop("object", "boots", random.oneChanceOutOf(5)), drops.createDrop("object", "swampMap", random.oneChanceOutOf(5)), drops.createDrop("object", "hutMap", random.oneChanceOutOf(5))]);
32                }
33            }
34        }
35    },
36    
37    getText : function(){
38        var text = "";
39        
40        text += "                                    "; for(var i = 12; i < 16; i++) text += quest.things[i].text; text += "\n";
41        text += "                           "; for(var i = 9; i < 12; i++) text += quest.things[i].text; text += "/ \\/ \\/ \\/ \\"; for(var i = 16; i < 19; i++) text += quest.things[i].text; text += "\n";
42        text += "                  "; for(var i = 6; i < 9; i++) text += quest.things[i].text; text += "/ \\/ \\/ \\  /   \\  \\  / \\/ \\/ \\"; for(var i = 19; i < 22; i++) text += quest.things[i].text; text += "\n";
43        text += "         "; for(var i = 3; i < 6; i++) text += quest.things[i].text; text += "/ \\/ \\/ \\   \\ /   \\/     \\  \\/  /   \\  / \\/ \\/ \\"; for(var i = 22; i < 25; i++) text += quest.things[i].text; text += "\n";
44        text += ""; for(var i = 0; i < 3; i++) text += quest.things[i].text; text += "/ \\/ \\/ \\  /  /   \\   /    /       \\ /  /     \\/  /   \\  / \\/ \\/ \\"; for(var i = 25; i < 28; i++) text += quest.things[i].text;
45    
46        return text;
47    }
48
49};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.