From d9f2a5a0e688e9c069964cfbba2431a152823faf Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 12 Sep 2020 23:20:13 -0400 Subject: [PATCH 1/4] Initial minigame for finding shinies on map Currently only Magikarp have their shinies released. Just like Pokemon GO. --- src/configs/default.json | 5 ++++- src/data/default.js | 1 - src/routes/ui.js | 3 +++ src/views/index.mustache | 2 ++ static/js/index.js | 29 ++++++++++++++++++++++++++--- 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/configs/default.json b/src/configs/default.json index c6e587fb..a101f48e 100644 --- a/src/configs/default.json +++ b/src/configs/default.json @@ -256,5 +256,8 @@ 407,416,424,429,430,433,438,439,440,442,446,447,448,458,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,532,533,534,559, 560,599,600,601,627,628 ] - } + }, + "shinyRates": { + "129-f253": 512 + } } diff --git a/src/data/default.js b/src/data/default.js index c35270e7..89c00b72 100644 --- a/src/data/default.js +++ b/src/data/default.js @@ -38,6 +38,5 @@ data.default_show_submission_cells = config.map.filters.submissionCells; data.default_show_nests = config.map.filters.nests; data.default_show_scan_areas = config.map.filters.scanAreas; data.default_show_devices = config.map.filters.devices; -data.pokemon_rarity_json = JSON.stringify(config.rarity); module.exports = data; diff --git a/src/routes/ui.js b/src/routes/ui.js index dd31668f..e2c6515a 100644 --- a/src/routes/ui.js +++ b/src/routes/ui.js @@ -193,6 +193,9 @@ const handlePage = async (req, res) => { data.min_zoom = config.map.minZoom || 10; data.max_zoom = config.map.maxZoom || 18; + data.pokemon_rarity_json = JSON.stringify(config.rarity); + data.pokemon_shiny_rates_json = JSON.stringify(config.shinyRates); + data.locale_last_modified = (await fs.promises.stat(path.resolve(__dirname, `../../static/locales/${data.locale}.json`))).mtimeMs; data.css_last_modified = (await fs.promises.stat(path.resolve(__dirname, '../../static/css/index.css'))).mtimeMs; data.js_last_modified = (await fs.promises.stat(path.resolve(__dirname, '../../static/js/index.js'))).mtimeMs; diff --git a/src/views/index.mustache b/src/views/index.mustache index 7c51a52d..c44eb28c 100644 --- a/src/views/index.mustache +++ b/src/views/index.mustache @@ -2,6 +2,7 @@ {{> navbar}}