This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
#ifndef _MTGABILITY_H_
|
#ifndef _MTGABILITY_H_
|
||||||
#define _MTGABILITY_H_
|
#define _MTGABILITY_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MTGCardInstance;
|
class MTGCardInstance;
|
||||||
class Spell;
|
class Spell;
|
||||||
class Damageable;
|
class Damageable;
|
||||||
@@ -40,7 +38,8 @@ using std::map;
|
|||||||
#define PARSER_FOREACH 2
|
#define PARSER_FOREACH 2
|
||||||
#define PARSER_ASLONGAS 3
|
#define PARSER_ASLONGAS 3
|
||||||
|
|
||||||
class MTGAbility: public ActionElement{
|
class MTGAbility: public ActionElement
|
||||||
|
{
|
||||||
protected:
|
protected:
|
||||||
char menuText[50];
|
char menuText[50];
|
||||||
|
|
||||||
@@ -79,7 +78,8 @@ class MTGAbility: public ActionElement{
|
|||||||
|
|
||||||
/*Poor man's casting */
|
/*Poor man's casting */
|
||||||
/* Todo replace that crap with dynamic casting */
|
/* Todo replace that crap with dynamic casting */
|
||||||
enum {
|
enum
|
||||||
|
{
|
||||||
UNKNOWN = 0,
|
UNKNOWN = 0,
|
||||||
MANA_PRODUCER = 1,
|
MANA_PRODUCER = 1,
|
||||||
MTG_ATTACK_RULE = 2,
|
MTG_ATTACK_RULE = 2,
|
||||||
@@ -106,18 +106,18 @@ class MTGAbility: public ActionElement{
|
|||||||
TAPPER = 23,
|
TAPPER = 23,
|
||||||
LIFER = 24,
|
LIFER = 24,
|
||||||
CLONING = 25,
|
CLONING = 25,
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class NestedAbility{
|
class NestedAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
MTGAbility* ability;
|
MTGAbility* ability;
|
||||||
NestedAbility(MTGAbility* _ability);
|
NestedAbility(MTGAbility* _ability);
|
||||||
};
|
};
|
||||||
|
|
||||||
class TriggeredAbility:public MTGAbility{
|
class TriggeredAbility:public MTGAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
TriggeredAbility(int id, MTGCardInstance* card);
|
TriggeredAbility(int id, MTGCardInstance* card);
|
||||||
TriggeredAbility(int id, MTGCardInstance* _source, Targetable* _target);
|
TriggeredAbility(int id, MTGCardInstance* _source, Targetable* _target);
|
||||||
@@ -132,7 +132,8 @@ class TriggeredAbility:public MTGAbility{
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ActivatedAbility:public MTGAbility{
|
class ActivatedAbility:public MTGAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum {
|
enum {
|
||||||
NO_RESTRICTION = 0,
|
NO_RESTRICTION = 0,
|
||||||
@@ -199,7 +200,8 @@ class ActivatedAbility:public MTGAbility{
|
|||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TargetAbility:public ActivatedAbility, public NestedAbility{
|
class TargetAbility:public ActivatedAbility, public NestedAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
TargetAbility(int id, MTGCardInstance* card, TargetChooser* _tc,ManaCost* _cost = NULL, int _playerturnonly = 0,int tap = 1);
|
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);
|
TargetAbility(int id, MTGCardInstance* card,ManaCost* _cost = NULL, int _playerturnonly = 0,int tap = 1);
|
||||||
@@ -213,7 +215,8 @@ class TargetAbility:public ActivatedAbility, public NestedAbility{
|
|||||||
~TargetAbility();
|
~TargetAbility();
|
||||||
};
|
};
|
||||||
|
|
||||||
class InstantAbility:public MTGAbility{
|
class InstantAbility:public MTGAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
int init;
|
int init;
|
||||||
virtual void Update(float dt);
|
virtual void Update(float dt);
|
||||||
@@ -226,7 +229,8 @@ class InstantAbility:public MTGAbility{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* State based effects. This class works ONLY for InPlay and needs to be extended for other areas of the game !!! */
|
/* State based effects. This class works ONLY for InPlay and needs to be extended for other areas of the game !!! */
|
||||||
class ListMaintainerAbility:public MTGAbility{
|
class ListMaintainerAbility:public MTGAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
map<MTGCardInstance *,bool> cards;
|
map<MTGCardInstance *,bool> cards;
|
||||||
map<Player *,bool> players;
|
map<Player *,bool> players;
|
||||||
@@ -247,7 +251,8 @@ class ListMaintainerAbility:public MTGAbility{
|
|||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TriggerAtPhase:public TriggeredAbility{
|
class TriggerAtPhase:public TriggeredAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
int phaseId;
|
int phaseId;
|
||||||
int who;
|
int who;
|
||||||
@@ -257,7 +262,8 @@ class TriggerAtPhase:public TriggeredAbility{
|
|||||||
virtual TriggerAtPhase* clone() const;
|
virtual TriggerAtPhase* clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TriggerNextPhase:public TriggerAtPhase{
|
class TriggerNextPhase:public TriggerAtPhase
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
int destroyActivated;
|
int destroyActivated;
|
||||||
TriggerNextPhase(int id, MTGCardInstance* source, Targetable* target,int _phaseId, int who = 0);
|
TriggerNextPhase(int id, MTGCardInstance* source, Targetable* target,int _phaseId, int who = 0);
|
||||||
@@ -267,7 +273,8 @@ class TriggerNextPhase:public TriggerAtPhase{
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class GenericTriggeredAbility:public TriggeredAbility, public NestedAbility{
|
class GenericTriggeredAbility:public TriggeredAbility, public NestedAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
TriggeredAbility* t;
|
TriggeredAbility* t;
|
||||||
queue<Targetable *> targets;
|
queue<Targetable *> targets;
|
||||||
@@ -288,7 +295,8 @@ class GenericTriggeredAbility:public TriggeredAbility, public NestedAbility{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Ability Factory */
|
/* Ability Factory */
|
||||||
class AbilityFactory{
|
class AbilityFactory
|
||||||
|
{
|
||||||
private:
|
private:
|
||||||
int countCards(TargetChooser* tc, Player* player = NULL, int option = 0);
|
int countCards(TargetChooser* tc, Player* player = NULL, int option = 0);
|
||||||
TriggeredAbility* parseTrigger(string s, string magicText, int id, Spell* spell, MTGCardInstance *card, Targetable* target);
|
TriggeredAbility* parseTrigger(string s, string magicText, int id, Spell* spell, MTGCardInstance *card, Targetable* target);
|
||||||
@@ -316,17 +324,18 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ActivatedAbilityTP:public ActivatedAbility{
|
class ActivatedAbilityTP:public ActivatedAbility
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
int who;
|
int who;
|
||||||
ActivatedAbilityTP(int id, MTGCardInstance* card, Targetable* _target = NULL, ManaCost* cost=NULL, int doTap = 0, int who = TargetChooser::UNSET);
|
ActivatedAbilityTP(int id, MTGCardInstance* card, Targetable* _target = NULL, ManaCost* cost=NULL, int doTap = 0, int who = TargetChooser::UNSET);
|
||||||
Targetable* getTarget();
|
Targetable* getTarget();
|
||||||
};
|
};
|
||||||
|
|
||||||
class AManaProducer: public ActivatedAbilityTP{
|
class AManaProducer: public ActivatedAbilityTP
|
||||||
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
string menutext;
|
string menutext;
|
||||||
Player* controller;
|
Player* controller;
|
||||||
|
|
||||||
@@ -342,7 +351,5 @@ class AManaProducer: public ActivatedAbilityTP{
|
|||||||
virtual AManaProducer* clone() const;
|
virtual AManaProducer* clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "MTGCardInstance.h"
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user