diff --git a/ck+/data.json b/ck+/data.json index f697b6a..98046cc 100644 --- a/ck+/data.json +++ b/ck+/data.json @@ -1,4 +1,8 @@ { + + "feature_flags": { + "badge_boost": true + }, "encounter_pools": { "fishing": [ { diff --git a/ck+/script/calc.js b/ck+/script/calc.js index bfbb526..a853c6b 100644 --- a/ck+/script/calc.js +++ b/ck+/script/calc.js @@ -111,18 +111,23 @@ function getDamage(attacker, defender, attackerStages, defenderStages, move, pla // Badge boost var attackerBoost = player || (attacker.transformStats !== undefined); var defenderBoost = !player || (defender.transformStats !== undefined); - if (attackerBoost && !special && badges >= attackBadges) { - a = parseInt(a * 1.125); - } - if (defenderBoost && !special && badges >= defenseBadges) { - d = parseInt(d * 1.125); - } - if (attackerBoost && special && badges >= specialBadges) { - a = parseInt(a * 1.125); - } - if (defenderBoost && special && badges >= specialBadges) { - d = parseInt(d * 1.125); + + + if (game_general_flags.badge_boost) { + if (attackerBoost && !special && badges >= attackBadges) { + a = parseInt(a * 1.125); + } + if (defenderBoost && !special && badges >= defenseBadges) { + d = parseInt(d * 1.125); + } + if (attackerBoost && special && badges >= specialBadges) { + a = parseInt(a * 1.125); + } + if (defenderBoost && special && badges >= specialBadges) { + d = parseInt(d * 1.125); + } } + // Screens if (player) { if (!special && document.getElementById("enemy-reflect").checked) { @@ -192,7 +197,7 @@ function getModdedDamage(v, attacker, defender, ap, dp, power, type, move, playe // TODO if (weather) - if (player && badgeTypes.has(type) && badgeTypes.get(type) <= badges) { + if (player && game_general_flags.badge_boost && badgeTypes.has(type) && badgeTypes.get(type) <= badges) { v = parseInt(v * 1.125); } diff --git a/ck+/script/data.js b/ck+/script/data.js index 26ea01d..bff6030 100644 --- a/ck+/script/data.js +++ b/ck+/script/data.js @@ -218,6 +218,12 @@ var doubleHitMoves = new Set([ "bonemerang", "double-hit", "double-kick", "twineedle" ]); +//ADD GENERAL FLAGS OBJECT TO GLOBAL VARIABLES +const game_general_flags = { + badge_boost: true +} + + function fetchData() { fetch("./data.json") .then(response => response.text()) @@ -315,6 +321,11 @@ function fetchData() { addPoolInfo(j.encounters[i]); } + //ADD GENERAL FLAGS TO DATA PARSE + const feature_flags = j.feature_flags; + game_general_flags.badge_boost = feature_flags.badge_boost; + + var pokemonDataList; for (const p of pokemonByName.keys()) { pokemonDataList += `