Erwan
- {z} cost becomes l2e (Library To Exile)
- {q} cost becomes s2l (Send to Library) <- from any place to Library
- subtypes leyline, controllsershroud, playershroud become ability keywords
This commit is contained in:
@@ -86,6 +86,9 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"affinitygreencreatures",
|
||||
"cantwin",
|
||||
"nomaxhand",
|
||||
"leyline",
|
||||
"playershroud",
|
||||
"controllershroud",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -328,6 +328,15 @@ int MTGGameZone::hasType(const char * value){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MTGGameZone::hasAbility(int ability){
|
||||
for (int i=0; i<(nb_cards); i++) {
|
||||
if (cards[i]->basicAbilities[ability]){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void MTGGameZone::cleanupPhase(){
|
||||
for (int i=0; i<(nb_cards); i++)
|
||||
|
||||
@@ -15,12 +15,12 @@ int cardsinhand = game->players[0]->game->hand->nb_cards;
|
||||
Player * player = game->currentlyActing();
|
||||
Player * currentPlayer = game->currentPlayer;
|
||||
if (!player->game->hand->hasCard(card)) return 0;
|
||||
if ((game->turn < 1) && (cardsinhand != 0) && (card->hasType("leyline"))
|
||||
if ((game->turn < 1) && (cardsinhand != 0) && (card->basicAbilities[Constants::LEYLINE])
|
||||
&& game->currentGamePhase == Constants::MTG_PHASE_FIRSTMAIN
|
||||
&& game->players[0]->game->graveyard->nb_cards == 0
|
||||
&& game->players[0]->game->exile->nb_cards == 0){
|
||||
Player * p = game->currentPlayer;
|
||||
if (card->hasType("leyline")){
|
||||
if (card->basicAbilities[Constants::LEYLINE]){
|
||||
MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->temp);
|
||||
Spell * spell = NEW Spell(copy);
|
||||
spell->resolve();
|
||||
|
||||
@@ -75,30 +75,32 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
|
||||
manaCost->addExtraCost(NEW TapTargetCost(tc));
|
||||
}
|
||||
break;
|
||||
case 's': //Sacrifice
|
||||
manaCost->addExtraCost(NEW SacrificeCost(tc));
|
||||
case 's':
|
||||
if (value == "s2l") { //Send To Library Cost (move from anywhere to Library)
|
||||
manaCost->addExtraCost(NEW ToLibraryCost(tc));
|
||||
} else { //Sacrifice
|
||||
manaCost->addExtraCost(NEW SacrificeCost(tc));
|
||||
}
|
||||
break;
|
||||
case 'e': //Exile
|
||||
manaCost->addExtraCost(NEW ExileTargetCost(tc));
|
||||
break;
|
||||
case 'h': //bounce
|
||||
case 'h': //bounce (move to Hand)
|
||||
manaCost->addExtraCost(NEW BounceTargetCost(tc));
|
||||
break;
|
||||
case 'l': //Life cost
|
||||
manaCost->addExtraCost(NEW LifeCost(tc));
|
||||
case 'l':
|
||||
if (value == "l2e") { //Mill to exile yourself as a cost (Library 2 Exile)
|
||||
manaCost->addExtraCost(NEW MillExileCost(tc));
|
||||
} else { //Life cost
|
||||
manaCost->addExtraCost(NEW LifeCost(tc));
|
||||
}
|
||||
break;
|
||||
case 'd': //DiscardRandom cost
|
||||
manaCost->addExtraCost(NEW DiscardRandomCost(tc));
|
||||
break;
|
||||
case 'q': //Hand To Library Cost
|
||||
manaCost->addExtraCost(NEW ToLibraryCost(tc));
|
||||
break;
|
||||
case 'm': //Mill yourself as a cost
|
||||
manaCost->addExtraCost(NEW MillCost(tc));
|
||||
break;
|
||||
case 'z': //Mill to exile yourself as a cost
|
||||
manaCost->addExtraCost(NEW MillExileCost(tc));
|
||||
break;
|
||||
case 'c': //Counters
|
||||
{
|
||||
size_t counter_start = value.find("(");
|
||||
|
||||
@@ -689,9 +689,9 @@ PlayerTargetChooser::PlayerTargetChooser(MTGCardInstance * card, int _maxtargets
|
||||
}
|
||||
|
||||
bool PlayerTargetChooser::canTarget(Targetable * target){
|
||||
if (source && targetter && (targetter->controller() != targetter->controller()->opponent()) && (targetter->controller()->opponent()->game->inPlay->hasType("controllershroud")) && targetter->controller() != target) return false;
|
||||
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->opponent()->game->inPlay->hasType("playershroud")) && targetter->controller()->opponent() == target) return false;
|
||||
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->game->inPlay->hasType("playershroud")) && targetter->controller()== target) return false;
|
||||
if (source && targetter && (targetter->controller() != targetter->controller()->opponent()) && (targetter->controller()->opponent()->game->inPlay->hasAbility(Constants::CONTROLLERSHROUD)) && targetter->controller() != target) return false;
|
||||
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->opponent()->game->inPlay->hasAbility(Constants::PLAYERSHROUD)) && targetter->controller()->opponent() == target) return false;
|
||||
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->game->inPlay->hasAbility(Constants::PLAYERSHROUD)) && targetter->controller()== target) return false;
|
||||
return (target->typeAsTarget() == TARGET_PLAYER) && (!p || p == (Player*)target);
|
||||
}
|
||||
|
||||
@@ -703,9 +703,9 @@ if (source && targetter && (targetter->controller() == targetter->controller())
|
||||
|
||||
/*Damageable Target */
|
||||
bool DamageableTargetChooser::canTarget(Targetable * target){
|
||||
if (source && targetter && (targetter->controller() != targetter->controller()->opponent()) && (targetter->controller()->opponent()->game->inPlay->hasType("controllershroud")) && targetter->controller() != target) return false;
|
||||
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->opponent()->game->inPlay->hasType("playershroud")) && targetter->controller()->opponent() == target) return false;
|
||||
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->game->inPlay->hasType("playershroud")) && targetter->controller()== target) return false;
|
||||
if (source && targetter && (targetter->controller() != targetter->controller()->opponent()) && (targetter->controller()->opponent()->game->inPlay->hasAbility(Constants::CONTROLLERSHROUD)) && targetter->controller() != target) return false;
|
||||
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->opponent()->game->inPlay->hasAbility(Constants::PLAYERSHROUD)) && targetter->controller()->opponent() == target) return false;
|
||||
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->game->inPlay->hasAbility(Constants::PLAYERSHROUD)) && targetter->controller()== target) return false;
|
||||
if (target->typeAsTarget() == TARGET_PLAYER){
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user