========================================
added a function to return the action element id by mtgcardinstance.
=======================================
refactored all 5 combat triggers to be handled in a single class, this change helps reduce the "bits and pieces" of trigger restrictions which some did support while others didnt, it also allows for easier editing and debugging if future code needs to be added to it.
refactored the parsing for the combat triggers also, so that a combat trigger can be built from a single object if it only contains "or"...amongst other reasons.
the new syntax is auto=@combat(blocking,attacking,turnlimited,once) source(TC) from(TC):effect...all the same words are still used, except they are now all included inside the combat(-----) this includes restrictions for the triggers. if a card still needs multiple triggers from some reason...it is still 100% allowed to have as many as you want, with whatever you want inside them...check updated primitive for examples.
the required sections are auto=@combat(atleast one trigger) source(TC):effect.
=========================================
moved the limitsperturn "limit:" from genericactivatedability up to its parent class activatedability, did this for the following reason
first rules correction, the previous method tracked uses on resolve, which is incorrect, it should count as the ability is fired and placed on the stack.
second, it keeps all the actiavted ability restrictions in the same place, this is the location we are checking summoning sickness, actived restrictions such as "myturnonly" ect. makes sense to handle it in the parent.
third, it allow any and all future activated abilities easy access to "limit:" if needed, it would only require adding a limit string to pass on construction to the child classes instead of recoding the same exact checks as genericactivated.
=======================================================
reworked "name(" so that it no longer is required to be used inside a "&&" ability, also it no longer will create a MTGAbility object with a false return. that was just dirty of me :/
enabled "name(" to replace the menutext of alternative cost.
"other={cost} name(holy cow)"
will display "holy cow" instead of "pay alternative cost", this change is nice because we ended up using "other" cost for WAY more then originally planned...now we can label it exactly what it should say when you click it.
======================================================
added a subtype keyword for powertoughnessmodifier so that you can basically switch on non-static variables for it...lifetotal/lifetotal nonstatic...PT can now except all word variables as i added reparsing of the ints, had to maintain old methods as ai needs them to decide what to do with them.
======================================================
removed the following extremely redundant classes
both ABecomes classes---atransformer has become far superior to it, i kept the "becomes(" parsing tho, and it will act exactly as it use to, except now it has access to most of the subkeywords of transforms...it also now allows word variables. and excepts "forever" as a tag. added "newcolor" subkeyword to transforms to create the "becomes(" adding a color without removing colors effect. "becomes(" now returns a constructor for ATransformer that emulates becomes( exactly as it worked before.
both forevertransformer classes, the only difference between the 2 was one subkeyword, and "forever" did not return a "destroy()"...i recreated this in less then 4 lines and a bool. that was sloppy of me :( i guess we learn and improve.
============================================================================
i removed the parsing of card casting restriction from the first pass when cards load, instead of making it a cardprimitive object, i now simply pass the string through the card and build the restrictions when theyre actually needed and checked.
this change allowed for alot of clean up, removing enum and dependancy on cardprimitive, and combining both allowedAltCast and allowedtocast functions checks through a new function "parseCastRestrictions"...this change keeps all the cast resrictions in a single place, which makes it easier to debug or add if needed, and while i was at it, i enabled it so cards can now contain as many restrictions as you want *of the available ones*
added "turn:" as a restriction to make it so "fourth turn" could actually be ANY turn you list, this allowed me to remove a dirty line of code which was checking if a card was o converted cost but had a suspend...lotus bloom...which can not be cast normally..for cards like this now you can use restriction=turn:200 or otherrestriction=turn:200....
=========================================================================
added Phyrexian Mana...svntax {p(r)} ....this will always be payable with 2 life, but if you have a red mana for this example, it will charge you the red mana instead...you can have any combination of P mana you want in any of the games manacost.
===================================================
reworked a bit of the ai logic i added, it now has true interrupting and can now correctly target for fizzles, Ai will go into full out counterspell wars with you now...
===================================================
added a ingame reward system with fancy flying text animations, they reward the player with actual credits, but are extremely hard to trigger off, theyre not meant to be something you see every 5 secs, but something that when you see them trigger you go "damn that was cool"
the triggers and effects are as follows
first the combo system:
you have to chain cast 5 or more card, without tapping or being interupted, tiny bonus for this..chain is broken as soon as you or your opponent tap something.
next combo level is
Abundant Resources - chain 10 or more spells same condition
then
killer - chain 15 or more same condition
this will include a flying text render once a chain is successfully started (5+ cast)
this bonus can be triggered multiple times in a match
the next bonus is
+ //creatures entering play consecutively will allow you a chance
+ //to gain a bonus for maintaining force sizes, it will trigger every 10th
+ //creature which enters play consecutively.
this is restarted every time a noncreature enters play.
the levels are as follows,
Deadly Force Bonus! -10 creatures enter play consecutively
Extreme Infantry Bonus! - 10 creatures enter play consecutively and you maintain a force size of 20+
Malignant Conqueror Bonus! -10 creatures enter play consecutively and you maintain a force size of 40+
this can only be triggered once per level per match.
next bonus is given for having alot of a specific type come into play under your control during a match, this bonus only triggers once per match.
the levels are:
Toy Collector!
Beast Tamer!
Vampire King!
Lord of Swarms!
Master of Elements!
Zombie Apocalypse!
Sword And Shield!
Medic!
The Promenade!
Heavenly Host!
Teeth And Scales!
its pretty easy to figure out what each requires to trigger, teeth and scales for example is dragons, wurms, drakes, and snakes.
the final bonus is deal 100 damage from a single source in a single damage event, this one triggers only once per match.
============================================================
fixed the following bugs::::
regenerate was not working for non-creature regeneration ie:welding jar
ai would sometime get stuck in a infinate loop tho extremely rarely while deciding what to do, the cause
if (clickstream.empty())
computeActions();
is NOT enough...ai should NEVER be computing actions (finding a card or ability to play) when it is NOT the active player..meaning, it does not have priority.
g->currentlyActing() is the player that has priority.
if (clickstream.empty() && g->currentlyActing() == this)...loop fixed :)
dynamicability had a couple weird results, from sources which dont have an amount to return, i now check this and if non, the amount is 0.
transformer will no longer add the same types a card already has..
removed an unneeded
if (!activated) ....oris bug seems to be corrected with this change.
wrapped limitsperturn checks in a conditional to skip it if there is no limit string.
added safer method to get the target of the combat trigger. the previous could potentially cause a crash if you interrupted the ability while the combat trigger was on the stack, it would do a call to "getnextopponent" and return a null pointer. i now send the opponent with the event.
fixed a crash that would happen when a card did not have a type= line. having a type or subtype line is now optional. and highly recommended to avoid using "type=nothing"
moved a function call in buyback isreactingtoclick so that it checks if its in the hand before parsing the restrictions for it.
removed allowedtocast function calls from the alternative payment types, they are only supposed to check allowedtocast if it is something like "buyback" and kicker...not "you may pay this instead"....
corrected an issue with type: variable where it would add the amount depending on the activeplayer. to correct i added a method to call TargetZoneChooser::targetsZone( with a mSource...so that you can set the source card for the scan.
note: all test pass.
445 lines
13 KiB
C++
445 lines
13 KiB
C++
#ifndef _MTGABILITY_H_
|
|
#define _MTGABILITY_H_
|
|
|
|
|
|
|
|
class MTGCardInstance;
|
|
class Spell;
|
|
class Damageable;
|
|
class PlayGuiObject;
|
|
class ManaCost;
|
|
class MTGGameZone;
|
|
class Player;
|
|
class AManaProducer;
|
|
class WEvent;
|
|
class Counter;
|
|
|
|
#include "GameObserver.h"
|
|
#include "ActionElement.h"
|
|
#include <string>
|
|
#include <map>
|
|
#include <hge/hgeparticle.h>
|
|
#include "Damage.h"
|
|
#include "TargetChooser.h"
|
|
using std::string;
|
|
using std::map;
|
|
|
|
|
|
//stupid variables used to give a hint to the AI:
|
|
// Should I cast a spell on an enemy or friendly unit ?
|
|
#define BAKA_EFFECT_GOOD 1
|
|
#define BAKA_EFFECT_BAD -1
|
|
#define BAKA_EFFECT_DONTKNOW 0
|
|
#define MODE_PUTINTOPLAY 1
|
|
#define MODE_ABILITY 2
|
|
#define MODE_TARGET 3
|
|
|
|
#define COUNT_POWER 1
|
|
|
|
#define PARSER_LORD 1
|
|
#define PARSER_FOREACH 2
|
|
#define PARSER_ASLONGAS 3
|
|
|
|
class MTGAbility: public ActionElement{
|
|
protected:
|
|
char menuText[50];
|
|
|
|
GameObserver * game;
|
|
public:
|
|
enum {
|
|
NO_RESTRICTION = 0,
|
|
PLAYER_TURN_ONLY = 1,
|
|
AS_SORCERY = 2,
|
|
MY_BEFORE_BEGIN = 3,
|
|
MY_UNTAP = 4,
|
|
MY_UPKEEP = 5,
|
|
MY_DRAW = 6,
|
|
MY_FIRSTMAIN = 7,
|
|
MY_COMBATBEGIN = 8,
|
|
MY_COMBATATTACKERS = 9,
|
|
MY_COMBATBLOCKERS = 10,
|
|
MY_COMBATDAMAGE = 11,
|
|
MY_COMBATEND = 12,
|
|
MY_SECONDMAIN = 13,
|
|
MY_ENDOFTURN = 14,
|
|
MY_EOT = 15,
|
|
MY_CLEANUP = 16,
|
|
MY_AFTER_EOT = 17,
|
|
|
|
OPPONENT_BEFORE_BEGIN = 23,
|
|
OPPONENT_UNTAP = 24,
|
|
OPPONENT_UPKEEP = 25,
|
|
OPPONENT_DRAW = 26,
|
|
OPPONENT_FIRSTMAIN = 27,
|
|
OPPONENT_COMBATBEGIN = 28,
|
|
OPPONENT_COMBATATTACKERS = 29,
|
|
OPPONENT_COMBATBLOCKERS = 30,
|
|
OPPONENT_COMBATDAMAGE = 31,
|
|
OPPONENT_COMBATEND = 32,
|
|
OPPONENT_SECONDMAIN = 33,
|
|
OPPONENT_ENDOFTURN = 34,
|
|
OPPONENT_EOT = 35,
|
|
OPPONENT_CLEANUP = 36,
|
|
OPPONENT_AFTER_EOT = 37,
|
|
|
|
BEFORE_BEGIN = 43,
|
|
UNTAP = 44,
|
|
UPKEEP = 45,
|
|
DRAW = 46,
|
|
FIRSTMAIN = 47,
|
|
COMBATBEGIN = 48,
|
|
COMBATATTACKERS = 49,
|
|
COMBATBLOCKERS = 50,
|
|
COMBATDAMAGE = 51,
|
|
COMBATEND = 52,
|
|
SECONDMAIN = 53,
|
|
ENDOFTURN = 54,
|
|
EOT = 55,
|
|
CLEANUP = 56,
|
|
AFTER_EOT = 57,
|
|
|
|
OPPONENT_TURN_ONLY = 60,
|
|
|
|
};
|
|
int parseCastRestrictions(MTGCardInstance * card,Player * player,string restrictions,string otherRestrictions);
|
|
int allowedToCast(MTGCardInstance * card,Player * player);
|
|
int allowedToAltCast(MTGCardInstance * card,Player * player);
|
|
int oneShot;
|
|
int forceDestroy;
|
|
ManaCost * cost;
|
|
ManaCost * alternative;
|
|
ManaCost * BuyBack;
|
|
ManaCost * FlashBack;
|
|
ManaCost * Retrace;
|
|
ManaCost * morph;
|
|
ManaCost * suspend;
|
|
|
|
Targetable * target;
|
|
int aType;
|
|
int naType;
|
|
int abilitygranted;
|
|
MTGCardInstance * source;
|
|
MTGAbility(int id, MTGCardInstance * card);
|
|
MTGAbility(int id, MTGCardInstance * _source, Targetable * _target);
|
|
virtual int testDestroy();
|
|
virtual ~MTGAbility();
|
|
virtual void Render(){};
|
|
virtual int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL){return 0;};
|
|
virtual int reactToClick(MTGCardInstance * card){return 0;};
|
|
virtual int receiveEvent(WEvent * event){return 0;};
|
|
virtual void Update(float dt){};
|
|
virtual int fireAbility();
|
|
virtual int stillInUse(MTGCardInstance * card);
|
|
virtual int resolve(){return 0;};
|
|
virtual MTGAbility* clone() const = 0;
|
|
virtual ostream& toString(ostream& out) const;
|
|
virtual int addToGame();
|
|
virtual int removeFromGame();
|
|
|
|
/*Poor man's casting */
|
|
/* Todo replace that crap with dynamic casting */
|
|
enum {
|
|
UNKNOWN = 0,
|
|
MANA_PRODUCER = 1,
|
|
MTG_ATTACK_RULE = 2,
|
|
DAMAGER = 3,
|
|
STANDARD_REGENERATE = 4,
|
|
PUT_INTO_PLAY = 5,
|
|
MOMIR = 6,
|
|
MTG_BLOCK_RULE = 7,
|
|
ALTERNATIVE_COST = 8,
|
|
BUYBACK_COST = 9,
|
|
FLASHBACK_COST = 10,
|
|
RETRACE_COST = 11,
|
|
MTG_COMBATTRIGGERS_RULE = 12,
|
|
STANDARD_PREVENT = 13,
|
|
STANDARD_EQUIP = 14,
|
|
STANDARD_LEVELUP = 15,
|
|
FOREACH = 16,
|
|
STANDARD_DRAW = 17,
|
|
STANDARD_PUMP = 18,
|
|
STANDARD_BECOMES = 19,
|
|
UPCOST = 20,
|
|
STANDARDABILITYGRANT = 21,
|
|
UNTAPPER = 22,
|
|
TAPPER = 23,
|
|
LIFER = 24,
|
|
CLONING = 25,
|
|
STANDARD_TEACH = 26,
|
|
STANDARD_TOKENCREATOR = 27,
|
|
MORPH_COST = 28,
|
|
SUSPEND_COST = 29,
|
|
|
|
|
|
};
|
|
};
|
|
|
|
class NestedAbility{
|
|
public:
|
|
MTGAbility * ability;
|
|
NestedAbility(MTGAbility * _ability);
|
|
};
|
|
|
|
class TriggeredAbility:public MTGAbility{
|
|
public:
|
|
TriggeredAbility(int id, MTGCardInstance * card);
|
|
TriggeredAbility(int id, MTGCardInstance * _source, Targetable * _target);
|
|
virtual void Update(float dt);
|
|
virtual void Render(){};
|
|
virtual int trigger(){return 0;};
|
|
virtual int triggerOnEvent(WEvent * e){return 0;};
|
|
int receiveEvent(WEvent * e);
|
|
virtual int resolve() = 0;
|
|
virtual TriggeredAbility* clone() const = 0;
|
|
virtual ostream& toString(ostream& out) const;
|
|
};
|
|
|
|
|
|
class ActivatedAbility:public MTGAbility{
|
|
public:
|
|
enum {
|
|
NO_RESTRICTION = 0,
|
|
PLAYER_TURN_ONLY = 1,
|
|
AS_SORCERY = 2,
|
|
MY_BEFORE_BEGIN = 3,
|
|
MY_UNTAP = 4,
|
|
MY_UPKEEP = 5,
|
|
MY_DRAW = 6,
|
|
MY_FIRSTMAIN = 7,
|
|
MY_COMBATBEGIN = 8,
|
|
MY_COMBATATTACKERS = 9,
|
|
MY_COMBATBLOCKERS = 10,
|
|
MY_COMBATDAMAGE = 11,
|
|
MY_COMBATEND = 12,
|
|
MY_SECONDMAIN = 13,
|
|
MY_ENDOFTURN = 14,
|
|
MY_EOT = 15,
|
|
MY_CLEANUP = 16,
|
|
MY_AFTER_EOT = 17,
|
|
|
|
OPPONENT_BEFORE_BEGIN = 23,
|
|
OPPONENT_UNTAP = 24,
|
|
OPPONENT_UPKEEP = 25,
|
|
OPPONENT_DRAW = 26,
|
|
OPPONENT_FIRSTMAIN = 27,
|
|
OPPONENT_COMBATBEGIN = 28,
|
|
OPPONENT_COMBATATTACKERS = 29,
|
|
OPPONENT_COMBATBLOCKERS = 30,
|
|
OPPONENT_COMBATDAMAGE = 31,
|
|
OPPONENT_COMBATEND = 32,
|
|
OPPONENT_SECONDMAIN = 33,
|
|
OPPONENT_ENDOFTURN = 34,
|
|
OPPONENT_EOT = 35,
|
|
OPPONENT_CLEANUP = 36,
|
|
OPPONENT_AFTER_EOT = 37,
|
|
|
|
BEFORE_BEGIN = 43,
|
|
UNTAP = 44,
|
|
UPKEEP = 45,
|
|
DRAW = 46,
|
|
FIRSTMAIN = 47,
|
|
COMBATBEGIN = 48,
|
|
COMBATATTACKERS = 49,
|
|
COMBATBLOCKERS = 50,
|
|
COMBATDAMAGE = 51,
|
|
COMBATEND = 52,
|
|
SECONDMAIN = 53,
|
|
ENDOFTURN = 54,
|
|
EOT = 55,
|
|
CLEANUP = 56,
|
|
AFTER_EOT = 57,
|
|
|
|
OPPONENT_TURN_ONLY = 69,
|
|
};
|
|
ManaCost * abilityCost;
|
|
int restrictions;
|
|
int limitPerTurn;
|
|
string limit;
|
|
int counters;
|
|
int needsTapping;
|
|
ActivatedAbility(int id, MTGCardInstance * card,ManaCost * _cost = NULL, int _restrictions = NO_RESTRICTION,int tap = 1,string limit = "");
|
|
virtual ~ActivatedAbility();
|
|
virtual void Update(float dt)
|
|
{
|
|
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_AFTER_EOT)
|
|
{
|
|
counters = 0;
|
|
}
|
|
return MTGAbility::Update(dt);
|
|
}
|
|
virtual int reactToClick(MTGCardInstance * card);
|
|
virtual int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
|
|
virtual int reactToTargetClick(Targetable * object);
|
|
virtual int resolve() = 0;
|
|
virtual ActivatedAbility* clone() const = 0;
|
|
virtual ostream& toString(ostream& out) const;
|
|
};
|
|
|
|
class TargetAbility:public ActivatedAbility, public NestedAbility{
|
|
public:
|
|
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);
|
|
virtual int reactToClick(MTGCardInstance * card);
|
|
virtual int reactToTargetClick(Targetable * object);
|
|
virtual TargetAbility* clone() const = 0;
|
|
virtual void Render();
|
|
virtual int resolve();
|
|
virtual const char * getMenuText();
|
|
virtual ostream& toString(ostream& out) const;
|
|
~TargetAbility();
|
|
};
|
|
|
|
class InstantAbility:public MTGAbility{
|
|
public:
|
|
int init;
|
|
virtual void Update(float dt);
|
|
virtual int testDestroy();
|
|
InstantAbility(int _id, MTGCardInstance * source);
|
|
InstantAbility(int _id, MTGCardInstance * source,Targetable * _target);
|
|
virtual int resolve(){return 0;};
|
|
virtual InstantAbility* clone() const = 0;
|
|
virtual ostream& toString(ostream& out) const;
|
|
};
|
|
|
|
/* State based effects. This class works ONLY for InPlay and needs to be extended for other areas of the game !!! */
|
|
class ListMaintainerAbility:public MTGAbility{
|
|
public:
|
|
map<MTGCardInstance *,bool> cards;
|
|
map<Player *,bool> players;
|
|
ListMaintainerAbility(int _id):MTGAbility(_id,NULL){};
|
|
ListMaintainerAbility(int _id, MTGCardInstance *_source):MTGAbility(_id, _source){};
|
|
ListMaintainerAbility(int _id, MTGCardInstance *_source,Damageable * _target):MTGAbility(_id, _source, _target){};
|
|
virtual void Update(float dt);
|
|
void updateTargets();
|
|
virtual bool canTarget(MTGGameZone * zone);
|
|
virtual int canBeInList(MTGCardInstance * card) = 0;
|
|
virtual int added(MTGCardInstance * card) = 0;
|
|
virtual int removed(MTGCardInstance * card) = 0;
|
|
virtual int canBeInList(Player * p){return 0;};
|
|
virtual int added(Player * p){return 0;};
|
|
virtual int removed(Player * p){return 0;};
|
|
virtual int destroy();
|
|
virtual ListMaintainerAbility* clone() const = 0;
|
|
virtual ostream& toString(ostream& out) const;
|
|
};
|
|
|
|
class TriggerAtPhase:public TriggeredAbility{
|
|
public:
|
|
int phaseId;
|
|
int who;
|
|
bool sourceUntapped;
|
|
bool sourceTap;
|
|
bool lifelost;
|
|
int lifeamount;
|
|
TriggerAtPhase(int id, MTGCardInstance * source, Targetable * target,int _phaseId, int who = 0,bool sourceUntapped = false,bool sourceTap = false,bool lifelost = false, int lifeamount = 0);
|
|
virtual int trigger();
|
|
int resolve(){return 0;};
|
|
virtual TriggerAtPhase* clone() const;
|
|
};
|
|
|
|
class TriggerNextPhase:public TriggerAtPhase{
|
|
public:
|
|
int destroyActivated;
|
|
bool sourceUntapped;
|
|
bool sourceTap;
|
|
TriggerNextPhase(int id, MTGCardInstance * source, Targetable * target,int _phaseId, int who = 0,bool sourceUntapped = false,bool sourceTap = false);
|
|
virtual TriggerNextPhase* clone() const;
|
|
virtual int testDestroy();
|
|
|
|
};
|
|
|
|
|
|
class GenericTriggeredAbility:public TriggeredAbility, public NestedAbility{
|
|
public:
|
|
TriggeredAbility * t;
|
|
queue<Targetable *> targets;
|
|
MTGAbility * destroyCondition;
|
|
GenericTriggeredAbility(int id, MTGCardInstance * _source, TriggeredAbility * _t, MTGAbility * a,MTGAbility * dc = NULL, Targetable * _target = NULL);
|
|
virtual int trigger();
|
|
virtual int triggerOnEvent(WEvent * e);
|
|
virtual int resolve();
|
|
virtual int testDestroy();
|
|
|
|
Targetable * getTriggerTarget(WEvent * e, MTGAbility * a);
|
|
void setTriggerTargets(Targetable * ta, MTGAbility * a);
|
|
|
|
void Update(float dt);
|
|
virtual GenericTriggeredAbility* clone() const;
|
|
const char * getMenuText();
|
|
~GenericTriggeredAbility();
|
|
};
|
|
|
|
/* Ability Factory */
|
|
class AbilityFactory{
|
|
private:
|
|
string storedString;
|
|
int countCards(TargetChooser * tc, Player * player = NULL, int option = 0);
|
|
TriggeredAbility * parseTrigger(string s, string magicText, int id, Spell * spell, MTGCardInstance *card, Targetable * target);
|
|
MTGAbility * getAlternateCost( string s, int id, Spell *spell, MTGCardInstance *card );
|
|
MTGAbility * getManaReduxAbility(string s, int id, Spell *spell, MTGCardInstance *card, MTGCardInstance *target);
|
|
|
|
public:
|
|
int parseRestriction(string s);
|
|
Counter * parseCounter(string s, MTGCardInstance * target, Spell * spell = NULL);
|
|
int parsePowerToughness(string s, int *power, int *toughness);
|
|
int getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCardInstance * card = NULL, int id = 0,MTGGameZone * dest = NULL);
|
|
MTGAbility * parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated = 0, int forceUEOT = 0,int oneShot = 0,int forceForever = 0, MTGGameZone * dest = NULL);
|
|
|
|
int abilityEfficiency(MTGAbility * a, Player * p, int mode = MODE_ABILITY, TargetChooser * tc = NULL);
|
|
int magicText(int id, Spell * spell, MTGCardInstance * card = NULL, int mode = MODE_PUTINTOPLAY, TargetChooser * tc = NULL, MTGGameZone * dest = NULL);
|
|
static int computeX(Spell * spell, MTGCardInstance * card);
|
|
static int computeXX(Spell * spell, MTGCardInstance * card);
|
|
static MTGAbility * getCoreAbility(MTGAbility * a);
|
|
int destroyAllInPlay(TargetChooser * tc, int bury = 0);
|
|
int moveAll(TargetChooser * tc, string destinationZone);
|
|
int damageAll(TargetChooser * tc, int damage);
|
|
int TapAll(TargetChooser * tc);
|
|
int UntapAll(TargetChooser * tc);
|
|
void addAbilities(int _id, Spell * spell);
|
|
};
|
|
|
|
|
|
class ActivatedAbilityTP:public ActivatedAbility{
|
|
public:
|
|
int who;
|
|
ActivatedAbilityTP(int id, MTGCardInstance * card, Targetable * _target = NULL, ManaCost * cost=NULL, int doTap = 0, int who = TargetChooser::UNSET);
|
|
Targetable * getTarget();
|
|
};
|
|
|
|
class InstantAbilityTP:public InstantAbility{
|
|
public:
|
|
int who;
|
|
InstantAbilityTP(int id, MTGCardInstance * card, Targetable * _target = NULL, int who = TargetChooser::UNSET);
|
|
Targetable * getTarget();
|
|
};
|
|
|
|
class AbilityTP:public MTGAbility{
|
|
public:
|
|
int who;
|
|
AbilityTP(int id, MTGCardInstance * card, Targetable * _target = NULL, int who = TargetChooser::UNSET);
|
|
Targetable * getTarget();
|
|
virtual ~AbilityTP(){};
|
|
};
|
|
|
|
class AManaProducer: public ActivatedAbilityTP{
|
|
protected:
|
|
|
|
|
|
Player * controller;
|
|
|
|
public:
|
|
string menutext;
|
|
ManaCost * output;
|
|
int tap;
|
|
AManaProducer(int id, MTGCardInstance * card, Targetable * t, ManaCost * _output, ManaCost * _cost = NULL, int doTap = 0, int who = TargetChooser::UNSET );
|
|
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL);
|
|
int resolve();
|
|
int reactToClick(MTGCardInstance * _card);
|
|
const char * getMenuText();
|
|
~AManaProducer();
|
|
virtual AManaProducer * clone() const;
|
|
};
|
|
|
|
#endif
|
|
|