Skip to content

Commit

Permalink
ascension
Browse files Browse the repository at this point in the history
  • Loading branch information
suddjian committed Oct 25, 2023
1 parent 52df111 commit ab7bf87
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/cookieclickermanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ function getShopItemsSortedByProfitability() {
name: upgrade.name,
upgrade,
l: store.querySelector(`#store .upgrade[data-id='${upgrade.id}']`),
profitability: getUpgradeCps(upgrade) / upgrade.getPrice(),
profitability: upgrade.pool === "toggle" ? 0 : getUpgradeCps(upgrade) / upgrade.getPrice(),
}));
var shopitems = [...products, ...upgrades];
for (let item in shopitems) {
if (isNaN(item)) {
for (let item of shopitems) {
if (isNaN(item.profitability)) {
console.warn(`Cookie manager: Be advised, bad profitability calculation for ${item.name}`);
console.warn(item);
}
}
shopitems = shopitems.filter(item => !isNaN(item.profitability));
shopitems.sort((a, b) => b.profitability - a.profitability);
return shopitems;
}
Expand Down Expand Up @@ -111,7 +113,7 @@ function getUpgradeCps(upgrade) {
if (upgrade.pool === "cookie") {
return extractPercent(upgrade.desc) * Game.cookiesPs;
}
if (/golden cookie/i.test(upgrade.desc)) {
if (/^golden cookie/i.test(upgrade.desc)) {
return 0.07 * Game.cookiesPs;
}
if (upgrade.pool === "kitten" || /^kitten /i.test(upgrade.name)) {
Expand All @@ -120,6 +122,10 @@ function getUpgradeCps(upgrade) {
if (/^cookie production multiplier /i.test(upgrade.desc)) {
return Game.cookiesPs * extractPercent(upgrade.desc);
}
if (/potential of your prestige level/i.test(upgrade.desc)) {
const heavenlyMultiplier = parseFloat(Game.prestige)*Game.heavenlyPower*Game.GetHeavenlyMultiplier()*0.01;
return Game.cookiesPs * heavenlyMultiplier;
}
if (upgrade.buildingTie) {
return getProductCps(upgrade.buildingTie) * upgrade.buildingTie.amount;
}
Expand Down

0 comments on commit ab7bf87

Please sign in to comment.