Pulled down update for SDL2
This commit is contained in:
@@ -668,6 +668,116 @@ private:
|
||||
{
|
||||
intValue = target->controller()->handsize;
|
||||
}
|
||||
else if (s == "olandg")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller()->opponent() && amp->output->hasColor(1))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "olandu")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller()->opponent() && amp->output->hasColor(2))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "olandr")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller()->opponent() && amp->output->hasColor(3))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "olandb")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller()->opponent() && amp->output->hasColor(4))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "olandw")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller()->opponent() && amp->output->hasColor(5))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "plandg")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller() && amp->output->hasColor(1))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "plandu")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller() && amp->output->hasColor(2))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "plandr")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller() && amp->output->hasColor(3))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "plandb")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller() && amp->output->hasColor(4))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "plandw")
|
||||
{
|
||||
intValue = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
{//start
|
||||
MTGAbility * a = ((MTGAbility *) target->getObserver()->mLayers->actionLayer()->manaObjects[i]);
|
||||
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
|
||||
if (amp && amp->source->isLand() && amp->source->controller() == target->controller() && amp->output->hasColor(5))
|
||||
intValue = 1;
|
||||
}//end
|
||||
}
|
||||
else if (s == "controllerturn")//intvalue = 1 if its your turn this(variable{controllerturn})
|
||||
{
|
||||
intValue = 0;
|
||||
@@ -850,12 +960,12 @@ private:
|
||||
else if (s == "morethanfourcards")
|
||||
{
|
||||
if(card->playerTarget)
|
||||
{//blackvise
|
||||
{//blackvise
|
||||
intValue = 0;
|
||||
if ((card->playerTarget->game->hand->nb_cards - 4)>0)
|
||||
intValue = (card->playerTarget->game->hand->nb_cards - 4);
|
||||
}
|
||||
else
|
||||
else
|
||||
{//viseling
|
||||
intValue = 0;
|
||||
if ((card->controller()->opponent()->game->hand->nb_cards - 4)>0)
|
||||
@@ -1196,7 +1306,7 @@ public:
|
||||
class TrcardDrawn: public Trigger
|
||||
{
|
||||
public:
|
||||
bool thiscontroller, thisopponent;
|
||||
bool thiscontroller, thisopponent;
|
||||
TrcardDrawn(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false, bool thiscontroller = false, bool thisopponent = false) :
|
||||
Trigger(observer, id, source,once, tc),thiscontroller(thiscontroller),thisopponent(thisopponent)
|
||||
{
|
||||
@@ -4611,7 +4721,7 @@ public:
|
||||
vector<int> dontremove;
|
||||
bool addNewColors;
|
||||
bool remove;
|
||||
bool removeCreatureSubtypes;
|
||||
bool removeCreatureSubtypes;
|
||||
bool removeTypes;
|
||||
string menu;
|
||||
|
||||
|
||||
@@ -21,18 +21,18 @@ private:
|
||||
string mText;
|
||||
float mX;
|
||||
float mY;
|
||||
float mTitleResetWidth;
|
||||
float mTitleResetWidth;
|
||||
string mDescription;
|
||||
static float mYOffset;
|
||||
float mScrollerOffset;
|
||||
DeckMetaData *mMetaData;
|
||||
string mImageFilename;
|
||||
string mImageFilename;
|
||||
void checkUserClick();
|
||||
|
||||
public:
|
||||
|
||||
|
||||
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL);
|
||||
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL);
|
||||
~DeckMenuItem();
|
||||
|
||||
virtual void Relocate(float x, float y);
|
||||
@@ -44,39 +44,39 @@ public:
|
||||
virtual bool ButtonPressed();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
|
||||
virtual bool getTopLeft(float& top, float& left)
|
||||
virtual bool getTopLeft(float& top, float& left)
|
||||
{
|
||||
top = mY + mYOffset;
|
||||
left = mX;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Accessors
|
||||
|
||||
string getImageFilename() const { return mImageFilename; };
|
||||
float getY() const { return mY; };
|
||||
float getX() const { return mX; };
|
||||
string getDescription() const { return mDescription; };
|
||||
string getText() const { return mText; };
|
||||
bool hasFocus() const { return mHasFocus; };
|
||||
bool hasMetaData() const { return mMetaData == NULL ? false : true;};
|
||||
// Accessors
|
||||
|
||||
string getImageFilename() const { return mImageFilename; };
|
||||
float getY() const { return mY; };
|
||||
float getX() const { return mX; };
|
||||
string getDescription() const { return mDescription; };
|
||||
string getText() const { return mText; };
|
||||
bool hasFocus() const { return mHasFocus; };
|
||||
bool hasMetaData() const { return mMetaData == NULL ? false : true;};
|
||||
|
||||
float getWidth() const;
|
||||
string getDeckName() const;
|
||||
float getWidth() const;
|
||||
string getDeckName() const;
|
||||
|
||||
string getDeckStatsSummary() const
|
||||
{
|
||||
if (mMetaData)
|
||||
return mMetaData->getStatsSummary();
|
||||
return "";
|
||||
}
|
||||
string getDeckStatsSummary() const
|
||||
{
|
||||
if (mMetaData)
|
||||
return mMetaData->getStatsSummary();
|
||||
return "";
|
||||
}
|
||||
|
||||
DeckMetaData *getMetaData() const
|
||||
{
|
||||
return mMetaData;
|
||||
}
|
||||
DeckMetaData *getMetaData() const
|
||||
{
|
||||
return mMetaData;
|
||||
}
|
||||
|
||||
// Setters
|
||||
// Setters
|
||||
void setDescription( const string& description ) { mDescription = description; }
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ protected:
|
||||
GuiAvatars * avatars;
|
||||
GameObserver* observer;
|
||||
MTGGamePhase* phaseHandler;
|
||||
int mPlayerViewIndex;
|
||||
int mPlayerViewIndex;
|
||||
CardSelectorBase* mCardSelector;
|
||||
|
||||
public:
|
||||
@@ -48,11 +48,11 @@ public:
|
||||
void Remove();
|
||||
int receiveEvent(WEvent * e);
|
||||
float RightBoundary();
|
||||
int getPlayerViewIndex(){ return mPlayerViewIndex; };
|
||||
Player* getRenderedPlayer();
|
||||
Player* getRenderedPlayerOpponent();
|
||||
CardSelectorBase* getCardSelector() { return mCardSelector; };
|
||||
GameObserver* getObserver(){ return observer; };
|
||||
int getPlayerViewIndex(){ return mPlayerViewIndex; };
|
||||
Player* getRenderedPlayer();
|
||||
Player* getRenderedPlayerOpponent();
|
||||
CardSelectorBase* getCardSelector() { return mCardSelector; };
|
||||
GameObserver* getObserver(){ return observer; };
|
||||
};
|
||||
|
||||
#include "ActionLayer.h"
|
||||
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
class MillExileCost : public MillCost
|
||||
{
|
||||
public:
|
||||
MillExileCost(TargetChooser *_tc = NULL);
|
||||
MillExileCost(TargetChooser *_tc = NULL);
|
||||
virtual int doPay();
|
||||
};
|
||||
|
||||
|
||||
@@ -122,8 +122,6 @@ class GameObserver{
|
||||
void gameStateBasedEffects();
|
||||
void enchantmentStatus();
|
||||
void Affinity();
|
||||
void ComputeTrinisphere();
|
||||
void RemoveTrinisphere(MTGCardInstance * card);
|
||||
void addObserver(MTGAbility * observer);
|
||||
bool removeObserver(ActionElement * observer);
|
||||
void startGame(GameType, Rules * rules);
|
||||
@@ -192,23 +190,23 @@ class GameObserver{
|
||||
class NetworkGameObserver : public GameObserver
|
||||
{
|
||||
protected:
|
||||
JNetwork* mpNetworkSession;
|
||||
bool mSynchronized;
|
||||
bool mForwardAction;
|
||||
virtual void logAction(const string& s);
|
||||
JNetwork* mpNetworkSession;
|
||||
bool mSynchronized;
|
||||
bool mForwardAction;
|
||||
virtual void logAction(const string& s);
|
||||
public:
|
||||
// no serverIp means a server is being instantiated, otherwise a client
|
||||
NetworkGameObserver(JNetwork* pNetwork, WResourceManager* output = 0, JGE* input = 0);
|
||||
virtual ~NetworkGameObserver();
|
||||
virtual void loadPlayer(int playerId, Player* player);
|
||||
virtual void Update(float dt);
|
||||
void synchronize();
|
||||
static void loadPlayer(void*pThis, stringstream& in, stringstream& out);
|
||||
static void sendAction(void*pThis, stringstream& in, stringstream& out);
|
||||
static void synchronize(void*pThis, stringstream& in, stringstream& out);
|
||||
static void checkSynchro(void*pxThis, stringstream& in, stringstream& out);
|
||||
// no serverIp means a server is being instantiated, otherwise a client
|
||||
NetworkGameObserver(JNetwork* pNetwork, WResourceManager* output = 0, JGE* input = 0);
|
||||
virtual ~NetworkGameObserver();
|
||||
virtual void loadPlayer(int playerId, Player* player);
|
||||
virtual void Update(float dt);
|
||||
void synchronize();
|
||||
static void loadPlayer(void*pThis, stringstream& in, stringstream& out);
|
||||
static void sendAction(void*pThis, stringstream& in, stringstream& out);
|
||||
static void synchronize(void*pThis, stringstream& in, stringstream& out);
|
||||
static void checkSynchro(void*pxThis, stringstream& in, stringstream& out);
|
||||
static void ignoreResponse(void*, stringstream&, stringstream&){};
|
||||
static void disconnect(void*pxThis, stringstream& in, stringstream& out);
|
||||
static void disconnect(void*pxThis, stringstream& in, stringstream& out);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _GAME_STATE_H_
|
||||
#define _GAME_STATE_H_
|
||||
|
||||
#define FADING_SPEED 350.0f
|
||||
#define FADING_SPEED 350.0f
|
||||
|
||||
class JGE;
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
|
||||
const int kDismissButtonId = 10000;
|
||||
const int kToggleDeckActionId = 10001;
|
||||
|
||||
@@ -211,8 +211,11 @@ public:
|
||||
MORPH_COST = 28,
|
||||
SUSPEND_COST = 29,
|
||||
COUNTERS = 30,
|
||||
PUT_INTO_PLAY_WITH_KICKER = 31,
|
||||
STANDARD_FIZZLER = 32,
|
||||
PUT_INTO_PLAY_WITH_KICKER = 31,
|
||||
STANDARD_FIZZLER = 32,
|
||||
PAYZERO_COST = 33,
|
||||
OVERLOAD_COST = 34,
|
||||
BESTOW_COST = 35,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -460,7 +463,7 @@ public:
|
||||
int parseRestriction(string s);
|
||||
int parseCastRestrictions(MTGCardInstance * card, Player * player, string restrictions);
|
||||
Counter * parseCounter(string s, MTGCardInstance * target, Spell * spell = NULL);
|
||||
int parsePowerToughness(string s, int *power, int *toughness);
|
||||
int parsePowerToughness(string s, int *power, int *toughness);
|
||||
int getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCardInstance * card = NULL, int id = 0, MTGGameZone * dest = NULL);
|
||||
MTGAbility* parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, bool activated = false, bool forceUEOT = false, MTGGameZone * dest = NULL);
|
||||
int abilityEfficiency(MTGAbility * a, Player * p, int mode = MODE_ABILITY, TargetChooser * tc = NULL,Targetable * target = NULL);
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
Pos* view;
|
||||
int X;
|
||||
int castX;
|
||||
int alternateCostPaid[ManaCost::MANA_PAID_WITH_SUSPEND + 1];
|
||||
int alternateCostPaid[ManaCost::MANA_PAID_WITH_BESTOW + 1];
|
||||
int paymenttype;
|
||||
int castMethod; /* Tells if the card reached its current zone by being cast or not (brought into the zone by an effect). non 0 == cast, 0 == not cast */
|
||||
int frozen;
|
||||
@@ -253,9 +253,8 @@ public:
|
||||
int cardistargetted;
|
||||
bool isTargetter();
|
||||
int cardistargetter;
|
||||
int tmodifier;
|
||||
int tmodifierb;
|
||||
int myconvertedcost;
|
||||
ManaCost * computeNewCost(MTGCardInstance * card,ManaCost * oldCost);
|
||||
|
||||
void eventattacked();
|
||||
void eventattackedAlone();
|
||||
|
||||
@@ -236,7 +236,9 @@ class Constants
|
||||
OPPGCREATUREEXILER = 118,
|
||||
PAYZERO = 119,
|
||||
TRINISPHERE = 120,
|
||||
NB_BASIC_ABILITIES = 121,
|
||||
CANPLAYFROMEXILE = 121,
|
||||
LIBRARYEATER = 122,
|
||||
NB_BASIC_ABILITIES = 123,
|
||||
|
||||
|
||||
RARITY_S = 'S', //Special Rarity
|
||||
@@ -274,21 +276,21 @@ class Constants
|
||||
GRADE_UNSUPPORTED = 4,
|
||||
GRADE_DANGEROUS = 5,
|
||||
|
||||
ASKIP_NONE=0,
|
||||
ASKIP_SAFE=1,
|
||||
ASKIP_FULL=2,
|
||||
|
||||
WHO_P=0,
|
||||
WHO_O=1,
|
||||
WHO_R=2,
|
||||
|
||||
KICKER_ALWAYS=0,
|
||||
KICKER_CHOICE=1,
|
||||
|
||||
ASKIP_NONE=0,
|
||||
ASKIP_SAFE=1,
|
||||
ASKIP_FULL=2,
|
||||
|
||||
WHO_P=0,
|
||||
WHO_O=1,
|
||||
WHO_R=2,
|
||||
|
||||
KICKER_ALWAYS=0,
|
||||
KICKER_CHOICE=1,
|
||||
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
{
|
||||
NOT_CAST = 0,
|
||||
CAST_NORMALLY = 1,
|
||||
CAST_WITH_KICKER = 2,
|
||||
|
||||
@@ -76,6 +76,8 @@ public:
|
||||
MTGPutInPlayRule(GameObserver* observer, int _id);
|
||||
const string getMenuText()
|
||||
{
|
||||
if(game && game->gameType() == GAME_TYPE_MOMIR)
|
||||
return "Play Land";
|
||||
return "Cast Card Normally";
|
||||
}
|
||||
virtual MTGPutInPlayRule * clone() const;
|
||||
@@ -99,7 +101,7 @@ class MTGAlternativeCostRule: public PermanentAbility
|
||||
{
|
||||
protected:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana, ManaCost *alternateManaCost);
|
||||
int reactToClick(MTGCardInstance * card, ManaCost * alternateManaCost, int paymentType = ManaCost::MANA_PAID);
|
||||
int reactToClick(MTGCardInstance * card, ManaCost * alternateManaCost, int paymentType = ManaCost::MANA_PAID, bool overload = false);
|
||||
string alternativeName;
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
@@ -173,21 +175,37 @@ public:
|
||||
virtual MTGMorphCostRule * clone() const;
|
||||
};
|
||||
|
||||
class MTGPlayFromGraveyardRule: public MTGAlternativeCostRule
|
||||
class MTGPayZeroRule: public MTGAlternativeCostRule
|
||||
{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
string CustomName;
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGPayZeroRule(GameObserver* observer, int _id);
|
||||
const string getMenuText()
|
||||
{
|
||||
if(CustomName.size())
|
||||
return CustomName.c_str();
|
||||
return "Pay Zero To Cast";
|
||||
}
|
||||
virtual MTGPayZeroRule * clone() const;
|
||||
};
|
||||
|
||||
class MTGOverloadRule: public MTGAlternativeCostRule
|
||||
{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGPlayFromGraveyardRule(GameObserver* observer, int _id);
|
||||
MTGOverloadRule(GameObserver* observer, int _id);
|
||||
const string getMenuText()
|
||||
{
|
||||
return "Cast Card From Graveyard";
|
||||
return "Overload";
|
||||
}
|
||||
virtual MTGPlayFromGraveyardRule * clone() const;
|
||||
virtual MTGOverloadRule * clone() const;
|
||||
};
|
||||
|
||||
|
||||
class MTGSuspendRule: public MTGAlternativeCostRule
|
||||
{
|
||||
public:
|
||||
@@ -293,15 +311,15 @@ public:
|
||||
class MTGDredgeRule: public PermanentAbility, public ReplacementEffect
|
||||
{
|
||||
public:
|
||||
vector<MTGCardInstance*>soulbonders;
|
||||
//vector<MTGCardInstance*>soulbonders;
|
||||
TargetChooser * tcb;
|
||||
MTGAbility * dredgeAbility;
|
||||
MTGAbility * targetAbility;
|
||||
MTGAbility * targetAbilityAdder;
|
||||
MTGAbility * targetAbility1;
|
||||
MTGAbility * mod;
|
||||
MTGAbility * activateDredge;
|
||||
vector<MTGAbility*>pairing;
|
||||
//MTGAbility * activateDredge;
|
||||
//vector<MTGAbility*>pairing;
|
||||
MTGDredgeRule(GameObserver* observer, int _id);
|
||||
WEvent * replace(WEvent *e);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
@@ -418,28 +436,28 @@ private:
|
||||
vector<int> pool[20];
|
||||
int initialized;
|
||||
public:
|
||||
MTGAllCards * collection;
|
||||
MTGCardInstance * genEquip(int id);
|
||||
MTGAllCards * collection;
|
||||
MTGCardInstance * genEquip(int id);
|
||||
MTGStoneHewerRule(GameObserver* observer, int _id, MTGAllCards * _collection);
|
||||
int receiveEvent(WEvent * event);
|
||||
const string getMenuText()
|
||||
{
|
||||
return "Stone Hewer";
|
||||
}
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual MTGStoneHewerRule * clone() const;
|
||||
int receiveEvent(WEvent * event);
|
||||
const string getMenuText()
|
||||
{
|
||||
return "Stone Hewer";
|
||||
}
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual MTGStoneHewerRule * clone() const;
|
||||
};
|
||||
//Hermit Druid avatar mode
|
||||
class MTGHermitRule: public PermanentAbility
|
||||
{
|
||||
public:
|
||||
MTGHermitRule(GameObserver* observer, int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
const string getMenuText()
|
||||
{
|
||||
return "Hermit";
|
||||
}
|
||||
virtual MTGHermitRule * clone() const;
|
||||
int receiveEvent(WEvent * event);
|
||||
const string getMenuText()
|
||||
{
|
||||
return "Hermit";
|
||||
}
|
||||
virtual MTGHermitRule * clone() const;
|
||||
};
|
||||
//
|
||||
/* LifeLink */
|
||||
|
||||
@@ -47,33 +47,36 @@ public:
|
||||
MANA_PAID_WITH_FLASHBACK = 5,
|
||||
MANA_PAID_WITH_RETRACE = 6,
|
||||
MANA_PAID_WITH_MORPH = 7,
|
||||
MANA_PAID_WITH_SUSPEND = 8
|
||||
MANA_PAID_WITH_SUSPEND = 8,
|
||||
MANA_PAID_WITH_OVERLOAD = 9,
|
||||
MANA_PAID_WITH_BESTOW = 10,
|
||||
MANA_PAID_WITH_OTHERCOST = 11
|
||||
};
|
||||
ExtraCosts * extraCosts;
|
||||
|
||||
ManaCost * getAlternative(){ return alternative; };
|
||||
void setAlternative(ManaCost * aMana){ SAFE_DELETE(alternative); alternative = aMana;};
|
||||
ManaCost * getAlternative(){ return alternative; };
|
||||
void setAlternative(ManaCost * aMana){ SAFE_DELETE(alternative); alternative = aMana;};
|
||||
|
||||
ManaCost * getKicker(){ return kicker; };
|
||||
void setKicker(ManaCost * aMana){ SAFE_DELETE(kicker); kicker = aMana;};
|
||||
ManaCost * getKicker(){ return kicker; };
|
||||
void setKicker(ManaCost * aMana){ SAFE_DELETE(kicker); kicker = aMana;};
|
||||
|
||||
ManaCost * getBuyback(){ return BuyBack; };
|
||||
void setBuyback(ManaCost * aMana){ SAFE_DELETE(BuyBack); BuyBack = aMana;};
|
||||
ManaCost * getBuyback(){ return BuyBack; };
|
||||
void setBuyback(ManaCost * aMana){ SAFE_DELETE(BuyBack); BuyBack = aMana;};
|
||||
|
||||
ManaCost * getFlashback(){ return FlashBack; };
|
||||
void setFlashback(ManaCost * aMana){ SAFE_DELETE(FlashBack); FlashBack = aMana;};
|
||||
ManaCost * getFlashback(){ return FlashBack; };
|
||||
void setFlashback(ManaCost * aMana){ SAFE_DELETE(FlashBack); FlashBack = aMana;};
|
||||
|
||||
ManaCost * getRetrace(){ return Retrace; };
|
||||
void setRetrace(ManaCost * aMana){ SAFE_DELETE(Retrace); Retrace = aMana;};
|
||||
ManaCost * getRetrace(){ return Retrace; };
|
||||
void setRetrace(ManaCost * aMana){ SAFE_DELETE(Retrace); Retrace = aMana;};
|
||||
|
||||
ManaCost * getMorph(){ return morph; };
|
||||
void setMorph(ManaCost * aMana){ SAFE_DELETE(morph); morph = aMana;};
|
||||
ManaCost * getMorph(){ return morph; };
|
||||
void setMorph(ManaCost * aMana){ SAFE_DELETE(morph); morph = aMana;};
|
||||
|
||||
ManaCost * getSuspend(){ return suspend; };
|
||||
void setSuspend(ManaCost * aMana){ SAFE_DELETE(suspend); suspend = aMana;};
|
||||
ManaCost * getSuspend(){ return suspend; };
|
||||
void setSuspend(ManaCost * aMana){ SAFE_DELETE(suspend); suspend = aMana;};
|
||||
|
||||
ManaCost * getManaUsedToCast(){ return manaUsedToCast; };
|
||||
void setManaUsedToCast(ManaCost * aMana){ SAFE_DELETE(manaUsedToCast); manaUsedToCast = aMana;};
|
||||
ManaCost * getManaUsedToCast(){ return manaUsedToCast; };
|
||||
void setManaUsedToCast(ManaCost * aMana){ SAFE_DELETE(manaUsedToCast); manaUsedToCast = aMana;};
|
||||
|
||||
string alternativeName;
|
||||
bool isMulti;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
|
||||
class hgeParticleSystem;
|
||||
|
||||
|
||||
@@ -109,11 +109,11 @@ public:
|
||||
int mFontSize;
|
||||
bool mFont;
|
||||
PIXEL_TYPE mFontColor;
|
||||
/*Icons attributes*/
|
||||
/*Icons attributes*/
|
||||
int mSizeIcon;
|
||||
int mIconPosX;
|
||||
int mIconPosY;
|
||||
string mFileName;
|
||||
int mIconPosX;
|
||||
int mIconPosY;
|
||||
string mFileName;
|
||||
ModRulesRenderCardGuiItem(string name, int posX, int posY, string formattedData, string filter, bool font, int fontSize, PIXEL_TYPE fontColor, int SizeIcon,int IconPosX,int IconPosY,string FileName);
|
||||
|
||||
};
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
std::string GetCurrentDeckStatsFile();
|
||||
virtual bool parseLine(const string& s);
|
||||
friend ostream& operator<<(ostream&, const Player&);
|
||||
friend istream& operator>>(istream&, Player&);
|
||||
friend istream& operator>>(istream&, Player&);
|
||||
bool operator<(Player& aPlayer);
|
||||
bool isDead();
|
||||
};
|
||||
|
||||
@@ -57,17 +57,17 @@ public:
|
||||
};
|
||||
|
||||
string bg;
|
||||
string filename;
|
||||
string filename;
|
||||
GameType gamemode;
|
||||
bool hidden;
|
||||
string displayName;
|
||||
int unlockOption;
|
||||
string displayName;
|
||||
int unlockOption;
|
||||
string mUnlockOptionString;
|
||||
static vector<Rules *> RulesList;
|
||||
static vector<Rules *> RulesList;
|
||||
|
||||
Rules(string bg = "");
|
||||
int load(string _filename);
|
||||
static int loadAllRules();
|
||||
static int loadAllRules();
|
||||
static void unloadAllRules();
|
||||
static Rules * getRulesByFilename(string _filename);
|
||||
void initPlayers(GameObserver *observer);
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
#define SCALE_SHRINK 0.75f
|
||||
#define SCALE_SELECTED_LARGE 1.7F
|
||||
#define SCALE_LARGE_NORMAL 1.5F
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
#define SCALE_SHRINK 0.75f
|
||||
#define SCALE_SELECTED_LARGE 1.7f
|
||||
#define SCALE_LARGE_NORMAL 1.5f
|
||||
|
||||
class SimpleButton: public JGuiObject
|
||||
{
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
#define SCALE_SELECTED 1.2f
|
||||
#define SCALE_NORMAL 1.0f
|
||||
|
||||
class SimpleMenuItem: public SimpleButton
|
||||
{
|
||||
|
||||
@@ -114,7 +114,7 @@ class ThisAttacked:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
ThisAttacked(int attack);
|
||||
ThisAttacked(int attack);
|
||||
ThisAttacked * clone() const;
|
||||
};
|
||||
|
||||
@@ -122,7 +122,7 @@ class ThisBlocked:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
ThisBlocked(int block);
|
||||
ThisBlocked(int block);
|
||||
ThisBlocked * clone() const;
|
||||
};
|
||||
|
||||
@@ -130,7 +130,7 @@ class ThisNotBlocked:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
ThisNotBlocked(int unblocked);
|
||||
ThisNotBlocked(int unblocked);
|
||||
ThisNotBlocked * clone() const;
|
||||
};
|
||||
|
||||
@@ -138,7 +138,7 @@ class ThisDamaged:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
ThisDamaged(int wasDealtDamage);
|
||||
ThisDamaged(int wasDealtDamage);
|
||||
ThisDamaged * clone() const;
|
||||
};
|
||||
|
||||
@@ -146,7 +146,7 @@ class ThisDualWield:public ThisDescriptor{
|
||||
public:
|
||||
virtual int match(MTGCardInstance * card);
|
||||
|
||||
ThisDualWield(int dualWield);
|
||||
ThisDualWield(int dualWield);
|
||||
ThisDualWield * clone() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -151,33 +151,33 @@ struct WEventCreatureAttacker : public WEventCardUpdate {
|
||||
//event when card attacks.
|
||||
struct WEventCardAttacked : public WEventCardUpdate {
|
||||
WEventCardAttacked(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card attacks alone.
|
||||
struct WEventCardAttackedAlone : public WEventCardUpdate {
|
||||
WEventCardAttackedAlone(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card attacks but is not blocked.
|
||||
struct WEventCardAttackedNotBlocked : public WEventCardUpdate {
|
||||
WEventCardAttackedNotBlocked(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card attacks but is blocked.
|
||||
struct WEventCardAttackedBlocked : public WEventCardUpdate {
|
||||
WEventCardAttackedBlocked(MTGCardInstance * card,MTGCardInstance * opponent);
|
||||
MTGCardInstance * opponent;
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card blocked.
|
||||
struct WEventCardBlocked : public WEventCardUpdate {
|
||||
WEventCardBlocked(MTGCardInstance * card,MTGCardInstance * opponent);
|
||||
MTGCardInstance * opponent;
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card is sacrificed.
|
||||
@@ -190,13 +190,13 @@ struct WEventCardSacrifice : public WEventCardUpdate {
|
||||
//event when card is discarded.
|
||||
struct WEventCardDiscard : public WEventCardUpdate {
|
||||
WEventCardDiscard(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card is cycled.
|
||||
struct WEventCardCycle : public WEventCardUpdate {
|
||||
WEventCardCycle(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//Event when a card's "defenser" status changes
|
||||
@@ -219,9 +219,9 @@ struct WEventBlockersChosen : public WEvent {
|
||||
};
|
||||
|
||||
struct WEventcardDraw : public WEvent {
|
||||
WEventcardDraw(Player * player,int nb_cards);
|
||||
Player * player;
|
||||
int nb_cards;
|
||||
WEventcardDraw(Player * player,int nb_cards);
|
||||
Player * player;
|
||||
int nb_cards;
|
||||
using WEvent::getTarget;
|
||||
virtual Targetable * getTarget(Player * player);
|
||||
};
|
||||
@@ -276,19 +276,19 @@ struct WEventEmptyManaPool : public WEvent {
|
||||
//event when card-equipment unattached
|
||||
struct WEventCardUnattached : public WEventCardUpdate {
|
||||
WEventCardUnattached(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card-equipment attached/equipped
|
||||
struct WEventCardEquipped : public WEventCardUpdate {
|
||||
WEventCardEquipped(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
//event when card moves from player/opponent battlefield to player/opponent battlefield
|
||||
struct WEventCardControllerChange : public WEventCardUpdate {
|
||||
WEventCardControllerChange(MTGCardInstance * card);
|
||||
virtual Targetable * getTarget(int target);
|
||||
virtual Targetable * getTarget(int target);
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream&, const WEvent&);
|
||||
|
||||
@@ -173,7 +173,7 @@ protected:
|
||||
int *mGBCode;
|
||||
int mCurr;
|
||||
|
||||
PIXEL_TYPE* mCharBuffer;
|
||||
PIXEL_TYPE* mCharBuffer;
|
||||
virtual int PreCacheChar(const u8 *ch);
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ enum ENUM_WRES_INFO
|
||||
|
||||
enum ENUM_RETRIEVE_STYLE
|
||||
{
|
||||
RETRIEVE_EXISTING, //Only returns a resource if it already exists. Does not lock or unlock.
|
||||
RETRIEVE_EXISTING, //Only returns a resource if it already exists. Does not lock or unlock.
|
||||
RETRIEVE_NORMAL, //Returns or creates a resource. Does not change lock status.
|
||||
RETRIEVE_LOCK, //As above, locks cached resource. Not for quads.
|
||||
RETRIEVE_UNLOCK, //As above, unlocks cached resource. Not for quads.
|
||||
@@ -33,7 +33,7 @@ enum ENUM_RETRIEVE_STYLE
|
||||
|
||||
enum ENUM_CACHE_SUBTYPE
|
||||
{
|
||||
CACHE_NORMAL = (1<<0), //Use default values. Not really a flag.
|
||||
CACHE_NORMAL = (1<<0), //Use default values. Not really a flag.
|
||||
//CACHE_EXISTING = (1<<1), //Retrieve it only if it already exists
|
||||
|
||||
//Because these bits only modify how a cached resource's Attempt() is called,
|
||||
@@ -51,8 +51,8 @@ enum ENUM_CACHE_ERROR
|
||||
CACHE_ERROR_NONE = 0,
|
||||
CACHE_ERROR_NOT_CACHED = CACHE_ERROR_NONE,
|
||||
CACHE_ERROR_404,
|
||||
CACHE_ERROR_BAD, //Something went wrong with item->attempt()
|
||||
CACHE_ERROR_BAD_ALLOC, //Couldn't allocate item
|
||||
CACHE_ERROR_BAD, //Something went wrong with item->attempt()
|
||||
CACHE_ERROR_BAD_ALLOC, //Couldn't allocate item
|
||||
CACHE_ERROR_LOST,
|
||||
CACHE_ERROR_NOT_MANAGED,
|
||||
};
|
||||
@@ -69,16 +69,16 @@ public:
|
||||
static void Terminate();
|
||||
|
||||
virtual ~WResourceManager()
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsThreaded() = 0;
|
||||
void PlaySample(const string& fileName) {
|
||||
JSample*sample = RetrieveSample(fileName);
|
||||
if(sample) {
|
||||
JSoundSystem::GetInstance()->PlaySample(sample);
|
||||
}
|
||||
};
|
||||
void PlaySample(const string& fileName) {
|
||||
JSample*sample = RetrieveSample(fileName);
|
||||
if(sample) {
|
||||
JSoundSystem::GetInstance()->PlaySample(sample);
|
||||
}
|
||||
};
|
||||
virtual JQuadPtr RetrieveCard(MTGCard * card, int style = RETRIEVE_NORMAL,int submode = CACHE_NORMAL) = 0;
|
||||
virtual JSample * RetrieveSample(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL) = 0;
|
||||
virtual JTexture * RetrieveTexture(const string& filename, int style = RETRIEVE_NORMAL, int submode = CACHE_NORMAL) = 0;
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
virtual void Release(JTexture * tex) = 0;
|
||||
virtual void Release(JSample * sample) = 0;
|
||||
|
||||
//Refreshes all files in cache, for when mode/profile changes.
|
||||
//Refreshes all files in cache, for when mode/profile changes.
|
||||
virtual void Refresh() = 0;
|
||||
|
||||
//Manual clear of the cache
|
||||
@@ -132,8 +132,8 @@ protected:
|
||||
** Singleton object only accessibly via Instance(), constructor is private
|
||||
*/
|
||||
WResourceManager()
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
static WResourceManager* sInstance;
|
||||
};
|
||||
|
||||
@@ -202,8 +202,8 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
bool bThemedCards; //Does the theme have a "sets" directory for overwriting cards?
|
||||
void FlattenTimes(); //To prevent bad cache timing on int overflow
|
||||
bool bThemedCards; //Does the theme have a "sets" directory for overwriting cards?
|
||||
void FlattenTimes(); //To prevent bad cache timing on int overflow
|
||||
|
||||
//For cached stuff
|
||||
WCache<WCachedTexture,JTexture> textureWCache;
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
ostream& saveUsedRandValues(ostream& out) const;
|
||||
ostream& saveLoadedRandValues(ostream& out);
|
||||
int random();
|
||||
void setSeed(unsigned int seed) { srand(seed); };
|
||||
void setSeed(unsigned int seed) { srand(seed); };
|
||||
template<typename Iter> void random_shuffle(Iter first, Iter last)
|
||||
{
|
||||
ptrdiff_t i, n;
|
||||
|
||||
Reference in New Issue
Block a user