Merge pull request #614 from kevlahnota/master

added FRF
This commit is contained in:
Xawotihs
2015-08-24 17:56:32 +02:00
15 changed files with 1405 additions and 140 deletions
@@ -86,17 +86,6 @@ mana={5}{U}
type=Sorcery
[/card]
[card]
name=Gravecrawler
abilities=cantblock
autograveyard=aslongas(zombie|myBattlefield) {B}:name(cast from graveyard) activate name(cast from graveyard) castcard(normal) assorcery
text=Gravecrawler can't block. -- You may cast Gravecrawler from your graveyard as long as you control a Zombie.
mana={B}
type=Creature
subtype=Zombie
power=2
toughness=1
[/card]
[card]
name=Ivy Seer
auto={2}{G}{T}:foreach(*[green]|myhand) 1/1 target(creature)
text={2}{G}, {T}: Reveal any number of green cards in your hand. Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way.
File diff suppressed because it is too large Load Diff
@@ -4149,15 +4149,6 @@ mana={U}{U}
type=Sorcery
[/card]
[card]
name=Draining Whelk
text=Flash (You may cast this spell any time you could cast an instant.) -- Flying -- When Draining Whelk enters the battlefield, counter target spell. Put X +1/+1 counters on Draining Whelk, where X is that spell's converted mana cost.
mana={4}{U}{U}
type=Creature
subtype=Illusion
power=1
toughness=1
[/card]
[card]
name=Drake Umbra
mana={4}{U}
type=Enchantment
@@ -7676,12 +7667,6 @@ type=Instant
text=As an additional cost to cast Induce Despair, reveal a creature card from your hand. Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost.
[/card]
[card]
name=Induce Paranoia
text=Counter target spell. If {B} was spent to cast Induce Paranoia, that spell's controller puts the top X cards of his or her library into his or her graveyard, where X is the spell's converted mana cost.
mana={2}{U}{U}
type=Instant
[/card]
[card]
name=Inescapable Brute
text=Wither (This deals damage to creatures in the form of -1/-1 counters.) -- Inescapable Brute must be blocked if able.
mana={5}{R}
@@ -12877,13 +12862,6 @@ mana={R}{R}
type=Enchantment
[/card]
[card]
name=Ral Zarek
text=+1: Tap target permanent, then untap another target permanent. -- -2: Ral Zarek deals 3 damage to target creature or player. -- -7: Flip five coins. Take an extra turn after this one for each coin that comes up heads.
mana={2}{U}{R}
type=Planeswalker
subtype=Ral
[/card]
[card]
name=Raiding Party
text=Raiding Party can't be the target of white spells or abilities from white sources. -- Sacrifice an Orc: Each player may tap any number of untapped white creatures he or she controls. For each creature tapped this way, that player chooses up to two Plains. Then destroy all Plains that weren't chosen this way by any player.
mana={2}{R}
@@ -14513,12 +14491,6 @@ mana={W}
type=Enchantment
[/card]
[card]
name=Serum Powder
text={T}: Add {1} to your mana pool. -- Any time you could mulligan and Serum Powder is in your hand, you may exile all the cards from your hand, then draw that many cards. (You can do this in addition to taking mulligans.)
mana={3}
type=Artifact
[/card]
[card]
name=Serum Visions
text=Draw a card. -- Scry 2. (To scry 2, look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)
mana={U}
+2
View File
@@ -662,6 +662,8 @@ tidal_warrior_i649.txt
tidal_warrior_i652.txt
Timely_Reinforcements.txt
titanic_ultimatum.txt
tokenizer.txt
tokenizer2.txt
torture.txt
tranquil_domain.txt
turn_to_slag.txt
+29
View File
@@ -0,0 +1,29 @@
# Testing Tokenizer - Parallel Lives (ISD) 249662
# Dragon Fodder (ALA) 174936
# text=Put two 1/1 red Goblin creature tokens into play.
# Tokens must be 2.. since there are no tokenizer.
[INIT]
FIRSTMAIN
[PLAYER1]
hand:174936
manapool:{R}{1}
inplay:249662
[PLAYER2]
hand:Demystify
manapool:{W}
[DO]
174936
no
yes
Demystify
249662
endinterruption
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:249662,174936
inplay:-174936,-174936
[PLAYER2]
graveyard:Demystify
life:20
[END]
+27
View File
@@ -0,0 +1,27 @@
# Testing Tokenizer - Parallel Lives (ISD) 249662
# Dragon Fodder (ALA) 174936
# text=Put two 1/1 red Goblin creature tokens into play.
# Tokens must be 8.. since there are two tokenizer... original value
# is 2 with first tokenizer it will become 4, with the second tokenizer
# the value will be 8...
[INIT]
FIRSTMAIN
[PLAYER1]
hand:174936
manapool:{R}{1}
inplay:249662,249662
[PLAYER2]
inplay:plains
hand:Demystify
[DO]
174936
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:174936
inplay:249662,249662,-174936,-174936,-174936,-174936,-174936,-174936,-174936,-174936
[PLAYER2]
hand:Demystify
inplay:plains
life:20
[END]
+29 -1
View File
@@ -3140,7 +3140,7 @@ public:
SAFE_DELETE(NewPow);
SAFE_DELETE(NewTou);
}
for (int i = 0; i < multiplier->getValue(); ++i)
for (int i = 0; i < Tokenizer(); ++i)
{
//MTGCardInstance * myToken;
if (tokenId)
@@ -3199,6 +3199,23 @@ public:
return 1;
}
int Tokenizer()//tokenizer
{
int tokenize = 1;
if (source->controller()->game->battlefield->hasAbility(Constants::TOKENIZER))
{
int nbcards = source->controller()->game->battlefield->nb_cards;
for (int j = 0; j < nbcards; j++)
{
if (source->controller()->game->battlefield->cards[j]->has(Constants::TOKENIZER))
tokenize *= 2;
}
return multiplier->getValue()*tokenize;
}
else
return multiplier->getValue();
}
void setTokenOwner()
{
switch(who)
@@ -5540,6 +5557,17 @@ public:
AAShuffle * clone() const;
};
//Mulligan
class AAMulligan: public ActivatedAbilityTP
{
public:
AAMulligan(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost = NULL, int who =
TargetChooser::UNSET);
int resolve();
const string getMenuText();
AAMulligan * clone() const;
};
//Remove Mana From ManaPool
class AARemoveMana: public ActivatedAbilityTP
{
+1
View File
@@ -151,6 +151,7 @@ class GameObserver{
bool undo();
bool isLoading(){ return mLoading; };
void Mulligan(Player* player = NULL);
void serumMulligan(Player* player = NULL);
Player* getPlayer(size_t index) { return players[index];};
bool isStarted() { return (mLayers!=NULL);};
RandomGenerator* getRandomGenerator() { return &randomGenerator; };
+2 -1
View File
@@ -219,7 +219,8 @@ class Constants
LURE = 101,
NOLEGEND = 102,
CANPLAYFROMGRAVEYARD = 103,
NB_BASIC_ABILITIES = 104,
TOKENIZER = 104,
NB_BASIC_ABILITIES = 105,
RARITY_S = 'S', //Special Rarity
+1
View File
@@ -68,6 +68,7 @@ public:
MTGInPlay * inPlay();
ManaPool * getManaPool();
void takeMulligan();
void serumMulligan();
ManaCost * doesntEmpty;
ManaCost * poolDoesntEmpty;
void cleanupPhase();
+74 -27
View File
@@ -1359,6 +1359,13 @@ int AAFizzler::resolve()
sCard = sTarget->source;
if (!sCard || !sTarget || sCard->has(Constants::NOFIZZLE))
return 0;
if (source->alias == 111057 && sTarget)//Draining Whelk
{
for (int j = sTarget->cost->getConvertedCost(); j > 0; j--)
{
source->counters->addCounter(1,1);
}
}
stack->Fizzle(sTarget, fizzleMode);
return 1;
}
@@ -2482,35 +2489,49 @@ int AACloner::resolve()
Player * targetPlayer = who == 1 ? source->controller()->opponent() : source->controller();
MTGCardInstance * myClone = NEW MTGCardInstance(clone, targetPlayer->game);
targetPlayer->game->temp->addCard(myClone);
int tokenize = 1;//tokenizer support for cloning
if (targetPlayer->game->battlefield->hasAbility(Constants::TOKENIZER))
{
int nbcards = targetPlayer->game->battlefield->nb_cards;
for (int j = 0; j < nbcards; j++)
{
if (targetPlayer->game->battlefield->cards[j]->has(Constants::TOKENIZER))
tokenize *= 2;
}
}
for (int i = 0; i < tokenize; ++i)
{
MTGCardInstance * myClone = NEW MTGCardInstance(clone, targetPlayer->game);
targetPlayer->game->temp->addCard(myClone);
Spell * spell = NEW Spell(game, myClone);
spell->source->isToken = 1;
spell->resolve();
spell->source->fresh = 1;
spell->source->model = spell->source;
spell->source->model->data = spell->source;
if(_target->isToken)
{
spell->source->power = _target->origpower;
spell->source->toughness = _target->origtoughness;
spell->source->life = _target->origtoughness;
Spell * spell = NEW Spell(game, myClone);
spell->source->isToken = 1;
spell->resolve();
spell->source->fresh = 1;
spell->source->model = spell->source;
spell->source->model->data = spell->source;
if(_target->isToken)
{
spell->source->power = _target->origpower;
spell->source->toughness = _target->origtoughness;
spell->source->life = _target->origtoughness;
}
list<int>::iterator it;
for (it = awith.begin(); it != awith.end(); it++)
{
spell->source->basicAbilities[*it] = 1;
}
for (it = colors.begin(); it != colors.end(); it++)
{
spell->source->setColor(*it);
}
for (it = typesToAdd.begin(); it != typesToAdd.end(); it++)
{
spell->source->addType(*it);
}
delete spell;
}
list<int>::iterator it;
for (it = awith.begin(); it != awith.end(); it++)
{
spell->source->basicAbilities[*it] = 1;
}
for (it = colors.begin(); it != colors.end(); it++)
{
spell->source->setColor(*it);
}
for (it = typesToAdd.begin(); it != typesToAdd.end(); it++)
{
spell->source->addType(*it);
}
delete spell;
return 1;
}
@@ -2941,6 +2962,32 @@ AAShuffle * AAShuffle::clone() const
return NEW AAShuffle(*this);
}
// Mulligan
AAMulligan::AAMulligan(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int who) :
ActivatedAbilityTP(observer, _id, card, _target, _cost, who)
{
}
int AAMulligan::resolve()
{
Player * player = getPlayerFromTarget(getTarget());
if (player)
{
player->serumMulligan();
}
return 1;
}
const string AAMulligan::getMenuText()
{
return "Mulligan";
}
AAMulligan * AAMulligan::clone() const
{
return NEW AAMulligan(*this);
}
// Remove Mana From ManaPool
AARemoveMana::AARemoveMana(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string manaDesc, int who) :
ActivatedAbilityTP(observer, _id, card, _target, NULL, who)
+7
View File
@@ -1839,6 +1839,13 @@ void GameObserver::Mulligan(Player* player)
player->takeMulligan();
}
void GameObserver::serumMulligan(Player* player)
{
if(!player) player = currentPlayer;
logAction(player, "mulligan serum powder");
player->serumMulligan();
}
Player* GameObserver::createPlayer(const string& playerMode
#ifdef TESTSUITE
, TestSuiteGame* testgame
+10
View File
@@ -2532,6 +2532,16 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a;
}
//Serum Powder
found = s.find("serumpowder");
if (found != string::npos)
{
Targetable * t = spell? spell->getNextTarget() : NULL;
MTGAbility * a = NEW AAMulligan(observer, id, card, t, NULL, who);
a->oneShot = 1;
return a;
}
//Remove Mana from ManaPool
vector<string> splitRemove = parseBetween(s, "removemana(", ")");
if (splitRemove.size())
+2 -1
View File
@@ -132,7 +132,8 @@ const char* Constants::MTGBasicAbilities[] = {
"soulbond",
"lure",
"nolegend",
"canplayfromgraveyard"
"canplayfromgraveyard",
"tokenizer"//parallel lives
};
map<string,int> Constants::MTGBasicAbilitiesMap;
+16
View File
@@ -217,6 +217,22 @@ void Player::takeMulligan()
//Draw hand with 1 less card penalty //almhum
}
void Player::serumMulligan()
{
MTGPlayerCards * currentPlayerZones = game;
int cardsinhand = currentPlayerZones->hand->nb_cards;
for (int i = 0; i < cardsinhand; i++) //Exile
currentPlayerZones->putInZone(currentPlayerZones->hand->cards[0],
currentPlayerZones->hand,
currentPlayerZones->exile);
currentPlayerZones->library->shuffle(); //Shuffle
for (int i = 0; i < (cardsinhand); i++)
game->drawFromLibrary();
//Draw hand no penalty
}
//Cleanup phase at the end of a turn
void Player::cleanupPhase()
{