Add first 9G support
This commit is contained in:
32
poketest.js
32
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
|
||||
|
Reference in New Issue
Block a user