Crew Corrections

This commit is contained in:
Anthony Calosa
2017-02-01 18:40:09 +08:00
parent ea5e397595
commit 711934a249
3 changed files with 39 additions and 35 deletions
+24 -23
View File
@@ -3227,29 +3227,30 @@ int MTGLegendRule::receiveEvent(WEvent * event)
MTGCardInstance * card = zone->cards[k];
if (card && card->hasType(Subtypes::TYPE_LEGENDARY) && !card->isPhased)
{
if(card->has(Constants::NOLEGEND)||card->controller()->opponent()->inPlay()->hasAbility(Constants::NOLEGENDRULE)||card->controller()->inPlay()->hasAbility(Constants::NOLEGENDRULE))
;
else
if(card->countDuplicateCardNames() > 1)
{
vector<MTGAbility*>selection;
TargetChooserFactory tfL(game);
tcL = tfL.createTargetChooser("*[share!name!]|mybattlefield",card->clone());
tcL->targetter = NULL;
tcL->maxtargets = card->countDuplicateCardNames()-1;
Legendrule = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, NULL,"ownergraveyard","Put in Graveyard");
Legendrule->oneShot = true;
Legendrule->canBeInterrupted = false;
LegendruleAbility = NEW GenericTargetAbility(game, "","",game->mLayers->actionLayer()->getMaxId(), card,tcL, Legendrule->clone());
LegendruleAbility->oneShot = true;
LegendruleAbility->canBeInterrupted = false;
LegendruleGeneric = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), card,NULL,LegendruleAbility->clone());
LegendruleGeneric->oneShot = true;
selection.push_back(LegendruleGeneric->clone());
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule");
menuChoice->addToGame();
return 1;
}
bool condition = (card->has(Constants::NOLEGEND)||card->controller()->opponent()->inPlay()->hasAbility(Constants::NOLEGENDRULE)||card->controller()->inPlay()->hasAbility(Constants::NOLEGENDRULE))?false:true;
if(condition && card->countDuplicateCardNames() > 1)
{
vector<MTGAbility*>selection;
TargetChooserFactory tfL(game);
tcL = tfL.createTargetChooser("*[share!name!]|mybattlefield",card->clone());
tcL->targetter = NULL;
tcL->maxtargets = card->countDuplicateCardNames()-1;
Legendrule = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, NULL,"ownergraveyard","Put in Graveyard");
Legendrule->oneShot = true;
Legendrule->canBeInterrupted = false;
LegendruleAbility = NEW GenericTargetAbility(game, "","",game->mLayers->actionLayer()->getMaxId(), card,tcL, Legendrule->clone());
SAFE_DELETE(Legendrule);
LegendruleAbility->oneShot = true;
LegendruleAbility->canBeInterrupted = false;
LegendruleGeneric = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), card,NULL,LegendruleAbility->clone());
SAFE_DELETE(LegendruleAbility);
LegendruleGeneric->oneShot = true;
selection.push_back(LegendruleGeneric->clone());
SAFE_DELETE(LegendruleGeneric);
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule");
menuChoice->addToGame();
return 1;
}
}
}
}