Merge branch 'master' into wp8

Conflicts:
	JGE/src/Qtmain.cpp
This commit is contained in:
xawotihs
2013-11-29 22:31:20 +01:00
55 changed files with 386 additions and 333 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ public:
{
return 0;
}
virtual const char * getMenuText()
virtual const string getMenuText()
{
return "Ability";
}
+84 -83
View File
@@ -1081,7 +1081,7 @@ public:
ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
const string getMenuText();
AACounter * clone() const;
};
@@ -1100,7 +1100,7 @@ public:
bool all,ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
const string getMenuText();
AARemoveAllCounter * clone() const;
};
@@ -1110,7 +1110,7 @@ class AAResetDamage: public ActivatedAbility
public:
AAResetDamage(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
const string getMenuText();
AAResetDamage * clone() const;
};
@@ -1120,7 +1120,7 @@ public:
string named;
AAFakeAbility(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,string _newName, ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
const string getMenuText();
AAFakeAbility * clone() const;
};
@@ -1131,7 +1131,7 @@ public:
AAFizzler(GameObserver* observer, int _id, MTGCardInstance * card, Spell * _target, ManaCost * _cost = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
AAFizzler* clone() const;
};
@@ -1160,7 +1160,7 @@ public:
string Cond;
IfThenAbility(GameObserver* observer, int _id,MTGAbility * delayedAbility = NULL,MTGAbility * delayedElseAbility = NULL, MTGCardInstance * _source=NULL, Targetable * target = NULL, int type = 1,string Cond = "");
int resolve();
const char * getMenuText();
const string getMenuText();
IfThenAbility * clone() const;
~IfThenAbility();
};
@@ -1179,7 +1179,7 @@ public:
void Update(float dt);
const char * getMenuText();
const string getMenuText();
int testDestroy();
int isReactingToTargetClick(Targetable * card);
@@ -1209,7 +1209,7 @@ public:
bool CheckUserInput(JButton key);
void Update(float dt);
int resolve();
const char * getMenuText();
const string getMenuText();
int testDestroy();
int isReactingToTargetClick(Targetable * card);
int reactToTargetClick(Targetable * object);
@@ -1225,7 +1225,7 @@ class AAProliferate: public ActivatedAbility
public:
AAProliferate(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target,ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
const string getMenuText();
AAProliferate * clone() const;
~AAProliferate();
};
@@ -1243,7 +1243,7 @@ public:
int resolve();
int addToGame();
int destroy();
const char * getMenuText();
const string getMenuText();
MultiAbility * clone() const;
~MultiAbility();
};
@@ -1258,8 +1258,9 @@ public:
GenericActivatedAbility(GameObserver* observer, string newName,string castRestriction,int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "",
int restrictions = 0, MTGGameZone * dest = NULL);
GenericActivatedAbility(const GenericActivatedAbility& other);
int resolve();
const char * getMenuText();
const string getMenuText();
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
void Update(float dt);
int testDestroy();
@@ -1274,7 +1275,7 @@ class AALibraryBottom: public ActivatedAbility
public:
AALibraryBottom(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
AALibraryBottom * clone() const;
};
@@ -1284,7 +1285,7 @@ class AACopier: public ActivatedAbility
public:
AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
AACopier * clone() const;
};
//imprint
@@ -1293,7 +1294,7 @@ class AAPhaseOut: public ActivatedAbility
public:
AAPhaseOut(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
AAPhaseOut * clone() const;
};
//cloning...this makes a token thats a copy of the target.
@@ -1310,7 +1311,7 @@ public:
AACloner(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL, int who = 0,
string abilitiesStringList = "",string typeslist = "");
int resolve();
const char * getMenuText();
const string getMenuText();
virtual ostream& toString(ostream& out) const;
AACloner * clone() const;
~AACloner();
@@ -1326,7 +1327,7 @@ public:
AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL);
MTGGameZone * destinationZone(Targetable * target = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
const char * getMenuText(TargetChooser * fromTc);
AAMover * clone() const;
~AAMover();
@@ -1342,7 +1343,7 @@ public:
AARandomMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string tcs, string from, string to);
MTGGameZone * destinationZone(Targetable * target = NULL,string zone = "");
int resolve();
const char * getMenuText();
const string getMenuText();
AARandomMover * clone() const;
~AARandomMover();
};
@@ -1356,7 +1357,7 @@ public:
string menu;
AABuryCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
int resolve();
const char * getMenuText();
const string getMenuText();
AABuryCard * clone() const;
~AABuryCard();
};
@@ -1367,7 +1368,7 @@ public:
MTGAbility * andAbility;
AADestroyCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
int resolve();
const char * getMenuText();
const string getMenuText();
AADestroyCard * clone() const;
~AADestroyCard();
};
@@ -1378,7 +1379,7 @@ public:
MTGAbility * andAbility;
AASacrificeCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
int resolve();
const char * getMenuText();
const string getMenuText();
AASacrificeCard * clone() const;
~AASacrificeCard();
};
@@ -1389,7 +1390,7 @@ public:
MTGAbility * andAbility;
AADiscardCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target);
int resolve();
const char * getMenuText();
const string getMenuText();
AADiscardCard * clone() const;
~AADiscardCard();
};
@@ -1409,7 +1410,7 @@ public:
string tcString;
GenericTargetAbility(GameObserver* observer, string newName, string castRestriction, int _id, MTGCardInstance * _source, TargetChooser * _tc, MTGAbility * a, ManaCost * _cost = NULL, string limit = "",MTGAbility * sideEffects = NULL,string usesBeforeSideEffects = "", int restrictions = 0, MTGGameZone * dest = NULL,string tcString ="");
const char * getMenuText();
const string getMenuText();
~GenericTargetAbility();
GenericTargetAbility * clone() const;
int resolve();
@@ -1447,7 +1448,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
return "Ninjutsu";
}
@@ -1479,7 +1480,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
return "Remove From Combat";
}
@@ -1501,7 +1502,7 @@ public:
AADrawer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost,string nbcardsStr, int who =
TargetChooser::UNSET,bool noReplace = false);
int resolve();
const char * getMenuText();
const string getMenuText();
AADrawer * clone() const;
int getNumCards();
};
@@ -1521,7 +1522,7 @@ public:
ACastRestriction(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, TargetChooser * _restrictionsScope, WParsedInt * _value, bool _modifyExisting, int _zoneId, int who = TargetChooser::UNSET);
int addToGame();
int destroy();
const char * getMenuText();
const string getMenuText();
ACastRestriction * clone() const;
~ACastRestriction();
@@ -1536,7 +1537,7 @@ public:
AInstantCastRestrictionUEOT(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, TargetChooser * _restrictionsScope, WParsedInt * _value, bool _modifyExisting, int _zoneId, int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AInstantCastRestrictionUEOT * clone() const;
~AInstantCastRestrictionUEOT();
};
@@ -1549,7 +1550,7 @@ public:
AALifer(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string life_s, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AALifer * clone() const;
int getLife();
@@ -1562,7 +1563,7 @@ public:
AAWinGame(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AAWinGame * clone() const;
};
@@ -1603,7 +1604,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
return Constants::MTGBasicAbilities[ability];
}
@@ -1645,7 +1646,7 @@ public:
return InstantAbility::addToGame();
}
const char * getMenuText()
const string getMenuText()
{
return Constants::MTGBasicAbilities[ability];
}
@@ -1706,7 +1707,7 @@ public:
return ActivatedAbility::addToGame();
}
const char * getMenuText()
const string getMenuText()
{
return ability->getMenuText();
}
@@ -1862,7 +1863,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
sprintf(menuText,"Protection from %s",tcstr.c_str());
return menuText;
@@ -2054,7 +2055,7 @@ public:
((MTGCardInstance *) target)->addToToughness(-wppt->toughness.getValue());
return 1;
}
const char * getMenuText()
const string getMenuText()
{
if(PT.size())
{
@@ -2147,7 +2148,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
return ability->getMenuText();
}
@@ -2189,7 +2190,7 @@ public:
return toAdd->addToGame();
}
const char * getMenuText()
const string getMenuText()
{
return ability->getMenuText();
}
@@ -2287,7 +2288,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
return "Regenerate";
}
@@ -2494,7 +2495,7 @@ public:
SAFE_DELETE(ability);
}
const char * getMenuText()
const string getMenuText()
{
if(ability)
{
@@ -2620,7 +2621,7 @@ public:
SAFE_DELETE(ability);
}
const char * getMenuText()
const string getMenuText()
{
//Special case for move
if (AAMover * move = dynamic_cast<AAMover *>(ability))
@@ -2806,7 +2807,7 @@ public:
int equip(MTGCardInstance * equipped);
int resolve();
const char * getMenuText();
const string getMenuText();
int testDestroy();
int destroy();
@@ -3034,7 +3035,7 @@ public:
card->setAttacker(1);
}
const char * getMenuText()
const string getMenuText()
{
sprintf(menuText, "Create %s", name.c_str());
return menuText;
@@ -3135,7 +3136,7 @@ public:
}
}
const char * getMenuText()
const string getMenuText()
{
if(name.size())
return name.c_str();
@@ -3308,7 +3309,7 @@ public:
return 0;
}
const char * getMenuText()
const string getMenuText()
{
return ability->getMenuText();
}
@@ -3520,7 +3521,7 @@ public:
}
}
const char * getMenuText()
const string getMenuText()
{
return ability->getMenuText();
}
@@ -3543,7 +3544,7 @@ public:
AASetHand(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int hand, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AASetHand * clone() const;
};
@@ -3557,7 +3558,7 @@ public:
AALifeSet(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, WParsedInt * life, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AALifeSet * clone() const;
~AALifeSet();
@@ -3574,7 +3575,7 @@ public:
AADamager(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, string d, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
int getDamage();
AADamager * clone() const;
@@ -3588,7 +3589,7 @@ public:
AADamagePrevent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int preventing, ManaCost * _cost = NULL, int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AADamagePrevent * clone() const;
~AADamagePrevent();
};
@@ -3602,7 +3603,7 @@ public:
AAAlterPoison(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int poison, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AAAlterPoison * clone() const;
~AAAlterPoison();
};
@@ -3630,7 +3631,7 @@ class AATapper: public ActivatedAbility
public:
AATapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
AATapper * clone() const;
};
@@ -3640,7 +3641,7 @@ class AAUntapper: public ActivatedAbility
public:
AAUntapper(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
AAUntapper * clone() const;
};
@@ -3661,7 +3662,7 @@ class AAFrozen: public ActivatedAbility
public:
AAFrozen(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
AAFrozen * clone() const;
};
/* ghetto new target*/
@@ -3671,7 +3672,7 @@ public:
bool retarget;
AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
AANewTarget * clone() const;
};
/* morph*/
@@ -3682,7 +3683,7 @@ public:
AAMorph(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
int resolve();
int testDestroy();
const char * getMenuText();
const string getMenuText();
AAMorph * clone() const;
};
/* flip*/
@@ -3694,7 +3695,7 @@ public:
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats);
int resolve();
int testDestroy();
const char * getMenuText();
const string getMenuText();
AAFlip * clone() const;
};
/* dynamic ability build*/
@@ -3759,7 +3760,7 @@ string menu;
int resolve();
int activateMainAbility(MTGAbility * toActivate,MTGCardInstance * source , Damageable * target);
int activateStored();
const char * getMenuText();
const string getMenuText();
AADynamic * clone() const;
~AADynamic();
};
@@ -3812,7 +3813,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
return "Swap power and toughness";
}
@@ -3828,7 +3829,7 @@ public:
AAExchangeLife(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AAExchangeLife * clone() const;
};
@@ -4064,7 +4065,7 @@ public:
int reapplyCountersBonus(MTGCardInstance * rtarget= NULL,bool powerapplied=false,bool toughnessapplied=false);
int testDestroy();
int destroy();
const char * getMenuText();
const string getMenuText();
ATransformer * clone() const;
~ATransformer();
};
@@ -4087,7 +4088,7 @@ public:
ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types = "", string abilities = "",string newpower = "",bool newpowerfound = false,string newtoughness = "",bool newtoughnessfound = false,vector<string>newAbilitiesList = vector<string>(),bool newAbilityFound = false,bool aForever = false, bool UYNT = false,string menutext = "");
int resolve();
const char * getMenuText();
const string getMenuText();
ATransformerInstant * clone() const;
~ATransformerInstant();
};
@@ -4103,7 +4104,7 @@ public:
WParsedPT * newWppt;
PTInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, WParsedPT * wppt,string s = "",bool nonstatic = false);
int resolve();
const char * getMenuText();
const string getMenuText();
PTInstant * clone() const;
~PTInstant();
};
@@ -4162,7 +4163,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
return "Exalted";
}
@@ -4180,7 +4181,7 @@ public:
ASwapPT * ability;
ASwapPTUEOT(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target);
int resolve();
const char * getMenuText();
const string getMenuText();
ASwapPTUEOT * clone() const;
~ASwapPTUEOT();
};
@@ -4257,7 +4258,7 @@ public:
APreventDamageTypesUEOT(GameObserver* observer, int id, MTGCardInstance * source, string to, string from, int type = 0);
int resolve();
int destroy();
const char * getMenuText();
const string getMenuText();
APreventDamageTypesUEOT * clone() const;
~APreventDamageTypesUEOT();
};
@@ -4274,7 +4275,7 @@ public:
AVanishing(GameObserver* observer, int _id, MTGCardInstance * card, ManaCost * _cost, int restrictions = 0,int amount = 0,string counterName = "");
void Update(float dt);
int resolve();
const char * getMenuText();
const string getMenuText();
AVanishing * clone() const;
~AVanishing();
};
@@ -4296,7 +4297,7 @@ public:
void Update(float dt);
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
virtual ostream& toString(ostream& out) const;
AUpkeep * clone() const;
~AUpkeep();
@@ -4322,7 +4323,7 @@ public:
MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = true,bool opponentturn = true,bool once = false);
void Update(float dt);
int resolve();
const char * getMenuText();
const string getMenuText();
APhaseAction * clone() const;
~APhaseAction();
};
@@ -4336,7 +4337,7 @@ public:
APhaseActionGeneric(GameObserver* observer, int _id, MTGCardInstance * card, MTGCardInstance * target, string sAbility, int restrictions = 0, int _phase =
MTG_PHASE_UPKEEP,bool forcedestroy = false,bool next = true,bool myturn = false,bool opponentturn = false,bool once = false);
int resolve();
const char * getMenuText();
const string getMenuText();
APhaseActionGeneric * clone() const;
~APhaseActionGeneric();
@@ -4356,7 +4357,7 @@ public:
void Update(float dt);
void resolveBlink();
int resolve();
const char * getMenuText();
const string getMenuText();
ABlink * clone() const;
~ABlink();
private:
@@ -4374,7 +4375,7 @@ public:
MTGAbility * stored;
ABlinkGeneric(GameObserver* observer, int _id, MTGCardInstance * card, MTGCardInstance * _target,bool blinkueot=false,bool blinkForSource = false,bool blinkhand = false,MTGAbility * stored = NULL);
int resolve();
const char * getMenuText();
const string getMenuText();
ABlinkGeneric * clone() const;
~ABlinkGeneric();
@@ -5280,7 +5281,7 @@ public:
return 1;
}
const char * getMenuText()
const string getMenuText()
{
return "phase alter";
}
@@ -5299,7 +5300,7 @@ public:
AADepleter(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AADepleter * clone() const;
};
@@ -5312,7 +5313,7 @@ public:
AAModTurn(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbTurnStr, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AAModTurn * clone() const;
};
@@ -5323,7 +5324,7 @@ public:
AAShuffle(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AAShuffle * clone() const;
};
@@ -5336,7 +5337,7 @@ public:
AARemoveMana(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string ManaDesc, int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AARemoveMana * clone() const;
~AARemoveMana();
@@ -5351,7 +5352,7 @@ public:
AARandomDiscarder(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const char * getMenuText();
const string getMenuText();
AARandomDiscarder * clone() const;
};
@@ -5523,7 +5524,7 @@ public:
int testDestroy(){return 0;};
void Update(float dt);
const char * getMenuText();
const string getMenuText();
int isReactingToTargetClick(Targetable * card);
int reactToTargetClick(Targetable * object);
MTGCardInstance * makeCard();
@@ -5640,7 +5641,7 @@ public:
MTGAbility * abilityAltered;
AASetColorChosen(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int _color = 0 ,string toAdd = "");
int resolve();
const char* getMenuText();
const string getMenuText();
AASetColorChosen * clone() const;
~AASetColorChosen();
};
@@ -5653,7 +5654,7 @@ public:
MTGAbility * abilityAltered;
AASetTypeChosen(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int _type = 0,string menu = "error" ,string toAdd = "");
int resolve();
const char* getMenuText();
const string getMenuText();
AASetTypeChosen * clone() const;
~AASetTypeChosen();
};
@@ -5667,7 +5668,7 @@ public:
bool ANonWall;
GenericChooseTypeColor(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "",bool chooseColor = false,bool nonwall = false, ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
const string getMenuText();
GenericChooseTypeColor * clone() const;
~GenericChooseTypeColor();
@@ -5684,7 +5685,7 @@ public:
MTGAbility * abilityAltered;
AASetCoin(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int side = -1,string toAdd = "");
int resolve();
const char* getMenuText();
const string getMenuText();
AASetCoin * clone() const;
~AASetCoin();
};
@@ -5695,7 +5696,7 @@ public:
AASetCoin * setCoin;
GenericFlipACoin(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "", ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
const string getMenuText();
GenericFlipACoin * clone() const;
~GenericFlipACoin();
@@ -5714,7 +5715,7 @@ public:
GenericPaidAbility(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target,string _newName,string _castRestriction,string _mayCost, string toAdd, ManaCost * cost = NULL);
int resolve();
const char* getMenuText();
const string getMenuText();
GenericPaidAbility * clone() const;
~GenericPaidAbility();
+1 -2
View File
@@ -101,10 +101,9 @@ public:
int removeType(string value, int removeAll = 0);
int removeType(int value, int removeAll = 0);
bool hasSubtype(int _subtype);
bool hasSubtype(const char * _subtype);
bool hasSubtype(const string& _subtype);
bool hasType(int _type);
bool hasType(const char * type);
bool hasType(const string& type);
void setManaCost(const string& value);
ManaCost * getManaCost();
+1 -1
View File
@@ -17,7 +17,7 @@ private:
StatsWrapper *stw;
public:
DeckEditorMenu(int id, JGuiListener* listener = NULL, int fontId = 1, const char * _title = "", DeckDataWrapper *selectedDeck = NULL, StatsWrapper *stats = NULL);
DeckEditorMenu(int id, JGuiListener* listener = NULL, int fontId = 1, const string& _title = "", DeckDataWrapper *selectedDeck = NULL, StatsWrapper *stats = NULL);
void Render();
virtual ~DeckEditorMenu();
};
+1 -1
View File
@@ -79,7 +79,7 @@ public:
virtual void Render();
virtual void Update(float dt);
using JGuiController::Add;
virtual void Add(int id, const char * Text, string desc = "", bool forceFocus = false, DeckMetaData *deckMetaData = NULL);
virtual void Add(int id, const string& Text, const string& desc = "", bool forceFocus = false, DeckMetaData *deckMetaData = NULL);
virtual void Close();
void updateScroller();
void RenderBackground();
+1 -3
View File
@@ -77,9 +77,7 @@ public:
}
// Setters
void setDescription( const string description ) { mDescription = description; };
;
void setDescription( const string& description ) { mDescription = description; }
};
#endif
+1 -1
View File
@@ -98,7 +98,7 @@ public:
string getManaColorIndex();
void updateStats(string filename, MTGAllCards * collection);
void updateStats(DeckDataWrapper *mtgDeck);
int countCardsByType(const char * _type, DeckDataWrapper * myDeck);
int countCardsByType(const string& _type, DeckDataWrapper * myDeck);
float noLuck(int n, int a, int x);
vector<string> aiDeckNames;
+2 -2
View File
@@ -98,8 +98,8 @@ class GameObserver{
int cardClick(MTGCardInstance * card,Targetable * _object = NULL, bool log = true);
GamePhase getCurrentGamePhase();
void setCurrentGamePhase(GamePhase phase) { mCurrentGamePhase = phase; };
const char * getCurrentGamePhaseName();
const char * getNextGamePhaseName();
const string& getCurrentGamePhaseName();
const string& getNextGamePhaseName();
void nextCombatStep();
void userRequestNextGamePhase(bool allowInterrupt = true, bool log = true);
void cleanupPhase();
+3 -3
View File
@@ -317,7 +317,7 @@ public:
virtual TargetAbility* clone() const = 0;
virtual void Render();
virtual int resolve();
virtual const char * getMenuText();
virtual const string getMenuText();
virtual ostream& toString(ostream& out) const;
};
@@ -436,7 +436,7 @@ public:
void Update(float dt);
virtual GenericTriggeredAbility* clone() const;
const char * getMenuText();
const string getMenuText();
~GenericTriggeredAbility();
};
@@ -525,7 +525,7 @@ public:
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL);
int resolve();
int reactToClick(MTGCardInstance* _card);
const char * getMenuText();
const string getMenuText();
~AManaProducer();
virtual AManaProducer * clone() const;
};
+4 -4
View File
@@ -129,11 +129,11 @@ public:
//types
void addType(char * type_text);
void addType(const string& type_text);
virtual void addType(int id);
void setType(const char * type_text);
void setSubtype( string value);
int removeType(string value, int removeAll = 0);
void setType(const string& type_text);
void setSubtype(const string &value);
int removeType(const string &value, int removeAll = 0);
int removeType(int value, int removeAll = 0);
//dangerranking is a hint to Ai which creatures are the ones it should be targetting for effects.
+8 -6
View File
@@ -19,7 +19,7 @@ class MTGPack;
class MTGSetInfo
{
public:
MTGSetInfo(string _id);
MTGSetInfo(const string& _id);
~MTGSetInfo();
string id; //Short name: 10E, RAV, etc. Automatic from folder.
string author; //Author of set, for crediting mod makers, etc.
@@ -70,7 +70,7 @@ public:
MTGSets();
~MTGSets();
int Add(const char * subtype);
int Add(const string& subtype);
int findSet(string value);
int findBlock(string s);
int size();
@@ -127,8 +127,10 @@ public:
MTGCard * getCardByName(string name);
void loadFolder(const string& folder, const string& filename="" );
int load(const char * config_file, const char * setName = NULL, int autoload = 1);
int countByType(const char * _type);
int load(const string& config_file);
int load(const string& config_file, const string& setName);
int load(const string& config_file, int set_id);
int countByType(const string& _type);
int countByColor(int color);
int countBySet(int setId);
int totalCards();
@@ -218,8 +220,8 @@ public:
int totalCards();
int totalPrice();
MTGDeck(MTGAllCards * _allcards);
MTGDeck(const char * config_file, MTGAllCards * _allcards, int meta_only = 0,int difficultySetting = 0);
int addRandomCards(int howmany, int * setIds = NULL, int nbSets = 0, int rarity = -1, const char * subtype = NULL,
MTGDeck(const string& config_file, MTGAllCards * _allcards, int meta_only = 0,int difficultySetting = 0);
int addRandomCards(int howmany, int * setIds = NULL, int nbSets = 0, int rarity = -1, const string& subtype = "",
int * colors = NULL, int nbcolors = 0);
int add(int cardid);
int add(MTGDeck * deck); // adds the contents of "deck" into myself
+1 -1
View File
@@ -293,7 +293,7 @@ class Constants
static map<string,int> MTGBasicAbilitiesMap;
static const char* MTGBasicAbilities[];
static const char* MTGPhaseNames[];
static const string MTGPhaseNames[];
static const char* MTGPhaseCodeNames[];
static int GetBasicAbilityIndex(string mtgAbility);
+1 -1
View File
@@ -95,7 +95,7 @@ class MTGGameZone {
void cleanupPhase();
void beforeBeginPhase();
unsigned int countByType(const char * value);
unsigned int countByType(const string &value);
unsigned int countByCanTarget(TargetChooser * tc);
unsigned int countTotalManaSymbols(TargetChooser * tc, int color);
MTGCardInstance * findByName(string name);
+16 -16
View File
@@ -73,7 +73,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGPutInPlayRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
return "cast card normally";
}
@@ -87,7 +87,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGKickerRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
return "pay kicker";
}
@@ -105,7 +105,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGAlternativeCostRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
if(alternativeName.size())
return alternativeName.c_str();
@@ -121,7 +121,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGBuyBackRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
return "cast and buy back";
}
@@ -136,7 +136,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGFlashBackRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
return "flash back";
}
@@ -150,7 +150,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGRetraceRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
return "retrace";
}
@@ -165,7 +165,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGMorphCostRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
return "play morphed";
}
@@ -181,7 +181,7 @@ public:
string suspendmenu;
virtual ostream& toString(ostream& out) const;
MTGSuspendRule(GameObserver* observer, int _id);
const char * getMenuText();
const string getMenuText();
virtual MTGSuspendRule * clone() const;
};
@@ -195,7 +195,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGAttackRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
return "Attacker";
}
@@ -213,7 +213,7 @@ public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card);
MTGPlaneswalkerAttackRule(GameObserver* observer, int _id);
const char * getMenuText()
const string getMenuText()
{
return "Attack Planeswalker";
}
@@ -226,7 +226,7 @@ public:
MTGCardInstance* attacker;
AAPlaneswalkerAttacked(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target);
int resolve();
const char* getMenuText();
const string getMenuText();
AAPlaneswalkerAttacked * clone() const;
~AAPlaneswalkerAttacked();
};
@@ -252,7 +252,7 @@ public:
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGBlockRule(GameObserver* observer, int _id);
const char * getMenuText();
const string getMenuText();
virtual MTGBlockRule * clone() const;
~MTGBlockRule();
};
@@ -386,7 +386,7 @@ public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card);
int reactToClick(MTGCardInstance * card, int id);
const char * getMenuText()
const string getMenuText()
{
return "Momir";
}
@@ -406,7 +406,7 @@ public:
MTGCardInstance * genEquip(int id);
MTGStoneHewerRule(GameObserver* observer, int _id, MTGAllCards * _collection);
int receiveEvent(WEvent * event);
const char * getMenuText()
const string getMenuText()
{
return "Stone Hewer";
}
@@ -419,7 +419,7 @@ class MTGHermitRule: public PermanentAbility
public:
MTGHermitRule(GameObserver* observer, int _id);
int receiveEvent(WEvent * event);
const char * getMenuText()
const string getMenuText()
{
return "Hermit";
}
@@ -447,7 +447,7 @@ public:
int receiveEvent(WEvent * event);
const char * getMenuText()
const string getMenuText()
{
return "Deathtouch";
}
+1 -1
View File
@@ -62,7 +62,7 @@ public:
int addCombatAfter(Player* player, int after_id, bool withMain = false);
int addPhaseAfter(GamePhase id, Player* player, int after_id);
int removePhase(int id);
const char * phaseName(int id);
const string& phaseName(int id);
static GamePhase phaseStrToInt(string s);
static string phaseIntToStr(int id);
+1 -1
View File
@@ -43,7 +43,7 @@ public:
virtual bool CheckUserInput(JButton key);
virtual void Update(float dt);
using JGuiController::Add;
virtual void Add(int id, const char * Text, string desc = "", bool forceFocus = false);
virtual void Add(int id, const string &Text, string desc = "", bool forceFocus = false);
int getmCurr(){return mCurr;}
float getWidth(){return mWidth; }
virtual void Close();
+16
View File
@@ -140,4 +140,20 @@ template <class T> istream& operator>>(istream& in, T& p)
/* replace_all ... replacement to avoid depending on boost for that */
void ReplaceString(std::string& subject, const std::string& search, const std::string& replace);
/*! \brief Returns true if base starts with start, otherwise false
*
* Compares the first strlen(start) characters of base with start and
* returns true if both match.
*/
bool StartsWith(const std::string& base, const char *start);
/*! \brief Returns true if base starts with start, otherwise false
*
* This version is slightly more efficient as strlen does not need to
* get called. Otherwise, it behaves exactly like
* StartsWith(const std::string& base, const char *start)
*
* \see StartsWith(const std::string& base, const char *start)
*/
bool StartsWith(const std::string& base, const std::string& start);
#endif