Adds Jenkinsfile
All checks were successful
EpicKnarvik97/pokemon-cmd/master This commit looks good

Also fixes some typos
This commit is contained in:
Kristian Knarvik 2020-02-16 02:42:52 +01:00
parent c5c4420ac0
commit 8c6f2dfad2
6 changed files with 32 additions and 8 deletions

24
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,24 @@
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building...'
sh 'mvn clean & mvn validate & mvn compile'
}
}
stage('Test') {
steps {
echo 'Testing...'
sh 'mvn clean & mvn test'
}
}
stage('Deploy') {
steps {
echo 'Deploying...'
sh 'mvn clean & mvn compile & mvn package & mvn verify & mvn install'
archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
}
}
}
}

View File

@ -2,4 +2,4 @@
A commandline pokemon clone written in java. A commandline pokemon clone written in java.
This started as an assignment in computer science, but since it became quite advanced in just one week, I want to see where it might go. This started as an assignment in computer science, but since it became quite advanced in just one week, I want to see where it might go.
This project has no clear goal, except mimicking the original pokemon games in a commandline interface. It would be interestig if people used this project as a base for custom games. There is still a lot to implement, but if it reaches a near complete stage, it should be possible to create custom types, moves pokemon, trainers, gyms, badges and maps. This project has no clear goal, except mimicking the original pokemon games in a commandline interface. It would be interesting if people used this project as a base for custom games. There is still a lot to implement, but if it reaches a near complete stage, it should be possible to create custom types, moves pokemon, trainers, gyms, badges and maps.

View File

@ -4,4 +4,4 @@
### Steps to reproduce the behavior ### Steps to reproduce the behavior
### Information about java version, enviroment, project branch etc. ### Information about java version, environment, project branch etc.

View File

@ -49,7 +49,7 @@ public class Game {
System.out.printf("Opponent: %s%nWhat will you do?%n", opponentPokemon); System.out.printf("Opponent: %s%nWhat will you do?%n", opponentPokemon);
System.out.printf("b: battle" System.out.printf("b: battle"
+ "%nh: heal or revive" + "%nh: heal or revive"
+ "%nt: throw pokeball" + "%nt: throw poke ball"
+ "%nc: change pokemon" + "%nc: change pokemon"
+ "%nf: flee" + "%nf: flee"
+ "%nv: view my pokemon" + "%nv: view my pokemon"
@ -121,7 +121,7 @@ public class Game {
List<Pokemon> loadedUsersPokemon = loadPokemon("user.save"); List<Pokemon> loadedUsersPokemon = loadPokemon("user.save");
Inventory loadedInventory = loadInventory("inventory.save"); Inventory loadedInventory = loadInventory("inventory.save");
if (loadedPokemon == null || loadedUsersPokemon == null || loadedInventory == null) { if (loadedPokemon == null || loadedUsersPokemon == null || loadedInventory == null) {
System.out.println("One or more savefiles seem corrupt or missing. Please delete, create or fix the affected file(s)."); System.out.println("One or more save files seem corrupt or missing. Please delete, create or fix the affected file(s).");
} else { } else {
availableOpponentPokemon = loadedPokemon; availableOpponentPokemon = loadedPokemon;
player.setPokemon(loadedUsersPokemon); player.setPokemon(loadedUsersPokemon);
@ -219,7 +219,7 @@ public class Game {
AbstractPokeBall currentPokeBall = player.getInventory().getChosenPokeBall(); AbstractPokeBall currentPokeBall = player.getInventory().getChosenPokeBall();
if (currentPokeBall == null) { if (currentPokeBall == null) {
in.nextLine(); in.nextLine();
System.out.println("Invalid pokeball."); System.out.println("Invalid poke ball.");
} else { } else {
boolean captured = currentPokeBall.use(opponentPokemon, availableOpponentPokemon, player); boolean captured = currentPokeBall.use(opponentPokemon, availableOpponentPokemon, player);
player.getInventory().addItem(currentPokeBall, -1); player.getInventory().addItem(currentPokeBall, -1);
@ -230,7 +230,7 @@ public class Game {
} }
} }
} else { } else {
System.out.println("You have used all your pokeballs."); System.out.println("You have used all your poke balls.");
} }
} }

View File

@ -9,7 +9,7 @@ import java.util.List;
public abstract class Item { public abstract class Item {
final String name; final String name;
final String description; final String description;
static List<Item> availableItems = new ArrayList<>(); static final List<Item> availableItems = new ArrayList<>();
/** /**
* Instantiates a new item * Instantiates a new item

View File

@ -144,7 +144,7 @@ public class Pokemon {
System.out.printf("%s was caught.%n", this.name); System.out.printf("%s was caught.%n", this.name);
return true; return true;
} else { } else {
System.out.printf("%s escaped from the pokeball.%n", this.name); System.out.printf("%s escaped from the poke ball.%n", this.name);
return false; return false;
} }
} }