Files
wagic/projects/mtg/include/CardDescriptor.h
omegablast2002@yahoo.com 946df16af5 removed eradicate ability and replaced it with a far more flexable solution which is
added new card discriptor [share!variable!]
the variables for this so far are
name <---eradicate effect targetting
color <--radiance effect targetting
types <--the plague cycles

it is important to note that a target IS REQUIRED before this, meaning it has to be used below a target= or after the targetting of an && ability...otherwise it will simply default to the source cards variables.
this solution provides a much more generic version without sacrificing the effectiveness of the eradicate set which was limited only to eradicate style cards(which ALSO required a target)

coding exsample 
[card]
name=Eradicate
target=creature[-black]
auto=all(*[share!name!]|targetcontrollerhand) moveto(exile)
auto=all(*[share!name!]|targetcontrollerlibrary) moveto(exile)
auto=all(*[share!name!]|targetcontrollergraveyard)moveto(exile)
auto=all(*[share!name!]|targetcontrollerbattlefield) moveto(exile)
mana={2}{b}{b}
type=sorcery
[/card]

you will notice something strange above, for this change to work i had to fix the bug with "targetcontrollerBLAH" zone targetting...tho my fix was a patchwork fix, it does indeed provide the targets controller...we need to find the root cause of why initToZone is not returning the correct "target" variable to this function.
if the source does not have a target it defaults to source.
before it there was no target, which there never is a correct target returned as noted by the fact that 0 cards exist with targetcontroller zone targetting in WAGIC however theres a considerably large card pool for this.

enjoy :)
docs going to kill me for this lol.
2011-01-22 12:30:42 +00:00

65 lines
1.7 KiB
C++

/*
A Filter/Mask system for Card Instances to find cards matching specific settings such as color, type, etc...
*/
#ifndef _CARDDESCRIPTOR_H_
#define _CARDDESCRIPTOR_H_
#include "MTGCardInstance.h"
#include "MTGGameZones.h"
#include "Counters.h"
#define CD_OR 1
#define CD_AND 2
enum ENUM_COMPARISON_MODES
{
COMPARISON_NONE = 0, // Needs to remain 0 for quick if(comparison_mode) checks
COMPARISON_AT_MOST,
COMPARISON_AT_LEAST,
COMPARISON_EQUAL,
COMPARISON_GREATER,
COMPARISON_LESS,
COMPARISON_UNEQUAL
};
class CardDescriptor: public MTGCardInstance{
protected:
MTGCardInstance * match_or(MTGCardInstance * card);
MTGCardInstance * match_and(MTGCardInstance * card);
bool valueInRange(int comparisonMode, int value, int criterion);
public:
int mode;
int powerComparisonMode;
int toughnessComparisonMode;
int manacostComparisonMode;
int counterComparisonMode;
int convertedManacost; // might fit better into MTGCardInstance?
int anyCounter;
int init();
CardDescriptor();
void unsecureSetTapped(int i);
void unsecuresetfresh(int k);
void setisMultiColored(int w);
void setisBlackAndWhite(int w);
void setisRedAndBlue(int w);
void setisBlackAndGreen(int w);
void setisBlueAndGreen(int w);
void setisRedAndWhite(int w);
void setNegativeSubtype( string value);
int counterPower;
int counterToughness;
int counterNB;
string counterName;
MTGCardInstance * match(MTGCardInstance * card);
MTGCardInstance * match(MTGGameZone * zone);
MTGCardInstance * nextmatch(MTGGameZone * zone, MTGCardInstance * previous);
int nameComparisonMode;
int colorComparisonMode;
string compareName;
};
#endif