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UUUUUPU ʠʠ UUUUU UUUUUUUU UUPUPUPUPUPUPUUUUUDDCIIHDDII9DI4IDD I4DIDII IDDDIDDCDDI 4DI IDI 4DD D4HCI 8<88̃L<8L3#2423S + -"332"p`ffffVH  #C4 85 and mouseposx <155 then if mouseposy >68 and mouseposy < 80 and num_open_cards < #pokemon_table then print("Open pack", 96, 70, 04) if mouseclicked then t = 0 scene = "show_pack" end end if mouseposy > 80 and mouseposy < 95 then print("See my cards", 88,85, 04) if mouseclicked then scene = "pokedex" end end end if key(18) and key(19) and key(20) then --R S and T reset_unlocks() load_save_data() end -- for num = 0,5 do -- local pok = pokemon_table[math.random(1, #pokemon_table)] -- pok.flipped = true -- draw_discovered_card(50 + num*23, 65, pok) -- end end function showing_new_pack() t = t + 1 cls(1) if activate_opening then elli(lower_pack_posx + 16, lower_pack_posy, elipse_size, elipse_size/2, 2) elli(lower_pack_posx+ 16, lower_pack_posy, elipse_size-30, (elipse_size-30)/2, 1) elipse_size = elipse_size +10 end if lower_pack_posy > 125 then activate_opening = false for num_cartas = 1, 5 do local delay = math.max(0, cards_movemet_timer - num_cartas*5) draw_covered_card(((lower_pack_posx+3 +( (36 * num_cartas)* delay)))/(delay +1),( lower_pack_posy+8 + 50* delay) /(delay +1)) end cards_movemet_timer = cards_movemet_timer + 1 end spr(455, lower_pack_posx, lower_pack_posy+4, 05, 1, 0, 0, 4, 4) spr(439, lower_pack_posx, upper_pack_posy, 05, 1, 0, 0, 4, 1) if mouseposx > lower_pack_posx-5 and mouseposx < lower_pack_posx+32 then if mouseclicked and t > 10 then activate_opening = true t = 0 end end if activate_opening then upper_pack_posy = upper_pack_posy + (-20)/3 end if upper_pack_posy <= 45 then lower_pack_posy = lower_pack_posy +(126- lower_pack_posy)/10 end if cards_movemet_timer > 60 then show_opened_pack() scene = "reveal_cards" end end function show_opened_pack() --reset the opening animation upper_pack_posy = 60 lower_pack_posx = 105 lower_pack_posy = 60 cards_movemet_timer = 0 elipse_size = 0 cards_flipped = 0 cls(01) cards_opened = {} for num = 1, 5 do local check_new_pokemon = pokemon_table[math.random(1, #pokemon_table)] while check_new_pokemon.rarity > math.random(0, 6) do check_new_pokemon = pokemon_table[math.random(1, #pokemon_table)] end new_pokemon = {sprite = check_new_pokemon.sprite, rarity = check_new_pokemon.rarity, type = check_new_pokemon.type, flipped = false, new_unlock = false, original_poke = check_new_pokemon} table.insert(cards_opened, num, new_pokemon) draw_covered_card(36*num, 50) end end function revealing_cards() t = t + 1 for num = 1, 5 do if mouseposx >= 36*num and mouseposx < 22 + 36*num and mouseposy >49 and mouseposy <49+30 then if mouseclicked then t = 0 if cards_opened[num].original_poke.unlocked == false then cards_opened[num].new_unlock = true cards_opened[num].original_poke.unlocked = true num_open_cards = num_open_cards +1 end if cards_opened[num].flipped == false then cards_opened[num].flipped = true cards_flipped = cards_flipped +1 end end end end for num, card in ipairs(cards_opened) do if cards_opened[num].flipped then draw_discovered_card(36*num, 50, cards_opened[num]) if cards_opened[num].new_unlock then print("NEW!", 36*num+1, 40, 12) end end end if cards_flipped >= 5 then save_cards() if num_open_cards < #pokemon_table then print("Open another pack", 70, 100, 12) print("Go back to main menu", 65, 120, 12) if mouseposx >= 65 and mouseposx < 200 then if mouseposy > 95 and mouseposy < 105 then print("Open another pack", 70, 100, 04) if mouseclicked and t > 20 then t = 0 scene = "show_pack" activate_opening= false end elseif mouseposy > 115 and mouseposy < 125 then print("Go back to main menu", 65, 120, 04) if mouseclicked then scene = "menu" end end end else print("Congrats! You collected all pokemon cards!", 4, 100, 12) print("Click to go back to main menu", 50, 115, 12) if mouseclicked and t > 20 then scene = "menu" end end end end function draw_covered_card(posx, posy) rectb(posx, posy, 22, 30, 00) spr(460, posx, posy, 05, 1, 0, 0, 3, 4) end function draw_discovered_card(posx, posy, pokemon) rect(posx, posy, 22, 30, pokemon.type) rectb(posx, posy, 22, 30, 00) rectb(posx+2, posy+2, 18, 18, 0) spr(pokemon.sprite, posx+3, posy+3, -1, 1, 0, 0, 2, 2) space = 2 for num = 1, pokemon.rarity do spr(507, posx + space, posy + 22, 0) space = space + 4 end end function open_pokedex() t = t+1 cls(15) --- rect(168, 37, 70, 41, 01) print(num_open_cards.."/"..#pokemon_table, 192, 5, 12) visible_pokemon = {pokemon_table[curr_pokedex_pos],pokemon_table[curr_pokedex_pos+1], pokemon_table[curr_pokedex_pos+2], pokemon_table[curr_pokedex_pos+3]} for num, pokemon in pairs(visible_pokemon) do local color = 12 if num == 1 then color = 04 end local name = "?????????????" if pokemon.unlocked then name = pokemon.name end print(name, 170, 30 + (num * 10), color) end spr(475, 190, 30, 05, 1, 0, 1, 1, 2) spr(475, 190, 78, 05, 1, 2, 1, 1, 2) print("Main menu", 177, 120, 12) if mouseposx > 190 and mouseposx < 216 then if mouseposy > 25 and mouseposy < 43 then if mouseclicked and t > 10 and curr_pokedex_pos > 1 then curr_pokedex_pos = curr_pokedex_pos -1 t = 0 end elseif mouseposy > 73 and mouseposy < 85 then if mouseclicked and t > 10 and curr_pokedex_pos < #pokemon_table then curr_pokedex_pos = curr_pokedex_pos +1 t = 0 end end end if mouseposx >175 and mouseposx <230 and mouseposy > 115 and mouseposy < 127 then print("Main menu", 177, 120, 04) if mouseclicked then scene = "menu" end end ---- current_sprite = 398 current_description ={"You didn't unlock", "this card yet."} if pokemon_table[curr_pokedex_pos].unlocked then current_sprite = pokemon_table[curr_pokedex_pos].sprite current_description = pokemon_table[curr_pokedex_pos].desc end rect(05, 05, 160, 126,pokemon_table[curr_pokedex_pos].type) rect(58, 8, 52, 52, 0) spr(current_sprite, 60, 10, -1, 3, 0, 0, 2, 2) rect(10, 78, 150, 50, 12) for star = 1, pokemon_table[curr_pokedex_pos].rarity do spr(507, 58 + star*8, 63, 0, 2) end local spacing = 0 for num, des in pairs(current_description) do print(des, 11, 80 + spacing, 00) spacing = spacing + 10 end end