[Automated] Merge dev into gh-pages
This commit is contained in:
19
.github/CONTRIBUTING.md
vendored
19
.github/CONTRIBUTING.md
vendored
@@ -2,17 +2,18 @@ Cookie Monster is written to modify Cookie Clicker as little as possible. This m
|
||||
|
||||
The following is a short description of the various `src` directories and their contents:
|
||||
|
||||
JS | Description
|
||||
-- | -
|
||||
Cache | Functions related to creating and storing data cache
|
||||
Config | Functions related to manipulating CM configuration
|
||||
Data | Hard coded values
|
||||
Disp | Functions related to displaying CM's UI
|
||||
InitSaveLoad | Functions related to registering the CM object with the Game's Modding API
|
||||
Main | Functions related to the main loop and initializing CM
|
||||
Sim | Functions related to simulate something
|
||||
| JS | Description |
|
||||
| ------------ | -------------------------------------------------------------------------- |
|
||||
| Cache | Functions related to creating and storing data cache |
|
||||
| Config | Functions related to manipulating CM configuration |
|
||||
| Data | Hard coded values |
|
||||
| Disp | Functions related to displaying CM's UI |
|
||||
| InitSaveLoad | Functions related to registering the CM object with the Game's Modding API |
|
||||
| Main | Functions related to the main loop and initializing CM |
|
||||
| Sim | Functions related to simulate something |
|
||||
|
||||
These are some additional guidelines:
|
||||
|
||||
- Try to use DOM as much as possible instead of using string manipulation to modify HTML.
|
||||
- Please be descriptive of your commits. If the commit is related to an issue or PR, please add the issue/PR number to the commit message.
|
||||
- PR's should target the `dev` branch
|
||||
|
||||
8
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
8
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -16,8 +16,7 @@ body:
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: Bug description
|
||||
description:
|
||||
What is the bug about?
|
||||
description: What is the bug about?
|
||||
placeholder: |
|
||||
# Please describe the bug and what you would have expected the mod to do
|
||||
validations:
|
||||
@@ -26,10 +25,9 @@ body:
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: To reproduce
|
||||
description:
|
||||
How can you reproduce the bug?
|
||||
description: How can you reproduce the bug?
|
||||
placeholder: |
|
||||
The steps needed to reproduce the behavior:
|
||||
The steps needed to reproduce the behavior:
|
||||
1.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
3
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
3
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
@@ -16,8 +16,7 @@ body:
|
||||
id: what-is-wanted
|
||||
attributes:
|
||||
label: Feature description
|
||||
description:
|
||||
Describe the function you'd like to see added to CookieMonster
|
||||
description: Describe the function you'd like to see added to CookieMonster
|
||||
placeholder: |
|
||||
# A clear and concise description of what you want to happen.
|
||||
validations:
|
||||
|
||||
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
@@ -5,7 +5,7 @@
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/" # Location of package manifests
|
||||
- package-ecosystem: 'npm'
|
||||
directory: '/' # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: 'weekly'
|
||||
|
||||
58
.github/workflows/CI.yml
vendored
58
.github/workflows/CI.yml
vendored
@@ -12,32 +12,32 @@ jobs:
|
||||
env:
|
||||
GITHUB_REGISTERY_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Run ESLint
|
||||
run: npx eslint src
|
||||
- name: Run Mocha tests
|
||||
run: npx mocha
|
||||
- name: Check if CookieMonsterDev.js is built correctly
|
||||
run: |
|
||||
npx webpack -o ./tmp --env minimize
|
||||
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
|
||||
echo '### SUCCESS: CookieMonsterDev is built correctly! ###'
|
||||
else
|
||||
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build-dev" after saving all your changes! ###'
|
||||
exit 1
|
||||
fi
|
||||
- name: Check if CookieMonster.js is built correctly
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
npx webpack -o ./tmp --env minimize --env finalfile
|
||||
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
|
||||
echo '### SUCCESS: CookieMonster is built correctly! ###'
|
||||
else
|
||||
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build-final" after saving all your changes! ###'
|
||||
exit 1
|
||||
fi
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Run ESLint
|
||||
run: npx eslint src
|
||||
- name: Run Mocha tests
|
||||
run: npx mocha
|
||||
- name: Check if CookieMonsterDev.js is built correctly
|
||||
run: |
|
||||
npx webpack -o ./tmp --env minimize
|
||||
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
|
||||
echo '### SUCCESS: CookieMonsterDev is built correctly! ###'
|
||||
else
|
||||
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build-dev" after saving all your changes! ###'
|
||||
exit 1
|
||||
fi
|
||||
- name: Check if CookieMonster.js is built correctly
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
npx webpack -o ./tmp --env minimize --env finalfile
|
||||
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
|
||||
echo '### SUCCESS: CookieMonster is built correctly! ###'
|
||||
else
|
||||
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build-final" after saving all your changes! ###'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
2
.github/workflows/publish-dev.yml
vendored
2
.github/workflows/publish-dev.yml
vendored
@@ -2,7 +2,7 @@ name: Publish
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "dev"
|
||||
- 'dev'
|
||||
jobs:
|
||||
publish-dev:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
17
.pre-commit-config.yaml
Normal file
17
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: v2.7.1
|
||||
hooks:
|
||||
- id: prettier
|
||||
args:
|
||||
- '--print-width=100'
|
||||
- '--single-quote'
|
||||
- '--trailing-comma=all'
|
||||
exclude: &build 'CookieMonster(Dev)?.js(.map)?'
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.3.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
exclude: *build
|
||||
- id: end-of-file-fixer
|
||||
exclude: *build
|
||||
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
||||
|
||||
36
README.md
36
README.md
@@ -3,7 +3,7 @@
|
||||
## 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.
|
||||
The mod helps you to *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**.
|
||||
The mod helps you to _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
|
||||
|
||||
@@ -13,7 +13,7 @@ Github Pages is hosted from the `gh-pages` branch
|
||||
|
||||
### What it does
|
||||
|
||||
At its core, Cookie Monster computes an index for both buildings and upgrades: the **Payback Period (PP)**. CM will take *everything* in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, CM will know and highlight that building's value. CM uses the following formula to calculate the PP:
|
||||
At its core, Cookie Monster computes an index for both buildings and upgrades: the **Payback Period (PP)**. CM will take _everything_ in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, CM will know and highlight that building's value. CM uses the following formula to calculate the PP:
|
||||
|
||||
```javascript
|
||||
max(cost - cookies in bank, 0)/cps + cost/Δ cps
|
||||
@@ -23,14 +23,14 @@ If the relevant option is enabled, CM will color-code each of them based on thei
|
||||
|
||||
<details>
|
||||
<summary>The following standard colours are used:</summary>
|
||||
|
||||
* Light Blue: (upgrades) This item has a better PP than the best building to buy
|
||||
* Green: This building has the best PP
|
||||
* Yellow: This building is within the top 10 of best PP's
|
||||
* Orange: This building is within the top 20 of best PP's
|
||||
* Red: This building is within the top 30 of best PP's
|
||||
* Purple: This building is worse than the top 10 of best PP's
|
||||
* Gray: This item does not have a PP, often this means that there is no change to CPS
|
||||
|
||||
- Light Blue: (upgrades) This item has a better PP than the best building to buy
|
||||
- Green: This building has the best PP
|
||||
- Yellow: This building is within the top 10 of best PP's
|
||||
- Orange: This building is within the top 20 of best PP's
|
||||
- Red: This building is within the top 30 of best PP's
|
||||
- Purple: This building is worse than the top 10 of best PP's
|
||||
- Gray: This item does not have a PP, often this means that there is no change to CPS
|
||||
|
||||
</details>
|
||||
|
||||
@@ -45,7 +45,7 @@ Copy this code and save it as a bookmark. Paste it in the URL section. To activa
|
||||
```javascript
|
||||
javascript: (function () {
|
||||
Game.LoadMod('https://cookiemonsterteam.github.io/CookieMonster/dist/CookieMonster.js');
|
||||
}());
|
||||
})();
|
||||
```
|
||||
|
||||
If (for some reason) the above doesn't work, trying pasting everything after the <code>javascript:</code> bit into your browser's console.
|
||||
@@ -80,10 +80,10 @@ Before pushing a new version to `main` and Github pages use the `build-final` co
|
||||
|
||||
## Contributors
|
||||
|
||||
* **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
||||
* **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
|
||||
* **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
|
||||
* **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
||||
* **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
||||
* **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer
|
||||
* **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer
|
||||
- **[Raving_Kumquat](https://cookieclicker.wikia.com/wiki/User:Raving_Kumquat)**: Original author
|
||||
- **[Maxime Fabre](https://github.com/Anahkiasen)**: Previous maintainer
|
||||
- **[BlackenedGem](https://github.com/BlackenedGem)**: Golden/Wrath Cookie Favicons
|
||||
- **[Sandworm](https://github.com/svschouw)**: Modified PP calculation
|
||||
- **[Aktanusa](https://github.com/Aktanusa)**: Current maintainer
|
||||
- **[DanielNoord](https://github.com/DanielNoord)**: Current maintainer
|
||||
- **[bitsandbytes1708](https://github.com/bitsandbytes1708)**: Current maintainer
|
||||
|
||||
2
dist/CookieMonster.js.map
vendored
2
dist/CookieMonster.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/CookieMonsterDev.js.map
vendored
2
dist/CookieMonsterDev.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -15,8 +15,11 @@ export default function CacheDragonCost() {
|
||||
Game.dragonLevel < 25 &&
|
||||
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
|
||||
) {
|
||||
const objectMatch = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/);
|
||||
let target = objectMatch !== null ? objectMatch[1] : Game.ObjectsById[Game.dragonLevel-5].name;
|
||||
const objectMatch = Game.dragonLevels[Game.dragonLevel].buy
|
||||
.toString()
|
||||
.match(/Objects\[(.*)\]/);
|
||||
let target =
|
||||
objectMatch !== null ? objectMatch[1] : Game.ObjectsById[Game.dragonLevel - 5].name;
|
||||
const amount = Game.dragonLevels[Game.dragonLevel].buy
|
||||
.toString()
|
||||
.match(/sacrifice\((.*?)\)/)[1];
|
||||
|
||||
@@ -19,10 +19,7 @@ export default function FormatTime(time, longFormat) {
|
||||
|
||||
if (Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat === 0) {
|
||||
if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||
str +=
|
||||
y > 0
|
||||
? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, `
|
||||
: '';
|
||||
str += y > 0 ? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` : '';
|
||||
if (str.length > 0 || d > 0)
|
||||
str += `${d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd')}, `;
|
||||
if (str.length > 0 || h > 0)
|
||||
|
||||
@@ -13,7 +13,8 @@ export default function AddMenu() {
|
||||
title.textContent = 'Cookie Monster Statistics';
|
||||
AddMenuStats(title);
|
||||
}
|
||||
} else if (Game.onMenu === 'prefs') { // Added because Framework is broken
|
||||
} else if (Game.onMenu === 'prefs') {
|
||||
// Added because Framework is broken
|
||||
l('menu').childNodes[2].insertBefore(
|
||||
createMenuOptions(),
|
||||
l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1],
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import Beautify from '../../BeautifyAndFormatting/Beautify';
|
||||
import GetTimeColour from '../../BeautifyAndFormatting/GetTimeColour';
|
||||
import CalculateGrimoireRefillTime from '../../HelperFunctions/CalculateGrimoireRefillTime';
|
||||
@@ -56,13 +55,7 @@ export default function Grimoire() {
|
||||
const reward = document.createElement('span');
|
||||
reward.style.color = '#33FF00';
|
||||
reward.textContent = Beautify(
|
||||
Math.max(
|
||||
Math.min(
|
||||
Game.cookies * 0.15,
|
||||
Game.cookiesPs * 60 * 30
|
||||
),
|
||||
7
|
||||
),
|
||||
Math.max(Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 30), 7),
|
||||
2,
|
||||
);
|
||||
conjure.appendChild(reward);
|
||||
@@ -72,14 +65,8 @@ export default function Grimoire() {
|
||||
const loss = document.createElement('span');
|
||||
loss.style.color = 'red';
|
||||
loss.textContent = Beautify(
|
||||
Math.min(
|
||||
Game.cookies,
|
||||
Math.min(
|
||||
Game.cookies * 0.15,
|
||||
Game.cookiesPs * 60 * 15
|
||||
) + 13
|
||||
),
|
||||
2
|
||||
Math.min(Game.cookies, Math.min(Game.cookies * 0.15, Game.cookiesPs * 60 * 15) + 13),
|
||||
2,
|
||||
);
|
||||
conjure.appendChild(loss);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ function ReplaceNativeGrimoireDraw() {
|
||||
minigame.magicBarTextL.innerHTML += ` (${FormatTime(
|
||||
CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM),
|
||||
)})`;
|
||||
minigame.magicBarL.style.width = "75%" // TODO: Fix this after Orteil pushes fix to main game;
|
||||
minigame.magicBarL.style.width = '75%'; // TODO: Fix this after Orteil pushes fix to main game;
|
||||
}
|
||||
};
|
||||
HasReplaceNativeGrimoireDraw = true;
|
||||
|
||||
@@ -67,7 +67,7 @@ export default function ReplaceNative() {
|
||||
l('bigCookie').addEventListener(
|
||||
'click',
|
||||
(event) => {
|
||||
FixMouseY(()=> Game.ClickCookie(event,0));
|
||||
FixMouseY(() => Game.ClickCookie(event, 0));
|
||||
},
|
||||
false,
|
||||
);
|
||||
|
||||
@@ -134,7 +134,8 @@ export default function CalculateGains() {
|
||||
if (SimHas('Kitten specialists')) catMult *= 1 + milkProgress * 0.2 * milkMult;
|
||||
if (SimHas('Kitten experts')) catMult *= 1 + milkProgress * 0.2 * milkMult;
|
||||
if (SimHas('Kitten consultants')) catMult *= 1 + milkProgress * 0.2 * milkMult;
|
||||
if (SimHas('Kitten assistants to the regional manager')) catMult *= 1 + milkProgress * 0.175 * milkMult;
|
||||
if (SimHas('Kitten assistants to the regional manager'))
|
||||
catMult *= 1 + milkProgress * 0.175 * milkMult;
|
||||
if (SimHas('Kitten marketeers')) catMult *= 1 + milkProgress * 0.15 * milkMult;
|
||||
if (SimHas('Kitten analysts')) catMult *= 1 + milkProgress * 0.125 * milkMult;
|
||||
if (SimHas('Kitten executives')) catMult *= 1 + milkProgress * 0.115 * milkMult;
|
||||
|
||||
@@ -12,8 +12,8 @@ export default function SimAuraMult(what) {
|
||||
n = 1;
|
||||
if (
|
||||
Game.dragonAuras[SimDragonAura].name === 'Reality Bending' ||
|
||||
Game.dragonAuras[SimDragonAura2].name === 'Reality Bending' &&
|
||||
Game.dragonLevel >= Game.dragonAurasBN[what].id + 4
|
||||
(Game.dragonAuras[SimDragonAura2].name === 'Reality Bending' &&
|
||||
Game.dragonLevel >= Game.dragonAurasBN[what].id + 4)
|
||||
)
|
||||
n += 0.1;
|
||||
return n;
|
||||
|
||||
@@ -5,15 +5,19 @@ import SimHas from './SimHas';
|
||||
* This functions creates functions similarly to Game.GetTieredCpsMult but checks Sim Data instead of Game Data
|
||||
*/
|
||||
export default function SimGetTieredCpsMult(me) {
|
||||
|
||||
let mult = 1;
|
||||
Object.keys(me.tieredUpgrades).forEach((i) => {
|
||||
if (!Game.Tiers[me.tieredUpgrades[i].tier].special && SimHas(me.tieredUpgrades[i].name)){
|
||||
let tierMult=2;
|
||||
// unshackled multipliers
|
||||
if (Game.ascensionMode!==1 && SimHas(me.unshackleUpgrade) && SimHas(Game.Tiers[me.tieredUpgrades[i].tier].unshackleUpgrade)) tierMult+=me.id===1?0.5:(20-me.id)*0.1;
|
||||
mult*=tierMult;
|
||||
};
|
||||
if (!Game.Tiers[me.tieredUpgrades[i].tier].special && SimHas(me.tieredUpgrades[i].name)) {
|
||||
let tierMult = 2;
|
||||
// unshackled multipliers
|
||||
if (
|
||||
Game.ascensionMode !== 1 &&
|
||||
SimHas(me.unshackleUpgrade) &&
|
||||
SimHas(Game.Tiers[me.tieredUpgrades[i].tier].unshackleUpgrade)
|
||||
)
|
||||
tierMult += me.id === 1 ? 0.5 : (20 - me.id) * 0.1;
|
||||
mult *= tierMult;
|
||||
}
|
||||
});
|
||||
Object.keys(me.synergies).forEach((i) => {
|
||||
if (SimHas(me.synergies[i].name)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SimGod1, SimGod2, SimGod3, SimObjects } from '../VariablesAndData';
|
||||
import SimHasAura from './SimHasAura'
|
||||
import SimHasAura from './SimHasAura';
|
||||
|
||||
/**
|
||||
* This function checks for the current God level in the sim data
|
||||
@@ -16,13 +16,13 @@ export default function SimHasGod(what) {
|
||||
return 1;
|
||||
}
|
||||
if (SimGod2 === god.id) {
|
||||
if (SimHasAura('Supreme Intellect')){
|
||||
if (SimHasAura('Supreme Intellect')) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
if (SimGod3 === god.id) {
|
||||
if (SimHasAura('Supreme Intellect')){
|
||||
if (SimHasAura('Supreme Intellect')) {
|
||||
return 2;
|
||||
}
|
||||
return 3;
|
||||
|
||||
@@ -33,7 +33,7 @@ function MouseCps() {
|
||||
if (SimHas('Octillion fingers')) add *= 20;
|
||||
if (SimHas('Nonillion fingers')) add *= 20;
|
||||
if (SimHas('Decillion fingers')) add *= 20;
|
||||
if (SimHas('Unshackled cursors')) add*= 25;
|
||||
if (SimHas('Unshackled cursors')) add *= 25;
|
||||
let num = 0;
|
||||
Object.keys(SimObjects).forEach((i) => {
|
||||
num += SimObjects[i].amount;
|
||||
|
||||
Reference in New Issue
Block a user