Files
wagic/projects/mtg/include/Counters.h
omegablast2002@yahoo.com fbebcd681e added a new aihint #HINT:dontattackwith(targetchooser)
which tells the ai not to use the targetible cards as attackers, this can be card names, and CD modes.

modified the way ai handles multikicker. it will not be casting 1/1 joragas anymore :D

made WParsedInt ignore "+" signs....

added a new affinity ability...autohand=affinity(creature[vampire]|mygraveyard) ....
this is essentially affinity for creatures in your grave.

added supkeyword to clone clone addtype(zombie)....it adds the type listed to the cards types on clone...

reparse PT bonus on resolve.

reworked bushido, it should now work correctly...aside from that it now excepts word variables...fumiko is now bushido(type:creature[attacking]:battlefield/type:creature[attacking]:battlefield)

added a keyword to access acontrolsteal..the keyword is "steal"
auto=ueot steal target(creature) 

reworked persist to handle undying..added the new counter handling rules intruduced by wotc in ISD


added a vector cardsAbilities to mtgcardinstance...this keeps the abilities added to the game for a card to use stored where we can easly alter or remove them.

added an automatic increase to geteff return if the ability is a putinplay ability.

finished coding support for flip and double sided cards, though viewing the "other side" is still not possible yet.
the ability follows the mtg rules.
the ability syntax is flip(card name)...a card can flip into any other card by name...even flip into itself.

added a "canPay() call for Ninja cost...to prevent it from coming up in a menu unless you're in blockers....

added 3 new restriction types that work very similar to type(
thisturn(tc)~morethan~2
lastturn(tc)~lessthan~thisturn(tc)
compare(wordvarible)~equalto~compare(wordvarible)

these are pretty self explanitory.

moved "&&" ability parsing below "this(" allowing "this(" to grant abilities now which contain &&...enclave egologist bug is fixed by this.

fixed an issue with combatspirit link for some reason the way i was doing the bool was not always working.

took care of the todo for AProtectionFrom...you can now give a protection from(blah) in a instant or ueot ability.

added altho very limited right now a "targetedplayer" tc word. i hope to increase this with time.

as always my sidekick doc already has some cards coded for this and test will follow the addition of the cards.
2012-01-31 14:07:40 +00:00

47 lines
1.4 KiB
C++

#ifndef _COUNTERS_H_
#define _COUNTERS_H_
#include <string>
using std::string;
class MTGCardInstance;
/* One family of counters. Ex : +1/+1 */
class Counter
{
public:
string name;
int nb;
int maxNb;
int power, toughness;
MTGCardInstance * target;
Counter(MTGCardInstance * _target, int _power, int _toughness);
Counter(MTGCardInstance * _target, const char * _name, int _power = 0, int _toughness = 0);
int init(MTGCardInstance * _target, const char * _name, int _power, int _toughness);
bool sameAs(const char * _name, int _power, int _toughness);
bool cancels(int _power, int _toughness);
int cancelCounter(int power, int toughness);
int added();
int removed();
};
/* Various families of counters attached to an instance of a card */
class Counters
{
public:
int mCount;
vector<Counter *>counters;
MTGCardInstance * target;
Counters(MTGCardInstance * _target);
~Counters();
int addCounter(const char * _name, int _power = 0, int _toughness = 0);
int addCounter(int _power, int _toughness);
int removeCounter(const char * _name, int _power = 0, int _toughness = 0);
int removeCounter(int _power, int _toughness);
Counter * hasCounter(const char * _name, int _power = 0, int _toughness = 0);
Counter * hasCounter(int _power, int _toughness);
Counter * getNext(Counter * previous = NULL);
int init();
};
#endif