- bug fix in JGE++ audio (improve HBL compatibility)
- Added new rewards in story mode: random card, card (either by "name" or id), specific set
- Story mode: added possibility to choose music, and bg for duel.
-- See "01. Where it all begins" for examples of new features
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-07-19 13:44:26 +00:00
parent acf06d0181
commit 1332842025
22 changed files with 205 additions and 63 deletions

View File

@@ -44,7 +44,10 @@ public:
void compute(Player * _p1, Player * _p2, GameApp * _app);
void Render();
static int unlockRandomSet(bool force = false);
static int unlockSetByName(string name);
static int addCreditBonus(int value);
static int addCardToCollection(int cardId, MTGDeck * collection);
static int addCardToCollection(int cardId);
};
#endif

View File

@@ -87,6 +87,7 @@ class GameApp: public JApp
static int HasMusic;
static string systemError;
static JMusic* music;
static void playMusic(string filename, bool loop = true);
static MTGAllCards * collection;
static int players[2];

View File

@@ -49,6 +49,7 @@ class GameObserver{
Player * gameOver;
Player * players[2]; //created outside
time_t startedAt;
Rules * mRules;
TargetChooser * getCurrentTargetChooser();
void stackObjectClicked(Interruptible * action);

View File

@@ -60,7 +60,10 @@ public:
PARSE_PLAYER2,
PARSE_PLAYERS
};
Rules(string filename);
string bg;
Rules(string filename, string bg = "");
int load(string filename);
int gamemode;
void initPlayers();
@@ -71,6 +74,7 @@ public:
RulesState initState;
static int getMTGId(string name);
static MTGCardInstance * getCardByMTGId(int mtgid);
};
#endif

View File

@@ -8,6 +8,7 @@ using namespace std;
#include "../../../JGE/src/tinyxml/tinyxml.h"
#include <JGui.h>
class GameObserver;
class MTGDeck;
#define CAMPAIGNS_FOLDER "Res/campaigns/"
@@ -49,7 +50,8 @@ class StoryReward:public StoryText {
public:
enum {
STORY_REWARD_CREDITS,
STORY_REWARD_SET
STORY_REWARD_SET,
STORY_REWARD_CARD,
};
int rewardDone;
@@ -62,6 +64,7 @@ public:
static bool rewardSoundPlayed;
static bool rewardsEnabled;
static MTGDeck * collection;
};
class StoryChoice:public StoryText {
@@ -85,18 +88,21 @@ public:
class StoryFlow;
class StoryPage {
protected:
string safeAttribute(TiXmlElement* element, string attribute);
public:
StoryFlow * mParent;
string musicFile;
StoryPage(StoryFlow * mParent);
virtual void Update(float dt)=0;
virtual void Render()=0;
virtual ~StoryPage(){};
int loadElement(TiXmlElement* element);
};
class StoryDialog:public StoryPage, public JGuiListener,public JGuiController {
private:
vector<StoryDialogElement *>graphics;
string safeAttribute(TiXmlElement* element, string attribute);
void RenderElement(StoryDialogElement * elmt);
public:
StoryDialog(TiXmlElement* el,StoryFlow * mParent);
@@ -115,6 +121,7 @@ class StoryDuel:public StoryPage {
public:
string pageId;
string onWin, onLose;
string bg; //background file
GameObserver * game;
Rules * rules;
StoryDuel(TiXmlElement* el,StoryFlow * mParent);