Advertisement
TechSkylander1518

Balancing Data scripts

Nov 7th, 2023 (edited)
1,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.58 KB | None | 0 0
  1. #Counts how many Pokémon can learn a move, and how many of those Pokémon are the same type as the move.
  2. def pbTypeCount(move)
  3.   learn = 0
  4.   typelearn = 0
  5.   movedata = GameData::Move.try_get(move)
  6.   GameData::Species.each { |species|
  7.     dummy = Pokemon.new(species,100)
  8.     if dummy.compatible_with_move?(move)
  9.       learn += 1
  10.       typelearn += 1 if dummy.hasType?(movedata.type)
  11.     end
  12.   }
  13.   string = "#{movedata.name} is learned by #{learn} Pokémon, #{typelearn} of which are #{movedata.type.downcase.capitalize}-type."
  14.   pbMessage(string)
  15.   Input.clipboard = string
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement