No code change. Reformat code
This commit is contained in:
@@ -625,7 +625,7 @@ public:
|
||||
int power;
|
||||
int toughness;
|
||||
string name;
|
||||
string menu;
|
||||
string menu;
|
||||
|
||||
AACounter(int id, MTGCardInstance * source, MTGCardInstance * target, const char * _name, int power, int toughness, int nb,
|
||||
ManaCost * cost = NULL, int doTap = 0);
|
||||
@@ -1019,7 +1019,7 @@ public:
|
||||
who = who;
|
||||
tokenId = 0;
|
||||
if (!multiplier) this->multiplier = NEW WParsedInt(1);
|
||||
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
|
||||
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
|
||||
|
||||
for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++)
|
||||
{
|
||||
@@ -1192,8 +1192,8 @@ public:
|
||||
ABasicAbilityModifier(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _ability, int _modifier = 1) :
|
||||
MTGAbility(_id, _source, _target), modifier(_modifier), ability(_ability)
|
||||
{
|
||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||
abilitygranted = ability;
|
||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||
abilitygranted = ability;
|
||||
}
|
||||
|
||||
int addToGame()
|
||||
@@ -1251,8 +1251,8 @@ public:
|
||||
int _modifier = 1, int _tap = 1) :
|
||||
TargetAbility(_id, _source, _cost, 0, _tap), modifier(_modifier), ability(_ability)
|
||||
{
|
||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||
abilitygranted = ability;
|
||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||
abilitygranted = ability;
|
||||
nbTargets = 0;
|
||||
tc = _tc;
|
||||
if (!tc) tc = NEW CreatureTargetChooser(_source);
|
||||
@@ -1325,8 +1325,8 @@ public:
|
||||
AInstantBasicAbilityModifierUntilEOT(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _ability, int value) :
|
||||
InstantAbility(_id, _source, _target), ability(_ability), value(value)
|
||||
{
|
||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||
abilitygranted = ability;
|
||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||
abilitygranted = ability;
|
||||
}
|
||||
|
||||
int addToGame()
|
||||
@@ -1375,8 +1375,8 @@ public:
|
||||
{
|
||||
target = _target;
|
||||
ability = NEW AInstantBasicAbilityModifierUntilEOT(_id, _source, _target, _ability, _value);
|
||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||
abilitygranted = _ability;
|
||||
aType = MTGAbility::STANDARDABILITYGRANT;
|
||||
abilitygranted = _ability;
|
||||
}
|
||||
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * cost = NULL)
|
||||
@@ -1430,7 +1430,7 @@ public:
|
||||
ASpellCastLife(int id, MTGCardInstance * _source, CardDescriptor _trigger, ManaCost * _cost, int _life) :
|
||||
MTGAbility(id, _source), trigger(_trigger), cost(_cost), life(_life), lastUsedOn(NULL), lastChecked(NULL)
|
||||
{
|
||||
aType = MTGAbility::LIFER;
|
||||
aType = MTGAbility::LIFER;
|
||||
}
|
||||
ASpellCastLife(int id, MTGCardInstance * _source, int color, ManaCost * _cost, int _life) :
|
||||
MTGAbility(id, _source), cost(_cost), life(_life), lastUsedOn(NULL), lastChecked(NULL)
|
||||
@@ -2270,84 +2270,84 @@ public:
|
||||
SAFE_DELETE(ability);
|
||||
}
|
||||
|
||||
const char * getMenuText()
|
||||
{
|
||||
if (AAMover * move = dynamic_cast<AAMover *>(ability))
|
||||
{
|
||||
MTGGameZone * dest = move->destinationZone();
|
||||
GameObserver * g = GameObserver::GetInstance();
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
// Move card to hand
|
||||
if (dest == g->players[i]->game->hand)
|
||||
{
|
||||
if (tc->targetsZone(g->players[i]->game->inPlay))
|
||||
{
|
||||
return "Bounce";
|
||||
}
|
||||
else if (tc->targetsZone(g->players[i]->game->graveyard))
|
||||
{
|
||||
return "Reclaim";
|
||||
}
|
||||
else if (tc->targetsZone(g->opponent()->game->hand))
|
||||
{
|
||||
return "Steal";
|
||||
}
|
||||
}
|
||||
// Move card to graveyard
|
||||
else if (dest == g->players[i]->game->graveyard)
|
||||
{
|
||||
if (tc->targetsZone(g->players[i]->game->inPlay))
|
||||
{
|
||||
return "Sacrifice";
|
||||
}
|
||||
else if (tc->targetsZone(g->players[i]->game->hand))
|
||||
{
|
||||
return "Discard";
|
||||
}
|
||||
else if (tc->targetsZone(g->opponent()->game->hand))
|
||||
{
|
||||
return "Opponent Discards";
|
||||
}
|
||||
}
|
||||
// move card to library
|
||||
else if (dest == g->players[i]->game->library)
|
||||
{
|
||||
if (tc->targetsZone(g->players[i]->game->graveyard))
|
||||
{
|
||||
return "Recycle";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Put in Library";
|
||||
}
|
||||
}
|
||||
// move card to battlefield
|
||||
else if (dest == g->players[i]->game->battlefield && tc->targetsZone(g->players[i]->game->graveyard))
|
||||
{
|
||||
return "Reanimate";
|
||||
}
|
||||
// move card in play ( different from battlefield? )
|
||||
else if (dest == g->players[i]->game->inPlay)
|
||||
{
|
||||
return "Put in Play";
|
||||
}
|
||||
// move card into exile
|
||||
else if (dest == g->players[i]->game->exile)
|
||||
{
|
||||
return "Exile";
|
||||
}
|
||||
// move card from Library
|
||||
else if (tc->targetsZone(g->players[i]->game->library))
|
||||
{
|
||||
return "Fetch";
|
||||
}
|
||||
}
|
||||
return "Move";
|
||||
}
|
||||
else
|
||||
return ability->getMenuText();
|
||||
}
|
||||
const char * getMenuText()
|
||||
{
|
||||
if (AAMover * move = dynamic_cast<AAMover *>(ability))
|
||||
{
|
||||
MTGGameZone * dest = move->destinationZone();
|
||||
GameObserver * g = GameObserver::GetInstance();
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
// Move card to hand
|
||||
if (dest == g->players[i]->game->hand)
|
||||
{
|
||||
if (tc->targetsZone(g->players[i]->game->inPlay))
|
||||
{
|
||||
return "Bounce";
|
||||
}
|
||||
else if (tc->targetsZone(g->players[i]->game->graveyard))
|
||||
{
|
||||
return "Reclaim";
|
||||
}
|
||||
else if (tc->targetsZone(g->opponent()->game->hand))
|
||||
{
|
||||
return "Steal";
|
||||
}
|
||||
}
|
||||
// Move card to graveyard
|
||||
else if (dest == g->players[i]->game->graveyard)
|
||||
{
|
||||
if (tc->targetsZone(g->players[i]->game->inPlay))
|
||||
{
|
||||
return "Sacrifice";
|
||||
}
|
||||
else if (tc->targetsZone(g->players[i]->game->hand))
|
||||
{
|
||||
return "Discard";
|
||||
}
|
||||
else if (tc->targetsZone(g->opponent()->game->hand))
|
||||
{
|
||||
return "Opponent Discards";
|
||||
}
|
||||
}
|
||||
// move card to library
|
||||
else if (dest == g->players[i]->game->library)
|
||||
{
|
||||
if (tc->targetsZone(g->players[i]->game->graveyard))
|
||||
{
|
||||
return "Recycle";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Put in Library";
|
||||
}
|
||||
}
|
||||
// move card to battlefield
|
||||
else if (dest == g->players[i]->game->battlefield && tc->targetsZone(g->players[i]->game->graveyard))
|
||||
{
|
||||
return "Reanimate";
|
||||
}
|
||||
// move card in play ( different from battlefield? )
|
||||
else if (dest == g->players[i]->game->inPlay)
|
||||
{
|
||||
return "Put in Play";
|
||||
}
|
||||
// move card into exile
|
||||
else if (dest == g->players[i]->game->exile)
|
||||
{
|
||||
return "Exile";
|
||||
}
|
||||
// move card from Library
|
||||
else if (tc->targetsZone(g->players[i]->game->library))
|
||||
{
|
||||
return "Fetch";
|
||||
}
|
||||
}
|
||||
return "Move";
|
||||
}
|
||||
else
|
||||
return ability->getMenuText();
|
||||
}
|
||||
|
||||
ALord * clone() const
|
||||
{
|
||||
@@ -3175,8 +3175,8 @@ public:
|
||||
{
|
||||
for (int i = 0; i < nbOpponents; i++)
|
||||
{
|
||||
if (game->isInPlay(opponents[i]))
|
||||
opponents[i]->destroy();
|
||||
if (game->isInPlay(opponents[i]))
|
||||
opponents[i]->destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3288,7 +3288,7 @@ public:
|
||||
list<int> oldcolors;
|
||||
list<int> oldtypes;
|
||||
bool remove;
|
||||
string menu;
|
||||
string menu;
|
||||
|
||||
ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities);
|
||||
int addToGame();
|
||||
@@ -3305,7 +3305,7 @@ public:
|
||||
list<int> abilities;
|
||||
list<int> types;
|
||||
list<int> colors;
|
||||
string menu;
|
||||
string menu;
|
||||
|
||||
AForeverTransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities);
|
||||
int addToGame();
|
||||
@@ -3344,12 +3344,12 @@ public:
|
||||
class ASwapPTUEOT: public InstantAbility
|
||||
{
|
||||
public:
|
||||
ASwapPT * ability;
|
||||
ASwapPTUEOT(int id, MTGCardInstance * source, MTGCardInstance * target);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
ASwapPTUEOT * clone() const;
|
||||
~ASwapPTUEOT();
|
||||
ASwapPT * ability;
|
||||
ASwapPTUEOT(int id, MTGCardInstance * source, MTGCardInstance * target);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
ASwapPTUEOT * clone() const;
|
||||
~ASwapPTUEOT();
|
||||
};
|
||||
|
||||
//becomes ability
|
||||
@@ -4027,61 +4027,61 @@ public:
|
||||
AErgRaiders * a = NEW AErgRaiders(*this);
|
||||
a->isClone = 1;
|
||||
return a;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Fastbond
|
||||
class AFastbond: public TriggeredAbility
|
||||
{
|
||||
public:
|
||||
int alreadyPlayedALand;
|
||||
int previous;
|
||||
AFastbond(int _id, MTGCardInstance * card) :
|
||||
TriggeredAbility(_id, card)
|
||||
{
|
||||
alreadyPlayedALand = 0;
|
||||
if (source->controller()->landsPlayerCanStillPlay == 0)
|
||||
{
|
||||
alreadyPlayedALand = 1;
|
||||
source->controller()->landsPlayerCanStillPlay += 1;
|
||||
source->controller()->canPutLandsIntoPlay = true;
|
||||
int alreadyPlayedALand;
|
||||
int previous;
|
||||
AFastbond(int _id, MTGCardInstance * card) :
|
||||
TriggeredAbility(_id, card)
|
||||
{
|
||||
alreadyPlayedALand = 0;
|
||||
if (source->controller()->landsPlayerCanStillPlay == 0)
|
||||
{
|
||||
alreadyPlayedALand = 1;
|
||||
source->controller()->landsPlayerCanStillPlay += 1;
|
||||
source->controller()->canPutLandsIntoPlay = true;
|
||||
|
||||
}
|
||||
previous = source->controller()->landsPlayerCanStillPlay;
|
||||
}
|
||||
}
|
||||
previous = source->controller()->landsPlayerCanStillPlay;
|
||||
}
|
||||
|
||||
void Update(float dt)
|
||||
{
|
||||
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UNTAP)
|
||||
{
|
||||
alreadyPlayedALand = 0;
|
||||
}
|
||||
TriggeredAbility::Update(dt);
|
||||
}
|
||||
void Update(float dt)
|
||||
{
|
||||
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UNTAP)
|
||||
{
|
||||
alreadyPlayedALand = 0;
|
||||
}
|
||||
TriggeredAbility::Update(dt);
|
||||
}
|
||||
|
||||
int trigger()
|
||||
{
|
||||
if (source->controller()->landsPlayerCanStillPlay == 0 && previous >= 1)
|
||||
{
|
||||
previous = 0;
|
||||
source->controller()->canPutLandsIntoPlay = true;
|
||||
source->controller()->landsPlayerCanStillPlay += 1;
|
||||
if (alreadyPlayedALand) return 1;
|
||||
alreadyPlayedALand = 1;
|
||||
return 0;
|
||||
}
|
||||
previous = source->controller()->landsPlayerCanStillPlay;
|
||||
return 0;
|
||||
}
|
||||
int trigger()
|
||||
{
|
||||
if (source->controller()->landsPlayerCanStillPlay == 0 && previous >= 1)
|
||||
{
|
||||
previous = 0;
|
||||
source->controller()->canPutLandsIntoPlay = true;
|
||||
source->controller()->landsPlayerCanStillPlay += 1;
|
||||
if (alreadyPlayedALand) return 1;
|
||||
alreadyPlayedALand = 1;
|
||||
return 0;
|
||||
}
|
||||
previous = source->controller()->landsPlayerCanStillPlay;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int resolve()
|
||||
{
|
||||
game->mLayers->stackLayer()->addDamage(source, source->controller(), 1);
|
||||
game->mLayers->stackLayer()->resolve();
|
||||
return 1;
|
||||
}
|
||||
int resolve()
|
||||
{
|
||||
game->mLayers->stackLayer()->addDamage(source, source->controller(), 1);
|
||||
game->mLayers->stackLayer()->resolve();
|
||||
return 1;
|
||||
}
|
||||
|
||||
virtual ostream& toString(ostream& out) const
|
||||
virtual ostream& toString(ostream& out) const
|
||||
{
|
||||
out << "AFastbond ::: alreadyPlayedALand : " << alreadyPlayedALand << " ; previous : " << previous << " (";
|
||||
return TriggeredAbility::toString(out) << ")";
|
||||
@@ -5222,10 +5222,8 @@ public:
|
||||
|
||||
// utility functions
|
||||
|
||||
void PopulateColorIndexVector( list<int>& colors, const string& colorsString, char delimiter = ',');
|
||||
void PopulateAbilityIndexVector( list<int>& abilities, const string& abilitiesString, char delimiter = ',');
|
||||
void PopulateSubtypesIndexVector( list<int>& subtypes, const string& subtypesString, char delimiter = ' ');
|
||||
|
||||
|
||||
void PopulateColorIndexVector(list<int>& colors, const string& colorsString, char delimiter = ',');
|
||||
void PopulateAbilityIndexVector(list<int>& abilities, const string& abilitiesString, char delimiter = ',');
|
||||
void PopulateSubtypesIndexVector(list<int>& subtypes, const string& subtypesString, char delimiter = ' ');
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,140 +9,172 @@
|
||||
#include "WEvent.h"
|
||||
#include "CardSelector.h"
|
||||
|
||||
class OtherAbilitiesEventReceiver:public MTGAbility{
|
||||
class OtherAbilitiesEventReceiver: public MTGAbility
|
||||
{
|
||||
public:
|
||||
int testDestroy();
|
||||
int receiveEvent(WEvent * event);
|
||||
OtherAbilitiesEventReceiver(int _id);
|
||||
OtherAbilitiesEventReceiver * clone() const;
|
||||
int testDestroy();
|
||||
int receiveEvent(WEvent * event);
|
||||
OtherAbilitiesEventReceiver(int _id);
|
||||
OtherAbilitiesEventReceiver * clone() const;
|
||||
};
|
||||
|
||||
class MTGPutInPlayRule:public MTGAbility{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGPutInPlayRule(int _id);
|
||||
const char * getMenuText(){return "Play Card Normally";}
|
||||
virtual MTGPutInPlayRule * clone() const;
|
||||
class MTGPutInPlayRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGPutInPlayRule(int _id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Play Card Normally";
|
||||
}
|
||||
virtual MTGPutInPlayRule * clone() const;
|
||||
};
|
||||
|
||||
class MTGAlternativeCostRule:public MTGAbility{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGAlternativeCostRule(int _id);
|
||||
const char * getMenuText(){return "Pay Alternative Cost";}
|
||||
virtual MTGAlternativeCostRule * clone() const;
|
||||
class MTGAlternativeCostRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGAlternativeCostRule(int _id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Pay Alternative Cost";
|
||||
}
|
||||
virtual MTGAlternativeCostRule * clone() const;
|
||||
};
|
||||
|
||||
class MTGBuyBackRule:public MTGAbility{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGBuyBackRule(int _id);
|
||||
const char * getMenuText(){return "Cast And Buy Back";}
|
||||
virtual MTGBuyBackRule * clone() const;
|
||||
class MTGBuyBackRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGBuyBackRule(int _id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Cast And Buy Back";
|
||||
}
|
||||
virtual MTGBuyBackRule * clone() const;
|
||||
};
|
||||
|
||||
class MTGFlashBackRule:public MTGAbility{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGFlashBackRule(int _id);
|
||||
const char * getMenuText(){return "Flash Back";}
|
||||
virtual MTGFlashBackRule * clone() const;
|
||||
class MTGFlashBackRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGFlashBackRule(int _id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Flash Back";
|
||||
}
|
||||
virtual MTGFlashBackRule * clone() const;
|
||||
};
|
||||
|
||||
class MTGRetraceRule:public MTGAbility{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGRetraceRule(int _id);
|
||||
const char * getMenuText(){return "Retrace";}
|
||||
virtual MTGRetraceRule * clone() const;
|
||||
class MTGRetraceRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGRetraceRule(int _id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Retrace";
|
||||
}
|
||||
virtual MTGRetraceRule * clone() const;
|
||||
};
|
||||
|
||||
class MTGAttackRule:public MTGAbility, public Limitor{
|
||||
public:
|
||||
virtual bool select(Target*);
|
||||
virtual bool greyout(Target*);
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGAttackRule(int _id);
|
||||
const char * getMenuText(){return "Attacker";}
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual MTGAttackRule * clone() const;
|
||||
class MTGAttackRule: public MTGAbility, public Limitor
|
||||
{
|
||||
public:
|
||||
virtual bool select(Target*);
|
||||
virtual bool greyout(Target*);
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGAttackRule(int _id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Attacker";
|
||||
}
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual MTGAttackRule * clone() const;
|
||||
};
|
||||
|
||||
|
||||
/* handles combat trigger send recieve events*/
|
||||
class MTGCombatTriggersRule:public MTGAbility{
|
||||
public:
|
||||
MTGCombatTriggersRule(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
int testDestroy();
|
||||
virtual MTGCombatTriggersRule * clone() const;
|
||||
class MTGCombatTriggersRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
MTGCombatTriggersRule(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
int testDestroy();
|
||||
virtual MTGCombatTriggersRule * clone() const;
|
||||
};
|
||||
|
||||
class MTGBlockRule:public MTGAbility{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGBlockRule(int _id);
|
||||
const char * getMenuText(){return "Blocker";}
|
||||
virtual MTGBlockRule * clone() const;
|
||||
class MTGBlockRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
MTGBlockRule(int _id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Blocker";
|
||||
}
|
||||
virtual MTGBlockRule * clone() const;
|
||||
};
|
||||
|
||||
|
||||
/* Persist Rule */
|
||||
class MTGPersistRule:public MTGAbility{
|
||||
public:
|
||||
MTGPersistRule(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
int testDestroy();
|
||||
virtual MTGPersistRule * clone() const;
|
||||
class MTGPersistRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
MTGPersistRule(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
int testDestroy();
|
||||
virtual MTGPersistRule * clone() const;
|
||||
};
|
||||
//affinity rules
|
||||
class MTGAffinityRule:public MTGAbility{
|
||||
public:
|
||||
MTGAffinityRule(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
int testDestroy();
|
||||
virtual MTGAffinityRule * clone() const;
|
||||
class MTGAffinityRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
MTGAffinityRule(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
int testDestroy();
|
||||
virtual MTGAffinityRule * clone() const;
|
||||
};
|
||||
//unearths destruction if leaves play effect
|
||||
class MTGUnearthRule:public MTGAbility{
|
||||
public:
|
||||
MTGUnearthRule(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
int testDestroy();
|
||||
virtual MTGUnearthRule * clone() const;
|
||||
class MTGUnearthRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
MTGUnearthRule(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
int testDestroy();
|
||||
virtual MTGUnearthRule * clone() const;
|
||||
};
|
||||
class MTGTokensCleanup:public MTGAbility{
|
||||
public:
|
||||
vector<MTGCardInstance *> list;
|
||||
MTGTokensCleanup(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
int testDestroy();
|
||||
virtual MTGTokensCleanup * clone() const;
|
||||
class MTGTokensCleanup: public MTGAbility
|
||||
{
|
||||
public:
|
||||
vector<MTGCardInstance *> list;
|
||||
MTGTokensCleanup(int _id);
|
||||
int receiveEvent(WEvent * event);
|
||||
int testDestroy();
|
||||
virtual MTGTokensCleanup * clone() const;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -151,99 +183,112 @@ class MTGTokensCleanup:public MTGAbility{
|
||||
* owners' graveyards. This is called the "legend rule." If only one of those permanents is
|
||||
* legendary, this rule doesn't apply.
|
||||
*/
|
||||
class MTGLegendRule:public ListMaintainerAbility{
|
||||
public:
|
||||
MTGLegendRule(int _id);
|
||||
int canBeInList(MTGCardInstance * card);
|
||||
int added(MTGCardInstance * card);
|
||||
int removed(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual MTGLegendRule * clone() const;
|
||||
class MTGLegendRule: public ListMaintainerAbility
|
||||
{
|
||||
public:
|
||||
MTGLegendRule(int _id);
|
||||
int canBeInList(MTGCardInstance * card);
|
||||
int added(MTGCardInstance * card);
|
||||
int removed(MTGCardInstance * card);
|
||||
int testDestroy();
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual MTGLegendRule * clone() const;
|
||||
};
|
||||
|
||||
|
||||
class MTGMomirRule:public MTGAbility{
|
||||
class MTGMomirRule: public MTGAbility
|
||||
{
|
||||
private:
|
||||
int genRandomCreatureId(int convertedCost);
|
||||
static vector<int> pool[20];
|
||||
static int initialized;
|
||||
int genRandomCreatureId(int convertedCost);
|
||||
static vector<int> pool[20];
|
||||
static int initialized;
|
||||
|
||||
int textAlpha;
|
||||
string text;
|
||||
int textAlpha;
|
||||
string text;
|
||||
public:
|
||||
|
||||
int alreadyplayed;
|
||||
MTGAllCards * collection;
|
||||
MTGCardInstance * genCreature(int id);
|
||||
int testDestroy();
|
||||
void Update(float dt);
|
||||
void Render();
|
||||
MTGMomirRule(int _id, MTGAllCards * _collection);
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int reactToClick(MTGCardInstance * card, int id);
|
||||
const char * getMenuText(){return "Momir";}
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual MTGMomirRule * clone() const;
|
||||
int alreadyplayed;
|
||||
MTGAllCards * collection;
|
||||
MTGCardInstance * genCreature(int id);
|
||||
int testDestroy();
|
||||
void Update(float dt);
|
||||
void Render();
|
||||
MTGMomirRule(int _id, MTGAllCards * _collection);
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
int reactToClick(MTGCardInstance * card, int id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Momir";
|
||||
}
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual MTGMomirRule * clone() const;
|
||||
};
|
||||
|
||||
|
||||
/* LifeLink */
|
||||
class MTGLifelinkRule:public MTGAbility{
|
||||
public:
|
||||
MTGLifelinkRule(int _id);
|
||||
class MTGLifelinkRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
MTGLifelinkRule(int _id);
|
||||
|
||||
int receiveEvent(WEvent * event);
|
||||
int receiveEvent(WEvent * event);
|
||||
|
||||
int testDestroy();
|
||||
int testDestroy();
|
||||
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
|
||||
virtual MTGLifelinkRule * clone() const;
|
||||
virtual MTGLifelinkRule * clone() const;
|
||||
};
|
||||
|
||||
/* Deathtouch */
|
||||
class MTGDeathtouchRule:public MTGAbility{
|
||||
public:
|
||||
MTGDeathtouchRule(int _id);
|
||||
class MTGDeathtouchRule: public MTGAbility
|
||||
{
|
||||
public:
|
||||
MTGDeathtouchRule(int _id);
|
||||
|
||||
int receiveEvent(WEvent * event);
|
||||
int receiveEvent(WEvent * event);
|
||||
|
||||
int testDestroy();
|
||||
const char * getMenuText(){return "Deathtouch";}
|
||||
int testDestroy();
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Deathtouch";
|
||||
}
|
||||
|
||||
virtual MTGDeathtouchRule * clone() const;
|
||||
virtual MTGDeathtouchRule * clone() const;
|
||||
};
|
||||
|
||||
/* HUD Display */
|
||||
|
||||
class HUDString {
|
||||
class HUDString
|
||||
{
|
||||
public:
|
||||
string value;
|
||||
float timestamp;
|
||||
int quantity;
|
||||
HUDString(string s, float ts):value(s),timestamp(ts){quantity = 1;};
|
||||
string value;
|
||||
float timestamp;
|
||||
int quantity;
|
||||
HUDString(string s, float ts) :
|
||||
value(s), timestamp(ts)
|
||||
{
|
||||
quantity = 1;
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
class HUDDisplay:public MTGAbility{
|
||||
class HUDDisplay: public MTGAbility
|
||||
{
|
||||
private:
|
||||
list<HUDString *> events;
|
||||
float timestamp;
|
||||
float popdelay;
|
||||
WFont * f;
|
||||
float maxWidth;
|
||||
int addEvent(string s);
|
||||
list<HUDString *> events;
|
||||
float timestamp;
|
||||
float popdelay;
|
||||
WFont * f;
|
||||
float maxWidth;
|
||||
int addEvent(string s);
|
||||
public:
|
||||
int testDestroy();
|
||||
int receiveEvent(WEvent * event);
|
||||
void Update(float dt);
|
||||
void Render();
|
||||
HUDDisplay(int _id);
|
||||
~HUDDisplay();
|
||||
virtual HUDDisplay * clone() const;
|
||||
int testDestroy();
|
||||
int receiveEvent(WEvent * event);
|
||||
void Update(float dt);
|
||||
void Render();
|
||||
HUDDisplay(int _id);
|
||||
~HUDDisplay();
|
||||
virtual HUDDisplay * clone() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,27 +22,27 @@ public:
|
||||
MODE_TEST_SUITE, MODE_HUMAN, MODE_AI,
|
||||
};
|
||||
|
||||
JTexture * mAvatarTex;
|
||||
JQuad * mAvatar;
|
||||
int playMode;
|
||||
bool canPutLandsIntoPlay;
|
||||
int landsPlayerCanStillPlay;
|
||||
bool nomaxhandsize;
|
||||
int castedspellsthisturn;
|
||||
bool onlyonecast;
|
||||
int castcount;
|
||||
bool nocreatureinstant;
|
||||
bool nospellinstant;
|
||||
bool onlyoneinstant;
|
||||
bool castrestrictedcreature;
|
||||
bool castrestrictedspell;
|
||||
bool onlyoneboth;
|
||||
bool bothrestrictedspell;
|
||||
bool bothrestrictedcreature;
|
||||
MTGPlayerCards * game;
|
||||
string deckFile;
|
||||
string deckFileSmall;
|
||||
string deckName;
|
||||
JTexture * mAvatarTex;
|
||||
JQuad * mAvatar;
|
||||
int playMode;
|
||||
bool canPutLandsIntoPlay;
|
||||
int landsPlayerCanStillPlay;
|
||||
bool nomaxhandsize;
|
||||
int castedspellsthisturn;
|
||||
bool onlyonecast;
|
||||
int castcount;
|
||||
bool nocreatureinstant;
|
||||
bool nospellinstant;
|
||||
bool onlyoneinstant;
|
||||
bool castrestrictedcreature;
|
||||
bool castrestrictedspell;
|
||||
bool onlyoneboth;
|
||||
bool bothrestrictedspell;
|
||||
bool bothrestrictedcreature;
|
||||
MTGPlayerCards * game;
|
||||
string deckFile;
|
||||
string deckFileSmall;
|
||||
string deckName;
|
||||
|
||||
Player(MTGDeck * deck, string deckFile, string deckFileSmall);
|
||||
virtual ~Player();
|
||||
@@ -71,7 +71,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
virtual int isAI()
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user