Files
wagic/projects/mtg/include/MTGCardInstance.h
wagic.the.homebrew f87c703866 Erwan
- Added WEvent class, allows to send events to abilities
- Cards that change zones now becomes new objects (as specified in the Comprehensive rules). This should allow to fix lots of stupid bugs in the near future, but probably brings loads of new issues :(
2009-02-16 13:46:14 +00:00

110 lines
2.4 KiB
C++

#ifndef _MTG_CARD_INSTANCE_H_
#define _MTG_CARD_INSTANCE_H_
#include "MTGCard.h"
#include "MTGGameZones.h"
#include "MTGAbility.h"
#include "TexturesCache.h"
#include "ManaCost.h"
#include "Blocker.h"
#include "Damage.h"
#include "Targetable.h"
class MTGCardInstance;
class MTGPlayerCards;
class MTGAbility;
class MTGCard;
class TexturesCache;
class ManaCost;
class Blockers;
class CardDescriptor;
class Counters;
class MTGCardInstance: public MTGCard, public Damageable, public Targetable {
protected:
int untapping;
int nb_damages;
string sample;
int lifeOrig;
Blockers * blockers;
MTGPlayerCards * belongs_to;
MTGAbility * UntapBlockers[10];
void unband();
MTGCardInstance * getNextPartner();
void initMTGCI();
public:
bool isToken;
int stillInUse();
Player * lastController;
MTGGameZone * getCurrentZone();
MTGGameZone * previousZone;
MTGCardInstance * previous;
MTGCardInstance * next;
int doDamageTest;
int summoningSickness;
// The recommended method to test for summoning Sickness !
int hasSummoningSickness();
int changeController(Player * newcontroller);
MTGCardInstance * defenser;
float changedZoneRecently;
Player * owner;
Counters * counters;
int typeAsTarget(){return TARGET_CARD;}
int attacker;
MTGCardInstance * banding; // If belongs to a band when attacking
MTGCardInstance * target;
int tapped;
void addType(int type);
int canBlock();
int canBlock(MTGCardInstance * opponent);
int canAttack();
int afterDamage();
void setUntapping();
int isUntapping();
int has(int ability);
int cleanup();
int reset();
int isAttacker();
MTGCardInstance * isDefenser();
int toggleDefenser(MTGCardInstance * opponent);
int toggleAttacker();
MTGCard * model;
MTGCardInstance();
MTGCardInstance(MTGCard * card, MTGPlayerCards * _belongs_to);
Blockers * getBlockers();
void regenerate();
Player * controller();
JQuad * getIcon();
int initAttackersDefensers();
MTGCardInstance * getNextOpponent(MTGCardInstance * previous=NULL);
int nbOpponents();
~MTGCardInstance();
int addToToughness(int value);
int setToughness(int value);
CardDescriptor * protections[10];
int nbprotections;
int addProtection(CardDescriptor * cd);
int removeProtection(CardDescriptor *cd, int erase = 0);
int protectedAgainst(MTGCardInstance * card);
// in game
int isTapped();
void untap();
void tap();
int isInPlay();
void resetAllDamage();
JSample * getSample();
};
#endif