m_wildPoke.getRareness(), 1.0, 1)) {
m_wildPoke.calculateStats(false);
m_player.catchPokemon(m_wildPoke);
showMessage("You successfuly caught " + m_wildPoke.getSpeciesName());
TcpProtocolHandler.writeMessage(m_player.getTcpSession(),
new BattleEndMessage(BattleEnd.POKEBALL));
m_player.setBattling(false);
dispose();
return true;
} else
showMessage("...but it failed!");
break;
case GREATBALL:
showMessage(m_player.getName() + " threw a Great Ball!");
if (getMechanics().isCaught(
m_wildPoke,
m_wildPoke.getRareness(), 1.5, 1)) {
m_wildPoke.calculateStats(false);
m_player.catchPokemon(m_wildPoke);
showMessage("You successfuly caught " + m_wildPoke.getSpeciesName());
TcpProtocolHandler.writeMessage(m_player.getTcpSession(),
new BattleEndMessage(BattleEnd.POKEBALL));
m_player.setBattling(false);
dispose();
return true;
} else
showMessage("...but it failed!");
break;
case ULTRABALL:
showMessage(m_player.getName() + " threw an Ultra Ball!");
if (getMechanics().isCaught(
m_wildPoke,
m_wildPoke.getRareness(), 2.0, 1)) {
m_wildPoke.calculateStats(false);
m_player.catchPokemon(m_wildPoke);
showMessage("You successfuly caught " + m_wildPoke.getSpeciesName());
TcpProtocolHandler.writeMessage(m_player.getTcpSession(),
new BattleEndMessage(BattleEnd.POKEBALL));
m_player.setBattling(false);
dispose();
return true;
} else
showMessage("...but it failed!");
break;
case MASTERBALL:
showMessage(m_player.getName() + " threw a Master Ball!");
if (getMechanics().isCaught(
m_wildPoke,
m_wildPoke.getRareness(), 255.0, 1)) {
m_wildPoke.calculateStats(false);
m_player.catchPokemon(m_wildPoke);
showMessage("You successfuly caught " + m_wildPoke.getSpeciesName());
TcpProtocolHandler.writeMessage(m_player.getTcpSession(),
new BattleEndMessage(BattleEnd.POKEBALL));
m_player.setBattling(false);
dispose();
return true;
} else
showMessage("...but it failed!");