Two example codes:
[card]
name=Alabaster Leech
auto=lord(*[white]|myhand) white:+1
autoexile=all(*|myhand) resetcost
autograveyard=all(*|myhand) resetcost
autohand=all(*|myhand) resetcost
autolibrary=all(*|myhand) resetcost
text=White spells you cast cost {W} more to cast.
mana={W}
type=Creature
subtype=Leech
power=1
toughness=3
[/card]
[card]
name=Helm of Awakening
auto=lord(*|myhand) colorless:-1
auto=lord(*|opponenthand) colorless:-1
autoexile=all(*|myhand) resetcost
autograveyard=all(*|myhand) resetcost
autohand=all(*|myhand) resetcost
autolibrary=all(*|myhand) resetcost
text=Spells cost {1} less to cast.
mana={2}
type=Artifact
[/card]
autoexile=all(*|myhand) resetcost
autograveyard=all(*|myhand) resetcost
autohand=all(*|myhand) resetcost
autolibrary=all(*|myhand) resetcost
----> This code section is necessary, because manacost altering cards will keep their effect even when they have left the battlefield. RESETCOST erases all alterations which have no existing source on the battlefield anymore.
2) Added the new keyword TRANSFORM, which is similar to BECOMES. The main difference is that you can change single parameters of a permanent (color,type,...).
Example codes:
[card]
name=Memnarch
auto={1}{U}{U}:target(*) transforms(artifact)
auto={3}{U}:moveTo(myBattlefield) target(arifact)
text={1}{U}{U}: Target permanent becomes an artifact in addition to its other types. (This effect lasts indefinitely.) -- {3}{U}: Gain control of target artifact. (This effect lasts indefinitely.)
mana={7}
type=Legendary Artifact Creature
subtype=Wizard
power=4
toughness=5
[/card]
[card]
name=Dralnu's Crusade
auto=lord(goblin) 1/1
auto=lord(goblin) transforms(zombie,black)
text=Goblin creatures get +1/+1. -- All Goblins are black and are Zombies in addition to their other creature types.
mana={1}{B}{R}
type=Enchantment
[/card]
Important notes concerning TRANSFORM:
- IF YOU TARGET A CREATURE THE EFFECT IS PERMINENT.
- IF YOU TARGET THE SOURCE THE EFFECT IS UNTIL END OF TURN.
- IF YOU USE LORD THE EFFECT LAST TIL PERMINENT SOURCE LEAVES PLAY.
These restrictions will probably be changed in the near future!
3) Added 57 successfully tested cards.
Card list ---> first comment
4) Changed the name of several tokens: "()" used to cuase crashes when used in the name-line.
5) Added the new keyword NONBATTLEZONE for leaves play trigger optimizing. It can be used to replace the phrase "EXILE,GRAVEYARD,HAND,LIBRARY".
I will add tests for test suite in one of the next revisions!!
####### TEST SUITE PROVEN ########
83 lines
1.7 KiB
C++
83 lines
1.7 KiB
C++
#ifndef _CARDPRIMITIVE_H_
|
|
#define _CARDPRIMITIVE_H_
|
|
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <map>
|
|
|
|
#include "ManaCost.h"
|
|
|
|
using namespace std;
|
|
|
|
class CardPrimitive {
|
|
protected:
|
|
vector<string> ftdText;
|
|
string lcname;
|
|
ManaCost manaCost;
|
|
|
|
public:
|
|
string text;
|
|
string name;
|
|
int init();
|
|
|
|
int colors[Constants::MTG_NB_COLORS];
|
|
map<int,int> basicAbilities;
|
|
map<string,string> magicTexts;
|
|
string magicText;
|
|
int alias;
|
|
string spellTargetType;
|
|
int power;
|
|
int toughness;
|
|
vector<int>types;
|
|
CardPrimitive();
|
|
CardPrimitive(CardPrimitive * source);
|
|
|
|
void setColor(int _color, int removeAllOthers = 0);
|
|
void setColor(string _color, int removeAllOthers = 0);
|
|
void removeColor(int color);
|
|
int getColor();
|
|
int hasColor(int _color);
|
|
int countColors();
|
|
|
|
int has(int ability);
|
|
|
|
void setText(const string& value);
|
|
const char * getText();
|
|
|
|
void addMagicText(string value);
|
|
void addMagicText(string value, string zone);
|
|
|
|
void setName(const string& value);
|
|
const string getName() const;
|
|
const string getLCName() const;
|
|
|
|
void addType(char * type_text);
|
|
void addType(int id);
|
|
void setType(const string& type_text);
|
|
void setSubtype(const string& value);
|
|
int removeType(string value, int removeAll = 0);
|
|
int removeType(int value, int removeAll = 0);
|
|
bool hasSubtype(int _subtype);
|
|
bool hasSubtype(const char * _subtype);
|
|
bool hasSubtype(string _subtype);
|
|
bool hasType(int _type);
|
|
bool hasType(const char * type);
|
|
|
|
void setManaCost(string value);
|
|
ManaCost * getManaCost();
|
|
bool isCreature();
|
|
bool isLand();
|
|
bool isSpell();
|
|
|
|
void setPower(int _power);
|
|
int getPower();
|
|
void setToughness(int _toughness);
|
|
int getToughness();
|
|
|
|
const vector<string>& formattedText();
|
|
};
|
|
|
|
|
|
#endif
|