Advertisement
TechSkylander1518

Tech's Oddities Update WIP

Jun 1st, 2023 (edited)
1,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.18 KB | None | 0 0
  1. #New evolution methods:
  2. #Level up with a specific ribbon
  3. GameData::Evolution.register({
  4.   :id                   => :LevelRibbon,
  5.   :parameter            => :Ribbon,
  6.   :minimum_level        => 1,   # Needs any level up
  7.   :level_up_proc        => proc { |pkmn, parameter|
  8.     next pkmn.hasRibbon?(parameter)
  9.   }
  10. })
  11. #Level up with PokeRus
  12. GameData::Evolution.register({
  13.   :id                   => :LevelPokerus,
  14.   :parameter            => Integer,
  15.   :level_up_proc        => proc { |pkmn, parameter|
  16.     next pkmn.level >= parameter && pkmn.pokerus > 0
  17.   }
  18. })
  19. #Alternate version of Berserk Gene that works like Toxic Orb?
  20. #Form handler based on poke ball?
  21.  
  22. #Choice Sp Def/Def items
  23.  
  24. #Unown are compatible with any move that starts with the same letter -
  25. #Script section Pokemon, this section -
  26.   def compatible_with_move?(move_id)
  27.     move_data = GameData::Move.try_get(move_id)
  28.     return false if !move_data
  29.     return true if species_data.tutor_moves.include?(move_data.id)
  30.     return true if getMoveList.any? { |m| m[1] == move_data.id }
  31.     return true if species_data.get_egg_moves.include?(move_data.id)
  32.     return false
  33.   end
  34.  
  35. #Add
  36.   def compatible_with_move?(move_id)
  37.     move_data = GameData::Move.try_get(move_id)
  38.     return false if !move_data
  39.     return true if species_data.tutor_moves.include?(move_data.id)
  40.     return true if getMoveList.any? { |m| m[1] == move_data.id }
  41.     return true if species_data.get_egg_moves.include?(move_data.id)
  42.     return true if self.isSpecies?(:UNOWN) && move_data.real_name.chr.upcase == species_data.form_name
  43.     return false
  44.   end
  45.  
  46. #Shiny autosave
  47. module Settings
  48.     SHINY_CAUGHT_SWITCH = 59
  49. end
  50.  
  51. module Battle::CatchAndStoreMixin
  52.   # Register all caught Pokémon in the Pokédex, and store them.
  53.   def pbRecordAndStoreCaughtPokemon
  54.     @caughtPokemon.each do |pkmn|
  55.       pbSetCaught(pkmn)
  56.       pbSetSeen(pkmn)   # In case the form changed upon leaving battle
  57.       if pkmn.shiny?
  58.         $game_switches[Settings::SHINY_CAUGHT_SWITCH] = true
  59.       end
  60.       # Record the Pokémon's species as owned in the Pokédex
  61.       if !pbPlayer.owned?(pkmn.species)
  62.         pbPlayer.pokedex.set_owned(pkmn.species)
  63.         if $player.has_pokedex
  64.           pbDisplayPaused(_INTL("{1}'s data was added to the Pokédex.", pkmn.name))
  65.           pbPlayer.pokedex.register_last_seen(pkmn)
  66.           @scene.pbShowPokedex(pkmn.species)
  67.         end
  68.       end
  69.       # Record a Shadow Pokémon's species as having been caught
  70.       pbPlayer.pokedex.set_shadow_pokemon_owned(pkmn.species) if pkmn.shadowPokemon?
  71.       # Store caught Pokémon
  72.       pbStorePokemon(pkmn)
  73.     end
  74.     @caughtPokemon.clear
  75.   end
  76. end
  77.  
  78. EventHandlers.add(:on_frame_update, :shiny_saveprompt,
  79.   proc {
  80.     next if $game_temp.in_menu || $game_temp.in_battle || $game_player.move_route_forcing ||
  81.             $game_temp.message_window_showing || pbMapInterpreterRunning?
  82.     if $game_switches[Settings::SHINY_CAUGHT_SWITCH]
  83.       pbMessage(_INTL("You caught a shiny Pokémon!"))
  84.       scene = PokemonSave_Scene.new
  85.       screen = PokemonSaveScreen.new(scene)
  86.       screen.pbSaveScreen
  87.       $game_switches[Settings::SHINY_CAUGHT_SWITCH] = false
  88.     end
  89.   }
  90. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement