- Files in Res/rules are now loaded dynamically. This allows people to add their own mods fairly easily
- also has a basic support for unlocks (does not yet allow people to create their own unlock rules, though...) - Some things are still hardcoded and should progressively move to these rules files (such as Game Type, how random decks are created, etc...) - Test suite doesn't foolishly ask you to choose a game mode (momir, etc...) anymore - UPDATE YOUR Res/rules/ folder !!!
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include "JNetwork.h"
|
||||
#endif //NETWORK_SUPPORT
|
||||
|
||||
|
||||
class Rules;
|
||||
enum
|
||||
{
|
||||
PLAYER_TYPE_CPU = 0,
|
||||
@@ -68,6 +70,7 @@ private:
|
||||
public:
|
||||
|
||||
int gameType;
|
||||
Rules * rules;
|
||||
CardEffect *effect;
|
||||
#ifdef NETWORK_SUPPORT
|
||||
JNetwork* mpNetwork;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
class TestSuite;
|
||||
#endif
|
||||
class Credits;
|
||||
class Rules;
|
||||
#ifdef NETWORK_SUPPORT
|
||||
class JNetwork;
|
||||
#endif
|
||||
@@ -41,7 +40,6 @@ private:
|
||||
bool premadeDeck;
|
||||
int OpponentsDeckid;
|
||||
string musictrack;
|
||||
Rules * rules;
|
||||
|
||||
bool MusicExist(string FileName);
|
||||
void loadPlayer(int playerId, int decknb = 0, bool isAI = false, bool isNetwork = false);
|
||||
|
||||
@@ -70,11 +70,20 @@ public:
|
||||
};
|
||||
|
||||
string bg;
|
||||
|
||||
Rules(string filename, string bg = "");
|
||||
int load(string filename);
|
||||
string filename;
|
||||
int gamemode;
|
||||
bool hidden;
|
||||
string displayName;
|
||||
int unlockOption;
|
||||
static vector<Rules *> RulesList;
|
||||
|
||||
Rules(string bg = "");
|
||||
int load(string _filename);
|
||||
static int loadAllRules();
|
||||
static void unloadAllRules();
|
||||
static Rules * getRulesByFilename(string _filename);
|
||||
void initPlayers();
|
||||
bool canChooseDeck(); //True if the players get to select their decks, false if the decks are automatically generated by the mode
|
||||
void addExtraRules();
|
||||
void initGame();
|
||||
void cleanup();
|
||||
@@ -85,4 +94,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user