Bug fixes for tournament mode.

This commit is contained in:
Krazy
2014-06-01 05:51:37 +00:00
parent 4962c9d91e
commit 0ce6c5a045

View File

@@ -106,9 +106,20 @@ public enum CSubmenuQuestDraft implements ICDoc {
QuestEventDraft draft = FModel.getQuest().getAchievements().getCurrentDraft(); QuestEventDraft draft = FModel.getQuest().getAchievements().getCurrentDraft();
if (!draft.isStarted()) {
boolean shouldQuit = FOptionPane.showConfirmDialog("If you leave now, this tournament will be forever gone."
+ "\nYou will keep the cards you drafted, but will receive no other prizes."
+ "\n\nWould you still like to quit the tournament?", "Really Quit?", false);
if (!shouldQuit) {
return;
}
} else {
if (draft.playerHasMatchesLeft()) { if (draft.playerHasMatchesLeft()) {
boolean shouldQuit = FOptionPane.showConfirmDialog("You have matches left to play!\nLeaving the tournament early will forfeit your potential future winnings." boolean shouldQuit = FOptionPane.showConfirmDialog("You have matches left to play!\nLeaving the tournament early will forfeit your potential future winnings."
+ "\nYou will still receive winnings as if you conceded your next match and you get to keep all your current cards.\n\nWould you still like to quit the tournament?", "Really Quit?", false); + "\nYou will still receive winnings as if you conceded your next match and you will keep the cards you drafted."
+ "\n\nWould you still like to quit the tournament?", "Really Quit?", false);
if (!shouldQuit) { if (!shouldQuit) {
return; return;
} }
@@ -203,6 +214,8 @@ public enum CSubmenuQuestDraft implements ICDoc {
FModel.getQuest().getAchievements().addDraftToken(); FModel.getQuest().getAchievements().addDraftToken();
} }
}
boolean saveDraft = FOptionPane.showConfirmDialog("Would you like to save this draft to the regular draft mode?", "Save Draft?"); boolean saveDraft = FOptionPane.showConfirmDialog("Would you like to save this draft to the regular draft mode?", "Save Draft?");
if (saveDraft) { if (saveDraft) {
@@ -220,12 +233,16 @@ public enum CSubmenuQuestDraft implements ICDoc {
} }
Deck deck = FModel.getQuest().getDraftDecks().get(QuestEventDraft.DECK_NAME).getHumanDeck(); String deckName = "Tournament Deck " + new SimpleDateFormat("EEE d MMM yyyy HH-mm-ss").format(new Date());
Deck tournamentDeck = FModel.getQuest().getDraftDecks().get(QuestEventDraft.DECK_NAME).getHumanDeck();
Deck deck = new Deck(deckName);
FModel.getQuest().getCards().addAllCards(deck.getAllCardsInASinglePool().toFlatList()); FModel.getQuest().getCards().addAllCards(deck.getAllCardsInASinglePool().toFlatList());
if (deck.get(DeckSection.Main).countAll() > 0) { if (tournamentDeck.get(DeckSection.Main).countAll() > 0) {
FModel.getQuest().getMyDecks().add(FModel.getQuest().getDraftDecks().get(QuestEventDraft.DECK_NAME).getHumanDeck()); deck.getOrCreate(DeckSection.Main).addAll(tournamentDeck.get(DeckSection.Main));
FModel.getQuest().getMyDecks().get(QuestEventDraft.DECK_NAME).get(DeckSection.Sideboard).clear(); FModel.getQuest().getMyDecks().add(deck);
} }
FModel.getQuest().getDraftDecks().delete(QuestEventDraft.DECK_NAME); FModel.getQuest().getDraftDecks().delete(QuestEventDraft.DECK_NAME);