Created RIgidel mode #694
This commit is contained in:
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js
vendored
2
dist/CookieMonster.js
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-restricted-syntax */
|
|
||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
/** Functions related to the Dragon */
|
/** Functions related to the Dragon */
|
||||||
|
|
||||||
@@ -52,28 +51,27 @@ export default function CacheDragonCost() {
|
|||||||
} else {
|
} else {
|
||||||
let cost = 0;
|
let cost = 0;
|
||||||
CopyData();
|
CopyData();
|
||||||
for (const j of Object.keys(Game.Objects)) {
|
Object.keys(Game.Objects).forEach((j) => {
|
||||||
target = j;
|
target = j;
|
||||||
if (Game.Objects[target].amount < amount) {
|
if (Game.Objects[target].amount < amount) {
|
||||||
CacheCostDragonUpgrade = 'Not enough buildings to sell';
|
CacheCostDragonUpgrade = 'Not enough buildings to sell';
|
||||||
break;
|
return;
|
||||||
} else {
|
}
|
||||||
for (let i = 0; i < amount; i++) {
|
for (let i = 0; i < amount; i++) {
|
||||||
let price =
|
let price =
|
||||||
SimObjects[target].basePrice *
|
SimObjects[target].basePrice *
|
||||||
Game.priceIncrease **
|
Game.priceIncrease **
|
||||||
Math.max(
|
Math.max(
|
||||||
0,
|
0,
|
||||||
SimObjects[target].amount - 1 - SimObjects[target].free,
|
SimObjects[target].amount - 1 - SimObjects[target].free,
|
||||||
);
|
);
|
||||||
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
price = Game.modifyBuildingPrice(SimObjects[target], price);
|
||||||
price = Math.ceil(price);
|
price = Math.ceil(price);
|
||||||
cost += price;
|
cost += price;
|
||||||
SimObjects[target].amount -= 1;
|
SimObjects[target].amount -= 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
CacheCostDragonUpgrade = `Cost to rebuy: ${Beautify(cost)}`;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CacheLastDragonLevel = Game.dragonLevel;
|
CacheLastDragonLevel = Game.dragonLevel;
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ import ColourOfPP from './ColourOfPP';
|
|||||||
*/
|
*/
|
||||||
function CacheColor(target, amount) {
|
function CacheColor(target, amount) {
|
||||||
Object.keys(target).forEach((i) => {
|
Object.keys(target).forEach((i) => {
|
||||||
|
if (CMOptions.PPRigidelMode && amount === 1) {
|
||||||
|
target.color = ColorGray;
|
||||||
|
return;
|
||||||
|
}
|
||||||
target[i].color = ColourOfPP(
|
target[i].color = ColourOfPP(
|
||||||
target[i],
|
target[i],
|
||||||
Game.Objects[i].getSumPrice(amount),
|
Game.Objects[i].getSumPrice(amount),
|
||||||
@@ -39,7 +43,8 @@ function CachePP(target, amount) {
|
|||||||
Game.cookiesPs +
|
Game.cookiesPs +
|
||||||
price / target[i].bonus;
|
price / target[i].bonus;
|
||||||
} else target[i].pp = price / target[i].bonus;
|
} else target[i].pp = price / target[i].bonus;
|
||||||
CachePPArray.push([target[i].pp, amount]);
|
if (!(CMOptions.PPRigidelMode && amount === 1))
|
||||||
|
CachePPArray.push([target[i].pp, amount]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -221,6 +221,13 @@ const Config = {
|
|||||||
'Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values',
|
'Makes CookieMonster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
|
PPRigidelMode: new SettingStandard(
|
||||||
|
'bool',
|
||||||
|
'Calculation',
|
||||||
|
["Don't Ignore Any", 'Ignore All Buy 1 Options'],
|
||||||
|
'Makes CookieMonster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel',
|
||||||
|
true,
|
||||||
|
),
|
||||||
PPSecondsLowerLimit: new SettingInputNumber(
|
PPSecondsLowerLimit: new SettingInputNumber(
|
||||||
'numscale',
|
'numscale',
|
||||||
'Calculation',
|
'Calculation',
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const ConfigDefault = {
|
|||||||
AvgCPSHist: 3,
|
AvgCPSHist: 3,
|
||||||
AvgClicksHist: 0,
|
AvgClicksHist: 0,
|
||||||
PPExcludeTop: 0,
|
PPExcludeTop: 0,
|
||||||
|
PPRigidelMode: 0,
|
||||||
PPSecondsLowerLimit: 0,
|
PPSecondsLowerLimit: 0,
|
||||||
PPOnlyConsiderBuyable: 0,
|
PPOnlyConsiderBuyable: 0,
|
||||||
ToolWarnBon: 1,
|
ToolWarnBon: 1,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-restricted-syntax */
|
|
||||||
import {
|
import {
|
||||||
CacheObjects1,
|
CacheObjects1,
|
||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
@@ -76,6 +75,9 @@ export default function Building() {
|
|||||||
// Add "production left till next achievement"-bar
|
// Add "production left till next achievement"-bar
|
||||||
l('CMTooltipProductionHeader').style.display = 'none';
|
l('CMTooltipProductionHeader').style.display = 'none';
|
||||||
l('CMTooltipTime').style.marginBottom = '0px';
|
l('CMTooltipTime').style.marginBottom = '0px';
|
||||||
|
|
||||||
|
// Can this ESLint error be solved while retaining the functionality of break?
|
||||||
|
// eslint-disable-next-line no-restricted-syntax
|
||||||
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
|
for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) {
|
||||||
if (
|
if (
|
||||||
!Game.HasAchiev(
|
!Game.HasAchiev(
|
||||||
|
|||||||
Reference in New Issue
Block a user