Add Snapcaster Mage Ability

tempflashback - flashback using manacost
This commit is contained in:
Anthony Calosa
2016-07-26 09:56:13 +08:00
parent 07b5f35b98
commit ae33977e10
8 changed files with 98 additions and 23 deletions

View File

@@ -78212,6 +78212,14 @@ mana={X}{X}{U}
type=Sorcery
[/card]
[card]
name=Past in Flames
auto=all(instant,sorcery|mygraveyard) tempflashback ueot
flashback={4}{R}
text=Each instant and sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. -- Flashback {4}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)
mana={3}{R}
type=Sorcery
[/card]
[card]
name=Patagia Golem
auto={3}:flying
text={3}: Patagia Golem gains flying until end of turn.
@@ -86217,6 +86225,15 @@ mana={2}{B}
type=Sorcery
[/card]
[card]
name=Recoup
target=sorcery|mygraveyard
auto=transforms((,newability[tempflashback])) ueot
flashback={3}{R}
text=Target sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (Mana cost includes color.) -- Flashback {3}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)
mana={1}{R}
type=Sorcery
[/card]
[card]
name=Recumbent Bliss
target=creature
auto=cantattack
@@ -100590,6 +100607,17 @@ mana={1}{U}
type=Instant
[/card]
[card]
name=Snapcaster Mage
abilities=flash
auto=target(instant,sorcery|mygraveyard) tempflashback ueot
text=Flash -- When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (You may cast that card from your graveyard for its flashback cost. Then exile it.)
mana={1}{U}
type=Creature
subtype=Human Wizard
power=2
toughness=1
[/card]
[card]
name=Snap
target=creature
auto=moveTo(ownerhand)

View File

@@ -12447,12 +12447,6 @@ type=Enchantment
subtype=Aura
[/card]
[card]
name=Past in Flames
text=Each instant and sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. -- Flashback {4}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)
mana={3}{R}
type=Sorcery
[/card]
[card]
name=Pathbreaker Ibex
text=Whenever Pathbreaker Ibex attacks, creatures you control gain trample and get +X/+X until end of turn, where X is the greatest power among creatures you control.
mana={4}{G}{G}
@@ -13846,12 +13840,6 @@ mana={2}{G}{W}
type=Enchantment
[/card]
[card]
name=Recoup
text=Target sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (Mana cost includes color.) -- Flashback {3}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)
mana={1}{R}
type=Sorcery
[/card]
[card]
name=Recross the Paths
text=Reveal cards from the top of your library until you reveal a land card. Put that card onto the battlefield and the rest on the bottom of your library in any order. Clash with an opponent. If you win, return Recross the Paths to its owner's hand. (Each clashing player reveals the top card of his or her library, then puts that card on the top or bottom. A player wins if his or her card had a higher converted mana cost.)
mana={2}{G}
@@ -16092,15 +16080,6 @@ type=Enchantment
subtype=Aura
[/card]
[card]
name=Snapcaster Mage
text=Flash -- When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (You may cast that card from your graveyard for its flashback cost. Then exile it.)
mana={1}{U}
type=Creature
subtype=Human Wizard
power=2
toughness=1
[/card]
[card]
name=Snow Mercy
text=Whenever a creature deals damage to you, put a globe counter on it. -- {T}, {untap}, {T}, {untap}, {T}: Tap all creatures with globe counters on them.
mana={2}{W}{W}

View File

@@ -219,6 +219,7 @@ public:
BESTOW_COST = 35,
ATTACK_COST = 36,
BLOCK_COST = 37,
GRANTEDFLASHBACK_COST = 38,
};
};

View File

@@ -255,7 +255,8 @@ class Constants
OVERLOAD = 133,
SHACKLER = 134,
FLYERSONLY = 135,//can attack only if it has flying
NB_BASIC_ABILITIES = 136,
TEMPFLASHBACK = 136,
NB_BASIC_ABILITIES = 137,
RARITY_S = 'S', //Special Rarity
RARITY_M = 'M', //Mythics

View File

@@ -150,6 +150,21 @@ public:
virtual MTGFlashBackRule * clone() const;
};
class MTGTempFlashBackRule: public MTGAlternativeCostRule
{
public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGTempFlashBackRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "Flashback Manacost";
}
virtual MTGTempFlashBackRule * clone() const;
};
class MTGRetraceRule: public MTGAlternativeCostRule
{
public:

View File

@@ -1176,6 +1176,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
if(found != string::npos)
{
observer->addObserver(NEW MTGFlashBackRule(observer, -1));
observer->addObserver(NEW MTGTempFlashBackRule(observer, -1));
return NULL;
}
//alternative cost type flashback

View File

@@ -166,7 +166,8 @@ const char* Constants::MTGBasicAbilities[] = {
"dethrone",
"overload",
"shackler",
"flyersonly"
"flyersonly",
"tempflashback"
};
map<string,int> Constants::MTGBasicAbilitiesMap;

View File

@@ -1056,6 +1056,55 @@ MTGFlashBackRule * MTGFlashBackRule::clone() const
return NEW MTGFlashBackRule(*this);
}
//temporary flashback
MTGTempFlashBackRule::MTGTempFlashBackRule(GameObserver* observer, int _id) :
MTGAlternativeCostRule(observer, _id)
{
aType = MTGAbility::GRANTEDFLASHBACK_COST;
}
int MTGTempFlashBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{
Player * player = game->currentlyActing();
if (!player->game->graveyard->hasCard(card))
return 0;
if (!card->has(Constants::TEMPFLASHBACK))
return 0;
ManaCost * flashbackCost = card->getManaCost();
if(flashbackCost->extraCosts)
for(unsigned int i = 0; i < flashbackCost->extraCosts->costs.size();i++)
{
flashbackCost->extraCosts->costs[i]->setSource(card);
}
return MTGAlternativeCostRule::isReactingToClick(card, mana, flashbackCost );
}
int MTGTempFlashBackRule::reactToClick(MTGCardInstance * card)
{
ManaCost * flashbackCost = card->getManaCost();
if(flashbackCost->extraCosts)
for(unsigned int i = 0; i < flashbackCost->extraCosts->costs.size();i++)
{
flashbackCost->extraCosts->costs[i]->setSource(card);
}
if (!isReactingToClick(card))
return 0;
card->paymenttype = MTGAbility::FLASHBACK_COST;
return MTGAlternativeCostRule::reactToClick(card, flashbackCost, ManaCost::MANA_PAID_WITH_FLASHBACK);
}
ostream& MTGTempFlashBackRule::toString(ostream& out) const
{
out << "MTGTempFlashBackRule ::: (";
return MTGAbility::toString(out) << ")";
}
MTGTempFlashBackRule * MTGTempFlashBackRule::clone() const
{
return NEW MTGTempFlashBackRule(*this);
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------