From 408d9d442ce0027bd84d78b541f56f721f510b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Marchal?= Date: Mon, 28 Feb 2022 18:39:21 +0100 Subject: [PATCH] Add first 9G support --- flashdex.html | 1 + flashdex.js | 17 ++++++++++------- index.html | 2 +- pokemon | 2 +- pokemon.json | 3 +++ poketest.js | 32 +++++++++++++++++++------------- style.css | 3 +++ 7 files changed, 38 insertions(+), 22 deletions(-) diff --git a/flashdex.html b/flashdex.html index 15d6d96..121cbd5 100644 --- a/flashdex.html +++ b/flashdex.html @@ -49,6 +49,7 @@ + Alternate forms diff --git a/flashdex.js b/flashdex.js index 20803e4..2352048 100644 --- a/flashdex.js +++ b/flashdex.js @@ -9,9 +9,10 @@ $(document).ready(function() { var G6 = [650, 721]; var G7 = [722, 809]; var G8 = [810, 905]; - var MEGA = [906, 955]; - var GIGA = [956, 987]; - var REG = [988, 1040]; + var G9 = [906, 908]; + var MEGA = [909, 958]; + var GIGA = [959, 990]; + var REG = [991, 1043]; /************ GAME *************/ /*******************************/ @@ -26,7 +27,7 @@ $(document).ready(function() { if ($(this).hasClass("unselected")) { - for (i = 1; i < 9; ++i) + for (i = 1; i < 10; ++i) $('input[name="'+i+'g"]').prop('checked', true); $('input[name="mega"]').prop('checked', true); $('input[name="regional"]').prop('checked', true); @@ -34,7 +35,7 @@ $(document).ready(function() { $(this).removeClass("unselected").addClass("selected"); $(this).text("Unselect all"); } else { - for (i = 1; i < 9; ++i) + for (i = 1; i < 10; ++i) $('input[name="'+i+'g"]').prop('checked', false); $('input[name="mega"]').prop('checked', false); $('input[name="regional"]').prop('checked', false); @@ -77,6 +78,8 @@ $(document).ready(function() { return '' else if (pkmn["origin"] == "Hisui") return '' + else if (pkmn["origin"] == "9G") + return '' else if (pkmn["type"] == "mega") return ''; else if (pkmn["type"] == "giga") @@ -128,13 +131,13 @@ $(document).ready(function() { for (i in gen_list) { evaluateByGeneration(i, "1g", G1); evaluateByGeneration(i, "2g", G2); evaluateByGeneration(i, "3g", G3); evaluateByGeneration(i, "4g", G4); evaluateByGeneration(i, "5g", G5); evaluateByGeneration(i, "6g", G6); - evaluateByGeneration(i, "7g", G7); evaluateByGeneration(i, "8g", G8); + evaluateByGeneration(i, "7g", G7); evaluateByGeneration(i, "8g", G8); evaluateByGeneration(i, "9g", G9); evaluateByGeneration(i, "mega", MEGA); evaluateByGeneration(i, "regional", REG); evaluateByGeneration(i, "gigantamax", GIGA); } } } - for (i = 0; i < 9; i++) + for (i = 0; i < 10; i++) createGenerationList((i + "g")); createGenerationList("regional"); createGenerationList("mega"); diff --git a/index.html b/index.html index 6205166..2cf4e1e 100644 --- a/index.html +++ b/index.html @@ -129,7 +129,7 @@ - + seconds diff --git a/pokemon b/pokemon index a636f68..169163e 160000 --- a/pokemon +++ b/pokemon @@ -1 +1 @@ -Subproject commit a636f68f889ee1f29e264910d787c066df07ac50 +Subproject commit 169163ed0057b273f8305de4827ccbd433efee5c diff --git a/pokemon.json b/pokemon.json index bca623c..8313f66 100644 --- a/pokemon.json +++ b/pokemon.json @@ -905,6 +905,9 @@ { "num": 903, "fr": "Farfurex", "en": "Sneasler", "ja": "オオニューラ", "romaji": "Ōnyūra", "de": "Snieboss", "kr": "포푸니크", "cn": "大狃拉", "cs": "大狃拉", "origin": "Hisui"}, { "num": 904, "fr": "Qwilpik", "en": "Overqwil", "ja": "ハリーマン", "romaji": "Harīman", "de": "Myriador", "kr": "장침바루", "cn": "萬針魚", "cs": "万针鱼", "origin": "Hisui"}, { "num": 905, "fr": "Amovénus", "en": "Enamorus", "ja": "ラブトロス", "romaji": "Rabutorosu", "de": "Cupidos", "kr": "러브로스", "cn": "眷戀雲", "cs": "眷恋云", "origin": "Hisui"}, +{ "num": 906, "fr": "Poussacha", "en": "Sprigatito", "ja": "ニャオハ", "romaji": "Nyaoha", "de": "Felori", "kr": "나오하", "cn": "新葉喵", "cs": "新叶喵", "origin": "9G"}, +{ "num": 907, "fr": "Chochodile", "en": "Fuecoco", "ja": "ホゲータ", "romaji": "Hogēta", "de": "Krokel", "kr": "뜨아거", "cn": "呆火鱷", "cs": "呆火鳄", "origin": "9G"}, +{ "num": 908, "fr": "Coiffeton", "en": "Quaxly", "ja": "クワッス", "romaji": "Kewassu", "de": "Kwaks", "kr": "꾸왁스", "cn": "潤水鴨", "cs": "润水鸭", "origin": "9G"}, { "num": "M3", "fr": "Méga-Florizarre", "en": "Mega Venusaur", "ja": "メガ フシギバナ", "romaji": "Mega Fushigibana", "de": "Mega-Bisaflor", "kr": "메가이상해꽃", "cn": "超級妙蛙花", "cs": "超级妙蛙花", "type": "mega"}, { "num": "M6X", "fr": "Méga-Dracaufeu X", "en": "Mega Charizard X", "ja": "メガ リザードン X", "romaji": "Mega Lizardon X", "de": "Mega-Glurak X", "kr": "메가리자몽 X", "cn": "超級噴火龍X", "cs": "超级喷火龙X", "type": "mega"}, { "num": "M6Y", "fr": "Méga-Dracaufeu Y", "en": "Mega Charizard Y", "ja": "メガ リザードン Y", "romaji": "Mega Lizardon Y", "de": "Mega-Glurak Y", "kr": "메가리자몽 Y", "cn": "超級噴火龍Y", "cs": "超级喷火龙Y", "type": "mega"}, diff --git a/poketest.js b/poketest.js index 4a77af2..61d7a8e 100644 --- a/poketest.js +++ b/poketest.js @@ -29,9 +29,10 @@ $(document).ready(function() { var G6 = [650, 721]; var G7 = [722, 809]; var G8 = [810, 905]; - var MEGA = [906, 955]; - var GIGA = [956, 987]; - var REG = [988, 1040]; + var G9 = [906, 908]; + var MEGA = [909, 958]; + var GIGA = [959, 990]; + var REG = [991, 1043]; /************ UTIL *************/ /*******************************/ @@ -86,8 +87,8 @@ $(document).ready(function() { // if it's not all generation, we check list of available pokemons if (pokemon_generation_list.length > 0) max_questions = pokemon_generation_list.length; - else // else, it's all the generation, from the first one to the gigantamax forms - max_questions = GIGA[1] - 1; + else // else, it's all the generation, from the first one to the regional forms + max_questions = REG[1]; } game(); }); @@ -126,7 +127,7 @@ $(document).ready(function() { evaluateByGeneration(i, "1g", G1); evaluateByGeneration(i, "2g", G2); evaluateByGeneration(i, "3g", G3); evaluateByGeneration(i, "4g", G4); evaluateByGeneration(i, "5g", G5); evaluateByGeneration(i, "6g", G6); evaluateByGeneration(i, "7g", G7); evaluateByGeneration(i, "8g", G8); - evaluateByGeneration(i, "mega", MEGA); evaluateByGeneration(i, "regional", REG); evaluateByGeneration(i, "gigantamax", GIGA); + evaluateByGeneration(i, "mega", MEGA); evaluateByGeneration(i, "gigantamax", GIGA); evaluateByGeneration(i, "regional", REG); } } } @@ -138,13 +139,13 @@ $(document).ready(function() { for (i = 0; i < 9; i++) createGenerationList((i + "g")); createGenerationList("mega"); - createGenerationList("regional"); createGenerationList("gigantamax"); + createGenerationList("regional"); generatePokemonList(); } // multiple artworks - function imageType(result) { + function imageType(result) { var four_types = [351, 386, 585, 586, 676, 741, 800]; var three_types = [249, 250, 384, 412, 413, 718, 745, 898]; var two_types = [251, 252, 255, 258, 374, 387, 390, 393, 421, 422, 423, 487, 492, 495, 498, 501, 521, 550, 555, @@ -181,8 +182,8 @@ $(document).ready(function() { // if it's not all generation, we check list of available pokemons if (pokemon_generation_list.length > 0) tmp = pokemon_generation_list[random(0, pokemon_generation_list.length - 1)]; - else // else, it's all the generation, from the first one to the gigantamax forms - tmp = random(0, GIGA[1] - 1); + else // else, it's all the generation, from the first one to the regional forms + tmp = random(0, REG[1] - 1); // checking if it's already there, if it is, recursion if (!findInArray(options, pklist.mn[tmp][lang])) @@ -208,7 +209,7 @@ $(document).ready(function() { previous_pokemon.splice(0, 6); } else { - if (previous_pokemon.length + 6 > GIGA[1] - 1) + if (previous_pokemon.length + 6 > REG[1] - 1) previous_pokemon.splice(0, 6); } } @@ -219,11 +220,16 @@ $(document).ready(function() { // if it's not all generation, we check list of available pokemons if (pokemon_generation_list.length > 0) result = pokemon_generation_list[random(0, pokemon_generation_list.length - 1)]; - else // else, it's all the generation, from the first one to the gigantamax forms - result = random(0, GIGA[1] - 1); + else // else, it's all the generation, from the first one to the regional forms + result = random(0, REG[1] - 1); lang = $('article select.lang option:selected').attr('id'); silhouette = $('article input[name="silhouette"]:checked').attr('id'); + //console.log("result = 0, " + (REG[1] - 1)); + //console.log("test = " + pklist.mn[0][lang]); + //console.log("test = " + pklist.mn[REG[1] - 1][lang]); + console.log("number: " + result); answer = pklist.mn[result][lang]; + console.log("pokemon: " + answer); if (checkPreviousPokemon(answer)) { // if it's already been selected within a short lapse of time if (whole_set && questions == max_questions) { } // makes the last question of whole set work else choosePokemon(); // recursive call diff --git a/style.css b/style.css index 9850afd..748305b 100644 --- a/style.css +++ b/style.css @@ -138,6 +138,8 @@ article #container.about ul li a { margin-top: 5px; margin-bottom: 5px; font-wei .SM2 { background: #589ac8; color: black; padding: 5px; border-radius: 0px 10px 10px 0px; } .SWSH1 { background: #00A1E9; color: black; padding: 5px; border-radius: 10px 0px 0px 10px; } .SWSH2 { background: #BF004F; color: white; padding: 5px; border-radius: 0px 10px 10px 0px; } +.SV1 { background: #e01715; color: white; padding: 5px; border-radius: 10px 0px 0px 10px; } +.SV2 { background: #741e85; color: white; padding: 5px; border-radius: 0px 10px 10px 0px; } .RB { border-radius:50%; background: linear-gradient(-45deg, #FF1111 50%, #1111FF 50%); display:block; border: 1px solid white; } .GS { border-radius:50%; background: linear-gradient(-45deg, #DAA520 50%, #C0C0C0 50%); display:block; border: 1px solid white; } @@ -148,6 +150,7 @@ article #container.about ul li a { margin-top: 5px; margin-bottom: 5px; font-wei .SM { border-radius:50%; background: linear-gradient(-45deg, #ef9039 50%, #589ac8 50%); display:block; border: 1px solid white; } .SWSH { border-radius:50%; background: linear-gradient(-45deg, #00A1E9 50%, #BF004F 50%); display:block; border: 1px solid white; } .LA { border-radius:50%; background: #36597B; display:block; border: 1px solid white; } +.SV { border-radius:50%; background: linear-gradient(-45deg, #e01715 50%, #741e85 50%); display:block; border: 1px solid white; } /**** FOOTER ****/