Chocolate egg stat now includes popping wrinklers (Issue #27)
This commit is contained in:
@@ -1059,11 +1059,11 @@ CM.Disp.CreateResetTooltip = function() {
|
|||||||
CM.Disp.CreateChoEggTooltip = function() {
|
CM.Disp.CreateChoEggTooltip = function() {
|
||||||
CM.Disp.ChoEggTooltipPlaceholder = document.createElement('div');
|
CM.Disp.ChoEggTooltipPlaceholder = document.createElement('div');
|
||||||
var choEggTitleDesc = document.createElement('div');
|
var choEggTitleDesc = document.createElement('div');
|
||||||
choEggTitleDesc.style.minWidth = '290px';
|
choEggTitleDesc.style.minWidth = '240px';
|
||||||
choEggTitleDesc.style.marginBottom = '4px';
|
choEggTitleDesc.style.marginBottom = '4px';
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.style.textAlign = 'left';
|
div.style.textAlign = 'left';
|
||||||
div.textContent = 'The amount of cookies you would get from selling all buildings and then buying Chocolate egg';
|
div.textContent = 'The amount of cookies you would get from selling all buildings, popping all wrinklers, and then buying Chocolate egg';
|
||||||
choEggTitleDesc.appendChild(div);
|
choEggTitleDesc.appendChild(div);
|
||||||
CM.Disp.ChoEggTooltipPlaceholder.appendChild(choEggTitleDesc);
|
CM.Disp.ChoEggTooltipPlaceholder.appendChild(choEggTitleDesc);
|
||||||
}
|
}
|
||||||
@@ -1376,18 +1376,21 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(listing(resetTitleFrag, resetFrag));
|
stats.appendChild(listing(resetTitleFrag, resetFrag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')); // Needs to be done for the checking below
|
||||||
|
|
||||||
if (Game.cpsSucked > 0) {
|
if (Game.cpsSucked > 0) {
|
||||||
stats.appendChild(header('Wrinklers', 'Wrink'));
|
stats.appendChild(header('Wrinklers', 'Wrink'));
|
||||||
if (CM.Config.StatsPref.Wrink) {
|
if (CM.Config.StatsPref.Wrink || (CM.Config.StatsPref.Sea && choEgg)) {
|
||||||
var sucked = 0;
|
var sucked = 0;
|
||||||
for (var i in Game.wrinklers) {
|
for (var i in Game.wrinklers) {
|
||||||
sucked += Game.wrinklers[i].sucked;
|
sucked += Game.wrinklers[i].sucked;
|
||||||
}
|
}
|
||||||
sucked *= 1.1;
|
sucked *= 1.1;
|
||||||
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
||||||
|
|
||||||
|
if (CM.Config.StatsPref.Wrink) {
|
||||||
var popAllFrag = document.createDocumentFragment();
|
var popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(document.createTextNode(Beautify(sucked) + ' '));
|
popAllFrag.appendChild(document.createTextNode(Beautify(sucked) + ' '));
|
||||||
|
|
||||||
var popAllA = document.createElement('a');
|
var popAllA = document.createElement('a');
|
||||||
popAllA.textContent = 'Pop All';
|
popAllA.textContent = 'Pop All';
|
||||||
popAllA.className = 'option';
|
popAllA.className = 'option';
|
||||||
@@ -1396,6 +1399,7 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(listing('Rewards of Popping', popAllFrag));
|
stats.appendChild(listing('Rewards of Popping', popAllFrag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var specDisp = false;
|
var specDisp = false;
|
||||||
var halloCook = [];
|
var halloCook = [];
|
||||||
@@ -1433,7 +1437,6 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
specDisp = true;
|
specDisp = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
|
||||||
|
|
||||||
if (Game.season == 'christmas' || specDisp || choEgg) {
|
if (Game.season == 'christmas' || specDisp || choEgg) {
|
||||||
stats.appendChild(header('Season Specials', 'Sea'));
|
stats.appendChild(header('Season Specials', 'Sea'));
|
||||||
@@ -1502,7 +1505,11 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
choEggTitleSpan.style.verticalAlign = 'bottom';
|
choEggTitleSpan.style.verticalAlign = 'bottom';
|
||||||
choEggTitleSpan.textContent = '?';
|
choEggTitleSpan.textContent = '?';
|
||||||
choEggTitleFrag.appendChild(choEggTitleSpan);
|
choEggTitleFrag.appendChild(choEggTitleSpan);
|
||||||
var choEggTotal = (Game.cookies + CM.Cache.SellAllTotal) * 0.05;
|
var choEggTotal = Game.cookies + CM.Cache.SellAllTotal;
|
||||||
|
if (Game.cpsSucked > 0) {
|
||||||
|
choEggTotal += sucked;
|
||||||
|
}
|
||||||
|
choEggTotal *= 0.05;
|
||||||
stats.appendChild(listing(choEggTitleFrag, document.createTextNode(Beautify(choEggTotal))));
|
stats.appendChild(listing(choEggTitleFrag, document.createTextNode(Beautify(choEggTotal))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
19
src/Disp.js
19
src/Disp.js
@@ -722,11 +722,11 @@ CM.Disp.CreateResetTooltip = function() {
|
|||||||
CM.Disp.CreateChoEggTooltip = function() {
|
CM.Disp.CreateChoEggTooltip = function() {
|
||||||
CM.Disp.ChoEggTooltipPlaceholder = document.createElement('div');
|
CM.Disp.ChoEggTooltipPlaceholder = document.createElement('div');
|
||||||
var choEggTitleDesc = document.createElement('div');
|
var choEggTitleDesc = document.createElement('div');
|
||||||
choEggTitleDesc.style.minWidth = '290px';
|
choEggTitleDesc.style.minWidth = '240px';
|
||||||
choEggTitleDesc.style.marginBottom = '4px';
|
choEggTitleDesc.style.marginBottom = '4px';
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.style.textAlign = 'left';
|
div.style.textAlign = 'left';
|
||||||
div.textContent = 'The amount of cookies you would get from selling all buildings and then buying Chocolate egg';
|
div.textContent = 'The amount of cookies you would get from selling all buildings, popping all wrinklers, and then buying Chocolate egg';
|
||||||
choEggTitleDesc.appendChild(div);
|
choEggTitleDesc.appendChild(div);
|
||||||
CM.Disp.ChoEggTooltipPlaceholder.appendChild(choEggTitleDesc);
|
CM.Disp.ChoEggTooltipPlaceholder.appendChild(choEggTitleDesc);
|
||||||
}
|
}
|
||||||
@@ -1039,18 +1039,21 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(listing(resetTitleFrag, resetFrag));
|
stats.appendChild(listing(resetTitleFrag, resetFrag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')); // Needs to be done for the checking below
|
||||||
|
|
||||||
if (Game.cpsSucked > 0) {
|
if (Game.cpsSucked > 0) {
|
||||||
stats.appendChild(header('Wrinklers', 'Wrink'));
|
stats.appendChild(header('Wrinklers', 'Wrink'));
|
||||||
if (CM.Config.StatsPref.Wrink) {
|
if (CM.Config.StatsPref.Wrink || (CM.Config.StatsPref.Sea && choEgg)) {
|
||||||
var sucked = 0;
|
var sucked = 0;
|
||||||
for (var i in Game.wrinklers) {
|
for (var i in Game.wrinklers) {
|
||||||
sucked += Game.wrinklers[i].sucked;
|
sucked += Game.wrinklers[i].sucked;
|
||||||
}
|
}
|
||||||
sucked *= 1.1;
|
sucked *= 1.1;
|
||||||
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
||||||
|
|
||||||
|
if (CM.Config.StatsPref.Wrink) {
|
||||||
var popAllFrag = document.createDocumentFragment();
|
var popAllFrag = document.createDocumentFragment();
|
||||||
popAllFrag.appendChild(document.createTextNode(Beautify(sucked) + ' '));
|
popAllFrag.appendChild(document.createTextNode(Beautify(sucked) + ' '));
|
||||||
|
|
||||||
var popAllA = document.createElement('a');
|
var popAllA = document.createElement('a');
|
||||||
popAllA.textContent = 'Pop All';
|
popAllA.textContent = 'Pop All';
|
||||||
popAllA.className = 'option';
|
popAllA.className = 'option';
|
||||||
@@ -1059,6 +1062,7 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
stats.appendChild(listing('Rewards of Popping', popAllFrag));
|
stats.appendChild(listing('Rewards of Popping', popAllFrag));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var specDisp = false;
|
var specDisp = false;
|
||||||
var halloCook = [];
|
var halloCook = [];
|
||||||
@@ -1096,7 +1100,6 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
specDisp = true;
|
specDisp = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
|
||||||
|
|
||||||
if (Game.season == 'christmas' || specDisp || choEgg) {
|
if (Game.season == 'christmas' || specDisp || choEgg) {
|
||||||
stats.appendChild(header('Season Specials', 'Sea'));
|
stats.appendChild(header('Season Specials', 'Sea'));
|
||||||
@@ -1165,7 +1168,11 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
choEggTitleSpan.style.verticalAlign = 'bottom';
|
choEggTitleSpan.style.verticalAlign = 'bottom';
|
||||||
choEggTitleSpan.textContent = '?';
|
choEggTitleSpan.textContent = '?';
|
||||||
choEggTitleFrag.appendChild(choEggTitleSpan);
|
choEggTitleFrag.appendChild(choEggTitleSpan);
|
||||||
var choEggTotal = (Game.cookies + CM.Cache.SellAllTotal) * 0.05;
|
var choEggTotal = Game.cookies + CM.Cache.SellAllTotal;
|
||||||
|
if (Game.cpsSucked > 0) {
|
||||||
|
choEggTotal += sucked;
|
||||||
|
}
|
||||||
|
choEggTotal *= 0.05;
|
||||||
stats.appendChild(listing(choEggTitleFrag, document.createTextNode(Beautify(choEggTotal))));
|
stats.appendChild(listing(choEggTitleFrag, document.createTextNode(Beautify(choEggTotal))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user