fixing quest e cards and changing card sets
Posted: 03 Jun 2009, 19:18
The problem is that Gui_Quest_DeckEditor was using the class ReadBoosterPack which reads from common.txt instead of QuestData_BoosterPack which reads from quest-common.txt I personally use Chris's original rarity files for both common.txt and quest-common.txt. I thought it would be good to divide them but who knows?
I wrote this code using wordpad and the code may have small syntax errors.
I wrote this code using wordpad and the code may have small syntax errors.
- Code: Select all
QuestData_BoosterPack.java - add this method
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
return "error";
}
Gui_Quest_DeckEditor - I changed one line, ReadBoosterPack to Quest_ReadBoosterPack
public void updateDisplay(CardList top, CardList bottom)
{
topModel.clear();
bottomModel.clear();
Card c;
String cardName;
Quest_ReadBoosterPack pack = new Quest_ReadBoosterPack();
ArrayList<String> addedList = AllZone.QuestData.getAddedCards();
//update top
for(int i = 0; i < top.size(); i++)
{
c = top.get(i);
cardName = c.getName();
c.setRarity(pack.getRarity(cardName));
if(addedList.contains(cardName))
c.setRarity("new");
topModel.addCard(c);
}//for
//update bottom
for(int i = 0; i < bottom.size(); i++)
{
c = bottom.get(i);
c.setRarity(pack.getRarity(c.getName()));;
bottomModel.addCard(c);
}//for
topModel.resort();
bottomModel.resort();
}//updateDisplay