serum powder code
serum powder second ability... 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.
This commit is contained in:
@@ -2941,6 +2941,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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user