Advertisement
TechSkylander1518

Fill Dex/View Dex from event (v20)

Dec 19th, 2022 (edited)
1,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.60 KB | None | 0 0
  1. #Credit to TechSkylander1518 and Maruno! (I used the debug code as a base for most of this)
  2.  
  3. def fillPokedex
  4.     GameData::Species.each do |species_data|
  5.       sp = species_data.species
  6.       f = species_data.form
  7.       # Record each form of each species as seen and owned
  8.       if f == 0
  9.         if species_data.single_gendered?
  10.           g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
  11.           $player.pokedex.register(sp, g, f, 0, false)
  12.           $player.pokedex.register(sp, g, f, 1, false)
  13.         else   # Both male and female
  14.           $player.pokedex.register(sp, 0, f, 0, false)
  15.           $player.pokedex.register(sp, 0, f, 1, false)
  16.           $player.pokedex.register(sp, 1, f, 0, false)
  17.           $player.pokedex.register(sp, 1, f, 1, false)
  18.         end
  19.         $player.pokedex.set_owned(sp, false)
  20.       elsif species_data.real_form_name && !species_data.real_form_name.empty?
  21.         g = (species_data.gender_ratio == :AlwaysFemale) ? 1 : 0
  22.         $player.pokedex.register(sp, g, f, 0, false)
  23.         $player.pokedex.register(sp, g, f, 1, false)
  24.       end
  25.     end
  26. end
  27.  
  28. MenuHandlers.add(:debug_menu, :fill_pokedex, {
  29.   "name"        => _INTL("Fill Pokédex"),
  30.   "parent"      => :player_menu,
  31.   "description" => _INTL("Register all species and forms in the Pokédex."),
  32.   "effect"      => proc { fillPokedex
  33.   }
  34. })
  35.  
  36. def pokeDex
  37.   $player.has_pokedex = true
  38.   $player.pokedex.unlock(-1)
  39.   pbFadeOutIn {
  40.     scene = PokemonPokedex_Scene.new
  41.     screen = PokemonPokedexScreen.new(scene)
  42.     screen.pbStartScreen
  43.     menu.pbRefresh
  44.   }
  45.   $player.has_pokedex = false
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement