mirror of
https://github.com/correl/mage.git
synced 2025-04-08 01:01:04 -09:00
- Fixed #6732
This commit is contained in:
parent
8e5b72b8c7
commit
d02d8a4dfe
3 changed files with 25 additions and 8 deletions
Mage/src/main/java/mage/abilities
|
@ -45,7 +45,9 @@ public class BecomesBlockedByCreatureTriggeredAbility extends TriggeredAbilityIm
|
|||
if (!filter.match(blocker, game)) {
|
||||
return false;
|
||||
}
|
||||
this.getEffects().setTargetPointer(new FixedTarget(blocker, game));
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@ public class ExileTargetEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
/**
|
||||
* Exile cards to normal exile window (but it can exile to source's exile window after toSourceExileZone change)
|
||||
* Exile cards to normal exile window (but it can exile to source's exile
|
||||
* window after toSourceExileZone change)
|
||||
*/
|
||||
public ExileTargetEffect() {
|
||||
this(null, "");
|
||||
|
@ -91,21 +92,27 @@ public class ExileTargetEffect extends OneShotEffect {
|
|||
Set<Card> toExile = new LinkedHashSet<>();
|
||||
if (multitargetHandling
|
||||
&& targetPointer instanceof FirstTargetPointer
|
||||
&& (source.getTargets().size() > 1 || (source.getTargets().size() > 0 && source.getTargets().get(0).getTargets().size() > 1))) {
|
||||
&& (source.getTargets().size() > 1
|
||||
|| (source.getTargets().size() > 0
|
||||
&& source.getTargets().get(0).getTargets().size() > 1))) {
|
||||
for (Target target : source.getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null
|
||||
&& permanent.isPhasedIn()) {
|
||||
Zone currentZone = game.getState().getZone(permanent.getId());
|
||||
if (currentZone != Zone.EXILED && (onlyFromZone == null || onlyFromZone == Zone.BATTLEFIELD)) {
|
||||
if (currentZone != Zone.EXILED
|
||||
&& (onlyFromZone == null
|
||||
|| onlyFromZone == Zone.BATTLEFIELD)) {
|
||||
toExile.add(permanent);
|
||||
}
|
||||
} else {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
Zone currentZone = game.getState().getZone(card.getId());
|
||||
if (currentZone != Zone.EXILED && (onlyFromZone == null || onlyFromZone == currentZone)) {
|
||||
if (currentZone != Zone.EXILED
|
||||
&& (onlyFromZone == null
|
||||
|| onlyFromZone == currentZone)) {
|
||||
toExile.add(card);
|
||||
}
|
||||
} else {
|
||||
|
@ -123,14 +130,18 @@ public class ExileTargetEffect extends OneShotEffect {
|
|||
if (permanent != null
|
||||
&& permanent.isPhasedIn()) {
|
||||
Zone currentZone = game.getState().getZone(permanent.getId());
|
||||
if (currentZone != Zone.EXILED && (onlyFromZone == null || onlyFromZone == Zone.BATTLEFIELD)) {
|
||||
if (currentZone != Zone.EXILED
|
||||
&& (onlyFromZone == null
|
||||
|| onlyFromZone == Zone.BATTLEFIELD)) {
|
||||
toExile.add(permanent);
|
||||
}
|
||||
} else {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
Zone currentZone = game.getState().getZone(card.getId());
|
||||
if (currentZone != Zone.EXILED && (onlyFromZone == null || onlyFromZone == currentZone)) {
|
||||
if (currentZone != Zone.EXILED
|
||||
&& (onlyFromZone == null
|
||||
|| onlyFromZone == currentZone)) {
|
||||
toExile.add(card);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -36,7 +36,11 @@ public class ExileUntilSourceLeavesEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source);
|
||||
ExileTargetEffect effect = new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName());
|
||||
if (targetPointer != null) { // Grasping Giant
|
||||
effect.setTargetPointer(targetPointer);
|
||||
}
|
||||
return effect.apply(game, source);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue