Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f429888727 | ||
|
|
4ae550e4ab | ||
|
|
952ee91f7c | ||
|
|
a9fe2df233 | ||
|
|
d453499014 |
140
CookieMonster.js
140
CookieMonster.js
@@ -1051,7 +1051,7 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
div.style.fontSize = '17px';
|
div.style.fontSize = '17px';
|
||||||
div.style.fontFamily = '\"Kavoon\", Georgia, serif';
|
div.style.fontFamily = '\"Kavoon\", Georgia, serif';
|
||||||
div.appendChild(document.createTextNode(text + ' '));
|
div.appendChild(document.createTextNode(text + ' '));
|
||||||
span = document.createElement('span');
|
var span = document.createElement('span');
|
||||||
span.style.cursor = 'pointer';
|
span.style.cursor = 'pointer';
|
||||||
span.style.display = 'inline-block';
|
span.style.display = 'inline-block';
|
||||||
span.style.height = '14px';
|
span.style.height = '14px';
|
||||||
@@ -1077,7 +1077,9 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.className = 'listing';
|
div.className = 'listing';
|
||||||
var b = document.createElement('b');
|
var b = document.createElement('b');
|
||||||
b.textContent = name + ' : ';
|
if (typeof name == 'string') b.appendChild(document.createTextNode(name));
|
||||||
|
else b.appendChild(name); // fragment
|
||||||
|
b.appendChild(document.createTextNode(' : '));
|
||||||
div.appendChild(b);
|
div.appendChild(b);
|
||||||
div.appendChild(text);
|
div.appendChild(text);
|
||||||
return div;
|
return div;
|
||||||
@@ -1181,7 +1183,42 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag));
|
stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag));
|
||||||
stats.appendChild(listing('Cookies To Next Chip', document.createTextNode(Beautify(neededCook))));
|
stats.appendChild(listing('Cookies To Next Chip', document.createTextNode(Beautify(neededCook))));
|
||||||
stats.appendChild(listing('Time To Next Chip', document.createTextNode(CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1))));
|
stats.appendChild(listing('Time To Next Chip', document.createTextNode(CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1))));
|
||||||
stats.appendChild(listing('Reset Bonus Income', document.createTextNode(Beautify(CM.Sim.ResetBonus()))));
|
var resetTitleFrag = document.createDocumentFragment();
|
||||||
|
resetTitleFrag.appendChild(document.createTextNode('Reset Bonus Income '))
|
||||||
|
var resetTitleSpan = document.createElement('span');
|
||||||
|
resetTitleSpan.onmouseout = function() { Game.tooltip.hide(); };
|
||||||
|
var resetTitlePlaceholder = document.createElement('div');
|
||||||
|
var resetTitleDesc = document.createElement('div');
|
||||||
|
resetTitleDesc.style.minWidth = '260px';
|
||||||
|
resetTitleDesc.style.marginBottom = '4px';
|
||||||
|
var resetTitleDiv = document.createElement('div');
|
||||||
|
resetTitleDiv.style.textAlign = 'left';
|
||||||
|
resetTitleDiv.textContent = 'The bonus income you would get from new heavenly chips/reset achievements if you have the same buildings/upgrades after reset';
|
||||||
|
resetTitleDesc.appendChild(resetTitleDiv);
|
||||||
|
resetTitlePlaceholder.appendChild(resetTitleDesc);
|
||||||
|
resetTitleSpan.onmouseover = function() {Game.tooltip.draw(this, escape(resetTitlePlaceholder.innerHTML));};
|
||||||
|
resetTitleSpan.style.cursor = 'default';
|
||||||
|
resetTitleSpan.style.display = 'inline-block';
|
||||||
|
resetTitleSpan.style.height = '10px';
|
||||||
|
resetTitleSpan.style.width = '10px';
|
||||||
|
resetTitleSpan.style.borderRadius = '5px';
|
||||||
|
resetTitleSpan.style.textAlign = 'center';
|
||||||
|
resetTitleSpan.style.backgroundColor = '#C0C0C0';
|
||||||
|
resetTitleSpan.style.color = 'black';
|
||||||
|
resetTitleSpan.style.fontSize = '9px';
|
||||||
|
resetTitleSpan.style.verticalAlign = 'bottom';
|
||||||
|
resetTitleSpan.textContent = '?';
|
||||||
|
resetTitleFrag.appendChild(resetTitleSpan);
|
||||||
|
var resetBonus = CM.Sim.ResetBonus();
|
||||||
|
var resetFrag = document.createDocumentFragment();
|
||||||
|
resetFrag.appendChild(document.createTextNode(Beautify(resetBonus)));
|
||||||
|
var increase = Math.round(resetBonus / Game.cookiesPs * 10000);
|
||||||
|
if (isFinite(increase) && increase != 0) {
|
||||||
|
var resetSmall = document.createElement('small');
|
||||||
|
resetSmall.textContent = ' (' + (increase / 100) + '% of income)';
|
||||||
|
resetFrag.appendChild(resetSmall);
|
||||||
|
}
|
||||||
|
stats.appendChild(listing(resetTitleFrag, resetFrag));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Game.cpsSucked > 0) {
|
if (Game.cpsSucked > 0) {
|
||||||
@@ -1240,7 +1277,7 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
var createSpecDisp = function(theSpecDisp) {
|
var createSpecDisp = function(theSpecDisp) {
|
||||||
var frag = document.createDocumentFragment();
|
var frag = document.createDocumentFragment();
|
||||||
frag.appendChild(document.createTextNode(theSpecDisp.length + ' '));
|
frag.appendChild(document.createTextNode(theSpecDisp.length + ' '));
|
||||||
span = document.createElement('span');
|
var span = document.createElement('span');
|
||||||
span.onmouseout = function() { Game.tooltip.hide(); };
|
span.onmouseout = function() { Game.tooltip.hide(); };
|
||||||
var placeholder = document.createElement('div');
|
var placeholder = document.createElement('div');
|
||||||
var missing = document.createElement('div');
|
var missing = document.createElement('div');
|
||||||
@@ -1396,15 +1433,15 @@ CM.Disp.AddTooltipUpgrade = function() {
|
|||||||
CM.Disp.AddTooltipBuild10 = function() {
|
CM.Disp.AddTooltipBuild10 = function() {
|
||||||
for (var i in Game.Objects) {
|
for (var i in Game.Objects) {
|
||||||
var me = Game.Objects[i];
|
var me = Game.Objects[i];
|
||||||
l('buttonBuy10-' + me.id).onmouseover = function() {CM.Disp.Buy10 = true;};
|
l('buttonBuy10-' + me.id).onmouseover = function() {CM.Disp.TooltipBuy10 = true;};
|
||||||
l('buttonBuy10-' + me.id).onmouseout = function() {CM.Disp.Buy10 = false;};
|
l('buttonBuy10-' + me.id).onmouseout = function() {CM.Disp.TooltipBuy10 = false;};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CM.Disp.Tooltip = function(type, name) {
|
CM.Disp.Tooltip = function(type, name) {
|
||||||
if (type == 'b') {
|
if (type == 'b') {
|
||||||
l('tooltip').innerHTML = Game.Objects[name].tooltip();
|
l('tooltip').innerHTML = Game.Objects[name].tooltip();
|
||||||
if (CM.Disp.Buy10) {
|
if (CM.Disp.TooltipBuy10) {
|
||||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join(Beautify(CM.Cache.Objects10[name].price));
|
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join(Beautify(CM.Cache.Objects10[name].price));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1465,7 +1502,7 @@ CM.Disp.UpdateTooltip = function() {
|
|||||||
var price;
|
var price;
|
||||||
var bonus;
|
var bonus;
|
||||||
if (CM.Disp.tooltipType == 'b') {
|
if (CM.Disp.tooltipType == 'b') {
|
||||||
if (!CM.Disp.Buy10) {
|
if (!CM.Disp.TooltipBuy10) {
|
||||||
bonus = CM.Cache.Objects[CM.Disp.tooltipName].bonus;
|
bonus = CM.Cache.Objects[CM.Disp.tooltipName].bonus;
|
||||||
price = Game.Objects[CM.Disp.tooltipName].getPrice();
|
price = Game.Objects[CM.Disp.tooltipName].getPrice();
|
||||||
if (CM.Config.Tooltip == 1) {
|
if (CM.Config.Tooltip == 1) {
|
||||||
@@ -1561,6 +1598,76 @@ CM.Disp.UpdateTooltipWarnCaut = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CM.Disp.AddWrinklerAreaDetect = function() {
|
||||||
|
l('backgroundLeftCanvas').onmouseover = function() {CM.Disp.TooltipWrinklerArea = 1;};
|
||||||
|
l('backgroundLeftCanvas').onmouseout = function() {
|
||||||
|
CM.Disp.TooltipWrinklerArea = 0;
|
||||||
|
Game.tooltip.hide();
|
||||||
|
for (var i = 0; i < 10; i++) {
|
||||||
|
CM.Disp.TooltipWrinklerCache[i] = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
CM.Disp.CheckWrinklerTooltip = function() {
|
||||||
|
if (CM.Disp.TooltipWrinklerArea == 1) {
|
||||||
|
var showingTooltip = false;
|
||||||
|
var mouseInWrinkler = function (x, y, rect) {
|
||||||
|
var dx = x + Math.sin(-rect.r) * (-(rect.h / 2 - rect.o)), dy = y + Math.cos(-rect.r) * (-(rect.h / 2 - rect.o));
|
||||||
|
var h1 = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
var currA = Math.atan2(dy, dx);
|
||||||
|
var newA = currA - rect.r;
|
||||||
|
var x2 = Math.cos(newA) * h1;
|
||||||
|
var y2 = Math.sin(newA) * h1;
|
||||||
|
if (x2 > -0.5 * rect.w && x2 < 0.5 * rect.w && y2 > -0.5 * rect.h && y2 < 0.5 * rect.h) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (var i in Game.wrinklers) {
|
||||||
|
var me = Game.wrinklers[i];
|
||||||
|
var rect = {w: 100, h: 200, r: (-me.r) * Math.PI / 180, o: 10};
|
||||||
|
if (me.phase > 0 && Game.LeftBackground && Game.mouseX < Game.LeftBackground.canvas.width && mouseInWrinkler(Game.mouseX - me.x, Game.mouseY - me.y, rect)) {
|
||||||
|
if (CM.Disp.TooltipWrinklerCache[i] == 0) {
|
||||||
|
var placeholder = document.createElement('div');
|
||||||
|
var wrinkler = document.createElement('div');
|
||||||
|
wrinkler.style.minWidth = '120px';
|
||||||
|
wrinkler.style.marginBottom = '4px';
|
||||||
|
var div = document.createElement('div');
|
||||||
|
div.style.textAlign = 'center';
|
||||||
|
div.id = 'CMTooltipWrinkler';
|
||||||
|
wrinkler.appendChild(div);
|
||||||
|
placeholder.appendChild(wrinkler);
|
||||||
|
Game.tooltip.draw(this, escape(placeholder.innerHTML), 'wrink');
|
||||||
|
CM.Disp.TooltipWrinkler = i;
|
||||||
|
CM.Disp.TooltipWrinklerCache[i] = 1;
|
||||||
|
}
|
||||||
|
showingTooltip = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CM.Disp.TooltipWrinklerCache[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!showingTooltip) {
|
||||||
|
Game.tooltip.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CM.Disp.UpdateWrinklerTooltip = function() {
|
||||||
|
if (l('CMTooltipWrinkler') != null) {
|
||||||
|
var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked;
|
||||||
|
sucked *= 1.1;
|
||||||
|
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
||||||
|
l('CMTooltipWrinkler').textContent = Beautify(sucked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CM.Disp.UpdateTooltipWrinklerLocation = function() {
|
||||||
|
if (Game.tooltip.origin == 'wrink') {
|
||||||
|
Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 20) + 'px';
|
||||||
|
Game.tooltip.tta.style.right = 'auto';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CM.Disp.ToggleSayTime = function() {
|
CM.Disp.ToggleSayTime = function() {
|
||||||
if (CM.Config.SayTime == 1) {
|
if (CM.Config.SayTime == 1) {
|
||||||
Game.sayTime = CM.Disp.sayTime;
|
Game.sayTime = CM.Disp.sayTime;
|
||||||
@@ -1595,7 +1702,14 @@ CM.Disp.lastGoldenCookieState = 'none';
|
|||||||
CM.Disp.metric = ['M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
CM.Disp.metric = ['M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||||
CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec'];
|
CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec'];
|
||||||
|
|
||||||
CM.Disp.Buy10 = false;
|
CM.Disp.TooltipBuy10 = false;
|
||||||
|
|
||||||
|
CM.Disp.TooltipWrinklerArea = 0;
|
||||||
|
CM.Disp.TooltipWrinkler = -1;
|
||||||
|
CM.Disp.TooltipWrinklerCache = [];
|
||||||
|
for (var i = 0; i < 10; i++) {
|
||||||
|
CM.Disp.TooltipWrinklerCache[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Main *
|
* Main *
|
||||||
@@ -1632,6 +1746,7 @@ CM.ReplaceNative = function() {
|
|||||||
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this').join('Game.tooltip'));
|
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this').join('Game.tooltip'));
|
||||||
Game.tooltip.update = function() {
|
Game.tooltip.update = function() {
|
||||||
CM.Backup.tooltip.updateMod();
|
CM.Backup.tooltip.updateMod();
|
||||||
|
CM.Disp.UpdateTooltipWrinklerLocation();
|
||||||
CM.Disp.UpdateTooltipWarnCaut();
|
CM.Disp.UpdateTooltipWarnCaut();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1682,6 +1797,10 @@ CM.Loop = function() {
|
|||||||
// Update Tooltip
|
// Update Tooltip
|
||||||
CM.Disp.UpdateTooltip();
|
CM.Disp.UpdateTooltip();
|
||||||
|
|
||||||
|
// Update Wrinkler Tooltip
|
||||||
|
CM.Disp.CheckWrinklerTooltip();
|
||||||
|
CM.Disp.UpdateWrinklerTooltip();
|
||||||
|
|
||||||
// Check Golden Cookies
|
// Check Golden Cookies
|
||||||
CM.Disp.CheckGoldenCookie();
|
CM.Disp.CheckGoldenCookie();
|
||||||
|
|
||||||
@@ -1706,6 +1825,7 @@ CM.Init = function() {
|
|||||||
CM.Disp.CreateTooltipWarnCaut();
|
CM.Disp.CreateTooltipWarnCaut();
|
||||||
CM.Disp.AddTooltipBuild();
|
CM.Disp.AddTooltipBuild();
|
||||||
CM.Disp.AddTooltipBuild10();
|
CM.Disp.AddTooltipBuild10();
|
||||||
|
CM.Disp.AddWrinklerAreaDetect();
|
||||||
CM.ReplaceNative();
|
CM.ReplaceNative();
|
||||||
Game.CalculateGains();
|
Game.CalculateGains();
|
||||||
CM.LoadConfig(); // Must be after all things are created!
|
CM.LoadConfig(); // Must be after all things are created!
|
||||||
@@ -1721,7 +1841,7 @@ CM.ConfigDefault = {BotBar: 1, TimerBar: 1, BuildColor: 1, UpBarColor: 1, Flash:
|
|||||||
CM.ConfigPrefix = 'CMConfig';
|
CM.ConfigPrefix = 'CMConfig';
|
||||||
|
|
||||||
CM.VersionMajor = '1.0465';
|
CM.VersionMajor = '1.0465';
|
||||||
CM.VersionMinor = '7';
|
CM.VersionMinor = '8';
|
||||||
|
|
||||||
/*******
|
/*******
|
||||||
* Sim *
|
* Sim *
|
||||||
|
|||||||
27
README.md
27
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Cookie Monster
|
# Cookie Monster
|
||||||
|
|
||||||
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.
|
**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**.
|
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**.
|
||||||
|
|
||||||
@@ -50,14 +50,11 @@ Do note though that, although these upgrades have no direct value, if buying the
|
|||||||
|
|
||||||
## Bookmarklet
|
## 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.
|
Copy this code and save it as a bookmark. Paste it in the URL section. To activate, click the bookmark when the game's open.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
javascript: (function () {
|
javascript: (function () {
|
||||||
var load = document.createElement('script');
|
Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js');
|
||||||
load.setAttribute('type', 'text/javascript');
|
|
||||||
load.setAttribute('src', 'http://aktanusa.github.io/CookieMonster/CookieMonster.js');
|
|
||||||
document.head.appendChild(load);
|
|
||||||
}());
|
}());
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -76,16 +73,9 @@ If you'd rather use the addon as a script via per example *Greasemonkey* or *Tam
|
|||||||
// @grant none
|
// @grant none
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
var init = Game.Init;
|
(function () {
|
||||||
Game.Init = function() {
|
Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js');
|
||||||
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
|
# Bugs and suggestions
|
||||||
@@ -96,10 +86,7 @@ Before submitting a bug, make sure to give a shot at the latest version of the a
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
javascript: (function () {
|
javascript: (function () {
|
||||||
var load = document.createElement('script');
|
Game.LoadMod('https://raw.githubusercontent.com/Aktanusa/CookieMonster/dev/CookieMonster.js');
|
||||||
load.setAttribute('type', 'text/javascript');
|
|
||||||
load.setAttribute('src', 'https://raw.githubusercontent.com/Aktanusa/CookieMonster/dev/CookieMonster.js');
|
|
||||||
document.head.appendChild(load);
|
|
||||||
}());
|
}());
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
132
src/Disp.js
132
src/Disp.js
@@ -745,7 +745,7 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
div.style.fontSize = '17px';
|
div.style.fontSize = '17px';
|
||||||
div.style.fontFamily = '\"Kavoon\", Georgia, serif';
|
div.style.fontFamily = '\"Kavoon\", Georgia, serif';
|
||||||
div.appendChild(document.createTextNode(text + ' '));
|
div.appendChild(document.createTextNode(text + ' '));
|
||||||
span = document.createElement('span');
|
var span = document.createElement('span');
|
||||||
span.style.cursor = 'pointer';
|
span.style.cursor = 'pointer';
|
||||||
span.style.display = 'inline-block';
|
span.style.display = 'inline-block';
|
||||||
span.style.height = '14px';
|
span.style.height = '14px';
|
||||||
@@ -771,7 +771,9 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.className = 'listing';
|
div.className = 'listing';
|
||||||
var b = document.createElement('b');
|
var b = document.createElement('b');
|
||||||
b.textContent = name + ' : ';
|
if (typeof name == 'string') b.appendChild(document.createTextNode(name));
|
||||||
|
else b.appendChild(name); // fragment
|
||||||
|
b.appendChild(document.createTextNode(' : '));
|
||||||
div.appendChild(b);
|
div.appendChild(b);
|
||||||
div.appendChild(text);
|
div.appendChild(text);
|
||||||
return div;
|
return div;
|
||||||
@@ -875,7 +877,42 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag));
|
stats.appendChild(listing('Heavenly Chips (CUR)', hcCurFrag));
|
||||||
stats.appendChild(listing('Cookies To Next Chip', document.createTextNode(Beautify(neededCook))));
|
stats.appendChild(listing('Cookies To Next Chip', document.createTextNode(Beautify(neededCook))));
|
||||||
stats.appendChild(listing('Time To Next Chip', document.createTextNode(CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1))));
|
stats.appendChild(listing('Time To Next Chip', document.createTextNode(CM.Disp.FormatTime(neededCook / (Game.cookiesPs * (1 - Game.cpsSucked)), 1))));
|
||||||
stats.appendChild(listing('Reset Bonus Income', document.createTextNode(Beautify(CM.Sim.ResetBonus()))));
|
var resetTitleFrag = document.createDocumentFragment();
|
||||||
|
resetTitleFrag.appendChild(document.createTextNode('Reset Bonus Income '))
|
||||||
|
var resetTitleSpan = document.createElement('span');
|
||||||
|
resetTitleSpan.onmouseout = function() { Game.tooltip.hide(); };
|
||||||
|
var resetTitlePlaceholder = document.createElement('div');
|
||||||
|
var resetTitleDesc = document.createElement('div');
|
||||||
|
resetTitleDesc.style.minWidth = '260px';
|
||||||
|
resetTitleDesc.style.marginBottom = '4px';
|
||||||
|
var resetTitleDiv = document.createElement('div');
|
||||||
|
resetTitleDiv.style.textAlign = 'left';
|
||||||
|
resetTitleDiv.textContent = 'The bonus income you would get from new heavenly chips/reset achievements if you have the same buildings/upgrades after reset';
|
||||||
|
resetTitleDesc.appendChild(resetTitleDiv);
|
||||||
|
resetTitlePlaceholder.appendChild(resetTitleDesc);
|
||||||
|
resetTitleSpan.onmouseover = function() {Game.tooltip.draw(this, escape(resetTitlePlaceholder.innerHTML));};
|
||||||
|
resetTitleSpan.style.cursor = 'default';
|
||||||
|
resetTitleSpan.style.display = 'inline-block';
|
||||||
|
resetTitleSpan.style.height = '10px';
|
||||||
|
resetTitleSpan.style.width = '10px';
|
||||||
|
resetTitleSpan.style.borderRadius = '5px';
|
||||||
|
resetTitleSpan.style.textAlign = 'center';
|
||||||
|
resetTitleSpan.style.backgroundColor = '#C0C0C0';
|
||||||
|
resetTitleSpan.style.color = 'black';
|
||||||
|
resetTitleSpan.style.fontSize = '9px';
|
||||||
|
resetTitleSpan.style.verticalAlign = 'bottom';
|
||||||
|
resetTitleSpan.textContent = '?';
|
||||||
|
resetTitleFrag.appendChild(resetTitleSpan);
|
||||||
|
var resetBonus = CM.Sim.ResetBonus();
|
||||||
|
var resetFrag = document.createDocumentFragment();
|
||||||
|
resetFrag.appendChild(document.createTextNode(Beautify(resetBonus)));
|
||||||
|
var increase = Math.round(resetBonus / Game.cookiesPs * 10000);
|
||||||
|
if (isFinite(increase) && increase != 0) {
|
||||||
|
var resetSmall = document.createElement('small');
|
||||||
|
resetSmall.textContent = ' (' + (increase / 100) + '% of income)';
|
||||||
|
resetFrag.appendChild(resetSmall);
|
||||||
|
}
|
||||||
|
stats.appendChild(listing(resetTitleFrag, resetFrag));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Game.cpsSucked > 0) {
|
if (Game.cpsSucked > 0) {
|
||||||
@@ -934,7 +971,7 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
var createSpecDisp = function(theSpecDisp) {
|
var createSpecDisp = function(theSpecDisp) {
|
||||||
var frag = document.createDocumentFragment();
|
var frag = document.createDocumentFragment();
|
||||||
frag.appendChild(document.createTextNode(theSpecDisp.length + ' '));
|
frag.appendChild(document.createTextNode(theSpecDisp.length + ' '));
|
||||||
span = document.createElement('span');
|
var span = document.createElement('span');
|
||||||
span.onmouseout = function() { Game.tooltip.hide(); };
|
span.onmouseout = function() { Game.tooltip.hide(); };
|
||||||
var placeholder = document.createElement('div');
|
var placeholder = document.createElement('div');
|
||||||
var missing = document.createElement('div');
|
var missing = document.createElement('div');
|
||||||
@@ -1090,15 +1127,15 @@ CM.Disp.AddTooltipUpgrade = function() {
|
|||||||
CM.Disp.AddTooltipBuild10 = function() {
|
CM.Disp.AddTooltipBuild10 = function() {
|
||||||
for (var i in Game.Objects) {
|
for (var i in Game.Objects) {
|
||||||
var me = Game.Objects[i];
|
var me = Game.Objects[i];
|
||||||
l('buttonBuy10-' + me.id).onmouseover = function() {CM.Disp.Buy10 = true;};
|
l('buttonBuy10-' + me.id).onmouseover = function() {CM.Disp.TooltipBuy10 = true;};
|
||||||
l('buttonBuy10-' + me.id).onmouseout = function() {CM.Disp.Buy10 = false;};
|
l('buttonBuy10-' + me.id).onmouseout = function() {CM.Disp.TooltipBuy10 = false;};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CM.Disp.Tooltip = function(type, name) {
|
CM.Disp.Tooltip = function(type, name) {
|
||||||
if (type == 'b') {
|
if (type == 'b') {
|
||||||
l('tooltip').innerHTML = Game.Objects[name].tooltip();
|
l('tooltip').innerHTML = Game.Objects[name].tooltip();
|
||||||
if (CM.Disp.Buy10) {
|
if (CM.Disp.TooltipBuy10) {
|
||||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join(Beautify(CM.Cache.Objects10[name].price));
|
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join(Beautify(CM.Cache.Objects10[name].price));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1159,7 +1196,7 @@ CM.Disp.UpdateTooltip = function() {
|
|||||||
var price;
|
var price;
|
||||||
var bonus;
|
var bonus;
|
||||||
if (CM.Disp.tooltipType == 'b') {
|
if (CM.Disp.tooltipType == 'b') {
|
||||||
if (!CM.Disp.Buy10) {
|
if (!CM.Disp.TooltipBuy10) {
|
||||||
bonus = CM.Cache.Objects[CM.Disp.tooltipName].bonus;
|
bonus = CM.Cache.Objects[CM.Disp.tooltipName].bonus;
|
||||||
price = Game.Objects[CM.Disp.tooltipName].getPrice();
|
price = Game.Objects[CM.Disp.tooltipName].getPrice();
|
||||||
if (CM.Config.Tooltip == 1) {
|
if (CM.Config.Tooltip == 1) {
|
||||||
@@ -1255,6 +1292,76 @@ CM.Disp.UpdateTooltipWarnCaut = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CM.Disp.AddWrinklerAreaDetect = function() {
|
||||||
|
l('backgroundLeftCanvas').onmouseover = function() {CM.Disp.TooltipWrinklerArea = 1;};
|
||||||
|
l('backgroundLeftCanvas').onmouseout = function() {
|
||||||
|
CM.Disp.TooltipWrinklerArea = 0;
|
||||||
|
Game.tooltip.hide();
|
||||||
|
for (var i = 0; i < 10; i++) {
|
||||||
|
CM.Disp.TooltipWrinklerCache[i] = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
CM.Disp.CheckWrinklerTooltip = function() {
|
||||||
|
if (CM.Disp.TooltipWrinklerArea == 1) {
|
||||||
|
var showingTooltip = false;
|
||||||
|
var mouseInWrinkler = function (x, y, rect) {
|
||||||
|
var dx = x + Math.sin(-rect.r) * (-(rect.h / 2 - rect.o)), dy = y + Math.cos(-rect.r) * (-(rect.h / 2 - rect.o));
|
||||||
|
var h1 = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
var currA = Math.atan2(dy, dx);
|
||||||
|
var newA = currA - rect.r;
|
||||||
|
var x2 = Math.cos(newA) * h1;
|
||||||
|
var y2 = Math.sin(newA) * h1;
|
||||||
|
if (x2 > -0.5 * rect.w && x2 < 0.5 * rect.w && y2 > -0.5 * rect.h && y2 < 0.5 * rect.h) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (var i in Game.wrinklers) {
|
||||||
|
var me = Game.wrinklers[i];
|
||||||
|
var rect = {w: 100, h: 200, r: (-me.r) * Math.PI / 180, o: 10};
|
||||||
|
if (me.phase > 0 && Game.LeftBackground && Game.mouseX < Game.LeftBackground.canvas.width && mouseInWrinkler(Game.mouseX - me.x, Game.mouseY - me.y, rect)) {
|
||||||
|
if (CM.Disp.TooltipWrinklerCache[i] == 0) {
|
||||||
|
var placeholder = document.createElement('div');
|
||||||
|
var wrinkler = document.createElement('div');
|
||||||
|
wrinkler.style.minWidth = '120px';
|
||||||
|
wrinkler.style.marginBottom = '4px';
|
||||||
|
var div = document.createElement('div');
|
||||||
|
div.style.textAlign = 'center';
|
||||||
|
div.id = 'CMTooltipWrinkler';
|
||||||
|
wrinkler.appendChild(div);
|
||||||
|
placeholder.appendChild(wrinkler);
|
||||||
|
Game.tooltip.draw(this, escape(placeholder.innerHTML), 'wrink');
|
||||||
|
CM.Disp.TooltipWrinkler = i;
|
||||||
|
CM.Disp.TooltipWrinklerCache[i] = 1;
|
||||||
|
}
|
||||||
|
showingTooltip = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CM.Disp.TooltipWrinklerCache[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!showingTooltip) {
|
||||||
|
Game.tooltip.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CM.Disp.UpdateWrinklerTooltip = function() {
|
||||||
|
if (l('CMTooltipWrinkler') != null) {
|
||||||
|
var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked;
|
||||||
|
sucked *= 1.1;
|
||||||
|
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
||||||
|
l('CMTooltipWrinkler').textContent = Beautify(sucked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CM.Disp.UpdateTooltipWrinklerLocation = function() {
|
||||||
|
if (Game.tooltip.origin == 'wrink') {
|
||||||
|
Game.tooltip.tta.style.left = (Game.mouseX + l('tooltip').offsetWidth + 20) + 'px';
|
||||||
|
Game.tooltip.tta.style.right = 'auto';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CM.Disp.ToggleSayTime = function() {
|
CM.Disp.ToggleSayTime = function() {
|
||||||
if (CM.Config.SayTime == 1) {
|
if (CM.Config.SayTime == 1) {
|
||||||
Game.sayTime = CM.Disp.sayTime;
|
Game.sayTime = CM.Disp.sayTime;
|
||||||
@@ -1289,5 +1396,12 @@ CM.Disp.lastGoldenCookieState = 'none';
|
|||||||
CM.Disp.metric = ['M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
CM.Disp.metric = ['M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
||||||
CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec'];
|
CM.Disp.shortScale = ['M', 'B', 'Tr', 'Quadr', 'Quint', 'Sext', 'Sept', 'Oct', 'Non', 'Dec', 'Undec', 'Duodec', 'Tredec'];
|
||||||
|
|
||||||
CM.Disp.Buy10 = false;
|
CM.Disp.TooltipBuy10 = false;
|
||||||
|
|
||||||
|
CM.Disp.TooltipWrinklerArea = 0;
|
||||||
|
CM.Disp.TooltipWrinkler = -1;
|
||||||
|
CM.Disp.TooltipWrinklerCache = [];
|
||||||
|
for (var i = 0; i < 10; i++) {
|
||||||
|
CM.Disp.TooltipWrinklerCache[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ CM.ReplaceNative = function() {
|
|||||||
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this').join('Game.tooltip'));
|
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this').join('Game.tooltip'));
|
||||||
Game.tooltip.update = function() {
|
Game.tooltip.update = function() {
|
||||||
CM.Backup.tooltip.updateMod();
|
CM.Backup.tooltip.updateMod();
|
||||||
|
CM.Disp.UpdateTooltipWrinklerLocation();
|
||||||
CM.Disp.UpdateTooltipWarnCaut();
|
CM.Disp.UpdateTooltipWarnCaut();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +84,10 @@ CM.Loop = function() {
|
|||||||
// Update Tooltip
|
// Update Tooltip
|
||||||
CM.Disp.UpdateTooltip();
|
CM.Disp.UpdateTooltip();
|
||||||
|
|
||||||
|
// Update Wrinkler Tooltip
|
||||||
|
CM.Disp.CheckWrinklerTooltip();
|
||||||
|
CM.Disp.UpdateWrinklerTooltip();
|
||||||
|
|
||||||
// Check Golden Cookies
|
// Check Golden Cookies
|
||||||
CM.Disp.CheckGoldenCookie();
|
CM.Disp.CheckGoldenCookie();
|
||||||
|
|
||||||
@@ -107,6 +112,7 @@ CM.Init = function() {
|
|||||||
CM.Disp.CreateTooltipWarnCaut();
|
CM.Disp.CreateTooltipWarnCaut();
|
||||||
CM.Disp.AddTooltipBuild();
|
CM.Disp.AddTooltipBuild();
|
||||||
CM.Disp.AddTooltipBuild10();
|
CM.Disp.AddTooltipBuild10();
|
||||||
|
CM.Disp.AddWrinklerAreaDetect();
|
||||||
CM.ReplaceNative();
|
CM.ReplaceNative();
|
||||||
Game.CalculateGains();
|
Game.CalculateGains();
|
||||||
CM.LoadConfig(); // Must be after all things are created!
|
CM.LoadConfig(); // Must be after all things are created!
|
||||||
@@ -122,5 +128,5 @@ CM.ConfigDefault = {BotBar: 1, TimerBar: 1, BuildColor: 1, UpBarColor: 1, Flash:
|
|||||||
CM.ConfigPrefix = 'CMConfig';
|
CM.ConfigPrefix = 'CMConfig';
|
||||||
|
|
||||||
CM.VersionMajor = '1.0465';
|
CM.VersionMajor = '1.0465';
|
||||||
CM.VersionMinor = '7';
|
CM.VersionMinor = '8';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user