ok this is the last commit but i had massive issues after chopping it all up, hopefully it doesn't hilight everything that was already commited...if it does i apologize my own patch started giving me conflicts....
im like 7 tries into commiting this part....
This commit is contained in:
@@ -1004,9 +1004,10 @@ class IfThenAbility: public InstantAbility
|
||||
{
|
||||
public:
|
||||
MTGAbility * delayedAbility;
|
||||
MTGAbility * delayedElseAbility;
|
||||
int type;
|
||||
string Cond;
|
||||
IfThenAbility(GameObserver* observer, int _id,MTGAbility * delayedAbility = NULL, MTGCardInstance * _source=NULL, Targetable * target = NULL, int type = 1,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();
|
||||
IfThenAbility * clone() const;
|
||||
@@ -1110,6 +1111,16 @@ public:
|
||||
|
||||
};
|
||||
|
||||
//place a card on the bottom of owners library
|
||||
class AALibraryBottom: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
AALibraryBottom(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AALibraryBottom * clone() const;
|
||||
};
|
||||
|
||||
//Copier. ActivatedAbility
|
||||
class AACopier: public ActivatedAbility
|
||||
{
|
||||
@@ -2659,6 +2670,11 @@ public:
|
||||
if(sabilities.find("battleready") != string::npos)
|
||||
battleReady = true;
|
||||
|
||||
if(sabilities.find("chosencolor") != string::npos)
|
||||
{
|
||||
colors.push_back(source->chooseacolor);
|
||||
}
|
||||
|
||||
for (int j = 0; j < Constants::NB_Colors; j++)
|
||||
{
|
||||
size_t found = sabilities.find(Constants::MTGColorStrings[j]);
|
||||
@@ -2674,12 +2690,21 @@ public:
|
||||
size_t found = s.find(" ");
|
||||
if (found != string::npos)
|
||||
{
|
||||
int id = MTGAllCards::findType(s.substr(0, found));
|
||||
string toCheck = s.substr(0, found);
|
||||
if(toCheck.find("chosentype") != string::npos || toCheck.find("Chosentype") != string::npos)
|
||||
{
|
||||
toCheck = source->chooseasubtype;
|
||||
}
|
||||
int id = MTGAllCards::findType(toCheck);
|
||||
types.push_back(id);
|
||||
s = s.substr(found + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(s.find("chosentype") != string::npos || s.find("Chosentype") != string::npos)
|
||||
{
|
||||
s = source->chooseasubtype;
|
||||
}
|
||||
int id = MTGAllCards::findType(s);
|
||||
types.push_back(id);
|
||||
s = "";
|
||||
@@ -3406,6 +3431,17 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class AAExchangeLife: public ActivatedAbilityTP
|
||||
{
|
||||
public:
|
||||
AAExchangeLife(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost = NULL,
|
||||
int who = TargetChooser::UNSET);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AAExchangeLife * clone() const;
|
||||
|
||||
};
|
||||
|
||||
// Add life of gives damage if a given zone has more or less than [condition] cards at the beginning of [phase]
|
||||
//Ex : the rack, ivory tower...
|
||||
class ALifeZoneLink: public MTGAbility
|
||||
@@ -4951,9 +4987,6 @@ public:
|
||||
return NEW APhaseAlter(*this);
|
||||
}
|
||||
};
|
||||
|
||||
//--------------Addon Abra------------------
|
||||
|
||||
//Basilik --> needs to be made more generic to avoid duplicate (also something like if opponent=type then ...)
|
||||
class ABasilik: public MTGAbility
|
||||
{
|
||||
@@ -5015,6 +5048,19 @@ public:
|
||||
AADepleter * clone() const;
|
||||
};
|
||||
|
||||
//Generic skip turn/extra turn
|
||||
class AAModTurn: public ActivatedAbilityTP
|
||||
{
|
||||
public:
|
||||
string nbTurnStr;
|
||||
|
||||
AAModTurn(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbTurnStr, ManaCost * _cost = NULL,
|
||||
int who = TargetChooser::UNSET);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AAModTurn * clone() const;
|
||||
};
|
||||
|
||||
//Shuffle
|
||||
class AAShuffle: public ActivatedAbilityTP
|
||||
{
|
||||
@@ -5283,6 +5329,15 @@ public:
|
||||
int resolve()
|
||||
{
|
||||
MTGCardInstance * _theftTarget = (MTGCardInstance*)target;
|
||||
bool recast = false;
|
||||
if(!_theftTarget->isInPlay(game))
|
||||
{
|
||||
recast = true;
|
||||
}
|
||||
while(_theftTarget->next)
|
||||
{
|
||||
_theftTarget= _theftTarget->next;
|
||||
}
|
||||
if(_theftTarget)
|
||||
{
|
||||
TrueController = _theftTarget->controller();
|
||||
@@ -5291,7 +5346,13 @@ public:
|
||||
target = copy;
|
||||
source->target = copy;
|
||||
copy->summoningSickness = 0;
|
||||
if(recast)
|
||||
{
|
||||
Spell * spell = NEW Spell(game, copy);
|
||||
spell->resolve();
|
||||
SAFE_DELETE(spell);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -5318,6 +5379,76 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------------------
|
||||
class AASetColorChosen: public InstantAbility
|
||||
{
|
||||
public:
|
||||
int color;
|
||||
string abilityToAlter;
|
||||
MTGAbility * abilityAltered;
|
||||
AASetColorChosen(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int _color = 0 ,string toAdd = "");
|
||||
int resolve();
|
||||
const char* getMenuText();
|
||||
AASetColorChosen * clone() const;
|
||||
~AASetColorChosen();
|
||||
};
|
||||
class AASetTypeChosen: public InstantAbility
|
||||
{
|
||||
public:
|
||||
int type;
|
||||
string menutext;
|
||||
string abilityToAlter;
|
||||
MTGAbility * abilityAltered;
|
||||
AASetTypeChosen(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int _type = 0,string menu = "error" ,string toAdd = "");
|
||||
int resolve();
|
||||
const char* getMenuText();
|
||||
AASetTypeChosen * clone() const;
|
||||
~AASetTypeChosen();
|
||||
};
|
||||
class GenericChooseTypeColor: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
string baseAbility;
|
||||
bool chooseColor;
|
||||
AASetColorChosen * setColor;
|
||||
AASetTypeChosen * setType;
|
||||
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();
|
||||
GenericChooseTypeColor * clone() const;
|
||||
~GenericChooseTypeColor();
|
||||
|
||||
};
|
||||
//------------------------------------------------
|
||||
//flip a coin and call it, with win or lose abilities
|
||||
class AASetCoin: public InstantAbility
|
||||
{
|
||||
public:
|
||||
int side;
|
||||
string abilityToAlter;
|
||||
string abilityWin;
|
||||
string abilityLose;
|
||||
MTGAbility * abilityAltered;
|
||||
AASetCoin(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int side = -1,string toAdd = "");
|
||||
int resolve();
|
||||
const char* getMenuText();
|
||||
AASetCoin * clone() const;
|
||||
~AASetCoin();
|
||||
};
|
||||
class GenericFlipACoin: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
string baseAbility;
|
||||
bool chooseColor;
|
||||
AASetCoin * setCoin;
|
||||
GenericFlipACoin(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "", ManaCost * cost = NULL);
|
||||
int resolve();
|
||||
const char* getMenuText();
|
||||
GenericFlipACoin * clone() const;
|
||||
~GenericFlipACoin();
|
||||
|
||||
};
|
||||
// utility functions
|
||||
|
||||
void PopulateColorIndexVector(list<int>& colors, const string& colorsString, char delimiter = ',');
|
||||
|
||||
@@ -212,8 +212,12 @@ class Constants
|
||||
HYDRA = 92,
|
||||
UNDYING = 93,
|
||||
POISONSHROUD = 94,
|
||||
NOACTIVATED = 95,
|
||||
NOACTIVATEDTAP = 96,
|
||||
NOMANA = 97,
|
||||
ONLYMANA = 98,
|
||||
|
||||
NB_BASIC_ABILITIES = 95,
|
||||
NB_BASIC_ABILITIES = 99,
|
||||
|
||||
|
||||
RARITY_S = 'S', //Special Rarity
|
||||
|
||||
@@ -203,6 +203,33 @@ public:
|
||||
virtual MTGAttackRule * clone() const;
|
||||
};
|
||||
|
||||
|
||||
class MTGPlaneswalkerAttackRule: public PermanentAbility, public Limitor
|
||||
{
|
||||
public:
|
||||
|
||||
virtual bool select(Target*);
|
||||
virtual bool greyout(Target*);
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
||||
int reactToClick(MTGCardInstance * card);
|
||||
MTGPlaneswalkerAttackRule(GameObserver* observer, int _id);
|
||||
const char * getMenuText()
|
||||
{
|
||||
return "Attack Planeswalker";
|
||||
}
|
||||
virtual MTGPlaneswalkerAttackRule * clone() const;
|
||||
};
|
||||
class AAPlaneswalkerAttacked: public InstantAbility
|
||||
{
|
||||
public:
|
||||
string menuText;
|
||||
MTGCardInstance* attacker;
|
||||
AAPlaneswalkerAttacked(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target);
|
||||
int resolve();
|
||||
const char* getMenuText();
|
||||
AAPlaneswalkerAttacked * clone() const;
|
||||
~AAPlaneswalkerAttacked();
|
||||
};
|
||||
/* handles combat trigger send recieve events*/
|
||||
class MTGCombatTriggersRule: public PermanentAbility
|
||||
{
|
||||
@@ -292,7 +319,16 @@ public:
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
virtual MTGPlaneWalkerRule * clone() const;
|
||||
};
|
||||
/* LifeLink */
|
||||
class MTGPlaneswalkerDamage: public PermanentAbility
|
||||
{
|
||||
public:
|
||||
MTGPlaneswalkerDamage(GameObserver* observer, int _id);
|
||||
|
||||
int receiveEvent(WEvent * event);
|
||||
|
||||
virtual MTGPlaneswalkerDamage * clone() const;
|
||||
};
|
||||
class MTGMomirRule: public PermanentAbility
|
||||
{
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user