Compare commits

..

4 Commits

Author SHA1 Message Date
Aktanusa
cdd395b8a9 Added season cookies/eggs gotten stats 2014-05-29 15:24:15 -04:00
Aktanusa
1962335ec4 Minor changes 2014-05-29 13:45:59 -04:00
Aktanusa
f7be274b73 Updated README to be similar to Wikia 2014-05-29 13:29:57 -04:00
Aktanusa
5306bd45d0 Removed Reset stats 2014-05-27 11:53:29 -04:00
2 changed files with 160 additions and 48 deletions

View File

@@ -1,5 +1,7 @@
CM = {};
CM.Data = {};
CM.Sim = {};
CM.Cache = {};
@@ -210,9 +212,17 @@ CM.Sim.CheckOtherAchiev = function() {
if (CM.Sim.UpgradesOwned >= 100) CM.Sim.Win('Upgrader');
if (CM.Sim.UpgradesOwned >= 150) CM.Sim.Win('Lord of Progress');
if (CM.Sim.Has('Skull cookies') && CM.Sim.Has('Ghost cookies') && CM.Sim.Has('Bat cookies') && CM.Sim.Has('Slime cookies') && CM.Sim.Has('Pumpkin cookies') && CM.Sim.Has('Eyeball cookies') && CM.Sim.Has('Spider cookies')) CM.Sim.Win('Spooky cookies');
var hasAllHalloCook = true;
for (var i in CM.Data.HalloCookies) {
if (!CM.Sim.Has(CM.Data.HalloCookies[i])) hasAllHalloCook = false;
}
if (hasAllHalloCook) CM.Sim.Win('Spooky cookies');
if (CM.Sim.Has('Christmas tree biscuits') && CM.Sim.Has('Snowflake biscuits') && CM.Sim.Has('Snowman biscuits') && CM.Sim.Has('Holly biscuits') && CM.Sim.Has('Candy cane biscuits') && CM.Sim.Has('Bell biscuits') && CM.Sim.Has('Present biscuits')) CM.Sim.Win('Let it snow');
var hasAllChristCook = true;
for (var i in CM.Data.ChristCookies) {
if (!CM.Sim.Has(CM.Data.ChristCookies[i])) hasAllChristCook = false;
}
if (hasAllChristCook) CM.Sim.Win('Let it snow');
}
CM.Sim.BuyBuildings = function() {
@@ -359,33 +369,6 @@ CM.Sim.BuyUpgrades = function() {
//CM.Sim.DoUpgradesSim = 0;
}
CM.Sim.ResetBonus = function() {
CM.Sim.CopyData();
if (Game.cookiesEarned >= 1000000) CM.Sim.Win('Sacrifice');
if (Game.cookiesEarned >= 1000000000) CM.Sim.Win('Oblivion');
if (Game.cookiesEarned >= 1000000000000) CM.Sim.Win('From scratch');
if (Game.cookiesEarned >= 1000000000000000) CM.Sim.Win('Nihilism');
if (Game.cookiesEarned >= 1000000000000000000) CM.Sim.Win('Dematerialize');
if (Game.cookiesEarned >= 1000000000000000000000) CM.Sim.Win('Nil zero zilch');
if (Game.cookiesEarned >= 1000000000000000000000000) CM.Sim.Win('Transcendence');
if (Game.cookiesEarned >= 1000000000000000000000000000) CM.Sim.Win('Obliterate');
if (Game.cookiesEarned >= 1000000000000000000000000000000) CM.Sim.Win('Negative void');
CM.Sim.prestige = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset);
var lastAchievementsOwned = CM.Sim.AchievementsOwned;
CM.Sim.CalculateGains();
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
CM.Sim.CalculateGains();
}
return (CM.Sim.cookiesPs - Game.cookiesPs);
}
/*********
* Cache *
*********/
@@ -1041,16 +1024,28 @@ CM.Disp.AddMenu = function() {
var possibleHC = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset);
var neededCook = CM.Sim.CookNeedPrest(possibleHC + 1) - (Game.cookiesEarned + Game.cookiesReset);
var bonusHC = CM.Sim.ResetBonus();
var bciHC = (CM.Sim.CookNeedPrest(CM.Sim.prestige) - CM.Sim.CookNeedPrest(Game.prestige['Heavenly chips'])) / bonusHC;
var bciColorHC;
if (bonusHC == 0) bciColorHC = CM.Disp.colorGray;
else if (bciHC < CM.Disp.min) bciColorHC = CM.Disp.colorBlue;
else if (bciHC == CM.Disp.min) bciColorHC = CM.Disp.colorGreen;
else if (bciHC > CM.Disp.max) bciColorHC = CM.Disp.colorPurple;
else if (bciHC == CM.Disp.max) bciColorHC = CM.Disp.colorRed;
else if (bciHC > CM.Disp.mid) bciColorHC = CM.Disp.colorOrange;
else bciColorHC = CM.Disp.colorYellow;
var halloCook = 0;
for (var i in CM.Data.HalloCookies) {
if (Game.Has(CM.Data.HalloCookies[i])) halloCook++;
}
var christCook = 0;
for (var i in CM.Data.ChristCookies) {
if (Game.Has(CM.Data.ChristCookies[i])) christCook++;
}
var valCook = 0;
for (var i in CM.Data.ValCookies) {
if (Game.Has(CM.Data.ValCookies[i])) valCook++;
else break;
}
var normEggs = 0;
for (var i in Game.eggDrops) {
if (Game.HasUnlocked(Game.eggDrops[i])) normEggs++;
}
var rareEggs = 0;
for (var i in Game.rareEggDrops) {
if (Game.HasUnlocked(Game.rareEggDrops[i])) rareEggs++;
}
var str = '<div class=\'title\' style=\'color: ' + CM.Disp.colorBlue + '\'>Cookie Monster Goodies</div>';
str += '<div class=\'listing\' style=\'padding:5px 16px; opacity:0.7; font-size: 17px; font-family: \"Kavoon\", Georgia, serif;\'>Lucky Cookies</div>';
@@ -1064,9 +1059,6 @@ CM.Disp.AddMenu = function() {
str += '<div class=\'listing\'><b>Heavenly Chips (CUR) :</b> ' + Beautify(Game.prestige['Heavenly chips']) + ' <small>(' + Beautify((Game.prestige['Heavenly chips'] * 2)) + '%)</small></div>';
str += '<div class=\'listing\'><b>Cookies To Next Chip :</b> ' + Beautify(neededCook) + '</div>';
str += '<div class=\'listing\'><b>Time To Next Chip :</b> ' + CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1) + '</div>';
str += '<div class=\'listing\' style=\'padding:5px 16px; opacity:0.7; font-size: 17px; font-family: \"Kavoon\", Georgia, serif;\'>Reset</div>';
str += '<div class=\'listing\'><b>Bonus Income :</b> ' + Beautify(bonusHC) + '</div>';
str += '<div class=\'listing\'><b>Base Cost Per Income :</b> <span style=\'font-weight: bold; color: ' + bciColorHC + ';\'>' + Beautify(bciHC) + '</span></div>';
if (Game.cpsSucked > 0) {
str += '<div class=\'listing\' style=\'padding:5px 16px; opacity:0.7; font-size: 17px; font-family: \"Kavoon\", Georgia, serif;\'>Wrinklers</div>';
var sucked = 0;
@@ -1077,8 +1069,13 @@ CM.Disp.AddMenu = function() {
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
str += '<div class=\'listing\'><b>Rewards of Popping :</b> ' + Beautify(sucked) + '</div>';
}
str += '<div class=\'listing\' style=\'padding:5px 16px; opacity:0.7; font-size: 17px; font-family: \"Kavoon\", Georgia, serif;\'>Season Specials</div>';
str += '<div class=\'listing\'><b>Halloween Cookies Bought :</b> ' + halloCook + ' of ' + CM.Data.HalloCookies.length + '</div>';
str += '<div class=\'listing\'><b>Christmas Cookies Bought :</b> ' + christCook + ' of ' + CM.Data.ChristCookies.length + '</div>';
str += '<div class=\'listing\'><b>Valentine Cookies Bought :</b> ' + valCook + ' of ' + CM.Data.ValCookies.length + '</div>';
str += '<div class=\'listing\'><b>Normal Eggs Unlocked :</b> ' + normEggs + ' of ' + Game.eggDrops.length + '</div>';
str += '<div class=\'listing\'><b>Rare Eggs Unlocked :</b> ' + rareEggs + ' of ' + Game.rareEggDrops.length + '</div>';
if (Game.season == 'christmas') {
str += '<div class=\'listing\' style=\'padding:5px 16px; opacity:0.7; font-size: 17px; font-family: \"Kavoon\", Georgia, serif;\'>Season Specials</div>';
str += '<div class=\'listing\'><b>Reindeer Reward :</b> ' + Beautify(CM.Cache.SeaSpec) + '</div>';
}
@@ -1505,6 +1502,10 @@ CM.Init = function() {
}
}
CM.Data.HalloCookies = ['Skull cookies', 'Ghost cookies', 'Bat cookies', 'Slime cookies', 'Pumpkin cookies', 'Eyeball cookies', 'Spider cookies'];
CM.Data.ChristCookies = ['Christmas tree biscuits', 'Snowflake biscuits', 'Snowman biscuits', 'Holly biscuits', 'Candy cane biscuits', 'Bell biscuits', 'Present biscuits'];
CM.Data.ValCookies = ['Pure heart biscuits', 'Ardent heart biscuits', 'Sour heart biscuits', 'Weeping heart biscuits', 'Golden heart biscuits', 'Eternal heart biscuits'];
//CM.Sim.DoSims = 1;
//CM.Sim.DoUpgradesSim = 1;
@@ -1554,6 +1555,6 @@ CM.ConfigData.SayTime = { label : [ 'Format Time OFF', 'Format Time ON' ], func
CM.ConfigData.Scale = { label : [ 'Game\'s Setting Scale', 'Metric', 'Short Scale', 'Scientific Notation' ], func : function() { CM.Disp.RefreshScale(); } };
CM.VersionMajor = '1.0465';
CM.VersionMinor = '3';
CM.VersionMinor = '4';
CM.Init();

117
README.md
View File

@@ -1,4 +1,115 @@
CookieMonster
=============
# Cookie Monster
Cookie Monster Addon to Cookie Clicker
Cookie Monster is an addon you can load into Cookie Clicker, that offers a wide range of tools and statistics to enhance the game. It is **not** a cheat interface although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
This is a helper, and it is here to help you at *whichever* degree you want, if you only need some help shortening long numbers, it does that. If you need to be accompanied by hand to pick the best buildings to buy, it does that, but **everything is an option**.
## Current version
You can see the current version, and a full history of all versions and what they changed by consulting the [releases page](https://github.com/Aktanusa/CookieMonster/releases).
## What it does
At its core, Cookie Monster computes an index on both buildings and upgrades :
* **Base Cost per Income (BCI)** : Indicates how much a building is worth by comparing how much it costs to how much income gained
Cookie Monster also indicates the time left before being able to buy an upgrade or building, and takes it into consideration. It will take *everything* in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, it will know and highlight that building's value.
This index is computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value :
* Light Blue : (upgrades) This item has a better BCI than any building
* Green : This item has the best BCI
* Yellow : This item is not the best, but it is closer to best than it is to worst
* Orange : This item is not the worst, but it is closer to worst than it is to best
* Red : This item has the worst BCI
* Purple : (upgrades) This item has a worse BCI than any building
* Gray : (upgrades) This item has not been calculated and/or cannot be calculated due to no definitive worth.
Note : For this index, **lower is better**, meaning a building with a BCI of 1 is more interesting that one with a BCI of 3.
## What it doesn't do
Most likely you'll find items in gray like Golden Cookie upgrades, clicking upgrades everything that doesn't earn you a direct bonus to your income will display as gray. This means the following upgrades are **not** taken into account by Cookie Monster :
* Plastic mouse
* Iron mouse
* Titanium mouse
* Adamantium mouse
* Unobtainium mouse
* Lucky day
* Serendipity
* Get lucky
* Elder Pledge
* Sacrificial rolling pins
* **etc.**
Do note though that, although these upgrades have no direct value, if buying them earns you an achievement of some sort which in return gives you milk and income, Cookie Monster **will** display that value.
# Using
## Bookmarklet
Simply use like the previous addon, create a bookmark and set this as the URL. Then when in the game, click on that bookmark.
```javascript
javascript: (function () {
var load = document.createElement('script');
load.setAttribute('type', 'text/javascript');
load.setAttribute('src', 'http://aktanusa.github.io/CookieMonster/CookieMonster.js');
document.head.appendChild(load);
}());
```
If (for some reason) the above doesn't work, trying pasting everything after the <code>javascript:</code> bit into your browser's console.
## Userscript
If you'd rather use the addon as a script via per example *Greasemonkey* or *Tampermonkey*, you can use the following script, which will automatically load *Cookie Monster* every time the original game loads. You may need to specify <code>http://orteil.dashnet.org/cookieclicker/</code> when asked for a *namespace* or *includes*. For how to add an userscript to your browser, refer to your browser/plugin's documentation as the method changes for each one.
```javascript
// ==UserScript==
// @name Cookie Monster
// @namespace Cookie
// @include http://orteil.dashnet.org/cookieclicker/
// @version 1
// @grant none
// ==/UserScript==
var init = Game.Init;
Game.Init = function() {
init();
(function () {
var load = document.createElement('script');
load.setAttribute('type', 'text/javascript');
load.setAttribute('src', 'http://aktanusa.github.io/CookieMonster/CookieMonster.js');
document.head.appendChild(load);
}());
}
```
# Bugs and suggestions
Any bug or suggestion should be **opened as an issue** [in the repository](https://github.com/Aktanusa/CookieMonster/issues) for easier tracking. This allows me to close issues once they're fixed.
Before submitting a bug, make sure to give a shot at the latest version of the addon on the <code>dev</code> branch. For this, use the following bookmarklet:
```javascript
javascript: (function () {
var load = document.createElement('script');
load.setAttribute('type', 'text/javascript');
load.setAttribute('src', 'https://raw.githubusercontent.com/Aktanusa/CookieMonster/dev/CookieMonster.js');
document.head.appendChild(load);
}());
```
If the bug is still here, you can submit an issue for it.
All suggestions are welcome, even the smallest ones.
#Contributors
* **[Raving_Kumquat](http://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)** : Original author
* **[Maxime Fabre](https://github.com/Anahkiasen)** : Previous maintainer
* **Alderi Tokori** : ROI calculations (unused now)
* **[Aktanusa](https://github.com/Aktanusa)** : Current maintainer