- Minor code cleanup (removed AABanishCard class and unused banishmentType variables)
This commit is contained in:
@@ -1002,56 +1002,38 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------
|
||||||
class AABanishCard: public ActivatedAbility
|
|
||||||
{
|
|
||||||
|
|
||||||
protected:
|
class AABuryCard: public ActivatedAbility
|
||||||
|
|
||||||
public:
|
|
||||||
int banishmentType;
|
|
||||||
const static int BANISHED = -1;
|
|
||||||
const static int BURY = 0;
|
|
||||||
const static int DESTROY = 1;
|
|
||||||
const static int SACRIFICE = 2;
|
|
||||||
const static int DISCARD = 3;
|
|
||||||
|
|
||||||
AABanishCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = BANISHED);
|
|
||||||
int resolve();
|
|
||||||
virtual const char * getMenuText();
|
|
||||||
AABanishCard * clone() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
class AABuryCard: public AABanishCard
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AABuryCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = BURY);
|
AABuryCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AABuryCard * clone() const;
|
AABuryCard * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AADestroyCard: public AABanishCard
|
class AADestroyCard: public ActivatedAbility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AADestroyCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = DESTROY);
|
AADestroyCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AADestroyCard * clone() const;
|
AADestroyCard * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AASacrificeCard: public AABanishCard
|
class AASacrificeCard: public ActivatedAbility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AASacrificeCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = SACRIFICE);
|
AASacrificeCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AASacrificeCard * clone() const;
|
AASacrificeCard * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AADiscardCard: public AABanishCard
|
class AADiscardCard: public ActivatedAbility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AADiscardCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = DISCARD);
|
AADiscardCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
AADiscardCard * clone() const;
|
AADiscardCard * clone() const;
|
||||||
|
|||||||
@@ -527,37 +527,12 @@ AAFizzler* AAFizzler::clone() const
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
// BanishCard implementations
|
// BanishCard implementations
|
||||||
|
|
||||||
AABanishCard::AABanishCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
|
||||||
ActivatedAbility(_id, _source, NULL), banishmentType(_banishmentType)
|
|
||||||
{
|
|
||||||
if (_target)
|
|
||||||
target = _target;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * AABanishCard::getMenuText()
|
|
||||||
{
|
|
||||||
return "Send to graveyard";
|
|
||||||
}
|
|
||||||
|
|
||||||
int AABanishCard::resolve()
|
|
||||||
{
|
|
||||||
DebugTrace("This is not implemented!");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
AABanishCard * AABanishCard::clone() const
|
|
||||||
{
|
|
||||||
AABanishCard * a = NEW AABanishCard(*this);
|
|
||||||
a->isClone = 1;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bury
|
// Bury
|
||||||
|
|
||||||
AABuryCard::AABuryCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
AABuryCard::AABuryCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
|
||||||
AABanishCard(_id, _source, _target, AABanishCard::BURY)
|
ActivatedAbility(_id, _source)
|
||||||
{
|
{
|
||||||
|
target = _target;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AABuryCard::resolve()
|
int AABuryCard::resolve()
|
||||||
@@ -584,9 +559,10 @@ AABuryCard * AABuryCard::clone() const
|
|||||||
|
|
||||||
// Destroy
|
// Destroy
|
||||||
|
|
||||||
AADestroyCard::AADestroyCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
AADestroyCard::AADestroyCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
|
||||||
AABanishCard(_id, _source, _target, AABanishCard::DESTROY)
|
ActivatedAbility(_id, _source)
|
||||||
{
|
{
|
||||||
|
target = _target;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AADestroyCard::resolve()
|
int AADestroyCard::resolve()
|
||||||
@@ -612,9 +588,10 @@ AADestroyCard * AADestroyCard::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sacrifice
|
// Sacrifice
|
||||||
AASacrificeCard::AASacrificeCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
AASacrificeCard::AASacrificeCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
|
||||||
AABanishCard(_id, _source, _target, AABanishCard::SACRIFICE)
|
ActivatedAbility(_id, _source)
|
||||||
{
|
{
|
||||||
|
target = _target;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AASacrificeCard::resolve()
|
int AASacrificeCard::resolve()
|
||||||
@@ -646,9 +623,10 @@ AASacrificeCard * AASacrificeCard::clone() const
|
|||||||
|
|
||||||
// Discard
|
// Discard
|
||||||
|
|
||||||
AADiscardCard::AADiscardCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
AADiscardCard::AADiscardCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
|
||||||
AABanishCard(_id, _source, _target, AABanishCard::DISCARD)
|
ActivatedAbility(_id, _source)
|
||||||
{
|
{
|
||||||
|
target = _target;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AADiscardCard::resolve()
|
int AADiscardCard::resolve()
|
||||||
|
|||||||
@@ -1616,28 +1616,28 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
//Bury, destroy, sacrifice, reject(discard)
|
//Bury, destroy, sacrifice, reject(discard)
|
||||||
if (s.find("bury") != string::npos)
|
if (s.find("bury") != string::npos)
|
||||||
{
|
{
|
||||||
MTGAbility *a = NEW AABuryCard(id, card, target, AABanishCard::BURY);
|
MTGAbility *a = NEW AABuryCard(id, card, target);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.find("destroy") != string::npos)
|
if (s.find("destroy") != string::npos)
|
||||||
{
|
{
|
||||||
MTGAbility * a = NEW AADestroyCard(id, card, target, AABanishCard::DESTROY);
|
MTGAbility * a = NEW AADestroyCard(id, card, target);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.find("sacrifice") != string::npos)
|
if (s.find("sacrifice") != string::npos)
|
||||||
{
|
{
|
||||||
MTGAbility *a = NEW AASacrificeCard(id, card, target, AABanishCard::SACRIFICE);
|
MTGAbility *a = NEW AASacrificeCard(id, card, target);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.find("reject") != string::npos)
|
if (s.find("reject") != string::npos)
|
||||||
{
|
{
|
||||||
MTGAbility *a = NEW AADiscardCard(id, card, target, AABanishCard::DISCARD);
|
MTGAbility *a = NEW AADiscardCard(id, card, target);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user