Refactoring of Game Adds and improves all comments Restructures files Improves items Makes project into a maven project
22 lines
553 B
Java
22 lines
553 B
Java
package items;
|
|
|
|
import pokemon.Pokemon;
|
|
import storage.Trainer;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* This class represents a master ball item
|
|
*/
|
|
public class MasterBall extends AbstractPokeBall {
|
|
public MasterBall() {
|
|
super("Master ball", "The best Poké Ball with the ultimate level of performance. With it, " +
|
|
"you will catch any wild Pokémon without fail.");
|
|
}
|
|
|
|
@Override
|
|
public boolean use(Pokemon target, List<Pokemon> current, Trainer catcher) {
|
|
return target.tryCapture(current, catcher, 0);
|
|
}
|
|
}
|