diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..db39be5 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "features": { + "ghcr.io/r3dpoint/devcontainer-features/tailwindcss-standalone-cli:1": {} + }, + + "postCreateCommand": "npm i" + +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index f7bf2ef..014291d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /node_modules /lib -/mclick-theme/node_modules \ No newline at end of file +/mclick-theme/node_modules diff --git a/mclick-counter/src/index.js b/mclick-counter/src/index.js index 69f75ab..6e8f867 100644 --- a/mclick-counter/src/index.js +++ b/mclick-counter/src/index.js @@ -1,7 +1,11 @@ -export default class MclickCounter { + +class MclickCounter { constructor(initialValue = 0n) { this.value = BigInt(initialValue); } + version() { + return '0.7.0'; + } increment(amount = 1n) { this.value += BigInt(amount); @@ -15,7 +19,7 @@ export default class MclickCounter { return this.value; } - // Format as words (e.g., "1.2 million", "3.4 billion", etc.) + // Format as words (e.g., "1.2 million", "3.4 billion", etc.) format() { const units = [ { suffix: "decillion", value: 10n ** 33n }, @@ -41,4 +45,4 @@ export default class MclickCounter { return this.value.toString(); // just show number for small values } -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 84bc46f..ce71fd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "dependencies": { "@tailwindcss/cli": "^4.1.4", "express": "^5.1.0", + "mclick-counter": "0.7.0", "mclick-theme": "^0.7.0" }, "devDependencies": { @@ -1324,6 +1325,11 @@ "node": ">= 0.4" } }, + "node_modules/mclick-counter": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/mclick-counter/-/mclick-counter-0.7.0.tgz", + "integrity": "sha512-yqiLH/IWhiZh9q2GAnq375+yiEciG5Ma53Dz+r6DI4jbbK00lXVnAQXbYJdNZs+Yn9itqH5PUn9e+n3LSoIflA==" + }, "node_modules/mclick-theme": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/mclick-theme/-/mclick-theme-0.7.0.tgz", diff --git a/package.json b/package.json index e77ed73..118360e 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "dependencies": { "@tailwindcss/cli": "^4.1.4", "express": "^5.1.0", - "mclick-theme": "^0.7.0" + "mclick-theme": "^0.7.0", + "mclick-counter": "0.7.0" } } diff --git a/src/index.js b/src/index.js index 10f59b0..8506b87 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,5 @@ //variables //sets variable called score to zero - var score = 0; var cursorCost = 2; var cursors = 0; @@ -13,7 +12,53 @@ var superclicker = 0 var superclickerCost = 1000 var Ultraclicker = 2000 var UltraclickerCost = 0 +var prestigePoints = 0 //prestige points +var requiredMoney = 1000000 //money required to prestige +var prestigeMultiplier = 1.2 //multiplier for prestige points +function constructor(initialValue = 0n) +{ + this.value = BigInt(initialValue); +} +function increment(amount = 1n) +{ + this.value += BigInt(amount); +} +function set(value) +{ + this.value = BigInt(value); +} +function get() +{ + console.log(this.value) +} +// Format as words (e.g., "1.2 million", "3.4 billion", etc.) +function format(value) +{ + this.value = BigInt(value); + const units = [ + { suffix: "decillion", value: 10n ** 33n }, + { suffix: "nonillion", value: 10n ** 30n }, + { suffix: "octillion", value: 10n ** 27n }, + { suffix: "septillion", value: 10n ** 24n }, + { suffix: "sextillion", value: 10n ** 21n }, + { suffix: "quintillion", value: 10n ** 18n }, + { suffix: "quadrillion", value: 10n ** 15n }, + { suffix: "trillion", value: 10n ** 12n }, + { suffix: "billion", value: 10n ** 9n }, + { suffix: "million", value: 10n ** 6n }, + { suffix: "thousand", value: 10n ** 3n } + ]; + + for (const unit of units) { + if (this.value >= unit.value) { + const whole = this.value / unit.value; + const decimal = (this.value % unit.value) / (unit.value / 10n); + return `${whole}.${decimal} ${unit.suffix}`; + } + } + return this.value.toString(); // just show number for small values +} //load the save on the website loading window.onload = function() { Load() @@ -47,11 +92,13 @@ function BuySuperCursors() { function getmoney() { + var formatedScorse = format(score) + document.getElementById("score").innerHTML = formatedScorse; score = score + clickPower; game.clicks++; game.totalMoney += clickPower; - document.getElementById("score").innerHTML = score; + //document.getElementById("score").innerHTML = formatedScorse; } @@ -135,6 +182,7 @@ const game = { clicks: 0, totalMoney: 0, clickers: 0, + prestigePoints: 0, // Other game properties }; @@ -175,16 +223,18 @@ const achievements = [ description: "click one million times. grazy to get without an auto clicker", condition: (game) => game.clicks >= 1000, unlocked: false + }, + { + id: "first_prestige", + name: "Prestige!", + description: "Prestige for the first time.", + condition: (game) => game.prestigePoints >= 1, + unlocked: false } ]; - // advancements - - - - function displayAchievement(achievement) { let container = document.getElementById("achievement-container"); if (!container) { @@ -222,14 +272,6 @@ function displayAchievement(achievement) { } - - - - - - - - function checkAchievements() { achievements.forEach(achievement => { if (!achievement.unlocked && achievement.condition(game)) { @@ -250,7 +292,6 @@ function disableclickerbuy() { } // building upgrades - function buyclicker() { if (score == clickerCost) { clicker++ @@ -277,3 +318,17 @@ function Ultraclickerbuys() { disableUltraclicker() } } + +// prestige system +function givePrestigePoints() { + if (game.totalMoney >= requiredMoney) { + prestigePoints++; + game.totalMoney = 0; // Reset total money after prestiging + game.clicks = 0; + game.clickers = 0; + game.prestigePoints += 1; + game.clickPower = Math.round(game.clickPower * prestigeMultiplier); + clickPower = game.clickPower; + } +} +