Jeck - fixed issue 354, cleaned up mixed boosters, fixed a few issues with pack loading (slot pools weren't working), fixed TSP boosters to use 'S' rarity, removed some unused code.

This commit is contained in:
wagic.jeck
2010-02-19 20:10:30 +00:00
parent c67390be88
commit afffd4509f
12 changed files with 117 additions and 89 deletions

View File

@@ -14,10 +14,11 @@ using std::string;
class GameApp;
class MTGCard;
class CardPrimitive;
class MTGPack;
class MTGSetInfo{
public:
MTGSetInfo(string _id);
~MTGSetInfo();
string id; //Short name: 10E, RAV, etc. Automatic from folder.
string author; //Author of set, for crediting mod makers, etc.
string name; //Long name: Tenth Edition
@@ -30,8 +31,6 @@ public:
int totalCards();
string getName();
string getBlock();
int boosterCost();
int boosterSize();
void processConfLine(string line);
enum {
@@ -46,10 +45,10 @@ public:
MAX_COUNT = 6
};
MTGPack * mPack; //Does it use a specialized booster pack?
bool bZipped; //Is this set's images present as a zip file?
bool bThemeZipped; //[...] in the theme?
int counts[MTGSetInfo::MAX_COUNT];
int booster[MAX_RARITY];
int counts[MTGSetInfo::MAX_COUNT];
};
class MTGSets{

View File

@@ -107,6 +107,7 @@ class Constants
NB_BASIC_ABILITIES = 48,
RARITY_S = 'S', //Special Rarity
RARITY_M = 'M', //Mythics
RARITY_R = 'R', //Rares
RARITY_U = 'U', //Uncommons
@@ -122,6 +123,7 @@ class Constants
//Price for singles
PRICE_1M = 3000,
PRICE_1R = 500,
PRICE_1S = 200,
PRICE_1U = 100,
PRICE_1C = 20,
PRICE_1L = 5,
@@ -132,10 +134,6 @@ class Constants
CHANCE_CUSTOM_PACK = 15,
CHANCE_PURE_OVERRIDE = 50,
CHANCE_MIXED_OVERRIDE = 25,
PRICE_XR = 355,
PRICE_XU = 88,
PRICE_XC = 8,
PRICE_XL = 1,
MAIN_FONT = 0,
MENU_FONT = 1,

View File

@@ -1,6 +1,8 @@
#ifndef _MTGPACCK_H_
#define _MTGPACK_H_
class ShopBooster;
class MTGPackEntry{
public:
virtual int addCard(WSrcCards * pool,MTGDeck * to) = 0;
@@ -9,6 +11,8 @@ public:
class MTGPackEntryRandom: public MTGPackEntry{
public:
MTGPackEntryRandom() {filter = ""; copies=1;};
MTGPackEntryRandom(string f, int c=1) {filter = f; copies = c;};
int addCard(WSrcCards * pool,MTGDeck * to);
string filter;
};
@@ -36,13 +40,16 @@ public:
class MTGPack{
public:
friend class MTGPacks;
friend class ShopBooster;
friend class MTGSetInfo;
bool meetsRequirements(); //Check if pool contains locked cards.
bool isUnlocked();
bool isValid() {return bValid;};
void load(string filename);
int assemblePack(MTGDeck * to);
MTGPack(string s) {bValid = false; load(s); unlockStatus=0;};
MTGPack() {bValid = false; unlockStatus = 0; price=Constants::PRICE_BOOSTER;};
MTGPack(string s) {bValid = false; load(s); unlockStatus = 0;};
~MTGPack();
string getName();
string getSort() {return sort;};
@@ -72,8 +79,9 @@ public:
int size() {return (int)packs.size();};
void refreshUnlocked();
static MTGPack * getDefault();
private:
static MTGPack defaultBooster;
vector<MTGPack*> packs;
};
#endif