Merge branch 'fix_possiblecard_removeaideck' into 'master'

Fix possiblecard with removeaideck

See merge request core-developers/forge!5251
This commit is contained in:
Michael Kamensky
2021-08-23 05:16:11 +00:00
2 changed files with 4 additions and 0 deletions

View File

@@ -107,6 +107,8 @@ public class CopyPermanentEffect extends TokenEffectBase {
Card possibleCard = Card.fromPaperCard(cp, activator); // Need to temporarily set the Owner so the Game is set
if (possibleCard.isValid(valid, host.getController(), host, sa)) {
if (host.getController().isAI() && possibleCard.getRules() != null && possibleCard.getRules().getAiHints().getRemAIDecks())
continue;
choice.add(possibleCard);
ncopied -= 1;
}

View File

@@ -124,6 +124,8 @@ public class PlayEffect extends SpellAbilityEffect {
int ncopied = AbilityUtils.calculateAmount(source, num, sa);
for (PaperCard cp : Aggregates.random(cards, ncopied)) {
final Card possibleCard = Card.fromPaperCard(cp, sa.getActivatingPlayer());
if (sa.getActivatingPlayer().isAI() && possibleCard.getRules() != null && possibleCard.getRules().getAiHints().getRemAIDecks())
continue;
// Need to temporarily set the Owner so the Game is set
possibleCard.setOwner(sa.getActivatingPlayer());
choice.add(possibleCard);