Added support for "buyback" and "flashback" with optional auto=buyback/flashback line support.

This commit is contained in:
omegablast2002@yahoo.com
2010-09-10 18:00:37 +00:00
parent 5658b1887b
commit 99da45f400
16 changed files with 417 additions and 11 deletions
+2
View File
@@ -89,6 +89,8 @@ class Spell: public Interruptible {
void Render();
bool kickerWasPaid();
bool AlternativeWasPaid();
bool BuyBackWasPaid();
bool FlashBackWasPaid();
const string getDisplayName() const;
virtual ostream& toString(ostream& out) const;
MTGCardInstance * getNextCardTarget(MTGCardInstance * previous = 0);
+2
View File
@@ -2634,6 +2634,8 @@ public:
_target->getManaCost()->add(type,amount);
if(_target->getManaCost()->alternative > 0){
_target->getManaCost()->alternative->add(type,amount);}
if(_target->getManaCost()->BuyBack > 0){
_target->getManaCost()->BuyBack->add(type,amount);}
return MTGAbility::addToGame();
}
AManaRedux * clone() const{
+5
View File
@@ -50,6 +50,8 @@ class MTGAbility: public ActionElement{
int forceDestroy;
ManaCost * cost;
ManaCost * alternative;
ManaCost * BuyBack;
ManaCost * FlashBack;
Targetable * target;
int aType;
@@ -83,6 +85,9 @@ class MTGAbility: public ActionElement{
MOMIR = 6,
MTG_BLOCK_RULE = 7,
ALTERNATIVE_COST = 8,
BUYBACK_COST = 9,
FLASHBACK_COST = 10,
};
};
+3
View File
@@ -44,6 +44,9 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
MTGGameZone * currentZone;
Pos* view;
int X;
int boughtback;
int flashedback;
int paymenttype;
int frozen;
int regenerateTokens;
int isToken;
+22
View File
@@ -39,6 +39,28 @@ class MTGAlternativeCostRule:public MTGAbility{
virtual MTGAlternativeCostRule * clone() const;
};
class MTGBuyBackRule:public MTGAbility{
public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card);
int testDestroy();
virtual ostream& toString(ostream& out) const;
MTGBuyBackRule(int _id);
const char * getMenuText(){return "Cast And Buy Back";}
virtual MTGBuyBackRule * clone() const;
};
class MTGFlashBackRule:public MTGAbility{
public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card);
int testDestroy();
virtual ostream& toString(ostream& out) const;
MTGFlashBackRule(int _id);
const char * getMenuText(){return "Flash Back";}
virtual MTGFlashBackRule * clone() const;
};
class MTGAttackRule:public MTGAbility, public Limitor{
public:
virtual bool select(Target*);
+6 -1
View File
@@ -23,11 +23,16 @@ class ManaCost{
enum{
MANA_PAID = 1,
MANA_PAID_WITH_KICKER = 2,
MANA_PAID_WITH_ALTERNATIVE = 3
MANA_PAID_WITH_ALTERNATIVE = 3,
MANA_PAID_WITH_BUYBACK = 4,
MANA_PAID_WITH_FLASHBACK = 5
};
ExtraCosts * extraCosts;
ManaCost * kicker;
ManaCost * alternative;
ManaCost * BuyBack;
ManaCost * FlashBack;
static ManaCost * parseManaCost(string value, ManaCost * _manacost = NULL, MTGCardInstance * c = NULL);
virtual void init();
void x();