diff --git a/src/main/java/controller/Controller.io b/src/main/java/controller/Controller.io deleted file mode 100644 index 1fa4e9d6..00000000 --- a/src/main/java/controller/Controller.io +++ /dev/null @@ -1,13 +0,0 @@ -package controller; - -import model.user.User; - -public abstract class Controller { - protected final User user; - protected final String username; - - protected Controller(String username) { - this.user = User.getUserByUsername(username); - this.username = username; - } -} diff --git a/src/main/java/controller/DatabaseController.io b/src/main/java/controller/DatabaseController.io deleted file mode 100644 index d9ced11f..00000000 --- a/src/main/java/controller/DatabaseController.io +++ /dev/null @@ -1,75 +0,0 @@ -package controller; - -import com.google.gson.reflect.TypeToken; -import com.gilecode.yagson.YaGson; -import model.card.Card; -import model.user.User; - -import java.io.FileWriter; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; - -public class DatabaseController extends Controller { - - public DatabaseController(String username) { - super(username); - } - - public static ArrayList importUsers() { - String jsonStr = ""; - try { - jsonStr = new String(Files.readAllBytes( - Paths.get("src/main/resources/controller/database/users.json"))); - } catch (IOException ioException) { - ioException.printStackTrace(); - } - YaGson yaGson = new YaGson(); - Type jsonType = new TypeToken>() { - }.getType(); - return yaGson.fromJson(jsonStr, jsonType); - } - - public static void exportUsers() { - ArrayList users = User.getUsers(); - YaGson yaGson = new YaGson(); - String jsonStr = yaGson.toJson(users); - try { - FileWriter writer = new FileWriter("src/main/resources/controller/database/users.json"); - writer.write(jsonStr); - writer.close(); - } catch (IOException ioException) { - ioException.printStackTrace(); - } - } - - public void importCard(String cardName) { - String jsonStr = ""; - try { - jsonStr = new String(Files.readAllBytes( - Paths.get("src/main/resources/controller/database/exported.txt"))); - - } catch (IOException ioException) { - ioException.printStackTrace(); - } - YaGson yaGson = new YaGson(); - Card card = yaGson.fromJson(jsonStr, Card.class); - card.setOwnerUsername(user.getUsername()); - user.getCardInventory().addCardToInventory(card); - } - - public void exportCard(String cardName) { - Card card = user.getCardInventory().getCardByCardName(cardName); - YaGson yaGson = new YaGson(); - String jsonStr = yaGson.toJson(card); - try { - FileWriter writer = new FileWriter("database\\exported.txt"); - writer.write(jsonStr); - writer.close(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/main/java/controller/DeckController.io b/src/main/java/controller/DeckController.io deleted file mode 100644 index 58575853..00000000 --- a/src/main/java/controller/DeckController.io +++ /dev/null @@ -1,145 +0,0 @@ -package controller; - - -import javafx.scene.control.ListView; -import javafx.scene.image.Image; -import javafx.scene.paint.Color; -import javafx.scene.paint.ImagePattern; -import javafx.scene.shape.Rectangle; -import model.user.UserDeck; -import view.gui.elements.GetImage; - - -import java.util.ArrayList; - -public class DeckController extends Controller { - - public DeckController(String userName) { - super(userName); - } - - public int createDeckErrorHandler(String deckName) { - UserDeck userDeck = user.getUserDeck(); - if (userDeck.doesDeckExist(deckName)) { - return 1; - } else { - userDeck.createDeck(deckName, user); - return 0; - } - } - - public int deleteDeckErrorHandler(String deckName) { - UserDeck userDeck = user.getUserDeck(); - if (!(userDeck.doesDeckExist(deckName))) { - return 1; - } else { - userDeck.deleteDeckFromUserDecks(deckName); - return 0; - } - } - - public int activateDeckErrorHandler(String deckName) { - UserDeck userDeck = user.getUserDeck(); - if (!(userDeck.doesDeckExist(deckName))) { - return 1; - } else { - user.getUserDeck().activateDeck(deckName); - return 0; - } - } - - public int addCardErrorHandler(String deckName, String cardName, boolean isSideDeck) { - UserDeck userDeck = user.getUserDeck(); - if (!(user.getCardInventory().doesCardExistToAddToDeck(userDeck, deckName, cardName))) { - return 1; - - } else if (!(userDeck.doesDeckExist(deckName))) { - return 2; - - } else if (userDeck.getDeckByName(deckName).isDeckFull(isSideDeck)) { - return 3; - - } else if (userDeck.getDeckByName(deckName).isFullFromCard(cardName)) { - return 4; - } - userDeck.getDeckByName(deckName).addCard(cardName, isSideDeck, user); - return 0; - } - - public int removeCardErrorHandler(String deckName, String cardName, boolean isSideDeck) { - UserDeck userDeck = (super.user).getUserDeck(); - if (!(userDeck.doesDeckExist(deckName))) { - return 1; - } else if (!(userDeck.getDeckByName(deckName).doesCardExist(cardName, isSideDeck))) { - return 2; - } - user.getUserDeck().getDeckByName(deckName).deleteCard(cardName, isSideDeck);; - return 0; - } - - public String getActiveDeckStr() { - UserDeck userDeck = user.getUserDeck(); - return userDeck.getActiveDeckStr(); - } - - public ArrayList getOtherDeckStr() { - return user.getUserDeck().getSortedOtherDeckStr(); - } - - public int showDeckErrorHandler(String deckName, boolean isSideDeck) { - UserDeck userDeck = user.getUserDeck(); - if (!(userDeck.doesDeckExist(deckName))) { - return 1; - } else { - return 0; - } - } - - public ArrayList getMonstersStr(String deckName, boolean isSideDeck) { - UserDeck userDeck = user.getUserDeck(); - return userDeck.getDeckByName(deckName).getMonstersStr(isSideDeck); - } - - public ArrayList getSpellAndTrapsStr(String deckName, boolean isSideDeck) { - UserDeck userDeck = user.getUserDeck(); - return userDeck.getDeckByName(deckName).getSpellAndTrapStr(isSideDeck); - } - - public ArrayList getAllCardsStr() { - return user.getCardInventory().getAllCardsStr(); - } - - - //for gui - public static void addCardToMainDeck(Rectangle[][] rectangles, Image image){ - boolean bol=false; - for(int i=0;i<6;i++){ - for(int j=0; j<10;j++){ - if(rectangles[i][j].getFill().equals(Color.color(1, 1, 1, 0))){ - rectangles[i][j].setFill(new ImagePattern(image)); - bol=true; - break; - } - } - if(bol){ - break; - } - } - } - - public void setScrollBar(ListView listView){ - if(user.getCardInventory()!=null) { - for (int i = 0; i < user.getCardInventory().getCards().size(); i++) { - Rectangle rectangle=new Rectangle(); - rectangle.setWidth(214); - rectangle.setHeight(240); - System.out.println(user.getCardInventory().getAllCardsStr().get(i)); - rectangle.setFill(new ImagePattern(GetImage.getCardImage(user.getCardInventory() - .getCards().get(i).getCardName()))); - listView.getItems().add(rectangle); - } - } - } - - -} diff --git a/src/main/java/controller/GameController.io b/src/main/java/controller/GameController.io deleted file mode 100644 index 3d17a26e..00000000 --- a/src/main/java/controller/GameController.io +++ /dev/null @@ -1,595 +0,0 @@ -package controller; - -import model.card.*; -import model.game.*; -import model.card.SpecialMonsters.AmazingAbility.BeastKingBarbaros; -import model.game.fields.CardField; -import model.user.User; -import view.cli.DuelMenu; -import view.cli.MainMenu; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.regex.Matcher; - -public class GameController extends Controller { - - private final User player; - private final User opponentPlayer; - private final int rounds; - private Game game; - private GameErrorHandler gameErrorHandler; - private int playerWins = 0; - private int opponentWins = 0; - private DuelMenu playerDuelMenu; - - - public GameController(String username, String opponentUsername, int rounds) { - super(username); - this.player = User.getUserByUsername(username); - this.opponentPlayer = User.getUserByUsername(opponentUsername); - this.rounds = rounds; - } - - - private void createNewGame() { - this.game = new Game(player, opponentPlayer, rounds, this); - this.gameErrorHandler = new GameErrorHandler(game); - } - - public void startGame() { - int playerMaxLp = 0; - int opponentMaxLp = 0; - User winner = null; - for (int i = 0; i < rounds; i++) { - if (playerWins == 2 || opponentWins == 2) break; - // create new round and start it: - createNewGame(); - playRound(); - // show winner of round: - winner = game.getWinner(); - if (winner.equals(player)) { - playerWins++; - } else { - opponentWins++; - } - playerDuelMenu.showGameWinner(winner.getUsername(), playerWins, opponentWins); - // save maxLp - int playerLp = player.getLifepoint().getLifepoint(); - if (playerLp > playerMaxLp) playerMaxLp = playerLp; - int opponentLp = opponentPlayer.getLifepoint().getLifepoint(); - if (opponentLp > opponentMaxLp) opponentMaxLp = opponentLp; - } - // show match winner if there is 3 rounds: - if (rounds == 3) playerDuelMenu.showMatchWinner(winner.getUsername(), playerWins, opponentWins); - // calculate and increase score and money after match: - increaseMoneyAndScore(playerMaxLp, opponentMaxLp); - // go back to first player's MainMenu: - MainMenu playerMainMenu = new MainMenu(player.getUsername()); - playerMainMenu.show(); - playerMainMenu.execute(); - } - - private void increaseMoneyAndScore(int playerMaxLp, int opponentMaxLp) { - if (rounds == 1) { - if (playerWins > 0) { - player.increaseScore(1000); - player.increaseMoney(1000 + playerMaxLp); - opponentPlayer.increaseMoney(100); - } else { - opponentPlayer.increaseScore(1000); - opponentPlayer.increaseMoney(1000 + opponentMaxLp); - player.increaseMoney(100); - } - } else { - if (playerWins > 1) { - player.increaseScore(3000); - player.increaseMoney(3000 + playerMaxLp); - opponentPlayer.increaseMoney(300); - } else { - opponentPlayer.increaseScore(3000); - opponentPlayer.increaseMoney(3000 + opponentMaxLp); - player.increaseMoney(300); - } - } - } - - public void surrender() { - game.surrenderGame(); - } - - private void playRound() { - playerDuelMenu = new DuelMenu(player.getUsername(), this); - playerDuelMenu.show(); - - while (!game.isFinished()) { - playerDuelMenu.getNextCommand(); - } - } - - public void cancel() { - game.cancelCommand(); - } - - ///////////////////////////////////////////// ERROR HANDLING: - - public int selectCardErrorHandler(String cardType, int cardPosition, boolean isOpponentCard) { - if (gameErrorHandler.isInputForSelectCardValid(cardType, cardPosition, isOpponentCard)) { - - if (gameErrorHandler.isThereAnyCardHere(cardType, cardPosition, isOpponentCard)) { - game.selectCard(cardType, cardPosition, isOpponentCard); - return 0; - } else { - return 2; - } - - } else { - return 1; - } - } - - public int deselectErrorHandler() { - if (gameErrorHandler.doesSelectedCardExist()) { - game.deselectCard(); - return 0; - } else { - return 1; - } - } - - public int nextPhaseInController() { - game.nextPhase(); - String phase = game.getPhase(); - switch (phase) { - case "draw phase": - game.drawPhase(); - return 1; - - case "standby phase": - game.standbyPhase(); - return 0; - - case "Main Phase1": - game.mainPhase1(); - return 2; - - case "End Phase": - game.endPhase(); - return 5; - - case "battle phase": - game.battlePhase(); - return 3; - - case "Main Phase2": - game.mainPhase2(); - return 4; - } - return -1; - } - - public int summonErrorHandler() { - if (gameErrorHandler.doesSelectedCardExist()) { - if (gameErrorHandler.isSelectedCardMonster() && gameErrorHandler.isCardInHand() && game.canSummonThisMonster()) { - if ((game.getPhase().equals("Main Phase1") || game.getPhase().equals("Main Phase2"))) { - if (!gameErrorHandler.isMonsterFieldFull()) { - if (!gameErrorHandler.wasSummonOrSetCardBeforeInThisTurn()) { - MonsterCard monster = (MonsterCard) game.getSelectedCard(); - if (monster.getLevel() < 5 || monster.getSpecial() == SpecialMonsterEnum.CRAB_TURTLE - || monster.getSpecial() == SpecialMonsterEnum.SKULL_GUARDIAN) { - - return game.summonMonster(); - - } else { - return tributeSummonErrorHandler(monster); - - } - } else { - return 5; - } - } else { - return 4; - } - } else { - return 3; - } - } else { - return 2; - } - } - - return 1; - } - - private int tributeSummonErrorHandler(MonsterCard monster) { - ArrayList cardsToTribute; - if (!gameErrorHandler.isThereEnoughCardsToTribute(monster)) { - return 7; - } else { - if (monster.getSpecial() == SpecialMonsterEnum.BEAST_KING_BARBAROS) { - BeastKingBarbaros beastKingBarbaros = new BeastKingBarbaros(game, gameErrorHandler, this); - return beastKingBarbaros.summonHandler(monster); - - } else if (monster.getLevel() > 10) { - cardsToTribute = playerDuelMenu.getCardsForTribute(3); - if (cardsToTribute == null) return -1; - - if (gameErrorHandler.isTributeCardsValid(cardsToTribute)) { - game.tributeSummon(cardsToTribute); - return 6; - } else { - return 9; - } - } else if (monster.getLevel() >= 7) { - cardsToTribute = playerDuelMenu.getCardsForTribute(2); - if (cardsToTribute == null) return -1; - - if (gameErrorHandler.isTributeCardsValid(cardsToTribute)) { - game.tributeSummon(cardsToTribute); - return 6; - } else { - return 9; - } - } else { - cardsToTribute = playerDuelMenu.getCardsForTribute(1); - if (cardsToTribute == null) return -1; - - if (gameErrorHandler.isTributeCardsValid(cardsToTribute)) { - game.tributeSummon(cardsToTribute); - return 6; - } else { - return 8; - } - } - } - } - - public int setCardErrorHandler() { - if (gameErrorHandler.doesSelectedCardExist()) { - if (gameErrorHandler.isCardInHand()) { - if (gameErrorHandler.isSelectedCardMonster()) { - if ((game.getPhase().equals("Main Phase1") || game.getPhase().equals("Main Phase2"))) { - if (!gameErrorHandler.isMonsterFieldFull()) { - if (!gameErrorHandler.wasSummonOrSetCardBeforeInThisTurn()) { - game.setMonster(); - return 6; - } else { - return 5; - } - } else { - return 4; - } - } else { - return 3; - } - } else { - if ((game.getPhase().equals("Main Phase1") || game.getPhase().equals("Main Phase2"))) { - if (!gameErrorHandler.isSpellTrapFieldFull()) { - game.setSpellOrTrap(); - return 6; - } else { - return 7; - } - } else { - return 3; - } - } - } else { - return 2; - } - } else { - return 1; - } - } - - public int changePositionErrorHandler(Matcher matcher) { - if (gameErrorHandler.doesSelectedCardExist()) { - if (gameErrorHandler.isThereSelectedCardInMonsterField()) { - if (game.getPhase().equals("Main Phase1") || game.getPhase().equals("Main Phase2")) { - if (gameErrorHandler.isChangeCorrect(matcher)) { - if (!gameErrorHandler.wasChangePositionInThisTurn()) { - game.changePosition(); - return 6; - } else { - return 5; - } - } else { - return 4; - } - } else { - return 3; - } - } else { - return 2; - } - } else { - return 1; - } - } - - public int flipSummonErrorHandler() { - if (gameErrorHandler.doesSelectedCardExist()) { - if (gameErrorHandler.isThereSelectedCardInMonsterField()) { - if (game.getPhase().equals("Main Phase1") || game.getPhase().equals("Main Phase2")) { - if (gameErrorHandler.canFlipSummonSelectedCard()) { - return game.flipSummon(); - } else { - return 4; - } - } else { - return 3; - } - } else { - return 2; - } - } else { - return 1; - } - } - - public int attackErrorHandler(int numberOfEnemyMonsterZone) { - if (gameErrorHandler.doesSelectedCardExist()) { - if (gameErrorHandler.isThereSelectedCardInMonsterField()) { - if (game.getPhase().equals("battle phase")) { - if (!gameErrorHandler.wasThisCardAttackedInThisTurn()) { - if (gameErrorHandler.isThereAnyMonsterInThisCell(numberOfEnemyMonsterZone)) { - int returnedNumber = game.attack(numberOfEnemyMonsterZone); - return returnedNumber; - /* - some order have to done for attack method in model{ - enemy card in attack position: - my attack power > enemy attack power -> return 6 - my attack power = enemy attack power -> return 7 - my attack power < enemy attack power -> return 8 - enemy card in defense position: - my attack power > enemy defense power : - DH mode -> return 12 - Not DH mode -> return 9; - my attack power = enemy defense power : - DH mode -> return 13 - Not DH mode -> return 10; - my attack power < enemy defense power : - DH mode -> return 14 - Not DH mode -> return 11; - } - */ - - } else { - return 5; - } - } else { - return 4; - } - } else { - return 3; - } - } else { - return 2; - } - } else { - return 1; - } - } - - public int directAttackErrorHandler() { - if (gameErrorHandler.doesSelectedCardExist()) { - if (gameErrorHandler.isThereSelectedCardInMonsterField()) { - if (game.getPhase().equals("battle phase")) { - if (!gameErrorHandler.wasThisCardAttackedInThisTurn()) { - if (game.canDirectAttack()) { - game.directAttack(); - return 6; - } - return 5; - } - return 4; - } - return 3; - } - return 2; - } - return 1; - } - - public int activeEffectErrorHandler() { - if (gameErrorHandler.doesSelectedCardExist()) { - if (gameErrorHandler.isSelectedCardSpell()) { - if (game.getPhase().equals("Main Phase1") || game.getPhase().equals("Main Phase2")) { - if (!gameErrorHandler.isSelectedSpellActive()) { - if (gameErrorHandler.isSelectedCardInHand() && gameErrorHandler.isSpellTrapFieldFull() - && game.isSelectedCardHaveToPutInField()) { - return 5; - } - if (game.canActivateSpell()) { - game.activeSpell(); - return 7; - } - return 6; - } - return 4; - } - return 3; - } - return 2; - } - return 1; - } - - public String showGraveyard() { - return game.showGraveyard(); - } - - public String controlCardShow() { - if (game.getSelectedCard() != null) { - if (!game.isSelectedCardVisibleToPlayer()) { - return "this card is not visible!"; - } else { - return game.showCard(); - } - } else { - return "no card is selected yet"; - } - } - - public String damageOnOpponent() { - return game.calculateDamageOnEnemy(); - } - - public String damageOnPlayer() { - return game.calculateDamageOnMe(); - } - - public String getDefenseTargetCardName() { - return game.getEnemyCardName(); - } - - public Game getGame() { - return game; - } - - public Boolean getYesNoAnswer(String question) { - return playerDuelMenu.getYesNoAnswer(question); - } - - public ArrayList getCardsForTribute(int n) { - return playerDuelMenu.getCardsForTribute(n); - } - - public String NumberOfField(String view) { - return playerDuelMenu.getInputNumberOfFieldForSpecialMonster(view); - } - - public MonsterCard getACardFromGraveyardForScanner(String view) { - String input = playerDuelMenu.getCardFromGraveYard(view); - if (input != null) { - ArrayList cards = game.getPlayerGameBoard().getGraveyard().getGraveyardCards(); - for (int i = 0; i < cards.size(); i++) { - if (cards.get(i).getCardName().equals(input) && cards.get(i) instanceof MonsterCard) { - return (MonsterCard) cards.get(i); - } - } - if (cards.size() == 0) { - try { - return new MonsterCard("Scanner"); - } catch (IOException e) { - e.printStackTrace(); - } - } - try { - return new MonsterCard("-1"); - } catch (IOException e) { - e.printStackTrace(); - } - } - return null; - } - - public ArrayList getCardFromPlayer(int n, CardField... fields) { - ArrayList selectedCards = new ArrayList<>(); - for (int i = 0; i < n; i++) { - while (true) { - String cardName = playerDuelMenu.getCardName(); - // for surrender and cancel: - - Card card = null; - for (CardField field : fields) { - if (field.doesCardExist(cardName)) { - card = field.getCardByName(cardName); - } - } - if (card != null) { - selectedCards.add(card); - break; - } else { - StringBuilder errorMessage = new StringBuilder("the selected card wasn't in: "); - for (CardField field : fields) { - errorMessage.append(field.getName()).append("\t"); - } - errorMessage.append("(try again!)"); - playerDuelMenu.showOutput(errorMessage.toString()); - } - } - } - return selectedCards; - } - - public void showOutput(String text) { - playerDuelMenu.showOutput(text); - } - - public int getNumberFromPlayer(String view) { - return playerDuelMenu.getNumber(view); - } - - public boolean doesPlayerWantToAddToTheChain(User player) { - showOutput("now it will be " + player.getUsername() + "’s turn"); - if (player == this.player) { - playerDuelMenu.updatePlayerGameBoard(); - } else { - playerDuelMenu.updateOpponentGameBoard(); - } - return getYesNoAnswer("do you want to add to this chain?"); - } - - public SpellTrapCard getSpellToAddToChain(User player, Chain chain) { - showOutput("please choose a valid spell to add to chain " + player.getUsername()); - SpellTrapCard spell; - while (true) { - spell = (SpellTrapCard) (getCardFromPlayer(1, chain.getPlayerGameBoard().getSpellTrapField())).get(0); - if (chain.canAddToChain(spell)) { - return spell; - } - } - } - - public boolean isCardExistsInMonsterField(String username, int index) { - return game.isMonsterExistInMonsterField(User.getUserByUsername(username), index); - } - - public void increaseLpCheat(int lp) { - game.increaseLp(lp); - } - - public void setWinnerCheat(String nickname) { - game.setWinner(nickname); - } - - public ArrayList getFieldCards(String fieldName) { - ArrayList cardData = new ArrayList<>(); - switch (fieldName) { - case "player_monster": - for (MonsterCard monster : game.getPlayerGameBoard().getMonsterField().getMonstersOnField()) { - String name = monster.getCardName(); - if (monster.getPosition() == PositionMonsters.DEFENSE) { - name = name + "_" + monster.getDefenceMode().toString(); - } - cardData.add(name); - } - break; - case "player_spell": - for (Card card : game.getPlayerGameBoard().getSpellTrapField().getSpellTrapsArrayList()) { - cardData.add(card.getCardName()); - } - break; - case "opponent_monster": - for (MonsterCard monster : game.getOpponentGameBoard().getMonsterField().getMonstersOnField()) { - if (monster.getPosition() != PositionMonsters.DEFENSE) { - if (monster.getDefenceMode() != DefensePosition.DH) { - cardData.add(monster.getDefenceMode().toString()); - } else { - cardData.add(monster.getCardName() + "_" + monster.getDefenceMode().toString()); - } - } else { - cardData.add(monster.getCardName()); - } - } - break; - case "opponent_spell": - for (Card ignored : game.getOpponentGameBoard().getSpellTrapField().getSpellTrapsArrayList()) { - cardData.add("opponent_spell"); - } - break; - } - return cardData; - } -} \ No newline at end of file diff --git a/src/main/java/controller/LoginController.io b/src/main/java/controller/LoginController.io deleted file mode 100644 index face7e3a..00000000 --- a/src/main/java/controller/LoginController.io +++ /dev/null @@ -1,28 +0,0 @@ -package controller; - -import model.user.User; - -public class LoginController { - - public int createUserErrorHandler(String username, String nickname, String password) { - if (User.doesUsernameExist(username)) { - return 1; - - } else if (User.doesNicknameExist(nickname)) { - return 2; - - } - // create new user: - new User(username, password, nickname); - return 0; - } - - public int loginUserErrorHandler(String username, String password) { - if (!User.isUserPassCorrect(username, password)) { - return 1; - - } - return 0; - } - -} diff --git a/src/main/java/controller/MainMenuController.io b/src/main/java/controller/MainMenuController.io deleted file mode 100644 index 2baa51e6..00000000 --- a/src/main/java/controller/MainMenuController.io +++ /dev/null @@ -1,37 +0,0 @@ -package controller; - -import model.user.User; - -public class MainMenuController extends Controller { - - public MainMenuController(String username) { - super(username); - } - - public int startGameErrorHandler(String opponentUsername, int rounds) { - User opponent = User.getUserByUsername(opponentUsername); - - if (!User.doesUsernameExist(opponentUsername)) { - return 1; - - } else if (!user.getUserDeck().doesActiveDeckExist()) { - return 2; - - } else if (!opponent.getUserDeck().doesActiveDeckExist()) { - return 3; - - } else if (!user.getUserDeck().isActiveDeckValid()) { - return 4; - - } else if (!opponent.getUserDeck().isActiveDeckValid()) { - return 5; - - } else if (!(rounds == 1 || rounds == 3)) { - return 6; - - } - - return 0; - } - -} diff --git a/src/main/java/controller/ProfileController.io b/src/main/java/controller/ProfileController.io deleted file mode 100644 index d563c858..00000000 --- a/src/main/java/controller/ProfileController.io +++ /dev/null @@ -1,42 +0,0 @@ -package controller; - -import model.user.User; - -public class ProfileController extends Controller { - - public ProfileController(String username) { - super(username); - } - - - public int changeNicknameErrorHandler(String nickname) { - if (User.doesNicknameExist(nickname)) { - return 1; - - } else { - assert user != null; - user.setNickname(nickname); - return 0; - - } - } - - public int changePasswordErrorHandler(String currentPassword, String newPassword) { - if (!user.isPasswordCorrect(currentPassword)) { - return 1; - - } else if (currentPassword.equals(newPassword)) { - return 2; - - } else { - user.setPassword(newPassword); - return 0; - - } - } - - public User getUser(){ - return user; - } - -} diff --git a/src/main/java/controller/Regex.io b/src/main/java/controller/Regex.io deleted file mode 100644 index 1d76041c..00000000 --- a/src/main/java/controller/Regex.io +++ /dev/null @@ -1,11 +0,0 @@ -package controller; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class Regex { - public static Matcher getMatcher(String input, String regexPattern) { - Pattern pattern = Pattern.compile(regexPattern); - return pattern.matcher(input); - } -} diff --git a/src/main/java/controller/ScoreboardController.io b/src/main/java/controller/ScoreboardController.io deleted file mode 100644 index 19d1ba3e..00000000 --- a/src/main/java/controller/ScoreboardController.io +++ /dev/null @@ -1,13 +0,0 @@ -package controller; - -import model.Scoreboard; - -import java.util.LinkedHashMap; - -public class ScoreboardController { - - public static LinkedHashMap getSortedNicknameScore() { - return Scoreboard.getSortedNicknameScore(); - } - -} diff --git a/src/main/java/controller/ShopController.io b/src/main/java/controller/ShopController.io deleted file mode 100644 index 79000bed..00000000 --- a/src/main/java/controller/ShopController.io +++ /dev/null @@ -1,47 +0,0 @@ -package controller; - -import model.Shop; - -import java.math.BigInteger; -import java.util.HashMap; - -public class ShopController extends Controller { - - private final Shop shop; - - public ShopController(String username) { - super(username); - shop = new Shop(username); - } - - public int getUserMoney() { - return user.getMoney(); - } - - - public int buyCardErrorHandler(String cardName) { - if (!Shop.doesCardExist(cardName)) { - return 1; - - } else if (!shop.hasEnoughMoney(cardName)) { - return 2; - - } else { - shop.buy(cardName); - return 0; - - } - } - - public int numberOfBoughtCards(String cardName) { - return user.getCardInventory().getCardCount(cardName); - } - - public HashMap getCardsPrices() { - return Shop.getCardsPrices(); - } - - public void increaseMoneyCheat(int money) { - shop.increaseMoney(money); - } -} diff --git a/src/main/java/model/ArtificialIntelligence.java b/src/main/java/model/ArtificialIntelligence.java index 6f49f33d..b871592f 100644 --- a/src/main/java/model/ArtificialIntelligence.java +++ b/src/main/java/model/ArtificialIntelligence.java @@ -10,10 +10,11 @@ public class ArtificialIntelligence { private User AI; - public ArtificialIntelligence(){ - AI=new User("AI","1234","artificial intelligence"); + + public ArtificialIntelligence() { + AI = new User("AI", "1234", "artificial intelligence"); AI.getCardInventory().setAICardInventory(); - AI.getUserDeck().createDeck("AIDECK",User.getUserByUsername("AI")); + AI.getUserDeck().createDeck("AIDECK", User.getUserByUsername("AI")); AI.getUserDeck().activateDeck("AIDECK"); AI.getUserDeck().getActiveDeck().setDeckForAI(); } @@ -23,25 +24,25 @@ public User getAI() { return AI; } - public static void playTurn(Game game){ + public static void playTurn(Game game) { game.drawPhase(); mainPhase1(game); battlePhase(game); game.endPhase(); } - private static void mainPhase1(Game game){ - Random random=new Random(); - if(game.getPlayerGameBoard().getHand().getCardsInHand().size()>0){ - Card card=game.getPlayerGameBoard().getHand().getCardFromHand(random.nextInt(game + private static void mainPhase1(Game game) { + Random random = new Random(); + if (game.getPlayerGameBoard().getHand().getCardsInHand().size() > 0) { + Card card = game.getPlayerGameBoard().getHand().getCardFromHand(random.nextInt(game .getPlayerGameBoard().getHand().getCardsInHand().size())); - if(card instanceof MonsterCard){ - if(game.getPlayerGameBoard().getMonsterField().getMonstersOnField().size()<5) { + if (card instanceof MonsterCard) { + if (game.getPlayerGameBoard().getMonsterField().getMonstersOnField().size() < 5) { game.getPlayerGameBoard().getMonsterField().addMonsterToField((MonsterCard) card); - ((MonsterCard) card).summon(); + ((MonsterCard) card).summon(); } - }else{ - if(game.getPlayerGameBoard().getSpellTrapField().getSpellTrapsArrayList().size()<5){ + } else { + if (game.getPlayerGameBoard().getSpellTrapField().getSpellTrapsArrayList().size() < 5) { game.getPlayerGameBoard().getSpellTrapField().addSpellTrapCard((SpellTrapCard) card); ((SpellTrapCard) card).set(); } @@ -49,21 +50,21 @@ private static void mainPhase1(Game game){ } } - private static void battlePhase(Game game){ - for(int i = 0; i gameCards; -// @FXML -// public Pane fieldPane; -// public Label selectedCardDescription; -// public Rectangle selectedCard; -// -// @Override -// public void start(Stage stage) throws IOException { -// gameCards = new ArrayList<>(); -// DuelMenuGui.stage = stage; -// Parent root = FXMLLoader.load(getClass().getResource("DuelMenuGui.fxml")); -// Scene scene = new Scene(root, 900, 600); -// stage.setScene(scene); -// stage.setTitle("YU-GI-OH!"); -// stage.setResizable(false); -// stage.show(); -// } -// -// @FXML -// private void initialize() { -// Image image = GetGameElements.getCardFieldImage(); -// BackgroundImage backgroundImage = new BackgroundImage(image, -// BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, -// BackgroundSize.DEFAULT); -// fieldPane.setBackground(new Background(backgroundImage)); -// DuelMenuGui.duelMenuGui = this; -//// updateGameBoard(); -// -// -// ArrayList opponentMonsterNames = new ArrayList<>(); -// opponentMonsterNames.add("DH"); -// opponentMonsterNames.add("Yomi Ship"); -// opponentMonsterNames.add("Man-Eater Bug_DO"); -// opponentMonsterNames.add("Blue-Eyes white dragon"); -// opponentMonsterNames.add("Scanner"); -// ArrayList opponentSpellNames = new ArrayList<>(); -// opponentSpellNames.add("opponent_spell"); -// opponentSpellNames.add("opponent_spell"); -// opponentSpellNames.add("opponent_spell"); -// opponentSpellNames.add("opponent_spell"); -// opponentSpellNames.add("opponent_spell"); -// ArrayList playerMonsterNames = new ArrayList<>(); -// playerMonsterNames.add("Suijin_DH"); -// playerMonsterNames.add("Curtain of the dark ones"); -// playerMonsterNames.add("Feral Imp_DO"); -// playerMonsterNames.add("Hero of the east"); -// playerMonsterNames.add("Battle warrior"); -// ArrayList playerSpellNames = new ArrayList<>(); -// playerSpellNames.add("Mind Crush"); -// playerSpellNames.add("Negate Attack"); -// playerSpellNames.add("Harpie's Feather Duster"); -// playerSpellNames.add("Messenger of peace"); -// playerSpellNames.add("Mystical space typhoon"); -// updateFields(opponentMonsterNames, "opponent_monster"); -// updateFields(opponentSpellNames, "opponent_spell"); -// updateFields(playerMonsterNames, "player_monster"); -// updateFields(playerSpellNames, "player_spell"); -// -// updateSelectedCard(); -// -// } -// -// public static void main(String[] args) { -// launch(args); -// } -// -// public static void setSelectedCardName(String cardName) { -// DuelMenuGui.selectedCardName = cardName; -// } -// -// public static String getSelectedCardName() { -// return DuelMenuGui.selectedCardName; -// } -// -// public static DuelMenuGui getDuelMenuGui() { -// return DuelMenuGui.duelMenuGui; -// } -// -// public void deSelectCards() { -// for (GameCard card : gameCards) { -// card.deselectCard(); -// } -// } -// -// public void updateGameBoard() { -// fieldPane.getChildren().removeAll(); -// for (String fieldName : CARD_FIELDS) { -// // updateFields(gameController.getFieldCards(fieldName), fieldName); -// } -// } -// -// private void updateFields(ArrayList cardData, String fieldName) { -// int startX = GameElementSize.CARD_START_X.getSize(); -// int startY = GameElementSize.getYSizeByName(fieldName); -// for (int i = 0; i < cardData.size(); i++) { -// boolean isVisible = getVisibility(fieldName, cardData.get(i)); -// int rotationDegree = getRotationDegree(fieldName, cardData.get(i)); -// String name; -// if (fieldName.equals(CARD_FIELDS[3])) { -// name = cardData.get(i); -// } else { -// name = cardData.get(i).split("_")[0]; -// } -// GameCard card = new GameCard(fieldPane, startX + (GameElementSize.CARD_DISTANCE.getSize() + -// GameElementSize.CARD_WIDTH.getSize()) * i, startY, name, isVisible, rotationDegree); -// fieldPane.getChildren().add(card); -// gameCards.add(card); -// } -// } -// -// private boolean getVisibility(String fieldName, String cardName) { -// boolean isVisible = true; -// if (fieldName.equals(CARD_FIELDS[3])) { -// isVisible = false; -// } else if (fieldName.equals(CARD_FIELDS[0])) { -// String[] data = cardName.split("_"); -// if (data.length > 1) { -// if (data[1].equals("DH")) { -// isVisible = false; -// } -// } -// } else if (fieldName.equals(CARD_FIELDS[2])) { -// if (cardName.equals("DH")) { -// isVisible = false; -// } -// } -// return isVisible; -// } -// -// private int getRotationDegree(String fieldName, String cardName) { -// int rotationDegree = 0; -// if (fieldName.equals(CARD_FIELDS[0])) { -// String[] data = cardName.split("_"); -// if (data.length > 1) { -// rotationDegree = 270; -// } -// } else if (fieldName.equals(CARD_FIELDS[2])) { -// rotationDegree = 180; -// String[] data = cardName.split("_"); -// if (data.length > 1 || cardName.equals("DH")) { -// rotationDegree = 90; -// } -// } else if (fieldName.equals(CARD_FIELDS[3])) { -// rotationDegree = 180; -// } -// return rotationDegree; -// } -// -// public void updateSelectedCard() { -// Image image; -// if (selectedCardName == null || -// selectedCardName.equals("DH") || -// selectedCardName.equals("opponent_spell")) { -// image = GetGameElements.getCardBack(); -// } else { -// image = GetImage.getCardImage(selectedCardName); -// } -// selectedCard.setFill(new ImagePattern(image)); -//// selectedCardDescription.setText(gameController.controlCardShow()); -// -// -// if (selectedCardName == null) { -// selectedCardDescription.setText("no card is selected!"); -// } else if (selectedCardName.equals("DH") || selectedCardName.equals("opponent_spell")) { -// selectedCardDescription.setText("description not available"); -// } else { -// selectedCardDescription.setText(Card.getCardByName(selectedCardName).getCardDescription()); -// } -// } -//} diff --git a/src/main/java/view/gui/GetInput.java b/src/main/java/view/gui/GetInput.java deleted file mode 100644 index a89d8fa3..00000000 --- a/src/main/java/view/gui/GetInput.java +++ /dev/null @@ -1,40 +0,0 @@ -//package view.gui; -// -//import javafx.scene.control.Alert; -//import javafx.scene.control.ButtonBar; -//import javafx.scene.control.ButtonType; -//import javax.activation.MimetypesFileTypeMap; -//import javafx.stage.FileChooser; -// -//import java.io.File; -//import java.util.concurrent.atomic.AtomicBoolean; -// -//public class GetInput { -// public static boolean getYesNoAnswer(String title, String question) { -// AtomicBoolean result = new AtomicBoolean(false); -// -// Alert alert = new Alert(Alert.AlertType.CONFIRMATION); -// alert.setTitle(title); -// alert.setHeaderText(question); -// ButtonType yesButton = new ButtonType("Yes", ButtonBar.ButtonData.YES); -// ButtonType noButton = new ButtonType("No", ButtonBar.ButtonData.NO); -// alert.getButtonTypes().setAll(yesButton, noButton); -// alert.showAndWait().ifPresent(type -> { -// result.set(type == yesButton); -// }); -// -// return result.get(); -// } -// -// public static File choosePictureFile(){ -// FileChooser fileChooser=new FileChooser(); -// File file=fileChooser.showOpenDialog(null); -// String mimetype= new MimetypesFileTypeMap().getContentType(file); -// String type = mimetype.split("/")[0]; -// if(type.equals("image")){ -// return file; -// }else{ -// return null; -// } -// } -//} diff --git a/src/main/java/view/gui/LoginMenuGui.java b/src/main/java/view/gui/LoginMenuGui.java deleted file mode 100644 index 11c45e27..00000000 --- a/src/main/java/view/gui/LoginMenuGui.java +++ /dev/null @@ -1,131 +0,0 @@ -//package view.gui; -// -//import controller.DatabaseController; -//import controller.LoginController; -//import javafx.fxml.FXML; -//import javafx.fxml.FXMLLoader; -//import javafx.scene.Parent; -//import javafx.scene.Scene; -//import javafx.scene.control.Button; -//import javafx.scene.control.TextField; -//import javafx.scene.image.Image; -//import javafx.scene.input.MouseEvent; -//import javafx.scene.paint.ImagePattern; -//import javafx.scene.shape.Rectangle; -//import javafx.stage.Stage; -//import model.user.User; -//import view.gui.elements.GetImage; -// -//import java.io.IOException; -// -//public class LoginMenuGui extends MenuGui { -// -// private static LoginController loginController; -// private static Stage stage; -// -// public TextField usernameSignUpTextBox; -// public TextField nicknameSignUpTextBox; -// public TextField passwordSignUpTextBox; -// public TextField usernameLoginTextBox; -// public TextField passwordLoginTextBox; -// public Button signUpButton; -// public Button loginButton; -// public Button exitButton; -// public Rectangle yugiohRect; -// -// @Override -// public void start(Stage stage) throws IOException { -// LoginMenuGui.stage = stage; -// Parent root = FXMLLoader.load(getClass().getResource("LoginMenuGui.fxml")); -// Scene scene = new Scene(root, 1080, 720); -// stage.setScene(scene); -// stage.setTitle("YU-GI-OH!"); -// stage.getIcons().add(GetImage.getGameIcon()); -// stage.show(); -// } -// -// @FXML -// private void initialize() { -// Image image = GetImage.getImage("YuGiOh.png"); -// yugiohRect.setWidth(256); -// yugiohRect.setHeight(128); -// yugiohRect.setFill(new ImagePattern(image)); -// } -// -// public static void main(String[] args) { -// launch(args); -// } -// -// -// private LoginController getLoginController() { -// if (loginController == null) loginController = new LoginController(); -// return loginController; -// } -// -// private boolean isInputFormatCorrect(String username, String nickname, String password) { -// if (username.matches("\\W") || username.equals("")) { -// ShowOutput.showOutput("Error", "The entered username's format is incorrect!"); -// return false; -// } else if (nickname.matches("\\W") || nickname.equals("")) { -// ShowOutput.showOutput("Error", "The entered nickname's format is incorrect!"); -// return false; -// } else if (password.matches("\\W") || password.equals("")) { -// ShowOutput.showOutput("Error", "The entered password's format is incorrect!"); -// return false; -// } -// return true; -// } -// -// private void signUp(String username, String nickname, String password) { -// if (isInputFormatCorrect(username, nickname, password)) { -// int error = getLoginController().createUserErrorHandler(username, nickname, password); -// if (error == 0) { -// ShowOutput.showOutput("Success", "user created successfully!"); -// } else if (error == 1) { -// ShowOutput.showOutput("Error", "user with username " + username + " exists"); -// } else if (error == 2) { -// ShowOutput.showOutput("Error", "user with nickname " + nickname + " exists"); -// } -// } -// } -// -// private void login(String username, String password) throws Exception { -// int error = getLoginController().loginUserErrorHandler(username, password); -// if (error == 0) { -// ShowOutput.showOutput("Success", "user logged in successfully!"); -// MainMenuGui mainMenuGui = new MainMenuGui(); -// MainMenuGui.setUser(User.getUserByUsername(username)); -// mainMenuGui.start(stage); -// -// } else if (error == 1) { -// ShowOutput.showOutput("Error", "Username and password didn't match!"); -// } -// } -// -// private void clearTextBoxes() { -// usernameSignUpTextBox.setText(""); -// nicknameSignUpTextBox.setText(""); -// passwordSignUpTextBox.setText(""); -// usernameLoginTextBox.setText(""); -// passwordLoginTextBox.setText(""); -// } -// -// public void signUp(MouseEvent mouseEvent) { -// String username = usernameSignUpTextBox.getText(); -// String nickname = nicknameSignUpTextBox.getText(); -// String password = passwordSignUpTextBox.getText(); -// signUp(username, nickname, password); -// clearTextBoxes(); -// } -// -// public void login(MouseEvent mouseEvent) throws Exception { -// String username = usernameLoginTextBox.getText(); -// String password = passwordLoginTextBox.getText(); -// login(username, password); -// } -// -// public void exit(MouseEvent mouseEvent) { -// DatabaseController.exportUsers(); -// System.exit(1); -// } -//} diff --git a/src/main/java/view/gui/MainGui.java b/src/main/java/view/gui/MainGui.java deleted file mode 100644 index 4e4c4657..00000000 --- a/src/main/java/view/gui/MainGui.java +++ /dev/null @@ -1,5 +0,0 @@ -//package view.gui; -// -//public class MainGui { -// -//} diff --git a/src/main/java/view/gui/MainMenuGui.java b/src/main/java/view/gui/MainMenuGui.java deleted file mode 100644 index dfe29787..00000000 --- a/src/main/java/view/gui/MainMenuGui.java +++ /dev/null @@ -1,82 +0,0 @@ -//package view.gui; -// -//import controller.DeckController; -//import controller.MainMenuController; -//import controller.ProfileController; -//import controller.ShopController; -//import javafx.application.Application; -//import javafx.fxml.FXMLLoader; -//import javafx.scene.Parent; -//import javafx.scene.Scene; -//import javafx.scene.control.Button; -//import javafx.scene.input.MouseEvent; -//import javafx.stage.Stage; -//import model.user.User; -// -//import java.io.IOException; -// -//public class MainMenuGui extends MenuGui { -// private static Stage stage; -// private static MainMenuController mainMenuController; -// private static User user; -// -// -// -// @Override -// public void start(Stage stage) throws Exception { -// MainMenuGui.stage = stage; -// Parent root = FXMLLoader.load(getClass().getResource("MainMenuGui.fxml")); -// Scene scene = new Scene(root, 1080, 720); -// stage.setScene(scene); -// stage.setTitle("YU-GI-OH!"); -// } -// -// public static void setUser(User user) { -// MainMenuGui.user = user; -// } -// -// public void startDuel(MouseEvent mouseEvent) { -// } -// -// public void startDeckMenu(MouseEvent mouseEvent) { -// DeckMenuGui deckMenuGui=new DeckMenuGui(); -// DeckController deckController=new DeckController(user.getUsername()); -// DeckMenuGui.setDeckController(deckController); -// try { -// deckMenuGui.start(stage); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// -// public void startScoreBoardMenu(MouseEvent mouseEvent) throws Exception { -// ScoreBoardMenuGui scoreBoardMenuGui = new ScoreBoardMenuGui(); -// ScoreBoardMenuGui.setUser(user); -// scoreBoardMenuGui.start(stage); -// } -// -// public void startProfileMenu(MouseEvent mouseEvent) { -// ProfileMenuGui profileMenuGui=new ProfileMenuGui(); -// ProfileMenuGui.setProfileController(new ProfileController(user.getUsername())); -// try { -// profileMenuGui.start(stage); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// } -// -// public void startShopMenu(MouseEvent mouseEvent) throws Exception { -// ShopMenuGui shopMenuGui = new ShopMenuGui(); -// ShopMenuGui.setUsername(user.getUsername()); -// shopMenuGui.start(stage); -// } -// -// public void startImportExportMenu(MouseEvent mouseEvent) { -// } -// -// public void logout(MouseEvent mouseEvent) throws IOException { -// LoginMenuGui loginMenuGui = new LoginMenuGui(); -// loginMenuGui.start(stage); -// } -//} diff --git a/src/main/java/view/gui/MenuGui.java b/src/main/java/view/gui/MenuGui.java deleted file mode 100644 index ca786be2..00000000 --- a/src/main/java/view/gui/MenuGui.java +++ /dev/null @@ -1,8 +0,0 @@ -//package view.gui; -// -//import javafx.application.Application; -// -//public abstract class MenuGui extends Application { -// -// -//} diff --git a/src/main/java/view/gui/ProfileMenuGui.java b/src/main/java/view/gui/ProfileMenuGui.java deleted file mode 100644 index 7c089745..00000000 --- a/src/main/java/view/gui/ProfileMenuGui.java +++ /dev/null @@ -1,170 +0,0 @@ -//package view.gui; -// -//import controller.ProfileController; -//import javafx.event.EventHandler; -//import javafx.fxml.FXMLLoader; -//import javafx.scene.Scene; -//import javafx.scene.control.Button; -//import javafx.scene.control.TextField; -//import javafx.scene.effect.DropShadow; -//import javafx.scene.image.Image; -//import javafx.scene.image.ImageView; -//import javafx.scene.input.MouseEvent; -//import javafx.scene.layout.AnchorPane; -//import javafx.scene.layout.HBox; -//import javafx.scene.text.Text; -//import javafx.scene.text.TextAlignment; -//import javafx.stage.Stage; -//import model.user.User; -//import org.apache.commons.io.FileUtils; -// -//import java.io.*; -// -//public class ProfileMenuGui extends MenuGui { -// -// public ImageView imageView; -// public AnchorPane anchorPane; -// public TextField newNickname; -// public TextField oldPassword; -// public TextField newPassword; -// private static Stage stage; -// private static ProfileController profileController; -// -// -// @Override -// public void start(Stage stage) throws Exception { -// anchorPane = FXMLLoader.load(getClass().getResource("ProfileMenuGui.fxml")); -// Scene scene = new Scene(anchorPane); -// ProfileMenuGui.stage = stage; -// ProfileMenuGui.stage.setScene(scene); -// setUsernameAndNickname(); -// } -// -// public void initialize() { -// User user = profileController.getUser(); -// imageView.setImage(User.getPicture(user.getProfilePicturePath())); -// } -// -// public static void setProfileController(ProfileController profileController) { -// ProfileMenuGui.profileController = profileController; -// } -// -// public void ChooseFile(MouseEvent mouseEvent) throws FileNotFoundException { -// File file = GetInput.choosePictureFile(); -// if (file != null) { -// File file1=new File("src/main/resources/view/gui/pictureFiles"+file.getName()); -// try { -// FileUtils.copyFile(file, file1); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// Image image = new Image(new FileInputStream(file.getPath())); -// imageView.setFitWidth(150); -// imageView.setImage(image); -// profileController.getUser().setProfilePicturePath(file.getPath()); -// } else { -// buttonError(); -// } -// } -// -// private void buttonError() { -// Button button = new Button(); -// button.setText("wrong file type please try again"); -// button.setStyle("-fx-cursor: Hand"); -// button.setEffect(new DropShadow()); -// button.setLayoutX(81); -// button.setLayoutY(295); -// button.setOnMouseClicked(new EventHandler() { -// @Override -// public void handle(MouseEvent mouseEvent) { -// anchorPane.getChildren().remove(button); -// } -// }); -// anchorPane.getChildren().add(button); -// } -// -// private void setUsernameAndNickname() { -// Text usernameText = new Text(); -// Text nicknameText = new Text(); -// usernameText.setX(309); -// usernameText.setY(109); -// nicknameText.setY(149); -// nicknameText.setX(309); -// usernameText.setText("username: " + profileController.getUser().getUsername()); -// nicknameText.setText("nickname: " + profileController.getUser().getNickname()); -// anchorPane.getChildren().add(usernameText); -// anchorPane.getChildren().add(nicknameText); -// } -// -// public void back(MouseEvent mouseEvent) { -// try { -// new MainMenuGui().start(stage); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// -// public void changeNickname(MouseEvent mouseEvent) { -// int error = profileController.changeNicknameErrorHandler(newNickname.getText()); -// if (error == 1) { -// errorBox("this nickname is already exist please try again"); -// } else { -// try { -// this.start(stage); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// } -// -// private void errorBox(String text2) { -// Stage stage1 = new Stage(); -// stage1.setWidth(300); -// stage1.setHeight(300); -// stage1.setTitle("Error Box"); -// AnchorPane anchorPane = new AnchorPane(); -// anchorPane.setPrefHeight(300); -// anchorPane.setPrefWidth(300); -// anchorPane.setStyle("-fx-background-color: rgba(255,255,152,0.92)"); -// Text text = new Text(); -// text.setText(text2); -// text.setTextAlignment(TextAlignment.CENTER); -// HBox hbox = new HBox(text); -// Button button = new Button(); -// button.setText("close"); -// button.setStyle("-fx-cursor: hand"); -// button.setOnMouseClicked(new EventHandler() { -// @Override -// public void handle(MouseEvent mouseEvent) { -// stage1.close(); -// } -// }); -// button.setLayoutY(170); -// button.setLayoutX(120); -// button.setStyle("-fx-cursor: Hand"); -// button.setStyle("-fx-background-color: #ff6a6a"); -// anchorPane.getChildren().add(hbox); -// anchorPane.getChildren().add(button); -// Scene scene = new Scene(anchorPane); -// stage1.setScene(scene); -// stage1.show(); -// newNickname.setText(""); -// } -// -// public void changePassword(MouseEvent mouseEvent) { -// int error = profileController.changePasswordErrorHandler(oldPassword.getText(), newPassword.getText()); -// if (error == 1) { -// errorBox("incorrect old password"); -// } else if (error == 2) { -// errorBox("your old and new password are equal"); -// } else { -// try { -// new ProfileMenuGui().start(stage); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// } -// -// -//} diff --git a/src/main/java/view/gui/ScoreBoardMenuGui.java b/src/main/java/view/gui/ScoreBoardMenuGui.java deleted file mode 100644 index 6ddf9126..00000000 --- a/src/main/java/view/gui/ScoreBoardMenuGui.java +++ /dev/null @@ -1,88 +0,0 @@ -//package view.gui; -// -//import controller.ScoreboardController; -//import javafx.application.Application; -//import javafx.fxml.FXML; -//import javafx.fxml.FXMLLoader; -//import javafx.geometry.Insets; -//import javafx.geometry.Pos; -//import javafx.scene.Parent; -//import javafx.scene.Scene; -//import javafx.scene.control.Label; -//import javafx.scene.control.ListView; -//import javafx.scene.input.MouseEvent; -//import javafx.scene.layout.*; -//import javafx.scene.paint.Color; -//import javafx.scene.paint.Paint; -//import javafx.stage.Stage; -//import model.user.User; -// -//import java.util.ArrayList; -//import java.util.LinkedHashMap; -//import java.util.Map; -// -//public class ScoreBoardMenuGui extends MenuGui { -// private static Stage stage; -// private static User user; -// -// @FXML -// public BorderPane borderpane; -// @FXML -// public GridPane scoreboard; -// -// @Override -// public void start(Stage stage) throws Exception { -// Parent root = FXMLLoader.load(getClass().getResource("ScoreBoardMenu.fxml")); -// ScoreBoardMenuGui.stage=stage; -// Scene scene = new Scene(root, 1080, 720); -// stage.setScene(scene); -// stage.setTitle("Score Board"); -// } -// -// @FXML -// void initialize() { -// LinkedHashMap list = ScoreboardController.getSortedNicknameScore(); -// ArrayList keyList = new ArrayList<>(); -// keyList.addAll(list.keySet()); -// -// for (int i = 0; i < list.size(); i++) { -// String key = keyList.get(i); -// setList(i, key, list.get(key)); -// } -// } -// -// public static void setUser(User user) { -// ScoreBoardMenuGui.user = user; -// } -// -// private void setList(int i, String nickName, Integer score) { -// boolean isLoginUser = false; -// if (nickName.equals(user.getNickname())) -// isLoginUser = true; -// -// scoreboard.add(getLabel(String.valueOf(i + 1), isLoginUser), 0, i + 1); -// scoreboard.add(getLabel(nickName, isLoginUser), 1, i + 1); -// scoreboard.add(getLabel(String.valueOf(score), isLoginUser), 2, i + 1); -// -// -// } -// -// private Label getLabel(String text, boolean isLoginUser) { -// Label label = new Label(text); -// label.setStyle("-fx-font-family: Arial;" + -// "-fx-font-size: 13;" + -// "-fx-font-weight: bold;"); -// label.setPrefWidth(100); -// label.setPrefHeight(26); -// label.setAlignment(Pos.CENTER); -// if (isLoginUser) -// label.setBackground(new Background(new -// BackgroundFill(Color.rgb(0, 0, 80, 0.7), new CornerRadii(0), new Insets(0)))); -// return label; -// } -// -// public void backToMainMenu(MouseEvent mouseEvent) throws Exception { -// MainMenuGui mainMenuGui = new MainMenuGui(); -// mainMenuGui.start(stage); -// } -//} diff --git a/src/main/java/view/gui/ShopCellMenu.java b/src/main/java/view/gui/ShopCellMenu.java deleted file mode 100644 index b22f3b1c..00000000 --- a/src/main/java/view/gui/ShopCellMenu.java +++ /dev/null @@ -1,85 +0,0 @@ -//package view.gui; -// -//import controller.ShopController; -//import javafx.scene.control.Button; -//import javafx.scene.control.Tooltip; -//import javafx.scene.image.ImageView; -//import javafx.scene.layout.AnchorPane; -//import javafx.scene.paint.ImagePattern; -//import javafx.scene.shape.Rectangle; -//import javafx.scene.text.Font; -//import javafx.scene.text.Text; -//import view.gui.elements.GetImage; -// -//import java.io.IOException; -// -//public class ShopCellMenu extends AnchorPane { -// private static ShopController shopController; -// private String cardName; -// private ImageView imageView; -// private Button buyButton; -// private Text numberOfBoughtCardsText; -// -// public ShopCellMenu(String cardName) { -// super(); -// this.setWidth(296.25); -// this.setHeight(400); -// this.setStyle("-fx-background-color: red; -fx-border-color: orange"); -// this.cardName = cardName; -// setAnchorPane(); -// } -// -// public static void setShopController(ShopController shopController) { -// ShopCellMenu.shopController = shopController; -// } -// -// public void setAnchorPane() { -// Rectangle rectangle = new Rectangle(); -// rectangle.setFill(new ImagePattern(GetImage.getCardImage(cardName))); -// rectangle.setHeight(368.4); -// rectangle.setWidth(252.5); -// this.getChildren().add(rectangle); -// setButton(); -// setCardText(); -// } -// -// public void setButton() { -// buyButton = new Button(); -// buyButton.setText("buy"); -// int price = shopController.getCardsPrices().get(cardName); -// // Tooltip tooltip = new Tooltip("card price: " + price + "\nyour money: " + shopController.getUserMoney()); -// // buyButton.setTooltip(tooltip); -// buyButton.setOnMouseClicked(e -> { -// try { -// buyCard(); -// } catch (IOException ioException) { -// ioException.printStackTrace(); -// } -// }); -// buyButton.setLayoutX(255); -// this.getChildren().add(buyButton); -// } -// -// public void setCardText() { -// numberOfBoughtCardsText = new Text(""); -// numberOfBoughtCardsText.setFont(new Font("Arial Bold", 12)); -// int number = shopController.numberOfBoughtCards(cardName); -// if (number != 0) -// numberOfBoughtCardsText.setText("bought cards: " + number); -// numberOfBoughtCardsText.setY(384.2); -// this.getChildren().add(numberOfBoughtCardsText); -// } -// -// public void buyCard() throws IOException { -// // if (shopController.getCardsPrices().get(cardName) <= shopController.getUserMoney()) { -// int result = shopController.buyCardErrorHandler(cardName); -// numberOfBoughtCardsText.setText("1"); -// if (result == 2) -// ShowOutput.showOutput("Error", "not enough money"); -// else { -// ShowOutput.showOutput("Success", "Card added successfully"); -// numberOfBoughtCardsText.setText("bought cards: " + shopController.numberOfBoughtCards(cardName)); -// } -// } -// } -//} diff --git a/src/main/java/view/gui/ShopMenuGui.java b/src/main/java/view/gui/ShopMenuGui.java deleted file mode 100644 index fff7fd08..00000000 --- a/src/main/java/view/gui/ShopMenuGui.java +++ /dev/null @@ -1,73 +0,0 @@ -//package view.gui; -// -//import controller.ShopController; -//import javafx.application.Application; -//import javafx.fxml.FXML; -//import javafx.fxml.FXMLLoader; -//import javafx.scene.Parent; -//import javafx.scene.Scene; -//import javafx.scene.control.ScrollPane; -//import javafx.scene.input.MouseEvent; -//import javafx.scene.layout.GridPane; -//import javafx.scene.text.Text; -//import javafx.stage.Stage; -//import model.Shop; -//import model.card.Card; -//import model.user.User; -// -//import java.util.Arrays; -//import java.util.HashMap; -// -//public class ShopMenuGui extends Application { -// private static Stage stage; -// private static String logInUsername; -// @FXML -// public GridPane gridPane; -// private ShopCellMenu[][] shopCellMenus; -// -// public static void setUsername(String username) { -// ShopMenuGui.logInUsername = username; -// } -// -// -// @Override -// public void start(Stage primaryStage) throws Exception { -// ShopMenuGui.stage = primaryStage; -// Parent root = FXMLLoader.load(getClass().getResource("ShopMenuGui.fxml")); -// ScrollPane scrollPane = new ScrollPane(); -// scrollPane.setStyle("-fx-background-color: black"); -// scrollPane.setFitToWidth(true); -// scrollPane.setContent(root); -// Scene scene = new Scene(scrollPane, 1080, 720); -// stage.setScene(scene); -// stage.setTitle("shop"); -// } -// -// @FXML -// void initialize() { -// shopCellMenus = new ShopCellMenu[17][4]; -// HashMap cards = new ShopController(logInUsername).getCardsPrices(); -// for (int index = 0; index < cards.keySet().size() - 2; index++) { -// int j = index % 4; -// int i = index / 4; -// ShopCellMenu.setShopController(new ShopController(logInUsername)); -// ShopCellMenu shopCellMenu = new ShopCellMenu((String) cards.keySet().toArray()[index]); -// shopCellMenus[i][j] = shopCellMenu; -// } -// -// for (int i = 0; i < 17; i++) { -// for (int j = 0; j < 4; j++) { -// gridPane.add(shopCellMenus[i][j], j, i); -// } -// } -// ShopCellMenu shopCellMenu = new ShopCellMenu((String) cards.keySet().toArray()[68]); -// ShopCellMenu shopCellMenu1 = new ShopCellMenu((String) cards.keySet().toArray()[69]); -// gridPane.add(shopCellMenu, 0, 17); -// gridPane.add(shopCellMenu1, 1, 17); -// } -// -// public void backToMainMenu(MouseEvent mouseEvent) throws Exception { -// MainMenuGui mainMenuGui = new MainMenuGui(); -// mainMenuGui.start(stage); -// } -//} diff --git a/src/main/java/view/gui/ShowOutput.java b/src/main/java/view/gui/ShowOutput.java deleted file mode 100644 index 3d5e0dfc..00000000 --- a/src/main/java/view/gui/ShowOutput.java +++ /dev/null @@ -1,19 +0,0 @@ -//package view.gui; -// -//import javafx.scene.control.Alert; -// -//public class ShowOutput { -// public static void showOutput(String title, String header, String message) { -// Alert alert = new Alert(Alert.AlertType.INFORMATION); -// alert.setTitle(title); -// alert.setHeaderText(header); -// alert.setContentText(message); -// alert.show(); -// } -// public static void showOutput(String title, String header) { -// Alert alert = new Alert(Alert.AlertType.INFORMATION); -// alert.setTitle(title); -// alert.setHeaderText(header); -// alert.show(); -// } -//} diff --git a/src/main/java/view/gui/elements/GameCard.java b/src/main/java/view/gui/elements/GameCard.java deleted file mode 100644 index 40aeffaf..00000000 --- a/src/main/java/view/gui/elements/GameCard.java +++ /dev/null @@ -1,90 +0,0 @@ -//package view.gui.elements; -// -//import javafx.event.EventHandler; -//import javafx.scene.effect.DropShadow; -//import javafx.scene.effect.Effect; -//import javafx.scene.input.MouseEvent; -//import javafx.scene.layout.*; -//import javafx.scene.paint.Color; -//import javafx.scene.paint.ImagePattern; -//import javafx.scene.shape.Rectangle; -//import view.gui.DuelMenuGui; -// -//public class GameCard extends Rectangle { -// private Pane parent; -// private String cardName; -// -// public GameCard(Pane parent, double x, double y, String cardName, boolean isVisible, int rotationDegree) { -// super(x, y, GameElementSize.CARD_WIDTH.getSize(), GameElementSize.CARD_HEIGHT.getSize()); -// this.parent = parent; -// this.cardName = cardName; -// if (!isVisible) { -// setFill(new ImagePattern(GetGameElements.getCardBack())); -// } else { -// setFill(new ImagePattern(GetImage.getCardImage(cardName))); -// } -// this.setOnMouseEntered(GameCard.getMouseEnteredEvent(this)); -// this.setOnMouseExited(GameCard.getMouseExitedEvent(this)); -// this.setOnMouseClicked(GameCard.getMouseClickedEvent(this)); -// this.setRotate(rotationDegree); -// } -// -// public GameCard(Pane parent, double x, double y, String cardName) { -// super(x, y, GameElementSize.CARD_WIDTH.getSize(), GameElementSize.CARD_HEIGHT.getSize()); -// this.parent = parent; -// this.cardName = cardName; -// setFill(new ImagePattern(GetImage.getCardImage(cardName))); -// this.setOnMouseEntered(GameCard.getMouseEnteredEvent(this)); -// this.setOnMouseExited(GameCard.getMouseExitedEvent(this)); -// this.setOnMouseClicked(GameCard.getMouseClickedEvent(this)); -// } -// -// private static DropShadow getCardMouseEnteredDropShadow() { -// return new DropShadow(); -// } -// -// private static EventHandler getMouseEnteredEvent(Rectangle rectangle) { -// return new EventHandler() { -// @Override -// public void handle(MouseEvent mouseEvent) { -// rectangle.setEffect(getCardMouseEnteredDropShadow()); -// } -// }; -// } -// -// private static EventHandler getMouseExitedEvent(Rectangle rectangle) { -// return new EventHandler() { -// @Override -// public void handle(MouseEvent mouseEvent) { -// Effect effect = rectangle.getEffect(); -// if (effect instanceof DropShadow) { -// if (((DropShadow) effect).getColor() != Color.WHITE) { -// rectangle.setEffect(null); -// } -// } -// } -// }; -// } -// -// private static EventHandler getMouseClickedEvent(GameCard card) { -// return new EventHandler() { -// @Override -// public void handle(MouseEvent mouseEvent) { -// DuelMenuGui.setSelectedCardName(card.getCardName()); -// DuelMenuGui.getDuelMenuGui().updateSelectedCard(); -// DuelMenuGui.getDuelMenuGui().deSelectCards(); -// DropShadow selectedShadow = new DropShadow(); -// selectedShadow.setColor(Color.WHITE); -// card.setEffect(selectedShadow); -// } -// }; -// } -// -// public String getCardName() { -// return cardName; -// } -// -// public void deselectCard() { -// this.setEffect(null); -// } -//} diff --git a/src/main/java/view/gui/elements/GameElementSize.java b/src/main/java/view/gui/elements/GameElementSize.java deleted file mode 100644 index cfd1efff..00000000 --- a/src/main/java/view/gui/elements/GameElementSize.java +++ /dev/null @@ -1,39 +0,0 @@ -//package view.gui.elements; -// -// -//public enum GameElementSize { -// CARD_WIDTH(51), -// CARD_HEIGHT(75), -// CARD_DISTANCE(26), -// CARD_START_X(116), -// PLAYER_MONSTER_Y(325), -// PLAYER_SPELL_Y(425), -// OPPONENT_MONSTER_Y(200), -// OPPONENT_SPELL_Y(100), -// CARD_SELECTED_WIDTH(210), -// CARD_SELECTED_HEIGHT(307); -// -// private final int size; -// -// GameElementSize(int size) { -// this.size = size; -// } -// -// public static int getYSizeByName(String name) { -// switch (name) { -// case "player_monster": -// return PLAYER_MONSTER_Y.size; -// case "player_spell": -// return PLAYER_SPELL_Y.size; -// case "opponent_monster": -// return OPPONENT_MONSTER_Y.size; -// case "opponent_spell": -// return OPPONENT_SPELL_Y.getSize(); -// } -// return 0; -// } -// -// public int getSize() { -// return size; -// } -//} diff --git a/src/main/java/view/gui/elements/GetGameElements.java b/src/main/java/view/gui/elements/GetGameElements.java deleted file mode 100644 index c3f87b67..00000000 --- a/src/main/java/view/gui/elements/GetGameElements.java +++ /dev/null @@ -1,13 +0,0 @@ -//package view.gui.elements; -// -//import javafx.scene.image.Image; -// -//public class GetGameElements { -// public static Image getCardFieldImage() { -// return new Image(String.valueOf(GetGameElements.class.getResource("game/field/field.bmp"))); -// } -// -// public static Image getCardBack() { -// return new Image(String.valueOf(GetGameElements.class.getResource("cards/CardBack.jpg"))); -// } -//} diff --git a/src/main/java/view/gui/elements/GetImage.java b/src/main/java/view/gui/elements/GetImage.java deleted file mode 100644 index 9e9ce252..00000000 --- a/src/main/java/view/gui/elements/GetImage.java +++ /dev/null @@ -1,46 +0,0 @@ -//package view.gui.elements; -// -//import javafx.scene.image.Image; -//import javafx.scene.paint.ImagePattern; -//import javafx.scene.shape.Rectangle; -// -//import java.io.FileInputStream; -//import java.io.FileNotFoundException; -// -//public class GetImage { -// public static Image getGameIcon() { -// return new Image(String.valueOf(GetImage.class.getResource("img/GameIcon.png"))); -// } -// -// public static Image getImage(String imageName) { -// String path = String.valueOf(GetImage.class.getResource("img")); -// path += "/" + imageName; -// return new Image(path); -// } -// -// public static Image getCardImage(String cardName) { -// return findFile(cardName); -// } -// -// private static Image findFile(String name) { -// name = name.trim(); -// String[] names = name.split(" "); -// StringBuilder finalName = new StringBuilder(); -// for (int i = 0; i < names.length; i++) { -// char u = names[i].charAt(0); -// if (!(u >= 'A' && u <= 'Z')) { -// u -= 32; -// String newName = u + names[i].substring(1); -// names[i] = newName; -// } -// finalName.append(names[i]); -// } -// Image file = null; -// try { -// file = new Image(new FileInputStream("src/main/resources/view/gui/elements/cards/" + finalName + ".jpg")); -// } catch (FileNotFoundException e) { -// e.printStackTrace(); -// } -// return file; -// } -//} diff --git a/src/main/resources/Monster.csv b/src/main/resources/Monster.csv deleted file mode 100644 index adf16485..00000000 --- a/src/main/resources/Monster.csv +++ /dev/null @@ -1,43 +0,0 @@ -Name,Level,Attribute, Monster Type , Card Type ,Atk,Def,Description,Price -Battle OX,4,EARHT,Beast-Warrior,Normal,1700,1000,"A monster with tremendous power, it destroys enemies with a swing of its axe.",2900 -Axe Raider,4,EARHT,Warrior,Normal,1700,1150,An axe-wielding monster of tremendous strength and agility.,3100 -Yomi Ship,3,WATER,Aqua,Effect,800,1400,If this card is destroyed by battle and sent to the GY: Destroy the monster that destroyed this card.,1700 -Horn Imp,4,DARK,Fiend,Normal,1300,1000,"A small fiend that dwells in the dark, its single horn makes it a formidable opponent.",2500 -Silver Fang,3,EARTH,Beast,Normal,1200,800,"A snow wolf that's beautiful to the eye, but absolutely vicious in battle.",1700 -Suijin,7,WATER,Aqua,Effect,2500,2400,"During damage calculation in your opponent's turn, if this card is being attacked: You can target the attacking monster; make that target's ATK 0 during damage calculation only (this is a Quick Effect). This effect can only be used once while this card is face-up on the field.",8700 -Fireyarou,4,FIRE,Pyro,Normal,1300,1000,A malevolent creature wrapped in flames that attacks enemies with intense fire.,2500 -Curtain of the dark ones,2,DARK,Spellcaster,Normal,600,500,"A curtain that a spellcaster made, it is said to raise a dark power.",700 -Feral Imp,4,DARK,Fiend,Normal,1300,1400,"A playful little fiend that lurks in the dark, waiting to attack an unwary enemy.",2800 -Dark magician,7,DARK,Spellcaster,Normal,2500,2100,The ultimate wizard in terms of attack and defense.,8300 -Wattkid,3,LIGHT,Thunder,Normal,1000,500,A creature that electrocutes opponents with bolts of lightning.,1300 -Baby Dragon,3,WIND,Dragon,Normal,1200,700,"Much more than just a child, this dragon is gifted with untapped power.",1600 -Hero of the east,3,EARTH,Warrior,Normal,1100,1000,Feel da strength ah dis sword-swinging samurai from da Far East.,1700 -Battle warrior,3,EARTH,Warrior,Normal,700,1000,A warrior that fights with his bare hands!!!,1300 -Crawling dragon,5,EARTH,Dragon,Normal,1600,1400,"This weakened dragon can no longer fly, but is still a deadly force to be reckoned with.",3900 -Flame manipulator,3,FIRE,Spellcaster,Normal,900,1000,"This Spellcaster attacks enemies with fire-related spells such as ""Sea of Flames"" and ""Wall of Fire"".",1500 -Blue-Eyes white dragon,8,LIGHT,Dragon,Normal,3000,2500,"This legendary dragon is a powerful engine of destruction. Virtually invincible, very few have faced this awesome creature and lived to tell the tale.",11300 -Crab Turtle,8,WATER,Aqua,Ritual,2550,2500,"This monster can only be Ritual Summoned with the Ritual Spell Card, ""Turtle Oath"". You must also offer monsters whose total Level Stars equal 8 or more as a Tribute from the field or your hand.",10200 -Skull Guardian,7,LIGHT,Warrior,Ritual,2050,2500,"This monster can only be Ritual Summoned with the Ritual Spell Card, ""Novox's Prayer"". You must also offer monsters whose total Level Stars equal 7 or more as a Tribute from the field or your hand.",7900 -Slot Machine,7,DARK,Machine,Normal,2000,2300,The machine's ability is said to vary according to its slot results.,7500 -Haniwa,2,EARTH,Rock,Normal,500,500,An earthen figure that protects the tomb of an ancient ruler.,600 -Man-Eater Bug,2,EARTH,Insect,Effect,450,600,FLIP: Target 1 monster on the field; destroy that target.,600 -Gate Guardian,11,DARK,Warrior,Effect,3750,3400,"Cannot be Normal Summoned/Set. Must first be Special Summoned (from your hand) by Tributing 1 ""Sanga of the Thunder"", ""Kazejin"", and ""Suijin"".",20000 -Scanner,1,LIGHT,Machine,Effect,0,0,"Once per turn, you can select 1 of your opponent's monsters that is removed from play. Until the End Phase, this card's name is treated as the selected monster's name, and this card has the same Attribute, Level, ATK, and DEF as the selected monster. If this card is removed from the field while this effect is applied, remove it from play.",8000 -Bitron,2,EARTH,Cyberse,Normal,200,2000,A new species found in electronic space. There's not much information on it.,1000 -Marshmallon,3,LIGHT,Fairy,Effect,300,500,"Cannot be destroyed by battle. After damage calculation, if this card was attacked, and was face-down at the start of the Damage Step: The attacking player takes 1000 damage.",700 -Beast King Barbaros,8,EARTH,Beast-Warrior,Effect,3000,1200,"You can Normal Summon/Set this card without Tributing, but its original ATK becomes 1900. You can Tribute 3 monsters to Tribute Summon (but not Set) this card. If Summoned this way: Destroy all cards your opponent controls.",9200 -Texchanger,1,DARK,Cyberse,Effect,100,100,"Once per turn, when your monster is targeted for an attack: You can negate that attack, then Special Summon 1 Cyberse Normal Monster from your hand, Deck, or GY.",200 -Leotron ,4,EARTH,Cyberse,Normal,2000,0,A territorial electronic monster that guards its own domain.,2500 -The Calculator,2,LIGHT,Thunder,Effect,0,0,The ATK of this card is the combined Levels of all face-up monsters you control x 300.,8000 -Alexandrite Dragon,4,LIGHT,Dragon,Normal,2000,100,"Many of the czars' lost jewels can be found in the scales of this priceless dragon. Its creator remains a mystery, along with how they acquired the imperial treasures. But whosoever finds this dragon has hit the jackpot... whether they know it or not.",2600 -Mirage Dragon,4,LIGHT,Dragon,Effect,1600,600,Your opponent cannot activate Trap Cards during the Battle Phase.,2500 -Herald of Creation,4,LIGHT,Spellcaster,Effect,1800,600,"Once per turn: You can discard 1 card, then target 1 Level 7 or higher monster in your Graveyard; add that target to your hand.",2700 -Exploder Dragon,3,EARTH,Dragon,Effect,1000,0,If this card is destroyed by battle and sent to the Graveyard: Destroy the monster that destroyed it. Neither player takes any battle damage from attacks involving this attacking card.,1000 -Warrior Dai Grepher,4,EARTH,Warrior,Normal,1700,1600,The warrior who can manipulate dragons. Nobody knows his mysterious past.,3400 -Dark Blade,4,DARK,Warrior,Normal,1800,1500,"They say he is a dragon-manipulating warrior from the dark world. His attack is tremendous, using his great swords with vicious power.",3500 -Wattaildragon,6,LIGHT,Dragon,Normal,2500,1000,"Capable of indefinite flight. Attacks by wrapping its body with electricity and ramming into opponents. -IMPORTANT: Capturing the ""Wattaildragon"" is forbidden by the Ancient Rules and is a Level 6 offense, the minimum sentence for which is imprisonment for no less than 2500 heliocycles.",5800 -"Terratiger, the Empowered Warrior",4,EARTH,Warrior,Effect,1800,1200,When this card is Normal Summoned: You can Special Summon 1 Level 4 or lower Normal Monster from your hand in Defense Position.,3200 -The Tricky,5,WIND,Spellcaster,Effect,2000,1200,You can Special Summon this card (from your hand) by discarding 1 card.,4300 -Spiral Serpent,8,WATER,Sea Serpent,Normal,2900,2900,"When huge whirlpools lay cities asunder, it is the hunger of this sea serpent at work. No one has ever escaped its dreaded Spiral Wave to accurately describe the terror they experienced.",11700 -Command Knight,4,Fire,Warrior,Effect,1000,1000,"All Warrior-Type monsters you control gain 400 ATK. If you control another monster, monsters your opponent controls cannot target this card for an attack.",2100 diff --git a/src/main/resources/Monster.xlsx b/src/main/resources/Monster.xlsx deleted file mode 100644 index c85be7b5..00000000 Binary files a/src/main/resources/Monster.xlsx and /dev/null differ diff --git a/src/main/resources/SpellTrap.csv b/src/main/resources/SpellTrap.csv deleted file mode 100644 index 6ef6208e..00000000 --- a/src/main/resources/SpellTrap.csv +++ /dev/null @@ -1,32 +0,0 @@ -Name,Type ,Icon (Property),Description,Status,Price -Trap Hole,Trap,Normal,When your opponent Normal or Flip Summons 1 monster with 1000 or more ATK: Target that monster; destroy that target.,Unlimited,2000 -Mirror Force,Trap,Normal,When an opponent's monster declares an attack: Destroy all your opponent's Attack Position monsters.,Unlimited,2000 -Magic Cylinder,Trap,Normal,"When an opponent's monster declares an attack: Target the attacking monster; negate the attack, and if you do, inflict damage to your opponent equal to its ATK.",Unlimited,2000 -Torrential Tribute,Trap,Normal,When a monster(s) is Summoned: Destroy all monsters on the field.,Unlimited,2000 -Negate Attack,Trap,Counter,"When an opponent's monster declares an attack: Target the attacking monster; negate the attack, then end the Battle Phase.",Unlimited,3000 -Solemn Warning,Trap,Counter,"When a monster(s) would be Summoned, OR when a Spell/Trap Card, or monster effect, is activated that includes an effect that Special Summons a monster(s): Pay 2000 LP; negate the Summon or activation, and if you do, destroy it.",Unlimited,3000 -Call of The Haunted,Trap,Continuous,"Activate this card by targeting 1 monster in your GY; Special Summon that target in Attack Position. When this card leaves the field, destroy that monster. When that monster is destroyed, destroy this card.",Unlimited,3500 -Vanity's Emptiness,Trap,Continuous,Neither player can Special Summon monsters. If a card is sent from the Deck or the field to your Graveyard: Destroy this card.,Limited,3500 -Wall of Revealing Light,Trap,Continuous,Activate by paying any multiple of 1000 Life Points. Monsters your opponent controls cannot attack if their ATK is less than or equal to the amount you paid.,Limited,3500 -Monster Reborn,Spell,Normal,Target 1 monster in either GY; Special Summon it.,Limited,2500 -Terraforming,Spell,Normal,Add 1 Field Spell from your Deck to your hand.,Limited,2500 -Pot of Greed,Spell,Normal,Draw 2 cards.,Limited,2500 -Raigeki,Spell,Normal,Destroy all monsters your opponent controls.,Limited,2500 -Harpie's Feather Duster,Spell,Normal,Destroy all Spells and Traps your opponent controls.,Limited,2500 -Dark Hole,Spell,Normal,Destroy all monsters on the field.,Unlimited,2500 -Supply Squad,Spell,Continuous,"Once per turn, if a monster(s) you control is destroyed by battle or card effect: Draw 1 card.",Unlimited,4000 -Spell Absorption,Spell,Continuous,"Each time a Spell Card is activated, gain 500 Life Points immediately after it resolves.",Unlimited,4000 -Messenger of peace,Spell,Continuous,"Monsters with 1500 or more ATK cannot declare an attack. Once per turn, during your Standby Phase, pay 100 LP or destroy this card.",Unlimited,4000 -Twin Twisters,Spell,Quick-play,"Discard 1 card, then target up to 2 Spells/Traps on the field; destroy them.",Unlimited,3500 -Mystical space typhoon,Spell,Quick-play,Target 1 Spell/Trap on the field; destroy that target.,Unlimited,3500 -Yami,Spell,Field,"All Fiend and Spellcaster monsters on the field gain 200 ATK/DEF, also all Fairy monsters on the field lose 200 ATK/DEF.",Unlimited,4300 -Forest,Spell,Field,"All Insect, Beast, Plant, and Beast-Warrior monsters on the field gain 200 ATK/DEF.",Unlimited,4300 -Closed Forest,Spell,Field,All Beast-Type monsters you control gain 100 ATK for each monster in your Graveyard. Field Spell Cards cannot be activated. Field Spell Cards cannot be activated during the turn this card is destroyed.,Unlimited,4300 -Umiiruka,Spell,Field,Increase the ATK of all WATER monsters by 500 points and decrease their DEF by 400 points.,Unlimited,4300 -Sword of dark destruction,Spell,Equip,A DARK monster equipped with this card increases its ATK by 400 points and decreases its DEF by 200 points.,Unlimited,4300 -Black Pendant,Spell,Equip,The equipped monster gains 500 ATK. When this card is sent from the field to the Graveyard: Inflict 500 damage to your opponent.,Unlimited,4300 -United We Stand,Spell,Equip,The equipped monster gains 800 ATK/DEF for each face-up monster you control.,Unlimited,4300 -Magnum Shield,Spell,Equip,"Equip only to a Warrior-Type monster. Apply this effect, depending on its battle position. -● Attack Position: It gains ATK equal to its original DEF. -● Defense Position: It gains DEF equal to its original ATK.",Unlimited,4300 -Advanced Ritual Art,Spell,Ritual,This card can be used to Ritual Summon any 1 Ritual Monster. You must also send Normal Monsters from your Deck to the Graveyard whose total Levels equal the Level of that Ritual Monster.,Unlimited,3000 diff --git a/src/main/resources/SpellTrap.xlsx b/src/main/resources/SpellTrap.xlsx deleted file mode 100644 index b028b94a..00000000 Binary files a/src/main/resources/SpellTrap.xlsx and /dev/null differ diff --git a/src/main/resources/view/cli/shortExpressions.txt b/src/main/resources/shortExpressions.txt similarity index 100% rename from src/main/resources/view/cli/shortExpressions.txt rename to src/main/resources/shortExpressions.txt