for (int i = 0; i < m_move.length; ++i) {
MoveListEntry move = m_move[i];
if (move != null) {
++moveCount;
String name = move.getName();
if (set.contains(name)) { throw new ValidationException(
"This pokemon learns two of the same move."); }
set.add(name);
if (!canLearn(speciesData, name)) { throw new ValidationException(
"This pokemon cannot learn " + name + "."); }
if ((m_ppUp[i] > 3) || (m_ppUp[i] < 0)) { throw new ValidationException(
"Each move must have between zero and "
+ "three PP ups applied to it."); }
}
}
if (moveCount == 0) {
// Pokemon must have at least one move.
throw new ValidationException("This pokemon learns no moves.");
} else if (moveCount > 4) { throw new ValidationException(
"This pokemon learns move than four moves."); }
int genders = getPossibleGenders();
if (((genders & m_gender) == 0) && ((genders != 0) || (m_gender != 0))) { throw new ValidationException(
"This pokemon has an invalid gender."); }
if (!canUseAbility(speciesData, m_abilityName)) {
String[] possibilities = getPossibleAbilities(speciesData);
if ((possibilities != null)) {
m_abilityName = possibilities[0];
}
}
if ((m_itemName != null)
&& !data.getHoldItemData().canUseItem(getSpeciesName(), m_itemName)) { throw new ValidationException(
"This pokemon's item is invalid."); }
}