mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
- Fixed #6732
This commit is contained in:
parent
8e5b72b8c7
commit
d02d8a4dfe
3 changed files with 25 additions and 8 deletions
|
|
@ -45,7 +45,9 @@ public class BecomesBlockedByCreatureTriggeredAbility extends TriggeredAbilityIm
|
||||||
if (!filter.match(blocker, game)) {
|
if (!filter.match(blocker, game)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.getEffects().setTargetPointer(new FixedTarget(blocker, game));
|
for (Effect effect : this.getEffects()) {
|
||||||
|
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
|
||||||
|
}
|
||||||
return true;
|
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() {
|
public ExileTargetEffect() {
|
||||||
this(null, "");
|
this(null, "");
|
||||||
|
|
@ -91,21 +92,27 @@ public class ExileTargetEffect extends OneShotEffect {
|
||||||
Set<Card> toExile = new LinkedHashSet<>();
|
Set<Card> toExile = new LinkedHashSet<>();
|
||||||
if (multitargetHandling
|
if (multitargetHandling
|
||||||
&& targetPointer instanceof FirstTargetPointer
|
&& 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 (Target target : source.getTargets()) {
|
||||||
for (UUID targetId : target.getTargets()) {
|
for (UUID targetId : target.getTargets()) {
|
||||||
Permanent permanent = game.getPermanent(targetId);
|
Permanent permanent = game.getPermanent(targetId);
|
||||||
if (permanent != null
|
if (permanent != null
|
||||||
&& permanent.isPhasedIn()) {
|
&& permanent.isPhasedIn()) {
|
||||||
Zone currentZone = game.getState().getZone(permanent.getId());
|
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);
|
toExile.add(permanent);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Card card = game.getCard(targetId);
|
Card card = game.getCard(targetId);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
Zone currentZone = game.getState().getZone(card.getId());
|
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);
|
toExile.add(card);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -123,14 +130,18 @@ public class ExileTargetEffect extends OneShotEffect {
|
||||||
if (permanent != null
|
if (permanent != null
|
||||||
&& permanent.isPhasedIn()) {
|
&& permanent.isPhasedIn()) {
|
||||||
Zone currentZone = game.getState().getZone(permanent.getId());
|
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);
|
toExile.add(permanent);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Card card = game.getCard(targetId);
|
Card card = game.getCard(targetId);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
Zone currentZone = game.getState().getZone(card.getId());
|
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);
|
toExile.add(card);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,11 @@ public class ExileUntilSourceLeavesEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
if (permanent != null) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue