- 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:
|
||||
|
||||
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
|
||||
class AABuryCard: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
AABuryCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = BURY);
|
||||
AABuryCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AABuryCard * clone() const;
|
||||
};
|
||||
|
||||
class AADestroyCard: public AABanishCard
|
||||
class AADestroyCard: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
AADestroyCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = DESTROY);
|
||||
AADestroyCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AADestroyCard * clone() const;
|
||||
};
|
||||
|
||||
class AASacrificeCard: public AABanishCard
|
||||
class AASacrificeCard: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
AASacrificeCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = SACRIFICE);
|
||||
AASacrificeCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AASacrificeCard * clone() const;
|
||||
};
|
||||
|
||||
class AADiscardCard: public AABanishCard
|
||||
class AADiscardCard: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
AADiscardCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType = DISCARD);
|
||||
AADiscardCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AADiscardCard * clone() const;
|
||||
|
||||
@@ -527,37 +527,12 @@ AAFizzler* AAFizzler::clone() const
|
||||
return a;
|
||||
}
|
||||
// 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
|
||||
|
||||
AABuryCard::AABuryCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
||||
AABanishCard(_id, _source, _target, AABanishCard::BURY)
|
||||
AABuryCard::AABuryCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
|
||||
ActivatedAbility(_id, _source)
|
||||
{
|
||||
target = _target;
|
||||
}
|
||||
|
||||
int AABuryCard::resolve()
|
||||
@@ -584,9 +559,10 @@ AABuryCard * AABuryCard::clone() const
|
||||
|
||||
// Destroy
|
||||
|
||||
AADestroyCard::AADestroyCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
||||
AABanishCard(_id, _source, _target, AABanishCard::DESTROY)
|
||||
AADestroyCard::AADestroyCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
|
||||
ActivatedAbility(_id, _source)
|
||||
{
|
||||
target = _target;
|
||||
}
|
||||
|
||||
int AADestroyCard::resolve()
|
||||
@@ -612,9 +588,10 @@ AADestroyCard * AADestroyCard::clone() const
|
||||
}
|
||||
|
||||
// Sacrifice
|
||||
AASacrificeCard::AASacrificeCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
||||
AABanishCard(_id, _source, _target, AABanishCard::SACRIFICE)
|
||||
AASacrificeCard::AASacrificeCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
|
||||
ActivatedAbility(_id, _source)
|
||||
{
|
||||
target = _target;
|
||||
}
|
||||
|
||||
int AASacrificeCard::resolve()
|
||||
@@ -646,9 +623,10 @@ AASacrificeCard * AASacrificeCard::clone() const
|
||||
|
||||
// Discard
|
||||
|
||||
AADiscardCard::AADiscardCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _banishmentType) :
|
||||
AABanishCard(_id, _source, _target, AABanishCard::DISCARD)
|
||||
AADiscardCard::AADiscardCard(int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
|
||||
ActivatedAbility(_id, _source)
|
||||
{
|
||||
target = _target;
|
||||
}
|
||||
|
||||
int AADiscardCard::resolve()
|
||||
|
||||
@@ -1616,28 +1616,28 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
//Bury, destroy, sacrifice, reject(discard)
|
||||
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;
|
||||
return a;
|
||||
}
|
||||
|
||||
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;
|
||||
return a;
|
||||
}
|
||||
|
||||
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;
|
||||
return a;
|
||||
}
|
||||
|
||||
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;
|
||||
return a;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user