Cheats

From Candy Box Wiki
Jump to: navigation, search

Cheats will allow you to modify your game experience, at the cost of a genuine playthrough. They work by changing the javascript values of the game while it is running in the browser. To use cheats you must be using a browser that possesses a javascript/debug console. Other possibility : creating a bookmark starting with "javascript:", but then you can NOT use spaces! (if you want to use a code with spaces, then try removing all of them, but if it doesn't work let it go)

All codes must be typed into the javascript/debug console at the correct time.

If you know some cheats, please help others -players- cheaters

You want to find some? You'll need to view the source code, and you should also know the basics of JavaScript.


Contents

[edit] More candies & Lollipops

[edit] Candies

[edit] 100 Extra Candies

Can be entered: At any time during the game (the code can be modified to add any number you so choose, even those with a billion zeros, a trillion zeros, etc.)

candies.nbrOwned += 100

[edit] 100 Candies Per Second

Can be entered: At any time during the game (the code can be modified to add any number you so choose, even those with a billion zeros, a trillion zeros, etc.)

candies.candiesPerSecond = 100;

[edit] Lollipops

[edit] 100 Extra Lollipops

'Can be entered:' At any time during the game (same as with candies the number in the lollipop can be modified)

lollipops.nbrOwned += 100;
lollipops.setNbrOwned();

If you don't put the second line, the display will be horribly glitchy...

[edit] 100 Extra Lollipops per second

Can be entered: At any time during the game (same as with candies the number in the lollipop farm can be modified)

farm.setLollipopsProduction(farm.lollipopsPlanted + 8640000)

[edit] Remove 100 lp/sec Lollipop Farm cap

Can be entered: At any time during the game.

Note: Has to be reentered every time, after loading a saved game.

farm.maxLollipopsPerDay = Number.MAX_VALUE; farm.calculateLollipopsProductionFromLollipopsPerDay();

[edit] Add/Set 1000 Hp

Can be entered: When in a quest

To add 1000 HP

quest.things[quest.getCharacterIndex()].hp += 1000

Or to set HP to 1000 points "naturally".

candies.setNbrEaten(3802403)

[edit] And the chocolate bars, too...

[edit] Set chocolate bars

chocolateBars.setNbrOwned(1000);

[edit] Shop Stuff

[edit] Show any product

No problem, just not on tab "candy box"!

Just type shop.showProduct("product_name");

Product names:

  • Lollipop
  • Swords : xxx_sword
    • wooden
    • copper
    • iron
    • silver
    • diamond
  • eat
  • throw_10
  • encrust
  • polish
  • coat
  • shop (candy merchant)

[edit] Lollipops restockage !

Tired of "stock shortage"? Then

lollipops.nbrInStock = 1000;

But, the stock will also be (maybe?) shorted  ; then replace 1000 by Number.POSITIVE_INFINITY

[edit] Swap Proposed Sword

This affects the price of the sword, but can be restored (see under)

Just type shop.showProduct("sword_name") (as "wooden_sword"), quotes needed!

Example : shop.showProduct("wooden_sword")


Or,without changing the price, shop.currentSwordButtonId = "buy_§type§_sword"

Replace §type§ by the type of the sword, as wooden.

Example : shop.currentSwordButtonId = "buy_wooden_sword"

[edit] Set Prices

The choice of the price... is yours! But quite cheated...

Available at any time

[edit] Lollipops

shop.oneLollipopPrice = price;

shop.tenLollipopsPrice = priceFor10;

[edit] Current Sword

shop.currentSwordPrice = price;

[edit] Change Sword

Can be entered: While not in a quest (will not take effect until after)

Just type this code : sword.setName("sword name"), replacing sword name by the name of the sword you want to switch with

  • Wooden Sword
  • Copper Sword
  • Silver Sword
  • Diamond Sword
  • Candy Diamond Sword
  • Polished Candy Diamond Sword
  • Chocolate Sword
  • Sharp Chocolate Sword
  • Sword of Flames
  • Sword of Life
  • Sword of Summoning
  • Sword of Liflamesummoning
  • Sword of Randomness

[edit] Add Any Item

Can be entered: While in a quest

List of available objects:

  • key
  • boots
  • swampMap
  • hutMap
  • wellMap
  • magicianHat
  • pinkRing
  • forgeMap
  • candiesConverter
  • plateArmour
  • cauldron
  • magicalHorn
  • hornOfPlenty
  • oldAmulet

objects.list["itemname"].found=true

[edit] Get Extra Potions/Scrolls

Can be entered: At any time during the game.

X : Name of the potion/scroll you want. It can be :

  • health
  • escape
  • berserk
  • fireScroll
  • acidRainScroll
  • teleportScroll
  • earthquakeScroll
  • impInvocationScroll
  • majorHealth
  • invulnerability
  • turtle
  • jelly
  • seed
  • cloning
  • superman
  • gmooh

N : How many potions/scrolls you desire.

potions.setPotionNbrOwned(potions.list.X, N);

potions.updateOnPage();

[edit] Special Places Cheating

[edit] Set Sword To Higher Level (Only Special Swords)

Can be entered: While not in a quest (will not take effect until after)

Note: You can increase the level as high as desired. There is no maximum level.

sword.specialPower = 7

[edit] Reset Status of Wishing Well

wishingWell.step=0

[edit] Quest

Remember: any modification will apply to Yourself, so do NOT try to apply "Infinite Invincibility" when in this quest!
If you did, or you want to quit a level, just use a GMOOH potion / cheat!

[edit] Peaceful Forest

[edit] More Chests

So, this makes more chests spawn in the Forest

peacefulForest.basicChestProbability = 1;

[edit] No Ponies

This code is hackish, and has to be entered 'before' the quest, and at each reload!

peacefulForest.makeWoodPoney = function() {};

[edit] Mount Goblin

Sorry, the map config doesn't allow to disable enemies generation.

[edit] More Chests

Just, more probability so chests spawn, but not sure...

mountGoblin.basicChestProbability = 50;

[edit] Underwater Cave

As Mount Goblin, special mob generation doesn't allow to affect mob spawning probability, except changing the generation code.

Because no chests spawn naturally in the Cave, this cheat isn't possible.

[edit] Castle's Entrance

Okay, from this point no chests are available, so there's no way to affect it.
Please don't throw me any tomatoes at me, I can give you the following cheats :

[edit] Remove guards

castleEntrance.makeGuard = function() {};

[edit] Remove knights

Doing this will deprive you of the Plate Armor, but... castleEntrance.makeKnight = function() {};
Uh, found that it also deletes the knights in the Castle's Keep!

[edit] Developer's Computer

[edit] Figure out the DEV killing letter

Can be entered: While in the developer's computer quest

This will display the key you need to press, but the game will pause until you close the window.

alert(String.fromCharCode(developperComputer.letter));

If you use a javascript console, you can use this, it will display it in the console, without pausing the game :

console.log(String.fromCharCode(developperComputer.letter));

[edit] All Quests

[edit] Enable pony time! (or disable it if you find it annoying)

land.ponyTime = true;

[edit] Create you own ally (SWORD summon only)

You must create two functions :
The first one is to let your personal ally to be summoned : sword.summonList.push({name:"XXX(1)", summonFunction:quest.makeXXX(2).bind(quest), powerNeeded:X(3)});
Help to create :

  1. The name of the ally
  2. A random name, doesn't matter
  3. The level required to summon (at least 8, else get ready to bug)

The second one is to create your ally : quest.makeXXX(1) = function(){return land.createAlly("ALL(2)", XXX(3), XXX(3), "XXX(4)", "XXX(5)", []);};
Help to create :

  1. Put the same name as above
  2. The THREE letters that will be displayed on the quest screen
  3. Total HP (put the same numbers, else there may be some bugs, didn't test
  4. Name of the weapon
  5. The description

[edit] Potions Never Stop

This code is very hackish, and requires to be re-used at each reload ; it removes the "potion ending" function

[edit] Infinite Invincible

quest.stopInvulnerability = function() {}

[edit] Infinite Berserk

quest.stopBerserk = function() {}

[edit] Infinite Turtle

quest.stopTurtle = function() {}

[edit] Set Potion Countdown To Zero

Can be entered: While in a quest, and the potion countdown is running

quest.potionUseCountdown = 0

[edit] Invincible

[edit] For 1000 Steps

Can be entered: While in a quest

quest.beginInvulnerability(); quest.invulnerabilityCountdown = 1000;

[edit] Infinite

quest.beginInvulnerability(); quest.invulnerabilityCountdown = -1;

Or, look the next tip.

[edit] True Invincibility

Can be entered: While not in a quest (does not work in Hard mode)

candies.setNbrEaten(Number.POSITIVE_INFINITY);

OR

by negative HP (showed 'NaN/NaN')

candies.setNbrEaten(-1); but this can bug when :

  • You fight against Yourself
  • You summon an ally against the developer ; it can be very long...

[edit] Berserk

Can be entered: While in a quest

[edit] For 1000 Steps

quest.beginBerserk(); quest.berserkCountDown = 1000;

[edit] Infinite

quest.beginBerserk(); quest.berserkCountDown = -1;

[edit] Turtle

Can be entered: While in a quest

[edit] For 1000 steps

quest.beginTurtle(); quest.turtleCountdown = 1000;

[edit] Infinite

quest.beginTurtle(); quest.turtleCountDown = -1;

[edit] Activate GMOOH

Can be entered: While in a quest

quest.gmooh = true

[edit] Remove Tired Time

Can be entered: While not in a quest

quest.tiredTime = 0

[edit] Auto Finish Quest

Can be entered: When in a quest

quest.speed = 0

Note: This will just finish the quest, not actualy beat it. Thats still on you.

[edit] Drops

Use it in Quest

[edit] Set candies dropped

Replace §candies_number§ by the number of candies found : quest.setCandiesFound(§candies_number§);

[edit] Create a chest

A chest will appear, with the following loots :

  • 300 - 800 candies
  • Lollipop farm key
  • Boots (1/3)
  • Map to the swampy swamp (1/3)
  • Map to the sorceress' hut (1/3)

things[getCharacterId()] = quest.makeBasicChest();
Sorry, I didn't test it and think it doesn't work...

[edit] Create an open chest

6000 to 8000 candies! quest.makeOpenChest();
Sorry, I don't think it works...

[edit] Beat Quest

Can be entered: When in a quest

yourself.end = true;

OR

quest.won();

[edit] Special skin for the Cow King

Can be used at any time, but at each reload ; creates a new skin to the COW KING, that can be found in the cow level
cowLevel.makeCowKing = function(){ return land.createMob("KIN", 180, 180, "horns", "The cow king ! It looks like a normal cow, but it isn't...", [drops.createDrop("candies", 1000), drops.createDrop("object", "hornOfPlenty", true)]); }
Hum, I noticed that the cow king WON'T move in that case ; use carefully...

[edit] Set damage you can do

When in a quest, quest.things[quest.getCharacterIndex()].weapon = "powerful explosion";
This will make you do 100 damage at once
If your sword level is over 17, then this will be better : quest.things[quest.getCharacterIndex()].weapon = "Sword of Liflamesummoning";
If you feel quite crazy, try the quest.things[quest.getCharacterIndex()].weapon = "Sword of Randomness";
For insane power, you could change the damage.getWeaponDamage by finding your sword name (e.g. iron sword, silver sword, etc.) and changing the number after return which will be your power/damage value. (e.g. case "wooden sword": return 99999999999999999999999999999999999999999999999; break;

[edit] AutoSave

Can be entered: At any time during the game. Has to be re-entered once you reload the page or load a saved game.

N: Interval to save at in milliseconds (ie 5000 saves the game every 5 seconds).

window.alert = function alert (message) {return true;}; setInterval(save,N);

[edit] Trivia

When looking at the source code, a line says: <!-- You're looking at the source code, hm, cheater ! :-) -->

[edit] Set the letter on top of the magician hat

Not really useful, but as you want inventory.setMagicianHatLetter("SSSSSletter") There must be five space ("S" in the example) before the letter.

[edit] Update page

At all time, type updateOnPage()