mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
fixed Haldan and Pako (fixes #6482)
This commit is contained in:
parent
237babc5e8
commit
ae20bb36a4
2 changed files with 19 additions and 16 deletions
|
@ -48,6 +48,16 @@ public final class HaldanAvidArcanist extends CardImpl {
|
|||
public HaldanAvidArcanist copy() {
|
||||
return new HaldanAvidArcanist(this);
|
||||
}
|
||||
|
||||
static boolean checkCard(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (!PakoArcaneRetriever.checkWatcher(affectedControllerId, game.getCard(sourceId), game)
|
||||
|| !source.isControlledBy(affectedControllerId)
|
||||
|| game.getState().getZone(sourceId) != Zone.EXILED) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(sourceId);
|
||||
return card != null && !card.isCreature() && card.getCounters(game).containsKey(CounterType.FETCH);
|
||||
}
|
||||
}
|
||||
|
||||
class HaldanAvidArcanistCastFromExileEffect extends AsThoughEffectImpl {
|
||||
|
@ -73,13 +83,7 @@ class HaldanAvidArcanistCastFromExileEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (!PakoArcaneRetriever.checkWatcher(affectedControllerId, game.getCard(sourceId), game)
|
||||
|| !source.isControlledBy(affectedControllerId)
|
||||
|| game.getState().getZone(sourceId) != Zone.EXILED) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(sourceId);
|
||||
return card != null && !card.isCreature() && card.getCounters(game).containsKey(CounterType.FETCH);
|
||||
return HaldanAvidArcanist.checkCard(sourceId, source, affectedControllerId, game);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,13 +110,7 @@ class HaldanAvidArcanistSpendAnyManaEffect extends AsThoughEffectImpl implements
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (!PakoArcaneRetriever.checkWatcher(affectedControllerId, game.getCard(objectId), game)
|
||||
|| !source.isControlledBy(affectedControllerId)
|
||||
|| game.getState().getZone(objectId) != Zone.EXILED) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(objectId);
|
||||
return card != null && !card.isCreature() && card.getCounters(game).containsKey(CounterType.FETCH);
|
||||
return HaldanAvidArcanist.checkCard(objectId, source, affectedControllerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,7 +80,8 @@ class PakoArcaneRetrieverEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
PakoArcaneRetrieverWatcher watcher = game.getState().getWatcher(PakoArcaneRetrieverWatcher.class);
|
||||
if (controller == null || watcher == null) {
|
||||
return false;
|
||||
}
|
||||
Cards cards = new CardsImpl();
|
||||
|
@ -97,7 +98,11 @@ class PakoArcaneRetrieverEffect extends OneShotEffect {
|
|||
if (cards.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
cards.getCards(game).stream().forEach(card -> card.addCounters(CounterType.FETCH.createInstance(), source, game));
|
||||
cards.getCards(game)
|
||||
.stream()
|
||||
.filter(card -> card.addCounters(CounterType.FETCH.createInstance(), source, game))
|
||||
.filter(card -> !card.isCreature())
|
||||
.forEach(card -> watcher.addCard(controller.getId(), card, game));
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent == null || counters == 0) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue