- Reward system in Story mode (currently, either credits or random set)
- Rules now accept for player 2 to start (see story mode "block" stage)
- Story mode now has an autosave/autoload mechanism. This is for convenience but also to prevent people from abusing the reward mechanism too easily.
- possibility to choose an avatar for both players through the rules (see example in story mode)
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-05-09 08:14:01 +00:00
parent 11a259d786
commit b1079942af
21 changed files with 326 additions and 53 deletions

View File

@@ -29,7 +29,6 @@ private:
int isMomirUnlocked();
int isEvilTwinUnlocked();
int isRandomDeckUnlocked();
int unlockRandomSet();
public:
int value;
Player * p1, *p2;
@@ -44,6 +43,8 @@ public:
~Credits();
void compute(Player * _p1, Player * _p2, GameApp * _app);
void Render();
static int unlockRandomSet(bool force = false);
static int addCreditBonus(int value);
};
#endif

View File

@@ -30,10 +30,10 @@ class GameObserver{
queue<WEvent *> eventsQueue;
int nbPlayers;
int currentPlayerId;
int untap(MTGCardInstance * card);
public:
int currentPlayerId;
CombatStep combatStep;
int turn;
int forceShuffleLibraries();

View File

@@ -26,8 +26,8 @@ private:
list<Phase *> ring;
list<Phase *>::iterator current;
Phase * getCurrentPhase();
Phase * forward();
Phase * goToPhase(int id, Player * player);
Phase * forward(bool sendEvents = true);
Phase * goToPhase(int id, Player * player,bool sendEvents = true);
PhaseRing(Player* players[], int nbPlayers=2);
~PhaseRing();
int addPhase(Phase * phase);

View File

@@ -40,6 +40,7 @@ class Player: public Damageable{
virtual int receiveEvent(WEvent * event){return 0;};
virtual void Render(){};
void loadAvatar(string file);
};
class HumanPlayer: public Player{

View File

@@ -6,10 +6,13 @@
class PlayerData{
protected:
void init();
public:
int credits;
map<string,string>storySaves;
MTGDeck * collection;
TaskList * taskList;
PlayerData(); //This doesn't init the collection, do not use it to manipulate the player's collection
PlayerData(MTGAllCards * allcards);
~PlayerData();
int save();

View File

@@ -25,6 +25,7 @@ class RulesPlayerData{
public:
vector <string> extraRules;
int life;
string avatar;
ManaCost * manapool;
RulesPlayerZone zones[5];
RulesPlayerData();
@@ -36,6 +37,7 @@ class RulesPlayerData{
class RulesState{
public:
int phase;
int player;
void parsePlayerState(int playerId, string s);
RulesState();
RulesPlayerData playerData[2];

View File

@@ -45,6 +45,25 @@ StoryImage(string img, float mX, float mY);
float getHeight();
};
class StoryReward:public StoryText {
public:
enum {
STORY_REWARD_CREDITS,
STORY_REWARD_SET
};
int rewardDone;
string value;
int type;
StoryReward(string _type, string _value, string text, float _mX, float _mY, string align = "center", int font = 0, int id = 0);
void Update(float dt);
void Render();
static bool rewardSoundPlayed;
static bool rewardsEnabled;
};
class StoryChoice:public StoryText {
public:
string pageId;
@@ -110,6 +129,7 @@ private:
map<string,StoryPage *>pages;
bool parse(string filename);
StoryPage * loadPage(TiXmlElement* element);
bool _gotoPage(string id);
public:
string currentPageId;
string folder;
@@ -117,6 +137,7 @@ public:
~StoryFlow();
bool gotoPage(string id);
bool loadPageId(string id);
void Update(float dt);
void Render();
};