mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
merge
This commit is contained in:
commit
194a454f86
2 changed files with 9 additions and 6 deletions
|
@ -287,11 +287,14 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
||||||
targets = threats(opponentId, ((FilterCreatureOrPlayer)t.getFilter()).getCreatureFilter(), game);
|
targets = threats(opponentId, ((FilterCreatureOrPlayer)t.getFilter()).getCreatureFilter(), game);
|
||||||
}
|
}
|
||||||
for (Permanent permanent: targets) {
|
for (Permanent permanent: targets) {
|
||||||
|
List<UUID> alreadyTargetted = target.getTargets();
|
||||||
if (t.canTarget(playerId, permanent.getId(), source, game)) {
|
if (t.canTarget(playerId, permanent.getId(), source, game)) {
|
||||||
|
if ( alreadyTargetted != null && !alreadyTargetted.contains(permanent.getId()) ) {
|
||||||
target.addTarget(permanent.getId(), source, game);
|
target.addTarget(permanent.getId(), source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (outcome.isGood()) {
|
if (outcome.isGood()) {
|
||||||
if (target.canTarget(playerId, source, game)) {
|
if (target.canTarget(playerId, source, game)) {
|
||||||
target.addTarget(playerId, source, game);
|
target.addTarget(playerId, source, game);
|
||||||
|
|
|
@ -37,12 +37,12 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
import mage.game.events.GameEvent.EventType;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -98,9 +98,9 @@ class NissasChosenEffect extends ReplacementEffectImpl<NissasChosenEffect> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Card card = game.getCard(event.getTargetId());
|
||||||
if ( permanent != null && event.getTargetId().equals(source.getSourceId()) ) {
|
if ( card != null && event.getTargetId().equals(source.getSourceId()) ) {
|
||||||
return permanent.moveToZone(Zone.LIBRARY, source.getId(), game, onTop);
|
return card.moveToZone(Zone.LIBRARY, source.getId(), game, onTop);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue