fixed storm spellcount, affinity/manaredux invis mana, added true "retrace" added 3 new extra cost types.

This commit is contained in:
omegablast2002@yahoo.com
2010-09-14 17:15:33 +00:00
parent 58d67d630a
commit b507053a1d
18 changed files with 551 additions and 15 deletions
+1
View File
@@ -92,6 +92,7 @@ class Spell: public Interruptible {
bool AlternativeWasPaid();
bool BuyBackWasPaid();
bool FlashBackWasPaid();
bool RetraceWasPaid();
const string getDisplayName() const;
virtual ostream& toString(ostream& out) const;
MTGCardInstance * getNextCardTarget(MTGCardInstance * previous = 0);
+15 -2
View File
@@ -2409,7 +2409,6 @@ class AAFrozen:public ActivatedAbility{
return a;
}
};
// Add life of gives damage if a given zone has more or less than [condition] cards at the beginning of [phase]
//Ex : the rack, ivory tower...
class ALifeZoneLink:public MTGAbility{
@@ -2636,11 +2635,25 @@ public:
MTGCardInstance * _target = (MTGCardInstance *)target;
amount;
type;
_target->getManaCost()->add(type,amount);
if(amount < 0){
//amount = amount * -1;
amount = abs(amount);
if(_target->getManaCost()->hasColor(type)){
if(_target->getManaCost()->getConvertedCost() >= 1){
_target->getManaCost()->remove(type,amount);
if(_target->getManaCost()->alternative > 0){
_target->getManaCost()->alternative->remove(type,amount);}
if(_target->getManaCost()->BuyBack > 0){
_target->getManaCost()->BuyBack->remove(type,amount);}
}
}
}else{
_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{
+39
View File
@@ -81,6 +81,45 @@ public:
virtual int setSource(MTGCardInstance * _source);
virtual DiscardRandomCost * clone() const;
};
//tolibrary cost
class ToLibraryCost: public ExtraCost{
public:
MTGCardInstance * target;
ToLibraryCost(TargetChooser *_tc = NULL);
virtual int setPayment(MTGCardInstance * card);
virtual int isPaymentSet();
virtual int canPay();
virtual int doPay();
virtual void Render();
virtual int setSource(MTGCardInstance * _source);
virtual ToLibraryCost * clone() const;
};
//Millyourself cost
class MillCost: public ExtraCost{
public:
MTGCardInstance * target;
MillCost(TargetChooser *_tc = NULL);
virtual int setPayment(MTGCardInstance * card);
virtual int isPaymentSet();
virtual int canPay();
virtual int doPay();
virtual void Render();
virtual int setSource(MTGCardInstance * _source);
virtual MillCost * clone() const;
};
//Mill to exile yourself cost
class MillExileCost: public ExtraCost{
public:
MTGCardInstance * target;
MillExileCost(TargetChooser *_tc = NULL);
virtual int setPayment(MTGCardInstance * card);
virtual int isPaymentSet();
virtual int canPay();
virtual int doPay();
virtual void Render();
virtual int setSource(MTGCardInstance * _source);
virtual MillExileCost * clone() const;
};
//tap other cost
class TapTargetCost: public ExtraCost{
public:
+2
View File
@@ -52,6 +52,7 @@ class MTGAbility: public ActionElement{
ManaCost * alternative;
ManaCost * BuyBack;
ManaCost * FlashBack;
ManaCost * Retrace;
Targetable * target;
int aType;
@@ -87,6 +88,7 @@ class MTGAbility: public ActionElement{
ALTERNATIVE_COST = 8,
BUYBACK_COST = 9,
FLASHBACK_COST = 10,
RETRACE_COST = 11,
};
};
+1
View File
@@ -49,6 +49,7 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable {
int flashedback;
int paymenttype;
int frozen;
int reduxamount;
int regenerateTokens;
int isToken;
int stillInUse();
+1
View File
@@ -161,6 +161,7 @@ class MTGPlayerCards {
void initDeck(MTGDeck * deck);
MTGCardInstance * putInGraveyard(MTGCardInstance * card);
MTGCardInstance * putInExile(MTGCardInstance * card);
MTGCardInstance * putInLibrary(MTGCardInstance * card);
MTGCardInstance * putInHand(MTGCardInstance * card);
MTGCardInstance * putInZone(MTGCardInstance * card, MTGGameZone * from, MTGGameZone * to);
int isInPlay(MTGCardInstance * card);
+11
View File
@@ -61,6 +61,17 @@ class MTGFlashBackRule:public MTGAbility{
virtual MTGFlashBackRule * clone() const;
};
class MTGRetraceRule:public MTGAbility{
public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card);
int testDestroy();
virtual ostream& toString(ostream& out) const;
MTGRetraceRule(int _id);
const char * getMenuText(){return "Retrace";}
virtual MTGRetraceRule * clone() const;
};
class MTGAttackRule:public MTGAbility, public Limitor{
public:
virtual bool select(Target*);
+3 -1
View File
@@ -25,7 +25,8 @@ class ManaCost{
MANA_PAID_WITH_KICKER = 2,
MANA_PAID_WITH_ALTERNATIVE = 3,
MANA_PAID_WITH_BUYBACK = 4,
MANA_PAID_WITH_FLASHBACK = 5
MANA_PAID_WITH_FLASHBACK = 5,
MANA_PAID_WITH_RETRACE = 6
};
ExtraCosts * extraCosts;
@@ -33,6 +34,7 @@ class ManaCost{
ManaCost * alternative;
ManaCost * BuyBack;
ManaCost * FlashBack;
ManaCost * Retrace;
static ManaCost * parseManaCost(string value, ManaCost * _manacost = NULL, MTGCardInstance * c = NULL);
virtual void init();
void x();