   # There are certain ways specific Pokemon can learn a move.
   # Check non-standard groups:
   # "form-change", "light-ball-egg", "stadium-surfing-pikachu"
-  return true  if loopLearnsets forGeneration, SpeciesData, FormeData, pokemon, (learnset) ->
+  return true  if looper (learnset) ->
     # Check to see if special moves can completely overlap these moves
     learnsetGroups = (g  for g of learnset when g not in standardGroups)
     for groupName in learnsetGroups


  # TODO: Check chain-breeding.
  eggMoves = []
  loopLearnsets forGeneration, SpeciesData, FormeData, pokemon, (learnset) ->
    return  if !learnset['egg']
    for moveName of learnset['egg']
      continue  if moveName in eggMoves || moveName not in leftoverMoves


  return false

checkMove = (looper, pokemon, move) ->
  {level} = pokemon
  valid = false

  return true  if looper (learnset) ->
    # Check level-up, TM/HM, and tutors.
    return true  if learnset["level-up"]?[move] <= level ||
                    learnset["machine"]?[move]  <= level ||
                    learnset["tutor"]?[move]    <= level

    # If the Pokemon can learn Sketch, then by golly, it can learn anything!
    # ... Except Chatter and Struggle. NOTE: Bogus moves are considered valid,
    # so you must take care of them at a higher level.
    return true  if learnset["level-up"]?["Sketch"] <= level &&
                    move not in [ "Chatter", "Struggle" ]

  # TODO: Skip unavailable Pokemon (due to being a generation later).
  # TODO: level-up moves can be bred.
