Update to support the 9th generation

This commit is contained in:
2023-02-18 00:48:06 +01:00
parent c3f84ab2ab
commit 09bbf223c3
22 changed files with 148 additions and 55 deletions

View File

@ -29,10 +29,10 @@ $(document).ready(function() {
var G6 = [650, 721];
var G7 = [722, 809];
var G8 = [810, 905];
var G9 = [906, 923];
var MEGA = [924, 973];
var GIGA = [974, 1005];
var REG = [1006, 1058];
var G9 = [906, 1008];
var MEGA = [1009, 1058];
var GIGA = [1059, 1090];
var REG = [1091, 1145];
var gen_number = 9;
var extra_number = 3; // mega, giga, reg
@ -161,7 +161,7 @@ $(document).ready(function() {
}
else
{
for (i = 0; i < gen_number; i++)
for (i = 1; i <= gen_number; i++)
createGenerationList((i + "g"));
createGenerationList("mega");
createGenerationList("gigantamax");
@ -252,15 +252,15 @@ $(document).ready(function() {
$('article #container .chrono').empty().append(chrono);
else
$('article #container .chrono').hide();
$('article #container .whois').empty().append("Who's that Pokémon? " + (!infinite? " ("+questions+"/"+max_questions+")" : ""));
$('article #container .pokemon').empty().append('<img src="pokemon/'+image_name+'.png" class="'+(silhouette)+' '+ (answertype) +'" />');
$('article #container .whois').empty().append("Who's that Pokémon? " + (!infinite? " (" + questions + "/" + max_questions + ")" : ""));
$('article #container .pokemon').empty().append('<img src="pokemon/' + image_name + '.png" class="' + (silhouette) + ' ' + (answertype) + '" />');
if (answertype == "choice")
{
$('article #container #answers').empty().append('<span><input type="submit" class="option a1" name="a1" value="'+options[0]+'"></span>');
$('article #container #answers').append('<span><input type="submit" class="option a2" name="a2" value="'+options[1]+'"></span>');
$('article #container #answers').append('<span><input type="submit" class="option a3" name="a3" value="'+options[2]+'"></span>');
$('article #container #answers').append('<span><input type="submit" class="option a4" name="a4" value="'+options[3]+'"></span>');
$('article #container #answers').empty().append('<span><input type="submit" class="option a1" name="a1" value="' + options[0] + '"></span>');
$('article #container #answers').append('<span><input type="submit" class="option a2" name="a2" value="' + options[1] + '"></span>');
$('article #container #answers').append('<span><input type="submit" class="option a3" name="a3" value="' + options[2] + '"></span>');
$('article #container #answers').append('<span><input type="submit" class="option a4" name="a4" value="' + options[3] + '"></span>');
}
else
{
@ -365,6 +365,7 @@ $(document).ready(function() {
gen += gen_list[i].substring(0,1);
}
else gen += "all";
s_gen = "?gen=" + gen;
s_lang = "&lang=" + lang;
s_answertype = "&answertype=" + answertype;