Simplification of multiple artworks

This commit is contained in:
Théo Marchal 2022-03-03 14:22:30 +01:00
parent 18c80456c4
commit 0b19f84814

View File

@ -170,36 +170,26 @@ $(document).ready(function() {
// multiple artworks
function imageType(result)
{
// TODO
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,
592, 593, 641, 642, 643, 644, 645, 647, 648, 668, 678, 681, 720, 746, 774, 791, 792, 802, 849,
876, 877, 888, 889, 892, 905, "G892"];
function randomizer()
function randomizer(result)
{
if (result >= MEGA[0]) return (pklist.mn[result-1]["num"])
if (result === 25) return (result+'-'+random(0, 16));
if (result === 666) return (result+'-'+random(0, 20));
if (result === 646) return (result+'-'+random(0, 6));
if (result === 479) return (result+'-'+random(0, 5));
for (i in four_types) {
if (four_types[i] == result) return (result+'-'+random(0, 3));
if (pk.mn[result]["sprite"])
return pklist.mn[result]["num"] + '-' + random(0, pk.mn[result]["sprite"] - 1);
else
{
if (pk.mn[result]["origin"] == "Kanto")
{
randomValue = random(0, 2);
if (randomValue == 0)
return pklist.mn[result]["num"];
else if (randomValue == 1)
return pklist.mn[result]["num"]+'RB';
else if (randomValue == 2)
return pklist.mn[result]["num"]+'RG';
}
return pklist.mn[result]["num"];
}
for (i in three_types) {
if (three_types[i] == result) return (result+'-'+random(0, 2));
}
for (i in two_types) {
if (two_types[i] == result) return (result+'-'+random(0, 1));
}
if (result > 151) return result;
if ((tmp = random(0, 2)) == 0) return result;
else if (tmp == 1) return (result+'RB');
else return (result+'RG');
}
image_name = randomizer(result+1);
image_name = randomizer(result);
image_memory = new Image();
image_memory.src = 'pokemon/' + image_name + '.png';
return image_name;
@ -239,7 +229,7 @@ $(document).ready(function() {
answer = pklist.mn[result][lang];
chooseOptions(result, lang);
imageType(result + 1);
imageType(result);
}
function game()