Simplification of multiple artworks
This commit is contained in:
		
							
								
								
									
										44
									
								
								poketest.js
									
									
									
									
									
								
							
							
						
						
									
										44
									
								
								poketest.js
									
									
									
									
									
								
							@@ -170,36 +170,26 @@ $(document).ready(function() {
 | 
				
			|||||||
		// multiple artworks
 | 
							// multiple artworks
 | 
				
			||||||
		function imageType(result)
 | 
							function imageType(result)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			// TODO
 | 
								function randomizer(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,
 | 
					 | 
				
			||||||
								  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()
 | 
					 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				if (result >= MEGA[0])				return (pklist.mn[result-1]["num"])
 | 
									if (pk.mn[result]["sprite"])
 | 
				
			||||||
				if (result === 25) 					return (result+'-'+random(0, 16));
 | 
										return pklist.mn[result]["num"] + '-' + random(0, pk.mn[result]["sprite"] - 1);
 | 
				
			||||||
				if (result === 666)					return (result+'-'+random(0, 20));
 | 
									else
 | 
				
			||||||
				if (result === 646)					return (result+'-'+random(0, 6));
 | 
									{
 | 
				
			||||||
				if (result === 479)					return (result+'-'+random(0, 5));
 | 
										if (pk.mn[result]["origin"] == "Kanto")
 | 
				
			||||||
				for (i in four_types) {
 | 
										{
 | 
				
			||||||
					if (four_types[i] == result) 	return (result+'-'+random(0, 3));
 | 
											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';
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				for (i in three_types) {
 | 
										return pklist.mn[result]["num"];
 | 
				
			||||||
					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;
 | 
								image_name = randomizer(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_memory = new Image();
 | 
								image_memory = new Image();
 | 
				
			||||||
			image_memory.src = 'pokemon/' + image_name + '.png';
 | 
								image_memory.src = 'pokemon/' + image_name + '.png';
 | 
				
			||||||
			return image_name;
 | 
								return image_name;
 | 
				
			||||||
@@ -239,7 +229,7 @@ $(document).ready(function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			answer = pklist.mn[result][lang];
 | 
								answer = pklist.mn[result][lang];
 | 
				
			||||||
			chooseOptions(result, lang);
 | 
								chooseOptions(result, lang);
 | 
				
			||||||
			imageType(result + 1);
 | 
								imageType(result);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		function game()
 | 
							function game()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user