mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Split quest package into gui and data.
Created temporary copies of QuestData* and QuestUtils in preparation of a new Quest file format. Created abstract pet strucure, should make creating new pets much easier
This commit is contained in:
41
.gitattributes
vendored
41
.gitattributes
vendored
@@ -6856,21 +6856,32 @@ src/forge/properties/ForgeProps.java svneol=native#text/plain
|
||||
src/forge/properties/NewConstants.java svneol=native#text/plain
|
||||
src/forge/properties/Preferences.java svneol=native#text/plain
|
||||
src/forge/properties/SavePreferencesListener.java svneol=native#text/plain
|
||||
src/forge/quest/QuestAbstractPanel.java svneol=native#text/plain
|
||||
src/forge/quest/QuestFrame.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestAbstractBazaarItem.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestAbstractBazaarStall.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestAlchemistStall.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestBankerStall.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestBazaarPanel.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestBookStall.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestGearStall.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestNurseryStall.java svneol=native#text/plain
|
||||
src/forge/quest/bazaar/QuestPetStall.java svneol=native#text/plain
|
||||
src/forge/quest/main/QuestBattle.java svneol=native#text/plain
|
||||
src/forge/quest/main/QuestMainPanel.java svneol=native#text/plain
|
||||
src/forge/quest/main/QuestQuest.java svneol=native#text/plain
|
||||
src/forge/quest/main/QuestSelectablePanel.java svneol=native#text/plain
|
||||
src/forge/quest/data/QuestData.java svneol=native#text/plain
|
||||
src/forge/quest/data/QuestData_BoosterPack.java svneol=native#text/plain
|
||||
src/forge/quest/data/QuestData_Prefs.java svneol=native#text/plain
|
||||
src/forge/quest/data/QuestData_State.java svneol=native#text/plain
|
||||
src/forge/quest/data/QuestUtil.java svneol=native#text/plain
|
||||
src/forge/quest/data/pet/QuestPetAbstract.java svneol=native#text/plain
|
||||
src/forge/quest/data/pet/QuestPetBird.java svneol=native#text/plain
|
||||
src/forge/quest/data/pet/QuestPetCrocodile.java svneol=native#text/plain
|
||||
src/forge/quest/data/pet/QuestPetHound.java svneol=native#text/plain
|
||||
src/forge/quest/data/pet/QuestPetPlant.java svneol=native#text/plain
|
||||
src/forge/quest/data/pet/QuestPetWolf.java svneol=native#text/plain
|
||||
src/forge/quest/gui/QuestAbstractPanel.java svneol=native#text/plain
|
||||
src/forge/quest/gui/QuestFrame.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestAbstractBazaarItem.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestAbstractBazaarStall.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestAlchemistStall.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestBankerStall.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestBazaarPanel.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestBookStall.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestGearStall.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestNurseryStall.java svneol=native#text/plain
|
||||
src/forge/quest/gui/bazaar/QuestPetStall.java svneol=native#text/plain
|
||||
src/forge/quest/gui/main/QuestBattle.java svneol=native#text/plain
|
||||
src/forge/quest/gui/main/QuestMainPanel.java svneol=native#text/plain
|
||||
src/forge/quest/gui/main/QuestQuest.java svneol=native#text/plain
|
||||
src/forge/quest/gui/main/QuestSelectablePanel.java svneol=native#text/plain
|
||||
src/org/jdesktop/beans/AbstractBean.java svneol=native#text/plain
|
||||
src/org/jdesktop/swingworker/AccumulativeRunnable.java -text svneol=native#text/plain
|
||||
src/org/jdesktop/swingworker/SwingPropertyChangeSupport.java -text svneol=native#text/plain
|
||||
|
||||
@@ -2,7 +2,7 @@ package forge;
|
||||
|
||||
import forge.error.ErrorViewer;
|
||||
import forge.gui.GuiUtils;
|
||||
import forge.quest.QuestFrame;
|
||||
import forge.quest.gui.QuestFrame;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
|
||||
@@ -2,30 +2,22 @@
|
||||
package forge;
|
||||
|
||||
|
||||
import forge.error.ErrorViewer;
|
||||
import forge.properties.ForgeProps;
|
||||
import forge.properties.NewConstants;
|
||||
import forge.properties.NewConstants.LANG.Gui_WinLose.WINLOSE_TEXT;
|
||||
import forge.quest.gui.QuestFrame;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.TitledBorder;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import forge.error.ErrorViewer;
|
||||
import forge.properties.ForgeProps;
|
||||
import forge.properties.NewConstants;
|
||||
import forge.properties.NewConstants.LANG.Gui_WinLose.WINLOSE_TEXT;
|
||||
import forge.quest.QuestFrame;
|
||||
|
||||
|
||||
public class Gui_WinLose extends JFrame implements NewConstants {
|
||||
private static final long serialVersionUID = -5800412940994975483L;
|
||||
|
||||
887
src/forge/quest/data/QuestData.java
Normal file
887
src/forge/quest/data/QuestData.java
Normal file
@@ -0,0 +1,887 @@
|
||||
package forge.quest.data;
|
||||
|
||||
import com.esotericsoftware.minlog.Log;
|
||||
import forge.*;
|
||||
import forge.error.ErrorViewer;
|
||||
import forge.properties.ForgeProps;
|
||||
import forge.properties.NewConstants;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
//when you create QuestData and AFTER you copy the AI decks over
|
||||
//you have to call one of these two methods below
|
||||
//see Gui_QuestOptions for more details
|
||||
|
||||
//
|
||||
//static readAIQuestDeckFiles(QuestData data, ArrayList aiDeckNames)
|
||||
//OR non-static readAIQuestDeckFiles()
|
||||
//which reads the files "questDecks-easy", "questDecks-medium","questDecks-hard",
|
||||
public class QuestData {
|
||||
QuestData_Prefs qdPrefs = null;
|
||||
|
||||
private int rankIndex;
|
||||
private int win;
|
||||
private int lost;
|
||||
|
||||
private int plantLevel;
|
||||
private int wolfPetLevel;
|
||||
private int crocPetLevel;
|
||||
private int birdPetLevel;
|
||||
private int houndPetLevel;
|
||||
|
||||
private String selectedPet;
|
||||
|
||||
private int life;
|
||||
private int estatesLevel;
|
||||
private int luckyCoinLevel;
|
||||
private int sleightOfHandLevel;
|
||||
private int gearLevel;
|
||||
|
||||
private int questsPlayed;
|
||||
|
||||
private long credits;
|
||||
|
||||
private int diffIndex;
|
||||
private String difficulty;
|
||||
private String mode = "";
|
||||
|
||||
private ArrayList<String> easyAIDecks;
|
||||
private ArrayList<String> mediumAIDecks;
|
||||
private ArrayList<String> hardAIDecks;
|
||||
|
||||
private Map<String, Deck> myDecks = new HashMap<String, Deck>();
|
||||
private Map<String, Deck> aiDecks = new HashMap<String, Deck>();
|
||||
|
||||
//holds String card names
|
||||
private ArrayList<String> cardPool = new ArrayList<String>();
|
||||
private ArrayList<String> newCardList = new ArrayList<String>();
|
||||
private ArrayList<String> shopList = new ArrayList<String>();
|
||||
|
||||
private ArrayList<Integer> availableQuests = new ArrayList<Integer>();
|
||||
private ArrayList<Integer> completedQuests = new ArrayList<Integer>();
|
||||
|
||||
private QuestData_BoosterPack boosterPack = new QuestData_BoosterPack();
|
||||
|
||||
//used by shouldAddAdditionalCards()
|
||||
private Random random = new Random();
|
||||
|
||||
//feel free to change this to something funnier
|
||||
private String[] rankArray = {
|
||||
"Level 0 - Confused Wizard", "Level 1 - Mana Mage", "Level 2 - Death by Megrim",
|
||||
"Level 3 - Shattered the Competition", "Level 4 - Black Knighted", "Level 5 - Shockingly Good",
|
||||
"Level 6 - Regressed into Timmy", "Level 7 - Loves Blue Control", "Level 8 - Immobilized by Fear",
|
||||
"Level 9 - Lands = Friends", "Saltblasted for your talent", "Serra Angel is your girlfriend",};
|
||||
|
||||
|
||||
public static final String FANTASY = "Fantasy";
|
||||
public static final String REALISTIC = "Realistic";
|
||||
|
||||
//TODO: Temporary.
|
||||
public boolean useNewQuestUI = false;
|
||||
|
||||
public QuestData() {
|
||||
qdPrefs = new QuestData_Prefs();
|
||||
|
||||
for (int i = 0; i < qdPrefs.getStartingBasic(); i++) {
|
||||
cardPool.add("Forest");
|
||||
cardPool.add("Mountain");
|
||||
cardPool.add("Swamp");
|
||||
cardPool.add("Island");
|
||||
cardPool.add("Plains");
|
||||
}
|
||||
|
||||
for (int i = 0; i < qdPrefs.getStartingSnowBasic(); i++) {
|
||||
cardPool.add("Snow-Covered Forest");
|
||||
cardPool.add("Snow-Covered Mountain");
|
||||
cardPool.add("Snow-Covered Swamp");
|
||||
cardPool.add("Snow-Covered Island");
|
||||
cardPool.add("Snow-Covered Plains");
|
||||
}
|
||||
}//QuestData
|
||||
|
||||
//adds cards to card pool and sets difficulty
|
||||
public void newGame(int difficulty, String m) {
|
||||
setDifficulty(difficulty);
|
||||
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.addAll(boosterPack.getCommon(qdPrefs.getStartingCommons(difficulty)));
|
||||
list.addAll(boosterPack.getUncommon(qdPrefs.getStartingUncommons(difficulty)));
|
||||
list.addAll(boosterPack.getRare(qdPrefs.getStartingRares(difficulty)));
|
||||
|
||||
//because cardPool already has basic land added to it
|
||||
cardPool.addAll(list);
|
||||
credits = qdPrefs.getStartingCredits();
|
||||
|
||||
mode = m;
|
||||
if (mode.equals(FANTASY)) {
|
||||
life = 15;
|
||||
}
|
||||
else {
|
||||
life = 20;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String[] getOpponents() {
|
||||
int index = getDiffIndex();
|
||||
|
||||
if (getWin() < qdPrefs.getWinsForMediumAI(index)) {
|
||||
return getOpponents(easyAIDecks);
|
||||
}
|
||||
|
||||
if (getWin() < qdPrefs.getWinsForHardAI(index)) {
|
||||
return getOpponents(mediumAIDecks);
|
||||
}
|
||||
|
||||
return getOpponents(hardAIDecks);
|
||||
}//getOpponents()
|
||||
|
||||
|
||||
static public void readAIQuestDeckFiles(QuestData data, ArrayList<String> aiDeckNames) {
|
||||
data.easyAIDecks = readFile(ForgeProps.getFile(NewConstants.QUEST.EASY), aiDeckNames);
|
||||
data.mediumAIDecks = readFile(ForgeProps.getFile(NewConstants.QUEST.MEDIUM), aiDeckNames);
|
||||
data.hardAIDecks = readFile(ForgeProps.getFile(
|
||||
NewConstants.QUEST.HARD), aiDeckNames);
|
||||
}
|
||||
|
||||
public void refreshAIQuestDeckFiles(ArrayList<String> aiDeckNames) {
|
||||
easyAIDecks = readFile(ForgeProps.getFile(NewConstants.QUEST.EASY), aiDeckNames);
|
||||
mediumAIDecks = readFile(ForgeProps.getFile(NewConstants.QUEST.MEDIUM), aiDeckNames);
|
||||
hardAIDecks = readFile(ForgeProps.getFile(NewConstants.QUEST.HARD), aiDeckNames);
|
||||
}
|
||||
|
||||
public String[] getOpponents(ArrayList<String> aiDeck) {
|
||||
Collections.shuffle(aiDeck);
|
||||
|
||||
return new String[]{aiDeck.get(0).toString(), aiDeck.get(1).toString(), aiDeck.get(2).toString()};
|
||||
|
||||
}//getOpponents()
|
||||
|
||||
private static ArrayList<String> readFile(File file, ArrayList<String> aiDecks) {
|
||||
ArrayList<String> list = FileUtil.readFile(file);
|
||||
|
||||
//remove any blank lines
|
||||
ArrayList<String> noBlankLines = new ArrayList<String>();
|
||||
String s;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
s = list.get(i).toString().trim();
|
||||
if (!s.equals("")) {
|
||||
noBlankLines.add(s);
|
||||
}
|
||||
}
|
||||
list = noBlankLines;
|
||||
|
||||
if (list.size() < 3) {
|
||||
ErrorViewer.showError(new Exception(),
|
||||
"QuestData : readFile() error, file %s is too short, it must contain at least 3 ai decks names",
|
||||
file);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
/*if(!aiDecks.contains(list.get(i).toString())) ErrorViewer.showError(new Exception(),
|
||||
"QuestData : readFile() error, file %s contains the invalid ai deck name: %s", file,
|
||||
list.get(i));*/ {
|
||||
if (!aiDecks.contains(list.get(i).toString())) {
|
||||
aiDecks.add(list.get(i).toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}//readFile()
|
||||
|
||||
public void readAIQuestDeckFiles() {
|
||||
readAIQuestDeckFiles(this, ai_getDeckNames());
|
||||
}
|
||||
|
||||
static public QuestData loadData() {
|
||||
try {
|
||||
//read file "questData"
|
||||
ObjectInputStream in = new ObjectInputStream(new FileInputStream(ForgeProps.getFile(NewConstants.QUEST.DATA)));
|
||||
Object o = in.readObject();
|
||||
in.close();
|
||||
|
||||
QuestData_State state = (QuestData_State) o;
|
||||
|
||||
QuestData data = new QuestData();
|
||||
|
||||
data.win = state.win;
|
||||
data.lost = state.lost;
|
||||
data.credits = state.credits;
|
||||
data.rankIndex = state.rankIndex;
|
||||
data.difficulty = state.difficulty;
|
||||
|
||||
data.mode = state.mode;
|
||||
if (data.mode == null) {
|
||||
data.mode = REALISTIC;
|
||||
}
|
||||
|
||||
data.plantLevel = state.plantLevel;
|
||||
data.wolfPetLevel = state.wolfPetLevel;
|
||||
data.crocPetLevel = state.crocPetLevel;
|
||||
data.birdPetLevel = state.birdPetLevel;
|
||||
data.houndPetLevel = state.houndPetLevel;
|
||||
data.selectedPet = state.selectedPet;
|
||||
data.life = state.life;
|
||||
data.estatesLevel = state.estatesLevel;
|
||||
data.luckyCoinLevel = state.luckyCoinLevel;
|
||||
data.sleightOfHandLevel = state.sleightOfHandLevel;
|
||||
data.gearLevel = state.gearLevel;
|
||||
data.questsPlayed = state.questsPlayed;
|
||||
data.availableQuests = state.availableQuests;
|
||||
data.completedQuests = state.completedQuests;
|
||||
|
||||
data.shopList = state.shopList;
|
||||
data.cardPool = state.cardPool;
|
||||
data.myDecks = state.myDecks;
|
||||
data.aiDecks = state.aiDecks;
|
||||
|
||||
readAIQuestDeckFiles(data, new ArrayList<String>(data.aiDecks.keySet()));
|
||||
|
||||
return data;
|
||||
}//try
|
||||
catch (Exception ex) {
|
||||
ErrorViewer.showError(ex, "Error loading Quest Data");
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}//loadData()
|
||||
|
||||
|
||||
//returns Strings of the card names
|
||||
public ArrayList<String> getCardpool() {
|
||||
//make a copy so the internal ArrrayList cannot be changed externally
|
||||
return new ArrayList<String>(cardPool);
|
||||
}
|
||||
|
||||
public ArrayList<String> getShopList() {
|
||||
if (shopList != null) {
|
||||
return new ArrayList<String>(shopList);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setShopList(ArrayList<String> list) {
|
||||
shopList = list;
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<Integer> getAvailableQuests() {
|
||||
if (availableQuests != null) {
|
||||
return new ArrayList<Integer>(availableQuests);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setAvailableQuests(ArrayList<Integer> list) {
|
||||
availableQuests = list;
|
||||
}
|
||||
|
||||
public void clearAvailableQuests() {
|
||||
availableQuests.clear();
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getCompletedQuests() {
|
||||
if (completedQuests != null) {
|
||||
return new ArrayList<Integer>(completedQuests);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCompletedQuests(ArrayList<Integer> list) {
|
||||
completedQuests = list;
|
||||
}
|
||||
|
||||
|
||||
public void clearShopList() {
|
||||
shopList.clear();
|
||||
}
|
||||
|
||||
//rename - removeDeck, addDeck
|
||||
//copy - addDeck
|
||||
|
||||
public void removeDeck(String deckName) {
|
||||
myDecks.remove(deckName);
|
||||
}
|
||||
|
||||
public void ai_removeDeck(String deckName) {
|
||||
aiDecks.remove(deckName);
|
||||
}
|
||||
|
||||
public void addDeck(Deck d) {
|
||||
myDecks.put(d.getName(), d);
|
||||
}
|
||||
|
||||
public void ai_addDeck(Deck d) {
|
||||
aiDecks.put(d.getName(), d);
|
||||
}
|
||||
|
||||
//this Deck object is a Constructed deck
|
||||
//deck.getDeckType() is Constant.GameType.Sealed
|
||||
//sealed since the card pool is the Deck sideboard
|
||||
public Deck getDeck(String deckName) {
|
||||
//have to always set the card pool aka the Deck sideboard
|
||||
//because new cards may have been added to the card pool by addCards()
|
||||
|
||||
//this sets the cards in Deck main
|
||||
Deck d = getDeckFromMap(myDecks, deckName);
|
||||
|
||||
//below is probably not needed
|
||||
|
||||
//remove old cards from card pool
|
||||
for (int i = 0; i < d.countSideboard(); i++) {
|
||||
d.removeSideboard(i);
|
||||
}
|
||||
|
||||
//add all cards to card pool
|
||||
for (int i = 0; i < cardPool.size(); i++) {
|
||||
d.addSideboard(cardPool.get(i).toString());
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
//this Deck object is a Constructed deck
|
||||
//deck.getDeckType() is Constant.GameType.Constructed
|
||||
//constructed because the computer can use any card
|
||||
public Deck ai_getDeck(String deckName) {
|
||||
return getDeckFromMap(aiDecks, deckName);
|
||||
}
|
||||
|
||||
public Deck ai_getDeckNewFormat(String deckName) {
|
||||
DeckIO deckIO = new NewDeckIO(ForgeProps.getFile(NewConstants.QUEST.DECKS), true);
|
||||
Deck aiDeck = deckIO.readDeck(deckName);
|
||||
return aiDeck;
|
||||
}
|
||||
|
||||
|
||||
private Deck getDeckFromMap(Map<String, Deck> map, String deckName) {
|
||||
if (!map.containsKey(deckName)) {
|
||||
ErrorViewer.showError(new Exception(),
|
||||
"QuestData : getDeckFromMap(String deckName) error, deck name not found - %s", deckName);
|
||||
}
|
||||
|
||||
return map.get(deckName);
|
||||
}
|
||||
|
||||
//returns human player decks
|
||||
//returns ArrayList of String deck names
|
||||
public ArrayList<String> getDeckNames() {
|
||||
return getDeckNames_String(myDecks);
|
||||
}//getDecks()
|
||||
|
||||
//returns AI computer decks
|
||||
//returns ArrayList of String deck names
|
||||
public ArrayList<String> ai_getDeckNames() {
|
||||
return getDeckNames_String(aiDecks);
|
||||
}
|
||||
|
||||
//returns ArrayList of Deck String names
|
||||
private ArrayList<String> getDeckNames_String(Map<String, Deck> map) {
|
||||
ArrayList<String> out = new ArrayList<String>();
|
||||
|
||||
Iterator<String> it = map.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
out.add(it.next().toString());
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
//get new cards that were added to your card pool by addCards()
|
||||
public ArrayList<String> getAddedCards() {
|
||||
return new ArrayList<String>(newCardList);
|
||||
}
|
||||
|
||||
//adds 11 cards, to the current card pool
|
||||
//(I chose 11 cards instead of 15 in order to make things more challenging)
|
||||
public void addCards() {
|
||||
int nCommon = qdPrefs.getNumCommon();
|
||||
int nUncommon = qdPrefs.getNumUncommon();
|
||||
int nRare = qdPrefs.getNumRare();
|
||||
|
||||
ArrayList<String> newCards = new ArrayList<String>();
|
||||
newCards.addAll(boosterPack.getCommon(nCommon));
|
||||
newCards.addAll(boosterPack.getUncommon(nUncommon));
|
||||
newCards.addAll(boosterPack.getRare(nRare));
|
||||
|
||||
|
||||
cardPool.addAll(newCards);
|
||||
|
||||
//getAddedCards() uses newCardList
|
||||
newCardList = newCards;
|
||||
|
||||
}//addCards()
|
||||
|
||||
public ArrayList<String> getRandomRares(int n, int colorIndex) {
|
||||
ArrayList<String> newCards = new ArrayList<String>();
|
||||
newCards.addAll(boosterPack.getRare(n, colorIndex));
|
||||
|
||||
/*
|
||||
for(String s : newCards ) {
|
||||
Card c = AllZone.CardFactory.getCard(s, AllZone.HumanPlayer);
|
||||
list.add(c);
|
||||
}*/
|
||||
return newCards;
|
||||
}
|
||||
|
||||
public void addRandomRare(int n) {
|
||||
ArrayList<String> newCards = new ArrayList<String>();
|
||||
newCards.addAll(boosterPack.getRare(n));
|
||||
|
||||
cardPool.addAll(newCards);
|
||||
newCardList.addAll(newCards);
|
||||
}
|
||||
|
||||
public String addRandomRare() {
|
||||
|
||||
ArrayList<String> newCards = new ArrayList<String>();
|
||||
newCards.addAll(boosterPack.getRare(1));
|
||||
|
||||
cardPool.addAll(newCards);
|
||||
newCardList.addAll(newCards);
|
||||
|
||||
Card c = AllZone.CardFactory.getCard(newCards.get(0), AllZone.HumanPlayer);
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
return CardUtil.buildFilename(c);
|
||||
//return GuiDisplayUtil.cleanString(newCards.get(0));
|
||||
}
|
||||
|
||||
public void addCard(Card c) {
|
||||
cardPool.add(c.getName());
|
||||
}
|
||||
|
||||
public void addCard(String s) {
|
||||
cardPool.add(s);
|
||||
}
|
||||
|
||||
public void removeCard(Card c) {
|
||||
|
||||
String s = c.getName();
|
||||
if (!cardPool.contains(s)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < cardPool.size(); i++) {
|
||||
String str = cardPool.get(i);
|
||||
if (str.equals(s)) {
|
||||
cardPool.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addCardToShopList(Card c) {
|
||||
shopList.add(c.getName());
|
||||
}
|
||||
|
||||
public void removeCardFromShopList(Card c) {
|
||||
String s = c.getName();
|
||||
if (!shopList.contains(s)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < shopList.size(); i++) {
|
||||
String str = shopList.get(i);
|
||||
if (str.equals(s)) {
|
||||
shopList.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public long getCreditsToAdd(WinLose winLose) {
|
||||
long creds = (long) (qdPrefs.getMatchRewardBase() + (qdPrefs.getMatchRewardTotalWins() * win));
|
||||
String[] wins = winLose.getWinMethods();
|
||||
int[] winTurns = winLose.getWinTurns();
|
||||
boolean[] mulliganedToZero = winLose.getMulliganedToZero();
|
||||
|
||||
if (winLose.getLose() == 0) {
|
||||
creds += qdPrefs.getMatchRewardNoLosses();
|
||||
}
|
||||
|
||||
for (String s : wins) {
|
||||
if (s != null) {
|
||||
if (s.equals("Poison Counters")) {
|
||||
creds += qdPrefs.getMatchRewardPoisonWinBonus();
|
||||
}
|
||||
else if (s.equals("Milled")) {
|
||||
creds += qdPrefs.getMatchRewardMilledWinBonus();
|
||||
}
|
||||
else if (s.equals("Battle of Wits") || s.equals("Felidar Sovereign") || s.equals("Helix Pinnacle") ||
|
||||
s.equals("Epic Struggle") || s.equals("Door to Nothingness") || s.equals("Barren Glory") ||
|
||||
s.equals("Near-Death Experience") || s.equals("Mortal Combat") || s.equals("Test of Endurance")) {
|
||||
creds += qdPrefs.getMatchRewardAltWinBonus();
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i : winTurns) {
|
||||
if (i == 1) {
|
||||
creds += qdPrefs.getMatchRewardWinFirst();
|
||||
}
|
||||
else if (i <= 5) {
|
||||
creds += qdPrefs.getMatchRewardWinByFifth();
|
||||
}
|
||||
else if (i <= 10) {
|
||||
creds += qdPrefs.getMatchRewardWinByTen();
|
||||
}
|
||||
else if (i <= 15) {
|
||||
creds += qdPrefs.getMatchRewardWinByFifteen();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (boolean b : mulliganedToZero) {
|
||||
if (b == true) {
|
||||
creds += qdPrefs.getMatchMullToZero();
|
||||
}
|
||||
}
|
||||
|
||||
if (getEstatesLevel() == 1) {
|
||||
creds *= 1.1;
|
||||
}
|
||||
else if (getEstatesLevel() == 2) {
|
||||
creds *= 1.15;
|
||||
}
|
||||
else if (getEstatesLevel() == 3) {
|
||||
creds *= 1.2;
|
||||
}
|
||||
|
||||
this.addCredits(creds);
|
||||
|
||||
return creds;
|
||||
}
|
||||
|
||||
//gets all of the cards that are in the cardpool
|
||||
public ArrayList<String> getCards() {
|
||||
//copy CardList in order to keep private variables private
|
||||
//if we just return cardPool, it could be changed externally
|
||||
return new ArrayList<String>(cardPool);
|
||||
}
|
||||
|
||||
|
||||
public int getTotalNumberOfGames(int difficulty) {
|
||||
//-2 because you start a level 1, and the last level is secret
|
||||
int numberLevels = rankArray.length - 2;
|
||||
int nMatches = qdPrefs.getWinsForRankIncrease(difficulty);
|
||||
|
||||
return numberLevels * nMatches;
|
||||
}
|
||||
|
||||
//this changes getRank()
|
||||
public void addWin() {
|
||||
win++;
|
||||
|
||||
if (win % qdPrefs.getWinsForRankIncrease(diffIndex) == 0) {
|
||||
rankIndex++;
|
||||
}
|
||||
}//addWin()
|
||||
|
||||
public void addLost() {
|
||||
lost++;
|
||||
}
|
||||
|
||||
public int getWin() {
|
||||
return win;
|
||||
}
|
||||
|
||||
public int getLost() {
|
||||
return lost;
|
||||
}
|
||||
|
||||
//********************FANTASY STUFF START***********************
|
||||
|
||||
public void addPlantLevel() {
|
||||
plantLevel++;
|
||||
}
|
||||
|
||||
public int getPlantLevel() {
|
||||
return plantLevel;
|
||||
}
|
||||
|
||||
public void addWolfPetLevel() {
|
||||
wolfPetLevel++;
|
||||
}
|
||||
|
||||
public int getWolfPetLevel() {
|
||||
return wolfPetLevel;
|
||||
}
|
||||
|
||||
public void addCrocPetLevel() {
|
||||
crocPetLevel++;
|
||||
}
|
||||
|
||||
public int getCrocPetLevel() {
|
||||
return crocPetLevel;
|
||||
}
|
||||
|
||||
public void addBirdPetLevel() {
|
||||
birdPetLevel++;
|
||||
}
|
||||
|
||||
public int getBirdPetLevel() {
|
||||
return birdPetLevel;
|
||||
}
|
||||
|
||||
public void addHoundPetLevel() {
|
||||
houndPetLevel++;
|
||||
}
|
||||
|
||||
public int getHoundPetLevel() {
|
||||
return houndPetLevel;
|
||||
}
|
||||
|
||||
public void setSelectedPet(String s) {
|
||||
selectedPet = s;
|
||||
}
|
||||
|
||||
public String getSelectedPet() {
|
||||
return selectedPet;
|
||||
}
|
||||
|
||||
|
||||
public void setLife(int n) {
|
||||
life = n;
|
||||
}
|
||||
|
||||
public int getLife() {
|
||||
return life;
|
||||
}
|
||||
|
||||
public void addLife(int n) {
|
||||
life += n;
|
||||
}
|
||||
|
||||
public int getEstatesLevel() {
|
||||
return estatesLevel;
|
||||
}
|
||||
|
||||
public void addEstatesLevel(int n) {
|
||||
estatesLevel += n;
|
||||
}
|
||||
|
||||
public int getLuckyCoinLevel() {
|
||||
return luckyCoinLevel;
|
||||
}
|
||||
|
||||
public void addLuckyCoinLevel(int n) {
|
||||
luckyCoinLevel += n;
|
||||
}
|
||||
|
||||
public int getSleightOfHandLevel() {
|
||||
return sleightOfHandLevel;
|
||||
}
|
||||
|
||||
public void addSleightOfHandLevel(int n) {
|
||||
sleightOfHandLevel += n;
|
||||
}
|
||||
|
||||
public int getGearLevel() {
|
||||
return gearLevel;
|
||||
}
|
||||
|
||||
public void addGearLevel(int n) {
|
||||
gearLevel += n;
|
||||
}
|
||||
|
||||
public int getQuestsPlayed() {
|
||||
return questsPlayed;
|
||||
}
|
||||
|
||||
public void addQuestsPlayed() {
|
||||
questsPlayed++;
|
||||
}
|
||||
|
||||
//********************FANTASY STUFF END***********************
|
||||
|
||||
public void addCredits(long c) {
|
||||
credits += c;
|
||||
}
|
||||
|
||||
public void subtractCredits(long c) {
|
||||
credits -= c;
|
||||
if (credits < 0) {
|
||||
credits = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public long getCredits() {
|
||||
return credits;
|
||||
}
|
||||
|
||||
public String getMode() {
|
||||
if (mode == null) {
|
||||
return "";
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
//should be called first, because the difficultly won't change
|
||||
public String getDifficulty() {
|
||||
return difficulty;
|
||||
}
|
||||
|
||||
public int getDiffIndex() {
|
||||
return diffIndex;
|
||||
}
|
||||
|
||||
public void setDifficulty(int i) {
|
||||
diffIndex = i;
|
||||
difficulty = qdPrefs.getDifficulty(i);
|
||||
}
|
||||
|
||||
public void setDifficultyIndex() {
|
||||
String[] diffStr = qdPrefs.getDifficulty();
|
||||
for (int i = 0; i < diffStr.length; i++) {
|
||||
if (difficulty.equals(diffStr[i])) {
|
||||
diffIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String[] getDifficutlyChoices() {
|
||||
return qdPrefs.getDifficulty();
|
||||
}
|
||||
|
||||
public String getRank() {
|
||||
//is rankIndex too big?
|
||||
if (rankIndex == rankArray.length) {
|
||||
rankIndex--;
|
||||
}
|
||||
|
||||
return rankArray[rankIndex];
|
||||
}
|
||||
|
||||
//add cards after a certain number of wins or losses
|
||||
public boolean shouldAddCards(boolean didWin) {
|
||||
int n = qdPrefs.getWinsForBooster(diffIndex);
|
||||
|
||||
if (didWin) {
|
||||
return getWin() % n == 0;
|
||||
}
|
||||
else {
|
||||
return getLost() % n == 0;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean shouldAddAdditionalCards(boolean didWin) {
|
||||
float chance = 0.5f;
|
||||
if (getLuckyCoinLevel() >= 1) {
|
||||
chance = 0.65f;
|
||||
}
|
||||
|
||||
float r = random.nextFloat();
|
||||
Log.debug("Random:" + r);
|
||||
|
||||
if (didWin) {
|
||||
return r <= chance;
|
||||
}
|
||||
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//opponentName is one of the Strings returned by getOpponents()
|
||||
public Deck getOpponentDeck(String opponentName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean hasSaveFile() {
|
||||
//File f = new File(this.saveFileName); // The static field QuestData.saveFileName should be accessed in a static way
|
||||
// No warning is given for it below in getBackupFilename
|
||||
return ForgeProps.getFile(NewConstants.QUEST.DATA).exists();
|
||||
}
|
||||
|
||||
//returns somethings like "questData-10"
|
||||
//find a new filename
|
||||
@SuppressWarnings("unused")
|
||||
static private File getBackupFilename() {
|
||||
//I made this a long because maybe an int would overflow, but who knows
|
||||
File original = ForgeProps.getFile(NewConstants.QUEST.DATA);
|
||||
File parent = original.getParentFile();
|
||||
String name = original.getName();
|
||||
long n = 1;
|
||||
|
||||
File f;
|
||||
while ((f = new File(parent, name + "-" + n)).exists()) {
|
||||
n++;
|
||||
}
|
||||
|
||||
return f;
|
||||
}//getBackupFilename()
|
||||
|
||||
static public void saveData(QuestData q) {
|
||||
try {
|
||||
/*
|
||||
//rename previous file "questData" to something like questData-23
|
||||
//just in case there is an error when playing the game or saving
|
||||
File file = new File(saveFileName);
|
||||
if(file.exists())
|
||||
file.renameTo(getBackupFilename());
|
||||
*/
|
||||
|
||||
//setup QuestData_State
|
||||
QuestData_State state = new QuestData_State();
|
||||
state.win = q.win;
|
||||
state.lost = q.lost;
|
||||
state.credits = q.credits;
|
||||
state.difficulty = q.difficulty;
|
||||
state.mode = q.mode;
|
||||
state.rankIndex = q.rankIndex;
|
||||
|
||||
state.plantLevel = q.plantLevel;
|
||||
state.wolfPetLevel = q.wolfPetLevel;
|
||||
state.crocPetLevel = q.crocPetLevel;
|
||||
state.birdPetLevel = q.birdPetLevel;
|
||||
state.houndPetLevel = q.houndPetLevel;
|
||||
state.selectedPet = q.selectedPet;
|
||||
state.life = q.life;
|
||||
state.estatesLevel = q.estatesLevel;
|
||||
state.luckyCoinLevel = q.luckyCoinLevel;
|
||||
state.sleightOfHandLevel = q.sleightOfHandLevel;
|
||||
state.gearLevel = q.gearLevel;
|
||||
state.questsPlayed = q.questsPlayed;
|
||||
state.availableQuests = q.availableQuests;
|
||||
|
||||
state.cardPool = q.cardPool;
|
||||
state.shopList = q.shopList;
|
||||
state.myDecks = q.myDecks;
|
||||
state.aiDecks = q.aiDecks;
|
||||
|
||||
//write object
|
||||
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(ForgeProps.getFile(NewConstants.QUEST.DATA)));
|
||||
out.writeObject(state);
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (Exception ex) {
|
||||
ErrorViewer.showError(ex, "Error saving Quest Data");
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}//saveData()
|
||||
|
||||
public static void main(String[] args) {
|
||||
QuestData q = new QuestData();
|
||||
for (int i = 0; i < 20; i++) {
|
||||
q.addCards();
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
QuestData.saveData(q);
|
||||
QuestData.loadData();
|
||||
}
|
||||
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
329
src/forge/quest/data/QuestData_BoosterPack.java
Normal file
329
src/forge/quest/data/QuestData_BoosterPack.java
Normal file
@@ -0,0 +1,329 @@
|
||||
package forge.quest.data;
|
||||
//import java.io.BufferedReader;
|
||||
//import java.io.File;
|
||||
//import java.io.FileReader;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
import forge.CardList;
|
||||
import forge.Constant;
|
||||
import forge.properties.NewConstants;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
//balance the number of colors and creature/spells for
|
||||
|
||||
//new cards that are won in quest mode
|
||||
public class QuestData_BoosterPack implements NewConstants {
|
||||
// final private static String comment = "//";
|
||||
|
||||
private ArrayList<String> commonCreature = new ArrayList<String>();
|
||||
private ArrayList<String> commonSpell = new ArrayList<String>();
|
||||
|
||||
private ArrayList<String> uncommonCreature = new ArrayList<String>();
|
||||
private ArrayList<String> uncommonSpell = new ArrayList<String>();
|
||||
|
||||
private ArrayList<String> rareCreature = new ArrayList<String>();
|
||||
private ArrayList<String> rareSpell = new ArrayList<String>();
|
||||
|
||||
private Random random = new Random();
|
||||
|
||||
private String[] colors = {
|
||||
"gold", Constant.Color.Colorless, Constant.Color.Black, Constant.Color.Blue, Constant.Color.Green,
|
||||
Constant.Color.Red, Constant.Color.White,
|
||||
|
||||
//repeat colors in order to make Colorless and gold not as popular
|
||||
Constant.Color.Black, Constant.Color.Blue, Constant.Color.Green, Constant.Color.Red,
|
||||
Constant.Color.White };
|
||||
|
||||
|
||||
//testing
|
||||
private ArrayList<String> colorTest = new ArrayList<String>();
|
||||
|
||||
//prints statistics to make sure everything is working
|
||||
public static void main(String[] args) {
|
||||
QuestData_BoosterPack q = new QuestData_BoosterPack();
|
||||
|
||||
for(int i = 0; i < 100; i++)
|
||||
q.print(q.getNewCards(6, 3, 1));
|
||||
|
||||
q.colorStats();
|
||||
}//main()
|
||||
|
||||
//testing
|
||||
//nCommon is the number of common cards
|
||||
private ArrayList<String> getNewCards(int nCommon, int nUncommon, int nRare) {
|
||||
ArrayList<String> out = new ArrayList<String>();
|
||||
|
||||
out.addAll(getCommon(nCommon));
|
||||
out.addAll(getUncommon(nUncommon));
|
||||
out.addAll(getRare(nRare));
|
||||
|
||||
return out;
|
||||
}//getNewCards()
|
||||
|
||||
//testing
|
||||
private void print(ArrayList<String> list) {
|
||||
int nCreature = 0;
|
||||
int nSpell = 0;
|
||||
|
||||
Card c;
|
||||
for(int i = 0; i < list.size(); i++) {
|
||||
c = AllZone.CardFactory.getCard(list.get(i).toString(), null);
|
||||
|
||||
if(c.isCreature()) nCreature++;
|
||||
else nSpell++;
|
||||
|
||||
colorTest.add(getColor(c));
|
||||
}//for
|
||||
System.out.println("creatures " + nCreature + " - noncreatures " + nSpell);
|
||||
}//print()
|
||||
|
||||
//testing
|
||||
private void colorStats() {
|
||||
String[] colors = {
|
||||
"gold", Constant.Color.Colorless, Constant.Color.Black, Constant.Color.Blue, Constant.Color.Green,
|
||||
Constant.Color.Red, Constant.Color.White};
|
||||
|
||||
for(int outer = 0; outer < colors.length; outer++) {
|
||||
int n = 0;
|
||||
|
||||
for(int z = 0; z < colorTest.size(); z++) {
|
||||
if(colorTest.get(z).equals(colors[outer])) n++;
|
||||
}
|
||||
System.out.println(colors[outer] + " " + n);
|
||||
}
|
||||
}//colorStats()
|
||||
|
||||
public QuestData_BoosterPack() {
|
||||
//setup(ForgeProps.getFile(QUEST.COMMON), commonCreature, commonSpell);
|
||||
//setup(ForgeProps.getFile(QUEST.UNCOMMON), uncommonCreature, uncommonSpell);
|
||||
//setup(ForgeProps.getFile(QUEST.RARE), rareCreature, rareSpell);
|
||||
|
||||
CardList AllCards = new CardList(AllZone.CardFactory.getAllCards().toArray());
|
||||
|
||||
for (int i=0; i<AllCards.size(); i++)
|
||||
{
|
||||
Card aCard = AllCards.get(i);
|
||||
String rr = aCard.getSVar("Rarity");
|
||||
|
||||
if (rr.equals("Common"))
|
||||
{
|
||||
if (aCard.isCreature())
|
||||
commonCreature.add(aCard.getName());
|
||||
else
|
||||
commonSpell.add(aCard.getName());
|
||||
}
|
||||
else if (rr.equals("Uncommon"))
|
||||
{
|
||||
if (aCard.isCreature())
|
||||
uncommonCreature.add(aCard.getName());
|
||||
else
|
||||
uncommonSpell.add(aCard.getName());
|
||||
}
|
||||
else if (rr.equals("Rare"))
|
||||
{
|
||||
if (aCard.isCreature())
|
||||
rareCreature.add(aCard.getName());
|
||||
else
|
||||
rareSpell.add(aCard.getName());
|
||||
}
|
||||
else if (rr.equals("Mythic"))
|
||||
{
|
||||
if (aCard.isCreature())
|
||||
rareCreature.add(aCard.getName());
|
||||
else
|
||||
rareSpell.add(aCard.getName());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private int getColorIndex(int n) {
|
||||
return n % colors.length;
|
||||
}
|
||||
|
||||
//return a number that is a multiple of colors.length
|
||||
//we want to loop all the way through the colors array
|
||||
private int getLoopStop(int n) {
|
||||
int stop = colors.length;
|
||||
while(stop < n)
|
||||
stop += colors.length;
|
||||
|
||||
return stop;
|
||||
}
|
||||
|
||||
public ArrayList<String> getCommon(int n) {
|
||||
ArrayList<String> bag = new ArrayList<String>();
|
||||
String c;
|
||||
int stop = getLoopStop(n);
|
||||
|
||||
for(int i = 0; i < stop; i++) {
|
||||
c = colors[getColorIndex(i)];
|
||||
|
||||
//creatures are more common than spells
|
||||
bag.add(getColor(c, commonCreature));
|
||||
bag.add(getColor(c, commonCreature));
|
||||
bag.add(getColor(c, commonSpell));
|
||||
}
|
||||
return getRandom(n, bag);
|
||||
}//getCommon()
|
||||
|
||||
|
||||
public ArrayList<String> getUncommon(int n) {
|
||||
ArrayList<String> bag = new ArrayList<String>();
|
||||
String c;
|
||||
int stop = getLoopStop(n);
|
||||
|
||||
for(int i = 0; i < stop; i++) {
|
||||
c = colors[getColorIndex(i)];
|
||||
|
||||
//creatures are more common than spells
|
||||
bag.add(getColor(c, uncommonCreature));
|
||||
bag.add(getColor(c, uncommonCreature));
|
||||
bag.add(getColor(c, uncommonSpell));
|
||||
}
|
||||
return getRandom(n, bag);
|
||||
}//getUncommon()
|
||||
|
||||
public ArrayList<String> getRare(int n) {
|
||||
ArrayList<String> bag = new ArrayList<String>();
|
||||
String c;
|
||||
int stop = getLoopStop(n);
|
||||
|
||||
for(int i = 0; i < stop; i++) {
|
||||
c = colors[getColorIndex(i)];
|
||||
|
||||
bag.add(getColor(c, rareCreature));
|
||||
bag.add(getColor(c, rareSpell));
|
||||
}
|
||||
return getRandom(n, bag);
|
||||
}//getRare()
|
||||
|
||||
public ArrayList<String> getRare(int n, int colorIndex) {
|
||||
ArrayList<String> bag = new ArrayList<String>();
|
||||
String c;
|
||||
int stop = getLoopStop(n);
|
||||
|
||||
for(int i = 0; i < stop; i++) {
|
||||
c = colors[colorIndex];
|
||||
|
||||
bag.add(getColor(c, rareCreature));
|
||||
bag.add(getColor(c, rareSpell));
|
||||
}
|
||||
return getRandom(n, bag);
|
||||
}//getRare()
|
||||
|
||||
//returns String of the card name that matches the parameter "color"
|
||||
private String getColor(String color, ArrayList<String> list) {
|
||||
Collections.shuffle(list, random);
|
||||
|
||||
Card c;
|
||||
String s;
|
||||
for(int i = 0; i < list.size(); i++) {
|
||||
s = list.get(i).toString();
|
||||
c = AllZone.CardFactory.getCard(s, null);
|
||||
if(getColor(c).equals(color)) return s;
|
||||
}
|
||||
//just get a random card
|
||||
//this will happens if there are 0 gold cards
|
||||
return list.get(0).toString();
|
||||
}//getColor()
|
||||
|
||||
|
||||
private String getColor(Card c) {
|
||||
String m = c.getManaCost();
|
||||
Set<String> colors = new HashSet<String>();
|
||||
|
||||
for(int i = 0; i < m.length(); i++) {
|
||||
switch(m.charAt(i)) {
|
||||
case ' ':
|
||||
break;
|
||||
case 'G':
|
||||
colors.add(Constant.Color.Green);
|
||||
break;
|
||||
case 'W':
|
||||
colors.add(Constant.Color.White);
|
||||
break;
|
||||
case 'B':
|
||||
colors.add(Constant.Color.Black);
|
||||
break;
|
||||
case 'U':
|
||||
colors.add(Constant.Color.Blue);
|
||||
break;
|
||||
case 'R':
|
||||
colors.add(Constant.Color.Red);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(colors.isEmpty()) return Constant.Color.Colorless;
|
||||
|
||||
if(1 < colors.size()) return "gold";
|
||||
|
||||
ArrayList<String> list = new ArrayList<String>(colors);
|
||||
return list.get(0).toString();
|
||||
}
|
||||
|
||||
private ArrayList<String> getRandom(int n, ArrayList<String> list) {
|
||||
//must always shuffle since we are starting at 0
|
||||
Collections.shuffle(list, random);
|
||||
|
||||
ArrayList<String> out = new ArrayList<String>();
|
||||
for(int i = 0; i < n; i++)
|
||||
out.add(list.get(i));
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/* @SuppressWarnings("unchecked")
|
||||
private void setup(File file, ArrayList creatureList, ArrayList spellList) {
|
||||
ArrayList all = readFile(file);
|
||||
|
||||
Card c;
|
||||
String s;
|
||||
for(int i = 0; i < all.size(); i++) {
|
||||
s = all.get(i).toString();
|
||||
|
||||
c = AllZone.CardFactory.getCard(s, "");
|
||||
if(c.isCreature()) creatureList.add(s);
|
||||
else spellList.add(s);
|
||||
}
|
||||
}//setup()
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private ArrayList readFile(File file) {
|
||||
ArrayList cardList = new ArrayList();
|
||||
|
||||
BufferedReader in;
|
||||
try {
|
||||
in = new BufferedReader(new FileReader(file));
|
||||
String line = in.readLine();
|
||||
|
||||
//stop reading if end of file or blank line is read
|
||||
while(line != null && (line.trim().length() != 0)) {
|
||||
if(!line.startsWith(comment)) {
|
||||
cardList.add(line.trim());
|
||||
}
|
||||
|
||||
line = in.readLine();
|
||||
}//if
|
||||
|
||||
} catch(Exception ex) {
|
||||
ErrorViewer.showError(ex);
|
||||
throw new RuntimeException("QuestData_BoosterPack : readFile() error, " + ex);
|
||||
}
|
||||
|
||||
return cardList;
|
||||
}//readFile()
|
||||
*/
|
||||
public String getRarity(String cardName) {
|
||||
if(commonCreature.contains(cardName) || commonSpell.contains(cardName)) return "Common";
|
||||
else if(uncommonCreature.contains(cardName) || uncommonSpell.contains(cardName)) return "Uncommon";
|
||||
else if(rareCreature.contains(cardName) || rareSpell.contains(cardName)) return "Rare";
|
||||
else if(cardName.equals("Forest") || cardName.equals("Plains") || cardName.equals("Island")
|
||||
|| cardName.equals("Swamp") || cardName.equals("Mountain")
|
||||
|| cardName.equals("Snow-Covered Forest") || cardName.equals("Snow-Covered Plains") || cardName.equals("Snow-Covered Island")
|
||||
|| cardName.equals("Snow-Covered Swamp") || cardName.equals("Snow-Covered Mountain")) return "Land";
|
||||
else return "error";
|
||||
}
|
||||
}
|
||||
357
src/forge/quest/data/QuestData_Prefs.java
Normal file
357
src/forge/quest/data/QuestData_Prefs.java
Normal file
@@ -0,0 +1,357 @@
|
||||
package forge.quest.data;
|
||||
|
||||
import forge.properties.ForgeProps;
|
||||
import forge.properties.NewConstants.QUEST;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class QuestData_Prefs implements Serializable {
|
||||
private static final long serialVersionUID = 3266336025656577905L;
|
||||
|
||||
private int numDiff = 4;
|
||||
|
||||
// Descriptive difficulty names
|
||||
private String[] sDifficulty = { "Easy", "Normal", "Hard", "Very Hard" };
|
||||
|
||||
// Default match wins it takes to gain a booster
|
||||
private int[] winsForBooster = { 1, 1, 2, 2 };
|
||||
private int[] winsForRankIncrease = { 1, 2, 3, 4 };
|
||||
private int[] winsForMediumAI = { 6, 6, 11, 11 };
|
||||
private int[] winsForHardAI = { 9, 9, 21, 21 };
|
||||
|
||||
// Default starting land for a quest
|
||||
private int startingBasicLand = 20;
|
||||
private int startingSnowBasicLand = 20;
|
||||
|
||||
// Default starting amount of each rarity
|
||||
private int[] startingCommons = {45, 40, 40, 40};
|
||||
private int[] startingUncommons = {20, 15, 15, 15};
|
||||
private int[] startingRares = {10, 10, 10, 10};
|
||||
|
||||
private int startingCredits = 250;
|
||||
|
||||
private int boosterPackRare = 1;
|
||||
private int boosterPackUncommon = 3;
|
||||
private int boosterPackCommon = 9;
|
||||
|
||||
private int matchRewardBase = 10;
|
||||
private double matchRewardTotalWins = 0.3;
|
||||
private int matchRewardNoLosses = 10;
|
||||
|
||||
private int matchRewardPoisonWinBonus = 50;
|
||||
private int matchRewardMilledWinBonus = 40;
|
||||
private int matchRewardAltWinBonus = 100;
|
||||
|
||||
private int matchRewardWinOnFirstTurn = 1500;
|
||||
private int matchRewardWinByTurnFive = 250;
|
||||
private int matchRewardWinByTurnTen = 50;
|
||||
private int matchRewardWinByTurnFifteen = 5;
|
||||
private int matchRewardMullToZero = 500;
|
||||
|
||||
public QuestData_Prefs()
|
||||
{
|
||||
// if quest.prefs exists
|
||||
grabPrefsFromFile();
|
||||
}
|
||||
|
||||
public void grabPrefsFromFile(){
|
||||
try{
|
||||
BufferedReader input = new BufferedReader(new FileReader(ForgeProps.getFile(QUEST.PREFS)));
|
||||
String line = null;
|
||||
while((line = input.readLine()) != null){
|
||||
if (line.startsWith("#") || line.length() == 0)
|
||||
continue;
|
||||
String[] split = line.split("=");
|
||||
|
||||
if (split[0].equals("difficultyString"))
|
||||
setDifficulty(split[1]);
|
||||
else if (split[0].equals("winsForBooster"))
|
||||
setWinsForBooster(split[1]);
|
||||
else if (split[0].equals("winsForRankIncrease"))
|
||||
setWinsForRank(split[1]);
|
||||
else if (split[0].equals("winsForMediumAI"))
|
||||
setWinsForMediumAI(split[1]);
|
||||
else if (split[0].equals("winsForHardAI"))
|
||||
setWinsForHardAI(split[1]);
|
||||
else if (split[0].equals("startingBasicLand"))
|
||||
setStartingBasic(split[1]);
|
||||
else if (split[0].equals("startingSnowBasicLand"))
|
||||
setStartingSnowBasic(split[1]);
|
||||
else if (split[0].equals("startingCommons"))
|
||||
setStartingCommons(split[1]);
|
||||
else if (split[0].equals("startingUncommons"))
|
||||
setStartingUncommons(split[1]);
|
||||
else if (split[0].equals("startingRares"))
|
||||
setStartingRares(split[1]);
|
||||
else if (split[0].equals("startingCredits"))
|
||||
setStartingCredits(split[1]);
|
||||
else if (split[0].equals("boosterPackCommon"))
|
||||
setNumCommon(split[1]);
|
||||
else if (split[0].equals("boosterPackUncommon"))
|
||||
setNumUncommon(split[1]);
|
||||
else if (split[0].equals("boosterPackRare"))
|
||||
setNumRares(split[1]);
|
||||
else if (split[0].equals("matchRewardBase"))
|
||||
setMatchRewardBase(split[1]);
|
||||
else if (split[0].equals("matchRewardTotalWins"))
|
||||
setMatchRewardTotalWins(split[1]);
|
||||
else if (split[0].equals("matchRewardNoLosses"))
|
||||
setMatchRewardNoLosses(split[1]);
|
||||
else if (split[0].equals("matchRewardMilledWinBonus"))
|
||||
setMatchRewardMilledWinBonus(split[1]);
|
||||
else if (split[0].equals("matchRewardPoisonWinBonus"))
|
||||
setMatchRewardPoisonWinBonus(split[1]);
|
||||
else if (split[0].equals("matchRewardAltWinBonus"))
|
||||
setMatchRewardAltWinBonus(split[1]);
|
||||
else if (split[0].equals("matchRewardWinOnFirstTurn"))
|
||||
setMatchRewardWinFirst(split[1]);
|
||||
else if (split[0].equals("matchRewardWinByTurnFive"))
|
||||
setMatchRewardWinByFifth(split[1]);
|
||||
else if (split[0].equals("matchRewardWinByTurnTen"))
|
||||
setMatchRewardWinByTen(split[1]);
|
||||
else if (split[0].equals("matchRewardWinByTurnFifteen"))
|
||||
setMatchRewardWinByFifteen(split[1]);
|
||||
else if (split[0].equals("matchRewardMullToZero"))
|
||||
setMatchMullToZero(split[1]);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
System.out.println("Trouble grabbing quest data preferences. Using default values.");
|
||||
}
|
||||
}
|
||||
|
||||
// getters
|
||||
public String[] getDifficulty(){
|
||||
return sDifficulty;
|
||||
}
|
||||
|
||||
public String getDifficulty(int index){
|
||||
return sDifficulty[index];
|
||||
}
|
||||
|
||||
public int getWinsForBooster(int index){
|
||||
return winsForBooster[index];
|
||||
}
|
||||
|
||||
public int getWinsForRankIncrease(int index){
|
||||
return winsForRankIncrease[index];
|
||||
}
|
||||
|
||||
public int getWinsForMediumAI(int index){
|
||||
return winsForMediumAI[index];
|
||||
}
|
||||
|
||||
public int getWinsForHardAI(int index){
|
||||
return winsForHardAI[index];
|
||||
}
|
||||
|
||||
public int getStartingBasic(){
|
||||
return startingBasicLand;
|
||||
}
|
||||
|
||||
public int getStartingSnowBasic(){
|
||||
return startingSnowBasicLand;
|
||||
}
|
||||
|
||||
public int getStartingCommons(int index){
|
||||
return startingCommons[index];
|
||||
}
|
||||
|
||||
public int getStartingUncommons(int index){
|
||||
return startingUncommons[index];
|
||||
}
|
||||
|
||||
public int getStartingRares(int index){
|
||||
return startingRares[index];
|
||||
}
|
||||
|
||||
public int getStartingCredits(){
|
||||
return startingCredits;
|
||||
}
|
||||
|
||||
public int getNumCommon(){
|
||||
return boosterPackCommon;
|
||||
}
|
||||
|
||||
public int getNumUncommon(){
|
||||
return boosterPackUncommon;
|
||||
}
|
||||
|
||||
public int getNumRare(){
|
||||
return boosterPackRare;
|
||||
}
|
||||
|
||||
|
||||
public int getMatchRewardBase(){
|
||||
return matchRewardBase;
|
||||
}
|
||||
|
||||
public double getMatchRewardTotalWins(){
|
||||
return matchRewardTotalWins;
|
||||
}
|
||||
|
||||
public int getMatchRewardNoLosses(){
|
||||
return matchRewardNoLosses;
|
||||
}
|
||||
|
||||
public int getMatchRewardPoisonWinBonus(){
|
||||
return matchRewardPoisonWinBonus;
|
||||
}
|
||||
|
||||
public int getMatchRewardMilledWinBonus(){
|
||||
return matchRewardMilledWinBonus;
|
||||
}
|
||||
|
||||
public int getMatchRewardAltWinBonus(){
|
||||
return matchRewardAltWinBonus;
|
||||
}
|
||||
|
||||
|
||||
public int getMatchRewardWinFirst(){
|
||||
return matchRewardWinOnFirstTurn;
|
||||
}
|
||||
|
||||
public int getMatchRewardWinByFifth(){
|
||||
return matchRewardWinByTurnFive;
|
||||
}
|
||||
|
||||
public int getMatchRewardWinByTen(){
|
||||
return matchRewardWinByTurnTen;
|
||||
}
|
||||
|
||||
public int getMatchRewardWinByFifteen(){
|
||||
return matchRewardWinByTurnFifteen;
|
||||
}
|
||||
|
||||
public int getMatchMullToZero(){
|
||||
return matchRewardMullToZero;
|
||||
}
|
||||
|
||||
|
||||
// setters
|
||||
public void setDifficulty(String diff){
|
||||
this.sDifficulty = diff.split(",");
|
||||
}
|
||||
|
||||
public void setWinsForBooster(String wins){
|
||||
String[] winsStr = wins.split(",");
|
||||
|
||||
for(int i = 0; i < numDiff; i++)
|
||||
this.winsForBooster[i] = Integer.parseInt(winsStr[i]);
|
||||
}
|
||||
|
||||
public void setWinsForRank(String wins){
|
||||
String[] winsStr = wins.split(",");
|
||||
|
||||
for(int i = 0; i < numDiff; i++)
|
||||
this.winsForRankIncrease[i] = Integer.parseInt(winsStr[i]);
|
||||
}
|
||||
|
||||
public void setWinsForMediumAI(String wins){
|
||||
String[] winsStr = wins.split(",");
|
||||
|
||||
for(int i = 0; i < numDiff; i++)
|
||||
this.winsForMediumAI[i] = Integer.parseInt(winsStr[i]);
|
||||
}
|
||||
|
||||
public void setWinsForHardAI(String wins){
|
||||
String[] winsStr = wins.split(",");
|
||||
|
||||
for(int i = 0; i < numDiff; i++)
|
||||
this.winsForHardAI[i] = Integer.parseInt(winsStr[i]);
|
||||
}
|
||||
|
||||
public void setStartingBasic(String land){
|
||||
this.startingBasicLand = Integer.parseInt(land);
|
||||
}
|
||||
|
||||
public void setStartingSnowBasic(String land){
|
||||
this.startingSnowBasicLand = Integer.parseInt(land);
|
||||
}
|
||||
|
||||
public void setStartingCommons(String rarity){
|
||||
String[] splitStr = rarity.split(",");
|
||||
|
||||
for(int i = 0; i < numDiff; i++)
|
||||
this.startingCommons[i] = Integer.parseInt(splitStr[i]);
|
||||
}
|
||||
|
||||
public void setStartingUncommons(String rarity){
|
||||
String[] splitStr = rarity.split(",");
|
||||
|
||||
for(int i = 0; i < numDiff; i++)
|
||||
this.startingUncommons[i] = Integer.parseInt(splitStr[i]);
|
||||
}
|
||||
|
||||
public void setStartingRares(String rarity){
|
||||
String[] splitStr = rarity.split(",");
|
||||
|
||||
for(int i = 0; i < numDiff; i++)
|
||||
this.startingRares[i] = Integer.parseInt(splitStr[i]);
|
||||
}
|
||||
|
||||
public void setStartingCredits(String credits){
|
||||
this.startingCredits = Integer.parseInt(credits);
|
||||
}
|
||||
|
||||
public void setNumCommon(String pack){
|
||||
this.boosterPackCommon = Integer.parseInt(pack);
|
||||
}
|
||||
|
||||
public void setNumUncommon(String pack){
|
||||
this.boosterPackUncommon = Integer.parseInt(pack);
|
||||
}
|
||||
|
||||
public void setNumRares(String pack){
|
||||
this.boosterPackRare = Integer.parseInt(pack);
|
||||
}
|
||||
|
||||
|
||||
public void setMatchRewardBase(String match){
|
||||
this.matchRewardBase = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
public void setMatchRewardTotalWins(String match){
|
||||
this.matchRewardTotalWins = Double.parseDouble(match);
|
||||
}
|
||||
|
||||
public void setMatchRewardNoLosses(String match){
|
||||
this.matchRewardNoLosses = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
public void setMatchRewardPoisonWinBonus(String match){
|
||||
this.matchRewardPoisonWinBonus = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
public void setMatchRewardMilledWinBonus(String match){
|
||||
this.matchRewardMilledWinBonus = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
public void setMatchRewardAltWinBonus(String match){
|
||||
this.matchRewardAltWinBonus = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
|
||||
public void setMatchRewardWinFirst(String match){
|
||||
this.matchRewardWinOnFirstTurn = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
public void setMatchRewardWinByFifth(String match){
|
||||
this.matchRewardWinByTurnFive = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
public void setMatchRewardWinByTen(String match){
|
||||
this.matchRewardWinByTurnTen = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
public void setMatchRewardWinByFifteen(String match){
|
||||
this.matchRewardWinByTurnFifteen = Integer.parseInt(match);
|
||||
}
|
||||
|
||||
public void setMatchMullToZero(String match){
|
||||
this.matchRewardMullToZero = Integer.parseInt(match);
|
||||
}
|
||||
}
|
||||
69
src/forge/quest/data/QuestData_State.java
Normal file
69
src/forge/quest/data/QuestData_State.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package forge.quest.data;
|
||||
|
||||
|
||||
/**
|
||||
* QuestData_State.java
|
||||
*
|
||||
* Created on 26.10.2009
|
||||
*/
|
||||
|
||||
|
||||
import forge.Deck;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* The class QuestData_State.
|
||||
*
|
||||
* @version V0.0 26.10.2009
|
||||
* @author Clemens Koza
|
||||
*/
|
||||
public class QuestData_State implements Serializable {
|
||||
private static final long serialVersionUID = 7007940230351051937L;
|
||||
|
||||
int rankIndex, win, lost;
|
||||
int plantLevel, wolfPetLevel, crocPetLevel, birdPetLevel, houndPetLevel, life, estatesLevel, luckyCoinLevel, sleightOfHandLevel, gearLevel, questsPlayed;
|
||||
long credits;
|
||||
String difficulty, mode, selectedPet;
|
||||
|
||||
ArrayList<Integer> availableQuests, completedQuests;
|
||||
ArrayList<String> cardPool, shopList;
|
||||
Map<String, Deck> myDecks, aiDecks;
|
||||
|
||||
public QuestData_State() {}
|
||||
|
||||
/**
|
||||
* This constructor is used by QestData_State in the default package to create a replacement object for the
|
||||
* obsolete class.
|
||||
*/
|
||||
public QuestData_State(int rankIndex, int win, int lost, int plantLevel, int wolfPetLevel, int crocPetLevel, int birdPetLevel, int houndPetLevel, String selectedPet, int life, int estatesLevel, int luckyCoinLevel, int sleightOfHandLevel, int gearLevel, int questsPlayed,
|
||||
ArrayList<Integer> availableQuests, ArrayList<Integer> completedQuests, long credits, String difficulty, String mode,
|
||||
ArrayList<String> cardPool, ArrayList<String> shopList, Map<String, Deck> myDecks, Map<String, Deck> aiDecks) {
|
||||
this.rankIndex = rankIndex;
|
||||
this.win = win;
|
||||
this.lost = lost;
|
||||
this.plantLevel = plantLevel;
|
||||
this.wolfPetLevel = wolfPetLevel;
|
||||
this.crocPetLevel = crocPetLevel;
|
||||
this.birdPetLevel = birdPetLevel;
|
||||
this.houndPetLevel = houndPetLevel;
|
||||
this.life = life;
|
||||
this.estatesLevel = estatesLevel;
|
||||
this.luckyCoinLevel = luckyCoinLevel;
|
||||
this.sleightOfHandLevel = sleightOfHandLevel;
|
||||
this.gearLevel = gearLevel;
|
||||
this.questsPlayed = questsPlayed;
|
||||
this.availableQuests = availableQuests;
|
||||
this.completedQuests = completedQuests;
|
||||
this.credits = credits;
|
||||
this.difficulty = difficulty;
|
||||
this.mode = mode;
|
||||
this.cardPool = cardPool;
|
||||
this.shopList = shopList;
|
||||
this.myDecks = myDecks;
|
||||
this.aiDecks = aiDecks;
|
||||
}
|
||||
}
|
||||
894
src/forge/quest/data/QuestUtil.java
Normal file
894
src/forge/quest/data/QuestUtil.java
Normal file
@@ -0,0 +1,894 @@
|
||||
package forge.quest.data;
|
||||
|
||||
import forge.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class QuestUtil {
|
||||
|
||||
public static int getLife(QuestData qd)
|
||||
{
|
||||
return qd.getLife();
|
||||
}
|
||||
|
||||
public static CardList getComputerCreatures(QuestData qd)
|
||||
{
|
||||
return new CardList();
|
||||
}
|
||||
|
||||
public static CardList getComputerCreatures(QuestData qd, Quest_Assignment qa)
|
||||
{
|
||||
CardList list = new CardList();
|
||||
if (qa!=null)
|
||||
{
|
||||
ArrayList<String> compCards = qa.getCompy();
|
||||
|
||||
for (String s:compCards)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(s, AllZone.ComputerPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
list.add(c);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static CardList getHumanPlantAndPet(QuestData qd)
|
||||
{
|
||||
CardList list = new CardList();
|
||||
|
||||
if (qd.getSelectedPet() != null)
|
||||
{
|
||||
if (qd.getSelectedPet().equals("No Plant/Pet"))
|
||||
return list;
|
||||
|
||||
if (qd.getSelectedPet().equals("Wolf") && qd.getWolfPetLevel() > 0)
|
||||
list.add(getWolfPetToken(qd.getWolfPetLevel()));
|
||||
else if (qd.getSelectedPet().equals("Croc") && qd.getCrocPetLevel() > 0)
|
||||
list.add(getCrocPetToken(qd.getCrocPetLevel()));
|
||||
else if (qd.getSelectedPet().equals("Bird") && qd.getBirdPetLevel() > 0)
|
||||
list.add(getBirdPetToken(qd.getBirdPetLevel()));
|
||||
else if (qd.getSelectedPet().equals("Hound") && qd.getHoundPetLevel() > 0)
|
||||
list.add(getHoundPetToken(qd.getHoundPetLevel()));
|
||||
}
|
||||
|
||||
if (qd.getPlantLevel() > 0)
|
||||
list.add(getPlantToken(qd.getPlantLevel()));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static CardList getHumanPlantAndPet(QuestData qd, Quest_Assignment qa)
|
||||
{
|
||||
CardList list = getHumanPlantAndPet(qd);
|
||||
|
||||
if (qa!=null)
|
||||
list.addAll(qa.getHuman().toArray());
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
//makeToken(String name, String imageName, Card source, String manaCost, String[] types, int baseAttack, int baseDefense, String[] intrinsicKeywords) {
|
||||
|
||||
public static Card getPlantToken(int level)
|
||||
{
|
||||
String imageName = "";
|
||||
int baseAttack = 0;
|
||||
int baseDefense = 0;
|
||||
|
||||
String keyword = "";
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
imageName = "G 0 1 Plant Wall";
|
||||
baseDefense = 1;
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
imageName = "G 0 2 Plant Wall";
|
||||
baseDefense = 2;
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
imageName = "G 0 3 Plant Wall";
|
||||
baseDefense = 3;
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
imageName = "G 1 3 Plant Wall";
|
||||
baseDefense = 3;
|
||||
baseAttack = 1;
|
||||
}
|
||||
else if (level == 5)
|
||||
{
|
||||
imageName = "G 1 3 Plant Wall Deathtouch";
|
||||
baseDefense = 3;
|
||||
baseAttack = 1;
|
||||
keyword = "Deathtouch";
|
||||
}
|
||||
|
||||
else if (level == 6)
|
||||
{
|
||||
imageName = "G 1 4 Plant Wall";
|
||||
baseDefense = 4;
|
||||
baseAttack = 1;
|
||||
keyword = "Deathtouch";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Card c = new Card();
|
||||
c.setName("Plant Wall");
|
||||
|
||||
c.setImageName(imageName);
|
||||
|
||||
c.setController(AllZone.HumanPlayer);
|
||||
c.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
//c.setManaCost("G");
|
||||
c.addColor("G");
|
||||
c.setToken(true);
|
||||
|
||||
c.addType("Creature");
|
||||
c.addType("Plant");
|
||||
c.addType("Wall");
|
||||
|
||||
c.addIntrinsicKeyword("Defender");
|
||||
if (!keyword.equals(""))
|
||||
c.addIntrinsicKeyword("Deathtouch");
|
||||
|
||||
c.setBaseAttack(baseAttack);
|
||||
c.setBaseDefense(baseDefense);
|
||||
|
||||
if (level == 6)
|
||||
{
|
||||
final Card crd = c;
|
||||
Ability_Cost abCost = new Ability_Cost("T", crd.getName(), true);
|
||||
final SpellAbility ability = new Ability_Activated(crd, abCost, null){
|
||||
private static final long serialVersionUID = 7546242087593613719L;
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
crd.getController().gainLife(1, crd);
|
||||
}
|
||||
};
|
||||
c.addSpellAbility(ability);
|
||||
ability.setDescription("tap: You gain 1 life.");
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Plant Wall - ").append(c.getController()).append(" gains 1 life.");
|
||||
ability.setStackDescription(sb.toString());
|
||||
|
||||
c.setText("tap: You gain 1 life.");
|
||||
}
|
||||
|
||||
|
||||
return c;
|
||||
}//getPlantToken
|
||||
|
||||
public static Card getWolfPetToken(int level)
|
||||
{
|
||||
String imageName = "";
|
||||
int baseAttack = 0;
|
||||
int baseDefense = 0;
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
imageName = "G 1 1 Wolf Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 1;
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
imageName = "G 1 2 Wolf Pet";
|
||||
baseDefense = 2;
|
||||
baseAttack = 1;
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
imageName = "G 2 2 Wolf Pet";
|
||||
baseDefense = 2;
|
||||
baseAttack = 2;
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
imageName = "G 2 2 Wolf Pet Flanking";
|
||||
baseDefense = 2;
|
||||
baseAttack = 2;
|
||||
}
|
||||
|
||||
|
||||
Card c = new Card();
|
||||
c.setName("Wolf Pet");
|
||||
|
||||
c.setImageName(imageName);
|
||||
|
||||
c.setController(AllZone.HumanPlayer);
|
||||
c.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
//c.setManaCost("G");
|
||||
c.addColor("G");
|
||||
c.setToken(true);
|
||||
|
||||
c.addType("Creature");
|
||||
c.addType("Wolf");
|
||||
c.addType("Pet");
|
||||
|
||||
if (level >= 4)
|
||||
c.addIntrinsicKeyword("Flanking");
|
||||
|
||||
c.setBaseAttack(baseAttack);
|
||||
c.setBaseDefense(baseDefense);
|
||||
|
||||
return c;
|
||||
}//getWolfPetToken
|
||||
|
||||
public static Card getCrocPetToken(int level)
|
||||
{
|
||||
String imageName = "";
|
||||
int baseAttack = 0;
|
||||
int baseDefense = 0;
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
imageName = "B 1 1 Crocodile Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 1;
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
imageName = "B 2 1 Crocodile Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 2;
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
imageName = "B 3 1 Crocodile Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 3;
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
imageName = "B 3 1 Crocodile Pet Swampwalk";
|
||||
baseDefense = 1;
|
||||
baseAttack = 3;
|
||||
}
|
||||
|
||||
|
||||
Card c = new Card();
|
||||
c.setName("Crocodile Pet");
|
||||
|
||||
c.setImageName(imageName);
|
||||
|
||||
c.setController(AllZone.HumanPlayer);
|
||||
c.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
//c.setManaCost("B");
|
||||
c.addColor("B");
|
||||
c.setToken(true);
|
||||
|
||||
c.addType("Creature");
|
||||
c.addType("Crocodile");
|
||||
c.addType("Pet");
|
||||
|
||||
if (level >= 4)
|
||||
c.addIntrinsicKeyword("Swampwalk");
|
||||
|
||||
c.setBaseAttack(baseAttack);
|
||||
c.setBaseDefense(baseDefense);
|
||||
|
||||
return c;
|
||||
}//getCrocPetToken
|
||||
|
||||
public static Card getBirdPetToken(int level)
|
||||
{
|
||||
String imageName = "";
|
||||
int baseAttack = 0;
|
||||
int baseDefense = 0;
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
imageName = "W 0 1 Bird Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 0;
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
imageName = "W 1 1 Bird Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 1;
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
imageName = "W 2 1 Bird Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 2;
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
imageName = "W 2 1 Bird Pet First Strike";
|
||||
baseDefense = 1;
|
||||
baseAttack = 2;
|
||||
}
|
||||
|
||||
|
||||
Card c = new Card();
|
||||
c.setName("Bird Pet");
|
||||
|
||||
c.setImageName(imageName);
|
||||
|
||||
c.setController(AllZone.HumanPlayer);
|
||||
c.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
//c.setManaCost("W");
|
||||
c.addColor("W");
|
||||
c.setToken(true);
|
||||
|
||||
c.addType("Creature");
|
||||
c.addType("Bird");
|
||||
c.addType("Pet");
|
||||
|
||||
c.addIntrinsicKeyword("Flying");
|
||||
|
||||
if (level >= 4)
|
||||
c.addIntrinsicKeyword("First Strike");
|
||||
|
||||
c.setBaseAttack(baseAttack);
|
||||
c.setBaseDefense(baseDefense);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
public static Card getHoundPetToken(int level)
|
||||
{
|
||||
String imageName = "";
|
||||
int baseAttack = 0;
|
||||
int baseDefense = 0;
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
imageName = "R 1 1 Hound Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 1;
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
imageName = "R 1 1 Hound Pet Haste";
|
||||
baseDefense = 1;
|
||||
baseAttack = 1;
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
imageName = "R 2 1 Hound Pet";
|
||||
baseDefense = 1;
|
||||
baseAttack = 2;
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
imageName = "R 2 1 Hound Pet Alone";
|
||||
baseDefense = 1;
|
||||
baseAttack = 2;
|
||||
}
|
||||
|
||||
|
||||
Card c = new Card();
|
||||
c.setName("Hound Pet");
|
||||
|
||||
c.setImageName(imageName);
|
||||
|
||||
c.setController(AllZone.HumanPlayer);
|
||||
c.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
//c.setManaCost("R");
|
||||
c.addColor("R");
|
||||
c.setToken(true);
|
||||
|
||||
c.addType("Creature");
|
||||
c.addType("Hound");
|
||||
c.addType("Pet");
|
||||
|
||||
if (level >= 2)
|
||||
c.addIntrinsicKeyword("Haste");
|
||||
|
||||
if (level >= 4)
|
||||
c.addIntrinsicKeyword("Whenever this creature attacks alone, it gets +2/+0 until end of turn.");
|
||||
|
||||
c.setBaseAttack(baseAttack);
|
||||
c.setBaseDefense(baseDefense);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
public static ArrayList<String> getPetNames(QuestData questData)
|
||||
{
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
if (questData.getWolfPetLevel() > 0)
|
||||
list.add("Wolf");
|
||||
if (questData.getCrocPetLevel() > 0)
|
||||
list.add("Croc");
|
||||
if (questData.getBirdPetLevel() > 0)
|
||||
list.add("Bird");
|
||||
if (questData.getHoundPetLevel() > 0)
|
||||
list.add("Hound");
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void setupQuest(Quest_Assignment qa)
|
||||
{
|
||||
/*
|
||||
* Gold = 0
|
||||
* Colorless = 1
|
||||
* Black = 2
|
||||
* Blue = 3
|
||||
* Green = 4
|
||||
* Red = 5
|
||||
* White = 6
|
||||
*/
|
||||
|
||||
QuestData_BoosterPack pack = new QuestData_BoosterPack();
|
||||
qa.clearCompy();
|
||||
|
||||
int id = qa.getId();
|
||||
|
||||
if (id == 1) //White Dungeon
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
Card c = AllZone.CardFactory.getCard("Adventuring Gear", AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
|
||||
qa.setHuman(humanList);
|
||||
|
||||
for (int i=0;i<2;i++)
|
||||
qa.addCompy("Savannah Lions");
|
||||
|
||||
qa.setCardRewardList(pack.getRare(3, 6));
|
||||
}
|
||||
|
||||
else if (id == 2) //Blue Dungeon
|
||||
{
|
||||
for (int i=0;i<3;i++)
|
||||
qa.addCompy("Merfolk of the Pearl Trident");
|
||||
|
||||
qa.setCardRewardList(pack.getRare(3, 3));
|
||||
}
|
||||
|
||||
else if (id == 3) //Black Dungeon
|
||||
{
|
||||
qa.setCardRewardList(pack.getRare(3, 2));
|
||||
}
|
||||
|
||||
else if (id == 4) //Red Dungeon
|
||||
{
|
||||
for (int i=0;i<3;i++)
|
||||
qa.addCompy("Mons's Goblin Raiders");
|
||||
|
||||
qa.setCardRewardList(pack.getRare(3, 5));
|
||||
}
|
||||
|
||||
else if (id == 5) //Green Dungeon
|
||||
{
|
||||
qa.setCardRewardList(pack.getRare(3, 4));
|
||||
}
|
||||
|
||||
else if (id == 6) //Colorless Dungeon
|
||||
{
|
||||
for (int i=0;i<2;i++)
|
||||
qa.addCompy("Ornithopter");
|
||||
qa.setCardRewardList(pack.getRare(3, 1));
|
||||
}
|
||||
|
||||
else if (id == 7) //Gold Dungeon
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
Card c = AllZone.CardFactory.getCard("Trailblazer's Boots", AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
|
||||
qa.setHuman(humanList);
|
||||
qa.setCardRewardList(pack.getRare(3, 0));
|
||||
}
|
||||
|
||||
else if (id == 8)
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
for (int i=0;i<3;i++)
|
||||
{
|
||||
//CANNOT use makeToken because of WheneverKeyword
|
||||
Card c = new Card();
|
||||
c.setName("Sheep");
|
||||
c.setImageName("G 0 1 Sheep");
|
||||
|
||||
c.setController(AllZone.HumanPlayer);
|
||||
c.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
//c.setManaCost("G");
|
||||
c.addColor("G");
|
||||
c.setToken(true);
|
||||
|
||||
c.addType("Creature");
|
||||
c.addType("Sheep");
|
||||
|
||||
c.setBaseAttack(0);
|
||||
c.setBaseDefense(1);
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
qa.setCardRewardList(pack.getRare(3));
|
||||
}
|
||||
|
||||
else if (id == 9)
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
Card c = AllZone.CardFactory.getCard("Trusty Machete", AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
|
||||
qa.setHuman(humanList);
|
||||
|
||||
for (int i=0;i<3;i++)
|
||||
qa.addCompy("Wall of Wood");
|
||||
|
||||
qa.setCardRewardList(pack.getRare(4, 4));
|
||||
}
|
||||
|
||||
else if (id == 10)
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
|
||||
Card crd = AllZone.CardFactory.getCard("Wall of Spears", AllZone.HumanPlayer);
|
||||
|
||||
crd.setCurSetCode(crd.getMostRecentSet());
|
||||
crd.setImageFilename(CardUtil.buildFilename(crd));
|
||||
|
||||
humanList.add(crd);
|
||||
|
||||
for (int i=0;i<3;i++)
|
||||
{
|
||||
Card c = new Card();
|
||||
c.setName("Citizen");
|
||||
c.setImageName("W 1 1 Citizen");
|
||||
|
||||
c.setController(AllZone.HumanPlayer);
|
||||
c.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
c.setManaCost("W");
|
||||
c.addColor("W");
|
||||
c.setToken(true);
|
||||
|
||||
c.addType("Creature");
|
||||
c.addType("Citizen");
|
||||
|
||||
c.setBaseAttack(1);
|
||||
c.setBaseDefense(1);
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
|
||||
qa.setHuman(humanList);
|
||||
|
||||
for (int i=0;i<3;i++)
|
||||
qa.addCompy("Scathe Zombies");
|
||||
qa.addCompy("Mass of Ghouls");
|
||||
|
||||
qa.setCardRewardList(pack.getRare(4, 2));
|
||||
}
|
||||
|
||||
else if (id == 11) // The King's Contest
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
Card c = AllZone.CardFactory.getCard("Seal of Cleansing", AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
|
||||
qa.setHuman(humanList);
|
||||
|
||||
qa.addCompy("Loyal Retainers");
|
||||
|
||||
qa.setCardRewardList(pack.getRare(3));
|
||||
}
|
||||
|
||||
else if (id == 12) // Barroom Brawl
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
Card c = new Card();
|
||||
c.setName("Soldier Ally");
|
||||
c.setImageName("W 1 1 Soldier Ally");
|
||||
|
||||
c.setController(AllZone.HumanPlayer);
|
||||
c.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
c.setManaCost("W");
|
||||
c.addColor("W");
|
||||
c.setToken(true);
|
||||
|
||||
c.addType("Creature");
|
||||
c.addType("Soldier");
|
||||
c.addType("Ally");
|
||||
|
||||
c.setBaseAttack(1);
|
||||
c.setBaseDefense(1);
|
||||
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
|
||||
qa.addCompy("Lowland Giant");
|
||||
|
||||
qa.setCardRewardList(pack.getRare(4));
|
||||
}
|
||||
|
||||
else if (id == 13) // The Court Jester
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
Card c = AllZone.CardFactory.getCard("Sensei's Divining Top", AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
|
||||
qa.setHuman(humanList);
|
||||
|
||||
qa.addCompy("Teferi's Puzzle Box");
|
||||
|
||||
qa.setCardRewardList(pack.getRare(4, 0));
|
||||
}
|
||||
|
||||
else if (id == 14) // Ancient Battlefield
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
String humanSetupCards[] = {"Glasses of Urza", "Blight Sickle"};
|
||||
|
||||
for (int i = 0; i < 2; i ++)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(humanSetupCards[i], AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] = {"Bad Moon", "Wall of Brambles"};
|
||||
|
||||
for (int i = 0; i < 2; i ++)
|
||||
{
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
}
|
||||
|
||||
qa.setCardRewardList(pack.getRare(4));
|
||||
}
|
||||
|
||||
else if (id == 15) // Don't Play With Matches
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
String humanSetupCards[] = {"Mudbutton Torchrunner", "Scuzzback Scrapper"};
|
||||
|
||||
for (int i = 0; i < 2; i ++)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(humanSetupCards[i], AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] = {"Heedless One", "Norwood Archers", "Wildslayer Elves"};
|
||||
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
}
|
||||
|
||||
qa.setCardRewardList(pack.getRare(4, 5));
|
||||
}
|
||||
|
||||
else if (id == 16) // Mines of Kazum Durl
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
String humanSetupCards[] = {"Dwarven Demolition Team", "Dwarven Pony", "Dwarven Trader"};
|
||||
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(humanSetupCards[i], AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] =
|
||||
{"Wall of Earth", "Wall of Air", "Wall of Ice", "Wall of Light", "Carrion Wall" ,"Steel Wall"};
|
||||
|
||||
for (int i = 0; i < 6; i ++)
|
||||
{
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
}
|
||||
|
||||
qa.setCardRewardList(pack.getRare(4, 4));
|
||||
}
|
||||
|
||||
else if (id == 17) // House Party
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
String humanSetupCards[] = {"Hopping Automaton", "Honden of Life's Web", "Forbidden Orchard"};
|
||||
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(humanSetupCards[i], AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] = {"Honden of Infinite Rage", "Mikokoro, Center of the Sea", "Tidehollow Strix"};
|
||||
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
}
|
||||
|
||||
qa.setCardRewardList(pack.getRare(4, 1));
|
||||
}
|
||||
|
||||
else if (id == 18) // Crows in the Field
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
String humanSetupCards[] = {"Straw Soldiers", "Femeref Archers", "Moonglove Extract"};
|
||||
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(humanSetupCards[i], AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] = {"Defiant Falcon", "Soulcatcher", "Storm Crow", "Hypnotic Specter"};
|
||||
|
||||
for (int i = 0; i < 4; i ++)
|
||||
{
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
}
|
||||
|
||||
qa.setCardRewardList(pack.getRare(5));
|
||||
}
|
||||
|
||||
else if (id == 19) // The Desert Caravan
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
String humanSetupCards[] = {"Spidersilk Net", "Dromad Purebred"};
|
||||
|
||||
for (int i = 0; i < 2; i ++)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(humanSetupCards[i], AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] = {"Ambush Party", "Ambush Party", "Gnat Alley Creeper", "Ambush Party", "Ambush Party"};
|
||||
|
||||
for (int i = 0; i < 5; i ++)
|
||||
{
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
}
|
||||
|
||||
qa.setCardRewardList(pack.getRare(5));
|
||||
}
|
||||
|
||||
else if (id == 20) // Blood Oath
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
String humanSetupCards[] = {"Counterbalance", "Hatching Plans", "Ley Druid"};
|
||||
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(humanSetupCards[i], AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] = {"Ior Ruin Expedition", "Oversold Cemetery", "Trapjaw Kelpie"};
|
||||
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
}
|
||||
|
||||
qa.setCardRewardList(pack.getRare(5, 1));
|
||||
}
|
||||
|
||||
else if (id == 21) // Private Domain
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
|
||||
Card c = AllZone.CardFactory.getCard("Strip Mine", AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] = {"Plains", "Island", "Swamp", "Mountain", "Forest"};
|
||||
|
||||
for (int i = 0; i < 5; i ++)
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
|
||||
qa.setCardRewardList(pack.getRare(6));
|
||||
}
|
||||
|
||||
else if (id == 22) // Pied Piper
|
||||
{
|
||||
CardList humanList = new CardList();
|
||||
String humanSetupCards[] = {"Volunteer Militia", "Land Tax", "Elvish Farmer", "An-Havva Township"};
|
||||
|
||||
for (int i = 0; i < 4; i ++)
|
||||
{
|
||||
Card c = AllZone.CardFactory.getCard(humanSetupCards[i], AllZone.HumanPlayer);
|
||||
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
humanList.add(c);
|
||||
}
|
||||
qa.setHuman(humanList);
|
||||
|
||||
String compySetupCards[] = {"Darksteel Citadel", "Relentless Rats"};
|
||||
|
||||
for (int i = 0; i < 2; i ++)
|
||||
qa.addCompy(compySetupCards[i]);
|
||||
|
||||
qa.setCardRewardList(pack.getRare(3));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}//QuestUtil
|
||||
54
src/forge/quest/data/pet/QuestPetAbstract.java
Normal file
54
src/forge/quest/data/pet/QuestPetAbstract.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package forge.quest.data.pet;
|
||||
|
||||
import forge.Card;
|
||||
|
||||
public abstract class QuestPetAbstract {
|
||||
int level;
|
||||
private int maxLevel;
|
||||
private String name;
|
||||
private String description;
|
||||
|
||||
public abstract Card getPetCard();
|
||||
|
||||
public abstract int[] getAllUpgradePrices();
|
||||
public int getUpgradePrice(){
|
||||
return getAllUpgradePrices()[level];
|
||||
}
|
||||
|
||||
public abstract String[] getAllUpgradeDescriptions();
|
||||
public String getUpgradeDescription(){
|
||||
return getAllUpgradeDescriptions()[level];
|
||||
}
|
||||
|
||||
|
||||
public abstract String[] getAllImageNames();
|
||||
public String getImageName(){
|
||||
return getAllImageNames()[level];
|
||||
}
|
||||
|
||||
public abstract String[] getAllStats();
|
||||
public String getStats(){
|
||||
return getAllStats()[level];
|
||||
}
|
||||
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void incrementLevel(){
|
||||
if (level < maxLevel){
|
||||
level++;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaxLevel(){
|
||||
return maxLevel;
|
||||
}
|
||||
|
||||
protected QuestPetAbstract(String name, String description, int maxLevel) {
|
||||
this.description = description;
|
||||
this.name = name;
|
||||
this.maxLevel = maxLevel;
|
||||
}
|
||||
}
|
||||
94
src/forge/quest/data/pet/QuestPetBird.java
Normal file
94
src/forge/quest/data/pet/QuestPetBird.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package forge.quest.data.pet;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
|
||||
public class QuestPetBird extends QuestPetAbstract{
|
||||
@Override
|
||||
public Card getPetCard() {
|
||||
Card petCard = new Card();
|
||||
|
||||
petCard.setName("Bird Pet");
|
||||
petCard.setController(AllZone.HumanPlayer);
|
||||
petCard.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
petCard.addColor("W");
|
||||
petCard.setToken(true);
|
||||
|
||||
petCard.addType("Creature");
|
||||
petCard.addType("Bird");
|
||||
petCard.addType("Pet");
|
||||
|
||||
petCard.addIntrinsicKeyword("Flying");
|
||||
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
petCard.setImageName("W 0 1 Bird Pet");
|
||||
petCard.setBaseAttack(0);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
petCard.setImageName("W 1 1 Bird Pet");
|
||||
petCard.setBaseAttack(1);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
petCard.setImageName("W 2 1 Bird Pet");
|
||||
petCard.setBaseAttack(2);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
petCard.setImageName("W 2 1 Bird Pet");
|
||||
petCard.setBaseAttack(2);
|
||||
petCard.setBaseDefense(1);
|
||||
petCard.addIntrinsicKeyword("First Strike");
|
||||
}
|
||||
|
||||
return petCard;
|
||||
}
|
||||
|
||||
public QuestPetBird() {
|
||||
super("Bird",
|
||||
"Unmatched in speed, agility and awareness, this trained hawk makes a fantastic hunter.",
|
||||
4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAllUpgradePrices() {
|
||||
return new int[]{200, 300, 450, 400};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllUpgradeDescriptions() {
|
||||
return new String[]{
|
||||
"Purchase Bird",
|
||||
"Improve the attack power of your bird.",
|
||||
"Improve the attack power of your bird.",
|
||||
"Give First Strike to your bird.",
|
||||
"You cannot train your bird any further"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllStats() {
|
||||
return new String[]{"You do not own a bird",
|
||||
"0/1, W, Flying",
|
||||
"1/1, W, Flying",
|
||||
"2/1, W, Flying",
|
||||
"2/1, W, Flying, First Strike"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllImageNames() {
|
||||
return new String[]{
|
||||
"",
|
||||
"w_0_1_bird_pet_small.jpg",
|
||||
"w_1_1_bird_pet_small.jpg",
|
||||
"w_2_1_bird_pet_small.jpg",
|
||||
"w_2_1_bird_pet_first_strike_small.jpg"
|
||||
};
|
||||
}
|
||||
}
|
||||
91
src/forge/quest/data/pet/QuestPetCrocodile.java
Normal file
91
src/forge/quest/data/pet/QuestPetCrocodile.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package forge.quest.data.pet;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
|
||||
public class QuestPetCrocodile extends QuestPetAbstract{
|
||||
@Override
|
||||
public Card getPetCard() {
|
||||
Card petCard = new Card();
|
||||
petCard.setName("Crocodile Pet");
|
||||
petCard.setController(AllZone.HumanPlayer);
|
||||
petCard.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
petCard.addColor("B");
|
||||
petCard.setToken(true);
|
||||
|
||||
petCard.addType("Creature");
|
||||
petCard.addType("Crocodile");
|
||||
petCard.addType("Pet");
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
petCard.setImageName("B 1 1 Crocodile Pet");
|
||||
petCard.setBaseAttack(1);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
petCard.setImageName("B 2 1 Crocodile Pet");
|
||||
petCard.setBaseAttack(2);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
petCard.setImageName("B 3 1 Crocodile Pet");
|
||||
petCard.setBaseAttack(3);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
petCard.setImageName("B 3 1 Crocodile Pet Swampwalk");
|
||||
petCard.setBaseAttack(3);
|
||||
petCard.setBaseDefense(1);
|
||||
petCard.addIntrinsicKeyword("Swampwalk");
|
||||
}
|
||||
|
||||
|
||||
return petCard;
|
||||
}
|
||||
|
||||
public QuestPetCrocodile() {
|
||||
super("Crocodile",
|
||||
"With its razor sharp teeth, this swamp-dwelling monster is extremely dangerous",
|
||||
4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAllUpgradePrices() {
|
||||
return new int[]{250, 300, 450, 600};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllUpgradeDescriptions() {
|
||||
return new String[]{
|
||||
"Purchase Crocodile",
|
||||
"Improve the attack power of your crocodile.",
|
||||
"Improve the attack power of your crocodile.",
|
||||
"Give Swampwalking to your crocodile.",
|
||||
"You cannot train your crocodile any further"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllStats() {
|
||||
return new String[]{"You do not own a crocodile",
|
||||
"1/1, B",
|
||||
"2/1, B",
|
||||
"3/1, B",
|
||||
"4/1, B, Swampwalking"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllImageNames() {
|
||||
return new String[]{
|
||||
"",
|
||||
"b_1_1_crocodile_pet_small.jpg",
|
||||
"b_2_1_crocodile_pet_small.jpg",
|
||||
"b_3_1_crocodile_pet_small.jpg",
|
||||
"b_3_1_crocodile_pet_swampwalk_small.jpg"
|
||||
};
|
||||
}
|
||||
}
|
||||
95
src/forge/quest/data/pet/QuestPetHound.java
Normal file
95
src/forge/quest/data/pet/QuestPetHound.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package forge.quest.data.pet;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
|
||||
public class QuestPetHound extends QuestPetAbstract{
|
||||
public QuestPetHound(){
|
||||
super("Hound", "Dogs are said to be man's best friend. Definitely not this one.", 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Card getPetCard() {
|
||||
Card petCard = new Card();
|
||||
|
||||
petCard.setName("Hound Pet");
|
||||
petCard.setController(AllZone.HumanPlayer);
|
||||
petCard.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
petCard.addColor("R");
|
||||
petCard.setToken(true);
|
||||
|
||||
petCard.addType("Creature");
|
||||
petCard.addType("Hound");
|
||||
petCard.addType("Pet");
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
petCard.setImageName("R 0 1 Hound Pet");
|
||||
petCard.setBaseAttack(0);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
petCard.setImageName("R 1 1 Hound Pet Haste");
|
||||
petCard.setBaseAttack(1);
|
||||
petCard.setBaseDefense(1);
|
||||
petCard.addIntrinsicKeyword("Haste");
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
petCard.setImageName("R 2 1 Hound Pet");
|
||||
petCard.setBaseAttack(2);
|
||||
petCard.setBaseDefense(1);
|
||||
petCard.addIntrinsicKeyword("Haste");
|
||||
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
petCard.setImageName("R 2 1 Hound Pet Alone");
|
||||
petCard.setBaseAttack(2);
|
||||
petCard.setBaseDefense(1);
|
||||
petCard.addIntrinsicKeyword("Haste");
|
||||
petCard.addIntrinsicKeyword("Whenever this creature attacks alone, it gets +2/+0 until end of turn.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
return petCard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAllUpgradePrices() {
|
||||
return new int[]{200, 350, 450, 750};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllUpgradeDescriptions() {
|
||||
return new String[]{
|
||||
"Purchase hound",
|
||||
"Give Haste to your hound.",
|
||||
"Improve the attack power of your hound.",
|
||||
"Greatly improves your hound's attack power if it attacks alone.",
|
||||
"You cannot train your hound any further"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllStats() {
|
||||
return new String[]{"You do not own a hound",
|
||||
"1/1, R",
|
||||
"1/1, R, Haste",
|
||||
"2/1, R, Haste",
|
||||
"2/1, R, Haste, Whenever this creature attacks alone, it gets +2/+0 until end of turn."};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllImageNames() {
|
||||
return new String[]{
|
||||
"",
|
||||
"r_1_1_hound_pet_small.jpg",
|
||||
"r_1_1_hound_pet_haste_small.jpg",
|
||||
"r_2_1_hound_pet_small.jpg",
|
||||
"r_2_1_hound_pet_alone_small.jpg"
|
||||
};
|
||||
}
|
||||
}
|
||||
132
src/forge/quest/data/pet/QuestPetPlant.java
Normal file
132
src/forge/quest/data/pet/QuestPetPlant.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package forge.quest.data.pet;
|
||||
|
||||
import forge.*;
|
||||
|
||||
public class QuestPetPlant extends QuestPetAbstract {
|
||||
@Override
|
||||
public Card getPetCard() {
|
||||
final Card petCard = new Card();
|
||||
|
||||
petCard.setName("Plant Wall");
|
||||
|
||||
petCard.setController(AllZone.HumanPlayer);
|
||||
petCard.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
petCard.addColor("G");
|
||||
petCard.setToken(true);
|
||||
|
||||
petCard.addType("Creature");
|
||||
petCard.addType("Plant");
|
||||
petCard.addType("Wall");
|
||||
|
||||
petCard.addIntrinsicKeyword("Defender");
|
||||
|
||||
if (level == 1) {
|
||||
petCard.setImageName("G 0 1 Plant Wall");
|
||||
petCard.setBaseAttack(0);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 2) {
|
||||
petCard.setImageName("G 0 2 Plant Wall");
|
||||
petCard.setBaseAttack(0);
|
||||
petCard.setBaseDefense(2);
|
||||
}
|
||||
else if (level == 3) {
|
||||
petCard.setImageName("G 0 3 Plant Wall");
|
||||
petCard.setBaseAttack(0);
|
||||
petCard.setBaseDefense(3);
|
||||
}
|
||||
else if (level == 4) {
|
||||
petCard.setImageName("G 1 3 Plant Wall");
|
||||
petCard.setBaseAttack(1);
|
||||
petCard.setBaseDefense(3);
|
||||
petCard.addIntrinsicKeyword("First Strike");
|
||||
}
|
||||
else if (level == 5) {
|
||||
petCard.setImageName("G 1 3 Plant Wall Deathtouch");
|
||||
petCard.setBaseAttack(1);
|
||||
petCard.setBaseDefense(3);
|
||||
petCard.addIntrinsicKeyword("Deathtouch");
|
||||
}
|
||||
else if (level == 6) {
|
||||
petCard.setImageName("G 1 4 Plant Wall");
|
||||
petCard.setBaseAttack(1);
|
||||
petCard.setBaseDefense(4);
|
||||
petCard.addIntrinsicKeyword("Deathtouch");
|
||||
|
||||
|
||||
Ability_Cost abCost = new Ability_Cost("T", petCard.getName(), true);
|
||||
final SpellAbility ability = new Ability_Activated(petCard, abCost, null){
|
||||
private static final long serialVersionUID = 7546242087593613719L;
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
petCard.getController().gainLife(1, petCard);
|
||||
}
|
||||
};
|
||||
petCard.addSpellAbility(ability);
|
||||
ability.setDescription("tap: You gain 1 life.");
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Plant Wall - ").append(petCard.getController()).append(" gains 1 life.");
|
||||
ability.setStackDescription(sb.toString());
|
||||
|
||||
petCard.setText("tap: You gain 1 life.");
|
||||
}
|
||||
|
||||
|
||||
return petCard;
|
||||
}
|
||||
|
||||
public QuestPetPlant() {
|
||||
super("Plant",
|
||||
"Start each of your battles with this lush, verdant plant on your side. Excellent at blocking the nastiest of critters!",
|
||||
6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAllUpgradePrices() {
|
||||
return new int[]{100, 150, 200, 300, 750, 1000};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllUpgradeDescriptions() {
|
||||
return new String[]{
|
||||
"Purchase Plant",
|
||||
"Improve the defense power of your plant.",
|
||||
"Improve the defense power of your plant.",
|
||||
"Improve the defense power of your plant.",
|
||||
"Grow venomous thorns on your plant.",
|
||||
"Improve the defense power of your plant and your plant will have healing properties",
|
||||
"You cannot train your plant any further"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllStats() {
|
||||
return new String[]{"You do not own a plant",
|
||||
"0/1, G, Defender",
|
||||
"0/2, G, Defender",
|
||||
"0/3, G, Defender",
|
||||
"1/3, G, Defender",
|
||||
"1/3, G, Defender, Deathtouch",
|
||||
"1/4, G, Defender, Deathtouch, T: Gain 1 life"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllImageNames() {
|
||||
return new String[]{
|
||||
"",
|
||||
"g_0_1_plant_wall_small.jpg",
|
||||
"g_0_2_plant_wall_small.jpg",
|
||||
"g_0_3_plant_wall_small.jpg",
|
||||
"g_1_3_plant_wall_small.jpg",
|
||||
"g_1_3_plant_wall_deathtouch_small",
|
||||
"g_1_4_plant_wall_small.jpg"
|
||||
};
|
||||
}
|
||||
}
|
||||
91
src/forge/quest/data/pet/QuestPetWolf.java
Normal file
91
src/forge/quest/data/pet/QuestPetWolf.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package forge.quest.data.pet;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
|
||||
public class QuestPetWolf extends QuestPetAbstract{
|
||||
@Override
|
||||
public Card getPetCard() {
|
||||
Card petCard = new Card();
|
||||
|
||||
petCard.setName("Wolf Pet");
|
||||
petCard.setController(AllZone.HumanPlayer);
|
||||
petCard.setOwner(AllZone.HumanPlayer);
|
||||
|
||||
petCard.addColor("G");
|
||||
petCard.setToken(true);
|
||||
|
||||
petCard.addType("Creature");
|
||||
petCard.addType("Wolf");
|
||||
petCard.addType("Pet");
|
||||
|
||||
if (level == 1)
|
||||
{
|
||||
petCard.setImageName("G 0 1 Wolf Pet");
|
||||
petCard.setBaseAttack(1);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 2)
|
||||
{
|
||||
petCard.setImageName("G 1 1 Wolf Pet");
|
||||
petCard.setBaseAttack(2);
|
||||
petCard.setBaseDefense(1);
|
||||
}
|
||||
else if (level == 3)
|
||||
{
|
||||
petCard.setImageName("G 2 1 Wolf Pet");
|
||||
petCard.setBaseAttack(2);
|
||||
petCard.setBaseDefense(2);
|
||||
}
|
||||
else if (level == 4)
|
||||
{
|
||||
petCard.setImageName("G 2 1 Wolf Pet Flanking");
|
||||
petCard.setBaseAttack(2);
|
||||
petCard.setBaseDefense(2);
|
||||
petCard.addIntrinsicKeyword("Flanking");
|
||||
}
|
||||
|
||||
return petCard;
|
||||
}
|
||||
|
||||
public QuestPetWolf() {
|
||||
super("Wolf",
|
||||
"This ferocious animal may have been raised in captivity, but it has been trained to kill.",
|
||||
4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAllUpgradePrices() {
|
||||
return new int[]{250, 250, 500, 550};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllUpgradeDescriptions() {
|
||||
return new String[]{
|
||||
"Purchase Wolf",
|
||||
"Improve the attack power of your wolf.",
|
||||
"Improve the defense power of your wolf.",
|
||||
"Give Flanking to your wolf.",
|
||||
"You cannot train your wolf any further"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllStats() {
|
||||
return new String[]{"You do not own a wolf",
|
||||
"1/1, G",
|
||||
"2/1, G",
|
||||
"2/2, G",
|
||||
"2/2, G, Flanking"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAllImageNames() {
|
||||
return new String[]{
|
||||
"",
|
||||
"g_1_1_wolf_pet_small.jpg",
|
||||
"g_1_2_wolf_pet_small.jpg",
|
||||
"g_2_2_wolf_pet_small.jpg",
|
||||
"g_2_2_wolf_pet_flanking_small.jpg"
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest;
|
||||
package forge.quest.gui;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package forge.quest;
|
||||
package forge.quest.gui;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Gui_NewGame;
|
||||
import forge.QuestData;
|
||||
import forge.gui.GuiUtils;
|
||||
import forge.quest.bazaar.QuestBazaarPanel;
|
||||
import forge.quest.main.QuestMainPanel;
|
||||
import forge.quest.gui.bazaar.QuestBazaarPanel;
|
||||
import forge.quest.gui.main.QuestMainPanel;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.QuestData;
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.QuestData;
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.quest.QuestAbstractPanel;
|
||||
import forge.quest.QuestFrame;
|
||||
import forge.quest.gui.QuestAbstractPanel;
|
||||
import forge.quest.gui.QuestFrame;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.BorderLayout;
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.bazaar;
|
||||
package forge.quest.gui.bazaar;
|
||||
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.main;
|
||||
package forge.quest.gui.main;
|
||||
|
||||
|
||||
import forge.AllZone;
|
||||
@@ -1,9 +1,9 @@
|
||||
package forge.quest.main;
|
||||
package forge.quest.gui.main;
|
||||
|
||||
import forge.*;
|
||||
import forge.gui.GuiUtils;
|
||||
import forge.quest.QuestAbstractPanel;
|
||||
import forge.quest.QuestFrame;
|
||||
import forge.quest.gui.QuestAbstractPanel;
|
||||
import forge.quest.gui.QuestFrame;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.main;
|
||||
package forge.quest.gui.main;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.QuestData;
|
||||
@@ -1,4 +1,4 @@
|
||||
package forge.quest.main;
|
||||
package forge.quest.gui.main;
|
||||
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
Reference in New Issue
Block a user