J :
* Remove useless whitespace & carriage returns, reindent.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
#ifndef _CARDS_H_
|
||||
#define _CARDS_H_
|
||||
|
||||
@@ -18,14 +17,14 @@
|
||||
using std::map;
|
||||
|
||||
/*
|
||||
Generic classes
|
||||
Generic classes
|
||||
*/
|
||||
|
||||
|
||||
//Drawer, allows to draw a card for a cost:
|
||||
|
||||
class ADrawer:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
int nbcards;
|
||||
ADrawer(int _id, MTGCardInstance * card,ManaCost * _cost, int _nbcards = 1, int _tap = 1):ActivatedAbility(_id, card,_cost,0,_tap),nbcards(_nbcards){
|
||||
}
|
||||
@@ -45,7 +44,7 @@ public:
|
||||
|
||||
//Destroyer. TargetAbility
|
||||
class ADestroyer:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
int bury;
|
||||
ADestroyer(int _id, MTGCardInstance * _source, TargetChooser * _tc = NULL, int _bury = 0):TargetAbility(_id,_source, tc),bury(_bury){
|
||||
if (!tc) tc = NEW CreatureTargetChooser();
|
||||
@@ -72,7 +71,7 @@ public:
|
||||
|
||||
//Destroyer. TargetAbility
|
||||
class ABurier:public ADestroyer{
|
||||
public:
|
||||
public:
|
||||
ABurier(int _id, MTGCardInstance * _source, TargetChooser * _tc = NULL):ADestroyer(_id,_source, tc,1){
|
||||
}
|
||||
|
||||
@@ -83,13 +82,13 @@ public:
|
||||
|
||||
|
||||
/*Changes one of the basic abilities of target
|
||||
source : spell
|
||||
target : spell target (creature)
|
||||
modifier : 1 to add the ability, 0 to remove it
|
||||
_ability : Id of the ability, as described in mtgdefinitions
|
||||
source : spell
|
||||
target : spell target (creature)
|
||||
modifier : 1 to add the ability, 0 to remove it
|
||||
_ability : Id of the ability, as described in mtgdefinitions
|
||||
*/
|
||||
class ABasicAbilityModifier:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int modifier;
|
||||
int ability;
|
||||
int value_before_modification;
|
||||
@@ -157,7 +156,7 @@ class ABasicAbilityModifierUntilEOT:public TargetAbility{
|
||||
|
||||
/*Instants that modifies a basic ability until end of turn */
|
||||
class AInstantBasicAbilityModifierUntilEOT: public InstantAbility{
|
||||
public:
|
||||
public:
|
||||
int stateBeforeActivation;
|
||||
int ability;
|
||||
AInstantBasicAbilityModifierUntilEOT(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _ability, int value):InstantAbility(_id, _source, _target),ability(_ability){
|
||||
@@ -174,7 +173,7 @@ public:
|
||||
|
||||
//Alteration of Ability until of turn (Aura)
|
||||
class ABasicAbilityAuraModifierUntilEOT: public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
int stateBeforeActivation;
|
||||
int ability;
|
||||
int value;
|
||||
@@ -208,7 +207,7 @@ public:
|
||||
|
||||
/*Gives life each time a spell matching CardDescriptor's criteria are match . Optionnal manacost*/
|
||||
class ASpellCastLife:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
CardDescriptor trigger;
|
||||
ManaCost * cost;
|
||||
int life;
|
||||
@@ -248,7 +247,7 @@ public:
|
||||
|
||||
//Allows to untap at any moment for an amount of mana
|
||||
class AUnBlocker:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
ManaCost * cost;
|
||||
AUnBlocker(int id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost):MTGAbility(id, _source, _target), cost(_cost){
|
||||
}
|
||||
@@ -273,7 +272,7 @@ public:
|
||||
|
||||
//Allows to untap target card once per turn for a manaCost
|
||||
class AUntaperOnceDuringTurn:public AUnBlocker{
|
||||
public:
|
||||
public:
|
||||
int untappedThisTurn;
|
||||
int onlyPlayerTurn;
|
||||
AUntaperOnceDuringTurn(int id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost, int _onlyPlayerTurn = 1):AUnBlocker(id, _source, _target, _cost){
|
||||
@@ -300,7 +299,7 @@ public:
|
||||
|
||||
//Alteration of Power and Toughness (enchantments)
|
||||
class APowerToughnessModifier: public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int power, toughness;
|
||||
APowerToughnessModifier(int id, MTGCardInstance * _source, MTGCardInstance * _target, int _power, int _toughness):MTGAbility(id,_source,_target),power(_power),toughness(_toughness){
|
||||
_target->power += power;
|
||||
@@ -316,7 +315,7 @@ public:
|
||||
|
||||
// Permanent life alteration evry turn of the target's controller. Useful only for unstable mutation currently
|
||||
class APowerToughnessModifierRegularCounter:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int power, toughness;
|
||||
int phase;
|
||||
APowerToughnessModifierRegularCounter(int id, MTGCardInstance * _source, MTGCardInstance * _target, int _phase, int _power, int _toughness):MTGAbility(id,_source,_target),power(_power),toughness(_toughness), phase(_phase){
|
||||
@@ -335,7 +334,7 @@ public:
|
||||
//Alteration of Power and Toughness until end of turn (TargetAbility)
|
||||
// Gives +n/+m until end of turn to any card that's a target
|
||||
class ATargetterPowerToughnessModifierUntilEOT: public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
MTGCardInstance * mTargets[50];
|
||||
int nbTargets;
|
||||
int power, toughness;
|
||||
@@ -378,7 +377,7 @@ public:
|
||||
|
||||
//Alteration of Power and Toughness until end of turn (Aura)
|
||||
class APowerToughnessModifierUntilEndOfTurn: public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int power, toughness;
|
||||
int counters;
|
||||
int maxcounters;
|
||||
@@ -419,7 +418,7 @@ public:
|
||||
|
||||
//Alteration of Power and toughness until end of turn (instant)
|
||||
class AInstantPowerToughnessModifierUntilEOT: public InstantAbility{
|
||||
public:
|
||||
public:
|
||||
int power, toughness;
|
||||
AInstantPowerToughnessModifierUntilEOT(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _power, int _toughness): InstantAbility(_id, _source, _target), power(_power), toughness(_toughness){
|
||||
}
|
||||
@@ -439,7 +438,7 @@ public:
|
||||
};
|
||||
//Untap Blockers with simple Mana Mechanism
|
||||
class AUntapManaBlocker: public Blocker{
|
||||
public:
|
||||
public:
|
||||
AUntapManaBlocker(int id, MTGCardInstance * card, ManaCost * _cost):Blocker(id, card, _cost){
|
||||
}
|
||||
|
||||
@@ -450,7 +449,7 @@ public:
|
||||
/* Spell Counters (Enchantment) for a mana cost */
|
||||
//LifeForce
|
||||
class ASpellCounterEnchantment:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
|
||||
ASpellCounterEnchantment(int _id, MTGCardInstance * _source, ManaCost * _cost,int color = -1, int _tap = 0):TargetAbility(_id,_source,NEW SpellTargetChooser(_source,color),_cost,0,_tap){
|
||||
}
|
||||
@@ -472,14 +471,14 @@ public:
|
||||
other solutions need to be provided for abilities that add mana (ex: mana flare)
|
||||
*/
|
||||
/*
|
||||
Currently the mana is added to the pool AFTER the animation
|
||||
This is VERY BAD, since we don't have any control on the duration of the animation. This can lead to bugs with
|
||||
the AI, who is expecting to have the mana in its manapool right after clicking the land card !!!
|
||||
The sum of "dt" has to be 0.25 for the mana to be in the manapool currently
|
||||
Currently the mana is added to the pool AFTER the animation
|
||||
This is VERY BAD, since we don't have any control on the duration of the animation. This can lead to bugs with
|
||||
the AI, who is expecting to have the mana in its manapool right after clicking the land card !!!
|
||||
The sum of "dt" has to be 0.25 for the mana to be in the manapool currently
|
||||
*/
|
||||
|
||||
class AManaProducer: public MTGAbility{
|
||||
protected:
|
||||
protected:
|
||||
ManaCost * cost;
|
||||
ManaCost * output;
|
||||
string menutext;
|
||||
@@ -488,7 +487,7 @@ protected:
|
||||
Player * controller;
|
||||
|
||||
hgeParticleSystem * mParticleSys;
|
||||
public:
|
||||
public:
|
||||
AManaProducer(int id, MTGCardInstance * card, ManaCost * _output, ManaCost * _cost = NULL ):MTGAbility(id, card){
|
||||
LOG("==Creating ManaProducer Object");
|
||||
cost = _cost;
|
||||
@@ -629,7 +628,7 @@ public:
|
||||
|
||||
/* Lifelink Ability */
|
||||
class ALifeLink:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int nbdamagesthisturn;
|
||||
Damage * lastDamage;
|
||||
ALifeLink(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
@@ -660,7 +659,7 @@ public:
|
||||
|
||||
//Circle of Protections
|
||||
class ACircleOfProtection: public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
ACircleOfProtection(int _id, MTGCardInstance * source, int _color):TargetAbility(_id,source,NEW DamageTargetChooser(source,_color),NEW ManaCost(),0,0){
|
||||
cost->add(MTG_COLOR_ARTIFACT,1);
|
||||
}
|
||||
@@ -675,7 +674,7 @@ public:
|
||||
|
||||
//Basic regeneration mechanism for a Mana cost
|
||||
class AStandardRegenerate:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
AStandardRegenerate(int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost):ActivatedAbility(_id,_source,_cost,0,0){
|
||||
target = _target;
|
||||
}
|
||||
@@ -704,7 +703,7 @@ public:
|
||||
|
||||
/*Gives protection to a target */
|
||||
class AProtectionFrom:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
CardDescriptor * cd;
|
||||
void initProtection(){
|
||||
((MTGCardInstance *)target)->addProtection(cd);
|
||||
@@ -728,7 +727,7 @@ public:
|
||||
|
||||
//Aura Enchantments that provide controller of target life or damages at a given phase of their turn
|
||||
class ARegularLifeModifierAura:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int life;
|
||||
int phase;
|
||||
int onlyIfTargetTapped;
|
||||
@@ -751,7 +750,7 @@ public:
|
||||
|
||||
//ExaltedAbility (Shards of Alara)
|
||||
class AExalted:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
int power, toughness;
|
||||
MTGCardInstance * luckyWinner;
|
||||
AExalted(int _id, MTGCardInstance * _source, int _power = 1, int _toughness = 1):ListMaintainerAbility(_id, _source),power(_power),toughness(_toughness){
|
||||
@@ -793,7 +792,7 @@ public:
|
||||
|
||||
//ExaltedAbility for basic abilities (Shards of Alara)
|
||||
class AExaltedAbility:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
int ability;
|
||||
MTGCardInstance * luckyWinner;
|
||||
AExaltedAbility(int _id, MTGCardInstance * _source, int _ability):ListMaintainerAbility(_id, _source),ability(_ability){
|
||||
@@ -830,7 +829,7 @@ public:
|
||||
|
||||
//Converts lands to creatures (Kormus bell, Living lands)
|
||||
class AConvertLandToCreatures:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
int type;
|
||||
int power, toughness;
|
||||
AConvertLandToCreatures(int _id, MTGCardInstance * _source, const char * _type, int _power = 1, int _toughness = 1):ListMaintainerAbility(_id, _source),power(_power),toughness(_toughness){
|
||||
@@ -859,7 +858,7 @@ public:
|
||||
|
||||
//Lords (Merfolk lord...) give power and toughness to OTHER creatures of their type, they can give them special abilities, regeneration
|
||||
class ALord:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
string type;
|
||||
int power, toughness;
|
||||
int ability;
|
||||
@@ -907,7 +906,7 @@ public:
|
||||
|
||||
//Lords (Merfolk lord...) give power and toughness to OTHER creatures of a given color, they can give them special abilities, regeneration
|
||||
class AColorLord:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
int color;
|
||||
int notcolor;
|
||||
int power, toughness;
|
||||
@@ -962,7 +961,7 @@ public:
|
||||
|
||||
/* Standard Damager, can choose a NEW target each time the price is paid */
|
||||
class ADamager:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
int damage;
|
||||
ADamager(int id, MTGCardInstance * card, ManaCost * _cost, int _damage, TargetChooser * _tc = NULL, int _tap = 1):TargetAbility(id,card, _tc, _cost,0,_tap),damage(_damage){
|
||||
if (!tc) tc = NEW DamageableTargetChooser(card);
|
||||
@@ -982,7 +981,7 @@ public:
|
||||
|
||||
/* Can tap a target for a cost */
|
||||
class ATapper:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
int damage;
|
||||
ATapper(int id, MTGCardInstance * card, ManaCost * _cost, TargetChooser * _chooser):TargetAbility(id,card, _chooser, _cost){
|
||||
}
|
||||
@@ -1003,7 +1002,7 @@ public:
|
||||
|
||||
//Ability to untap a target
|
||||
class AUntaper:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
AUntaper(int _id, MTGCardInstance * card, ManaCost * _manacost, TargetChooser * _tc):TargetAbility(_id,card,_tc,_manacost){
|
||||
}
|
||||
|
||||
@@ -1025,7 +1024,7 @@ public:
|
||||
// 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{
|
||||
public:
|
||||
public:
|
||||
int phase;
|
||||
int condition;
|
||||
int life;
|
||||
@@ -1067,7 +1066,7 @@ public:
|
||||
//Creatures that cannot attack if opponent has not a given type of land, and die if controller has not this type of land
|
||||
//Ex : pirate ship...
|
||||
class AStrongLandLinkCreature: public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
char land[20];
|
||||
AStrongLandLinkCreature(int _id, MTGCardInstance * _source, const char * _land):MTGAbility(_id, _source){
|
||||
sprintf(land,"%s",_land);
|
||||
@@ -1090,7 +1089,7 @@ public:
|
||||
|
||||
//Steal control of a target
|
||||
class AControlStealAura: public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
Player * originalController;
|
||||
AControlStealAura(int _id , MTGCardInstance * _source, MTGCardInstance * _target):MTGAbility(_id, _source, _target){
|
||||
originalController = _target->controller();
|
||||
@@ -1112,7 +1111,7 @@ public:
|
||||
|
||||
//Same as StealControl Aura ???? Obsolete ?
|
||||
class ATakeControlAura:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
Player * previousController;
|
||||
ATakeControlAura(int _id, MTGCardInstance * _source, MTGCardInstance * _target):MTGAbility(_id, _source,_target){
|
||||
previousController = _target->controller();
|
||||
@@ -1133,7 +1132,7 @@ public:
|
||||
//Creatures that kill their blockers
|
||||
//Ex : Cockatrice
|
||||
class AOldSchoolDeathtouch:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
MTGCardInstance * opponents[20];
|
||||
int nbOpponents;
|
||||
AOldSchoolDeathtouch(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
@@ -1170,7 +1169,7 @@ public:
|
||||
|
||||
//Converts a card to a creature (Aura)
|
||||
class AConvertToCreatureAura:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
AConvertToCreatureAura(int _id, MTGCardInstance * _source, MTGCardInstance * _target, int _power, int _toughness):MTGAbility(_id, _source, _target){
|
||||
_target->setSubtype("creature");
|
||||
_target->power = _power;
|
||||
@@ -1188,7 +1187,7 @@ public:
|
||||
};
|
||||
|
||||
/*
|
||||
Specific Classes
|
||||
Specific Classes
|
||||
*/
|
||||
|
||||
// 1092 Specific to Aladdin's Lamp
|
||||
@@ -1253,7 +1252,7 @@ class AAladdinsLamp: public TargetAbility{
|
||||
|
||||
//Ankh of Mishra
|
||||
class AAnkhOfMishra: public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int playerLands[2];
|
||||
AAnkhOfMishra(int id, MTGCardInstance * _source):MTGAbility(id, _source){
|
||||
for (int i=0; i< 2; i++){
|
||||
@@ -1276,7 +1275,7 @@ public:
|
||||
|
||||
// Armageddon Clock
|
||||
class AArmageddonClock:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int counters;
|
||||
ManaCost cost;
|
||||
AArmageddonClock(int id, MTGCardInstance * _source):MTGAbility(id, _source){
|
||||
@@ -1315,7 +1314,7 @@ public:
|
||||
|
||||
//Black Vise
|
||||
class ABlackVise: public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int nbcards;
|
||||
ABlackVise(int id, MTGCardInstance * _source):MTGAbility(id, _source){
|
||||
nbcards = game->opponent()->game->hand->nb_cards;
|
||||
@@ -1334,7 +1333,7 @@ public:
|
||||
|
||||
//Channel
|
||||
class AChannel:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
|
||||
AChannel(int _id, MTGCardInstance * card):ActivatedAbility(_id, card,0,0,0){
|
||||
}
|
||||
@@ -1363,7 +1362,7 @@ public:
|
||||
|
||||
// Clockwork Beast
|
||||
class AClockworkBeast:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int counters;
|
||||
ManaCost cost;
|
||||
AClockworkBeast(int id, MTGCardInstance * _source):MTGAbility(id, _source){
|
||||
@@ -1402,7 +1401,7 @@ public:
|
||||
|
||||
//1102: Conservator
|
||||
class AConservator: public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int canprevent;
|
||||
ManaCost cost;
|
||||
AConservator(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
@@ -1470,7 +1469,7 @@ public:
|
||||
|
||||
//Creature bond
|
||||
class ACreatureBond:public TriggeredAbility{
|
||||
public:
|
||||
public:
|
||||
int resolved;
|
||||
ACreatureBond(int _id, MTGCardInstance * _source, MTGCardInstance * _target):TriggeredAbility(_id,_source,_target){
|
||||
resolved = 1;
|
||||
@@ -1503,7 +1502,7 @@ public:
|
||||
|
||||
//1105: Dingus Egg
|
||||
class ADingusEgg: public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int playerLands[2];
|
||||
ADingusEgg(int id, MTGCardInstance * _source):MTGAbility(id, _source){
|
||||
for (int i=0; i< 2; i++){
|
||||
@@ -1526,7 +1525,7 @@ public:
|
||||
|
||||
//1106 DisruptingScepter
|
||||
class ADisruptingScepter:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
ADisruptingScepter(int id, MTGCardInstance * _source):TargetAbility(id,_source){
|
||||
MTGGameZone * zones[] = {GameObserver::GetInstance()->opponent()->game->hand};
|
||||
tc = NEW TargetZoneChooser(zones,1,_source);
|
||||
@@ -1558,7 +1557,7 @@ public:
|
||||
|
||||
//1108 Ebony Horse
|
||||
class AEbonyHorse:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
|
||||
AEbonyHorse(int _id, MTGCardInstance * _source):TargetAbility(_id,_source, NEW CreatureTargetChooser()){
|
||||
int _cost[] = {MTG_COLOR_ARTIFACT, 2};
|
||||
@@ -1574,7 +1573,7 @@ public:
|
||||
|
||||
//1345 Farmstead
|
||||
class AFarmstead:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
AFarmstead(int _id, MTGCardInstance * source, MTGCardInstance * _target):ActivatedAbility(_id, source,0,1,0){
|
||||
int _cost[] = {MTG_COLOR_WHITE, 2};
|
||||
cost = NEW ManaCost(_cost,1);
|
||||
@@ -1596,7 +1595,7 @@ public:
|
||||
|
||||
//1110 Glasses of Urza
|
||||
class AGlassesOfUrza:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
CardDisplay * display;
|
||||
AGlassesOfUrza(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
display = NEW CardDisplay(0, game,SCREEN_WIDTH/2, SCREEN_HEIGHT/2,NULL);
|
||||
@@ -1644,7 +1643,7 @@ public:
|
||||
|
||||
//1112 Howling Mine
|
||||
class AHowlingMine:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
AHowlingMine(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){}
|
||||
|
||||
void Update(float dt){
|
||||
@@ -1656,7 +1655,7 @@ public:
|
||||
|
||||
//1119 Jayemdae Tome
|
||||
class AJayemdaeTome:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
AJayemdaeTome(int _id, MTGCardInstance * card):ActivatedAbility(_id, card){
|
||||
int _cost[] = {MTG_COLOR_ARTIFACT, 4};
|
||||
cost = NEW ManaCost(_cost,1);
|
||||
@@ -1671,7 +1670,7 @@ public:
|
||||
|
||||
//Living Artifact
|
||||
class ALivingArtifact:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int usedThisTurn;
|
||||
int counters;
|
||||
Damage * latest;
|
||||
@@ -1711,7 +1710,7 @@ public:
|
||||
|
||||
//Lord of the Pit
|
||||
class ALordOfThePit: public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
int paidThisTurn;
|
||||
ALordOfThePit(int _id, MTGCardInstance * source):TargetAbility(_id, source, NEW CreatureTargetChooser(),0,1,0){
|
||||
paidThisTurn = 1;
|
||||
@@ -1746,7 +1745,7 @@ public:
|
||||
};
|
||||
//1143 Animate Dead
|
||||
class AAnimateDead:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
AAnimateDead(int _id, MTGCardInstance * _source, MTGCardInstance * _target):MTGAbility(_id, _source, _target){
|
||||
MTGCardInstance * card = _target;
|
||||
card->power--;
|
||||
@@ -1769,7 +1768,7 @@ public:
|
||||
|
||||
//1144 Bad Moon, 1341 Crusade
|
||||
class ABadMoon:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
int color;
|
||||
ABadMoon(int _id, MTGCardInstance * _source, int _color = MTG_COLOR_BLACK):ListMaintainerAbility(_id, _source),color(_color){
|
||||
}
|
||||
@@ -1796,7 +1795,7 @@ public:
|
||||
|
||||
//1159 Erg Raiders
|
||||
class AErgRaiders:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int init;
|
||||
int dealDamage;
|
||||
AErgRaiders(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
@@ -1825,7 +1824,7 @@ public:
|
||||
|
||||
//Fastbond
|
||||
class AFastbond:public TriggeredAbility{
|
||||
public:
|
||||
public:
|
||||
int alreadyPlayedALand;
|
||||
AFastbond(int _id, MTGCardInstance * card):TriggeredAbility(_id, card){
|
||||
alreadyPlayedALand = 0;
|
||||
@@ -1857,7 +1856,7 @@ public:
|
||||
|
||||
//1165 Hypnotic Specter
|
||||
class AHypnoticSpecter:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int nbdamagesthisturn[2];
|
||||
AHypnoticSpecter(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
currentPhase = -1;
|
||||
@@ -1904,7 +1903,7 @@ public:
|
||||
|
||||
//1117 Jandor's Ring
|
||||
class AJandorsRing:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
AJandorsRing(int _id, MTGCardInstance * _source):ActivatedAbility(_id,_source, NEW ManaCost()){
|
||||
cost->add(MTG_COLOR_ARTIFACT, 2);
|
||||
}
|
||||
@@ -1926,7 +1925,7 @@ public:
|
||||
//Kudzu.
|
||||
//What happens when there are no targets ???
|
||||
class AKudzu: public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
int previouslyTapped;
|
||||
AKudzu(int _id, MTGCardInstance * card, MTGCardInstance * _target):TargetAbility(_id,card, NEW TypeTargetChooser("land",card)){
|
||||
tc->toggleTarget(_target);
|
||||
@@ -1962,7 +1961,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
int reactToClick(MTGCardInstance * card){
|
||||
if (!waitingForAnswer) {
|
||||
}else{
|
||||
@@ -2003,7 +2002,7 @@ public:
|
||||
|
||||
//Millstone
|
||||
class AMillstone:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
AMillstone(int _id, MTGCardInstance * card):TargetAbility(_id,card, NEW PlayerTargetChooser(), NEW ManaCost()){
|
||||
cost->add(MTG_COLOR_ARTIFACT, 2);
|
||||
}
|
||||
@@ -2023,7 +2022,7 @@ public:
|
||||
|
||||
//1170: Nightmare
|
||||
class ANightmare:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
ANightmare(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
|
||||
@@ -2050,7 +2049,7 @@ public:
|
||||
|
||||
//1172 Pestilence
|
||||
class APestilence: public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
APestilence(int _id, MTGCardInstance * card):ActivatedAbility(_id, card, NEW ManaCost(), 0,0){
|
||||
cost->add(MTG_COLOR_BLACK, 1);
|
||||
}
|
||||
@@ -2078,7 +2077,7 @@ public:
|
||||
|
||||
//Plague Rats and similar. Power and toughness equal to number of cards that share a name
|
||||
class APlagueRats:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
string name;
|
||||
APlagueRats(int _id, MTGCardInstance * _source, const char * _name):ListMaintainerAbility(_id,_source){
|
||||
name = _name;
|
||||
@@ -2109,7 +2108,7 @@ public:
|
||||
|
||||
//Power Leak
|
||||
class APowerLeak:public TriggeredAbility{
|
||||
public:
|
||||
public:
|
||||
int damagesToDealThisTurn;
|
||||
ManaCost cost;
|
||||
APowerLeak(int _id, MTGCardInstance * _source, MTGCardInstance * _target):TriggeredAbility(_id, _source, _target){
|
||||
@@ -2156,7 +2155,7 @@ public:
|
||||
|
||||
//Power Surge
|
||||
class APowerSurge:public TriggeredAbility{
|
||||
public:
|
||||
public:
|
||||
int totalLands;
|
||||
APowerSurge(int _id, MTGCardInstance * _source):TriggeredAbility(_id,_source){
|
||||
totalLands = 0;
|
||||
@@ -2189,7 +2188,7 @@ public:
|
||||
|
||||
//1175 Royal Assassin
|
||||
class ARoyalAssassin:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
|
||||
ARoyalAssassin(int _id, MTGCardInstance * _source):TargetAbility(_id,_source, NEW CreatureTargetChooser()){
|
||||
}
|
||||
@@ -2208,7 +2207,7 @@ public:
|
||||
|
||||
//1176 Sacrifice
|
||||
class ASacrifice:public InstantAbility{
|
||||
public:
|
||||
public:
|
||||
ASacrifice(int _id, MTGCardInstance * _source, MTGCardInstance * _target):InstantAbility(_id, _source){
|
||||
target = _target;
|
||||
}
|
||||
@@ -2227,7 +2226,7 @@ public:
|
||||
|
||||
//1178 Scavenging Ghoul
|
||||
class AScavengingGhoul:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int counters;
|
||||
AScavengingGhoul(int _id, MTGCardInstance * _source, MTGCardInstance * _target):MTGAbility(_id, _source, _target){
|
||||
counters = 0;
|
||||
@@ -2256,7 +2255,7 @@ public:
|
||||
|
||||
//1218 Psychic Venom
|
||||
class APsychicVenom:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int tapped;
|
||||
APsychicVenom(int _id, MTGCardInstance * _source, MTGCardInstance * _target):MTGAbility(_id, _source,_target){
|
||||
tapped = _target->tapped;
|
||||
@@ -2275,7 +2274,7 @@ public:
|
||||
|
||||
//1221 Serendib Efreet
|
||||
class ASerendibEfreet:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
ASerendibEfreet(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
}
|
||||
|
||||
@@ -2289,7 +2288,7 @@ public:
|
||||
|
||||
//1235 Aspect of Wolf
|
||||
class AAspectOfWolf:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
int color;
|
||||
AAspectOfWolf(int _id, MTGCardInstance * _source, MTGCardInstance * _target):ListMaintainerAbility(_id, _source, _target){
|
||||
}
|
||||
@@ -2326,7 +2325,7 @@ public:
|
||||
|
||||
//1276 Wanderlust, 1148 Cursed Lands
|
||||
class AWanderlust:public TriggeredAbility{
|
||||
public:
|
||||
public:
|
||||
AWanderlust(int _id, MTGCardInstance * _source, MTGCardInstance * _target):TriggeredAbility(_id,_source, _target){}
|
||||
|
||||
int trigger(){
|
||||
@@ -2344,7 +2343,7 @@ public:
|
||||
|
||||
//1280 Atog
|
||||
class AAtog:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
Player * currentController;
|
||||
int counters;
|
||||
AAtog(int _id, MTGCardInstance * _source):TargetAbility(_id, _source,NULL, NULL, 0,0){
|
||||
@@ -2386,7 +2385,7 @@ public:
|
||||
|
||||
//1284 Dragon Whelp
|
||||
class ADragonWhelp: public APowerToughnessModifierUntilEndOfTurn{
|
||||
public:
|
||||
public:
|
||||
ADragonWhelp(int id, MTGCardInstance * card):APowerToughnessModifierUntilEndOfTurn(id, card, card, 1, 0, NEW ManaCost()){
|
||||
cost->add(MTG_COLOR_RED, 1);
|
||||
}
|
||||
@@ -2402,7 +2401,7 @@ public:
|
||||
|
||||
//1288 EarthBind
|
||||
class AEarthbind:public ABasicAbilityModifier{
|
||||
public:
|
||||
public:
|
||||
AEarthbind(int _id, MTGCardInstance * _source, MTGCardInstance * _target):ABasicAbilityModifier(_id,_source,_target,FLYING,0){
|
||||
if (value_before_modification) game->mLayers->stackLayer()->addDamage(source,target,2);
|
||||
}
|
||||
@@ -2410,7 +2409,7 @@ public:
|
||||
|
||||
//1291 Fireball
|
||||
class AFireball:public InstantAbility{
|
||||
public:
|
||||
public:
|
||||
AFireball(int _id, MTGCardInstance * card, Spell * spell, int x):InstantAbility(_id, card){
|
||||
int nbtargets = spell->cursor;
|
||||
int totaldamage = x+1-nbtargets;
|
||||
@@ -2425,7 +2424,7 @@ public:
|
||||
|
||||
//1245 ForceOfNature
|
||||
class AForceOfNature:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
int dealDamageThisTurn;
|
||||
AForceOfNature(int _id, MTGCardInstance * card):ActivatedAbility(_id,card, NEW ManaCost(),1,0){
|
||||
dealDamageThisTurn = 0;
|
||||
@@ -2455,7 +2454,7 @@ public:
|
||||
|
||||
//1301 KeldonWarlord
|
||||
class AKeldonWarlord:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
AKeldonWarlord(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
|
||||
@@ -2480,7 +2479,7 @@ public:
|
||||
|
||||
//1302 : Kird Ape
|
||||
class AKirdApe:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int init;
|
||||
AKirdApe(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
init = 0;
|
||||
@@ -2505,7 +2504,7 @@ public:
|
||||
|
||||
//1309 Orcish Artilery
|
||||
class AOrcishArtillery: public ADamager{
|
||||
public:
|
||||
public:
|
||||
AOrcishArtillery(int _id,MTGCardInstance * card): ADamager(_id, card, NEW ManaCost(), 2){
|
||||
}
|
||||
|
||||
@@ -2519,7 +2518,7 @@ public:
|
||||
|
||||
//1310 Orcish Oriflame
|
||||
class AOrcishOriflame:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
int color;
|
||||
AOrcishOriflame(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
@@ -2543,7 +2542,7 @@ public:
|
||||
|
||||
//1334 Castle
|
||||
class ACastle:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
ACastle(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
|
||||
@@ -2566,7 +2565,7 @@ public:
|
||||
|
||||
//1351 Island Sanctuary
|
||||
class AIslandSanctuary:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int initThisTurn;
|
||||
AIslandSanctuary(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
initThisTurn = 0;
|
||||
@@ -2603,7 +2602,7 @@ public:
|
||||
|
||||
//1352 Karma
|
||||
class AKarma: public TriggeredAbility{
|
||||
public:
|
||||
public:
|
||||
AKarma(int _id, MTGCardInstance * _source):TriggeredAbility(_id, _source){
|
||||
}
|
||||
|
||||
@@ -2625,7 +2624,7 @@ public:
|
||||
|
||||
//1355 Norther Paladin
|
||||
class ANorthernPaladin:public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
ANorthernPaladin(int _id, MTGCardInstance * card):TargetAbility(_id, card){
|
||||
int _cost[] = {MTG_COLOR_WHITE, 2};
|
||||
cost = NEW ManaCost(_cost,1);
|
||||
@@ -2646,7 +2645,7 @@ public:
|
||||
|
||||
//Sedge Troll
|
||||
class ASedgeTroll:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int init;
|
||||
ASedgeTroll(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
init = 0;
|
||||
@@ -2671,7 +2670,7 @@ public:
|
||||
|
||||
//Soul Net
|
||||
class ASoulNet:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
PutInGraveyard * latest;
|
||||
PutInGraveyard * newDead;
|
||||
ASoulNet(int _id, MTGCardInstance * card):ActivatedAbility(_id, card,0,0,0){
|
||||
@@ -2697,7 +2696,7 @@ public:
|
||||
|
||||
//Stasis
|
||||
class AStasis:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
int paidThisTurn;
|
||||
AStasis(int _id, MTGCardInstance * card):ActivatedAbility(_id,card, NEW ManaCost(),1,0){
|
||||
paidThisTurn = 1;
|
||||
@@ -2745,7 +2744,7 @@ public:
|
||||
//--------------Addon Abra------------------
|
||||
//ShieldOfTheAge
|
||||
class AShieldOfTheAge: public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
AShieldOfTheAge(int _id, MTGCardInstance * card):TargetAbility(_id,card,NEW DamageTargetChooser(card,_id),NEW ManaCost(),0,0){
|
||||
cost->add(MTG_COLOR_ARTIFACT,2);
|
||||
}
|
||||
@@ -2760,7 +2759,7 @@ public:
|
||||
|
||||
// People of the Woods
|
||||
class APeopleOfTheWoods:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
APeopleOfTheWoods(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
|
||||
@@ -2783,7 +2782,7 @@ public:
|
||||
|
||||
//Abomination Kill blocking creature if white or green
|
||||
class AAbomination :public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
MTGCardInstance * opponents[20];
|
||||
int nbOpponents;
|
||||
AAbomination (int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
||||
@@ -2819,7 +2818,7 @@ public:
|
||||
|
||||
// GiveLifeForTappedType
|
||||
class AGiveLifeForTappedType:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
char type[20];
|
||||
int nbtypestapped;
|
||||
|
||||
@@ -2850,7 +2849,7 @@ public:
|
||||
|
||||
//Minion of Leshrac
|
||||
class AMinionofLeshrac: public TargetAbility{
|
||||
public:
|
||||
public:
|
||||
int paidThisTurn;
|
||||
AMinionofLeshrac(int _id, MTGCardInstance * source):TargetAbility(_id, source, NEW CreatureTargetChooser(),0,1,0){
|
||||
paidThisTurn = 1;
|
||||
@@ -2887,7 +2886,7 @@ public:
|
||||
|
||||
//2703 Lost Order of Jarkeld
|
||||
class ALostOrderofJarkeld:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
ALostOrderofJarkeld(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
|
||||
@@ -2914,7 +2913,7 @@ public:
|
||||
|
||||
//CreaturePowerToughnessModifierForAllTypeControlled
|
||||
class ACreaturePowerToughnessModifierForAllTypeControlled:public ListMaintainerAbility{
|
||||
public:
|
||||
public:
|
||||
char type[20];
|
||||
ACreaturePowerToughnessModifierForAllTypeControlled(int _id, MTGCardInstance * _source, const char * _type):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
@@ -2941,7 +2940,7 @@ public:
|
||||
//GenericKirdApe
|
||||
//Erwan 2008/11/15 : this cannot work as type is never initialized...
|
||||
class AGenericKirdApe:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int init;
|
||||
char type [20];
|
||||
int power;
|
||||
@@ -2970,7 +2969,7 @@ public:
|
||||
|
||||
//Rampage ability Tentative 2
|
||||
class ARampageAbility:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int nbOpponents;
|
||||
int PowerModifier;
|
||||
int ToughnessModifier;
|
||||
@@ -2996,7 +2995,7 @@ public:
|
||||
|
||||
//Rampage ability Tentative 1 - Did not work as expected
|
||||
class A1RampageAbility:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
MTGCardInstance * opponents[20];
|
||||
int nbOpponents;
|
||||
int PowerModifier;
|
||||
|
||||
@@ -21,7 +21,7 @@ using std::map;
|
||||
|
||||
|
||||
//Two stupid variables used to give a hint to the AI:
|
||||
// Should I cast a spell on an ennemy or friendly unit ?
|
||||
// Should I cast a spell on an enemy or friendly unit ?
|
||||
#define BAKA_EFFECT_GOOD 10
|
||||
#define BAKA_EFFECT_BAD 11
|
||||
|
||||
@@ -61,7 +61,7 @@ class TriggeredAbility:public MTGAbility{
|
||||
|
||||
|
||||
class ActivatedAbility:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
ManaCost * cost;
|
||||
int playerturnonly;
|
||||
int needsTapping;
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
};
|
||||
|
||||
class TargetAbility:public ActivatedAbility{
|
||||
public:
|
||||
public:
|
||||
TargetAbility(int id, MTGCardInstance * card, TargetChooser * _tc,ManaCost * _cost = NULL, int _playerturnonly = 0,int tap = 1);
|
||||
TargetAbility(int id, MTGCardInstance * card,ManaCost * _cost = NULL, int _playerturnonly = 0,int tap = 1);
|
||||
virtual void Update(float dt);
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
};
|
||||
|
||||
class InstantAbility:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
int init;
|
||||
virtual void Update(float dt);
|
||||
virtual int testDestroy();
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
|
||||
/* State based effects. This class works ONLY for InPlay and needs to be extended for other areas of the game !!! */
|
||||
class ListMaintainerAbility:public MTGAbility{
|
||||
public:
|
||||
public:
|
||||
map<MTGCardInstance *,bool> cards;
|
||||
ListMaintainerAbility(int _id):MTGAbility(_id,NULL){};
|
||||
ListMaintainerAbility(int _id, MTGCardInstance *_source):MTGAbility(_id, _source){};
|
||||
@@ -119,14 +119,14 @@ class MTGAbilityBasicFeatures{
|
||||
};
|
||||
|
||||
class Trigger:public MTGAbilityBasicFeatures{
|
||||
public:
|
||||
public:
|
||||
virtual int trigger()=0;
|
||||
virtual int testDestroy(){return 0;};
|
||||
};
|
||||
|
||||
|
||||
class TriggerAtPhase:public Trigger{
|
||||
public:
|
||||
public:
|
||||
int currentPhase, newPhase;
|
||||
int phaseId;
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
};
|
||||
|
||||
class TriggerNextPhase:public TriggerAtPhase{
|
||||
public:
|
||||
public:
|
||||
int destroyActivated;
|
||||
TriggerNextPhase(int _phaseId);
|
||||
|
||||
@@ -145,12 +145,12 @@ public:
|
||||
};
|
||||
|
||||
class TriggeredEvent:public MTGAbilityBasicFeatures{
|
||||
public:
|
||||
public:
|
||||
virtual int resolve()=0;
|
||||
};
|
||||
|
||||
class DrawEvent:public TriggeredEvent{
|
||||
public:
|
||||
public:
|
||||
Player * player;
|
||||
int nbcards;
|
||||
DrawEvent(Player * _player, int _nbcards);
|
||||
@@ -158,18 +158,18 @@ public:
|
||||
};
|
||||
|
||||
class BuryEvent: public TriggeredEvent{
|
||||
public:
|
||||
public:
|
||||
int resolve();
|
||||
};
|
||||
|
||||
class DestroyCondition:public MTGAbilityBasicFeatures{
|
||||
public:
|
||||
public:
|
||||
virtual int testDestroy();
|
||||
};
|
||||
|
||||
|
||||
class GenericTriggeredAbility:public TriggeredAbility{
|
||||
public:
|
||||
public:
|
||||
Trigger * t;
|
||||
TriggeredEvent * te;
|
||||
DestroyCondition * dc;
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
|
||||
/* Ability Factory */
|
||||
class AbilityFactory{
|
||||
private:
|
||||
private:
|
||||
int destroyAllInPlay(TargetChooser * tc, int bury = 0);
|
||||
int putInPlayFromZone(MTGCardInstance * card, MTGGameZone * zone, Player * p);
|
||||
Trigger * parseTrigger(string magicText);
|
||||
|
||||
Reference in New Issue
Block a user