mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
Fix portcullis
This commit is contained in:
parent
56526d5413
commit
6cf3d8b7b4
1 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -91,14 +90,18 @@ class PortcullisExileEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
|
||||||
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
|
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
|
||||||
|
|
||||||
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
|
if (permanent == null) {
|
||||||
|
permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
||||||
|
}
|
||||||
if (permanent != null && creature != null) {
|
if (permanent != null && creature != null) {
|
||||||
Player controller = game.getPlayer(creature.getControllerId());
|
Player controller = game.getPlayer(creature.getControllerId());
|
||||||
Zone currentZone = game.getState().getZone(creature.getId());
|
Zone currentZone = game.getState().getZone(creature.getId());
|
||||||
if (currentZone == Zone.BATTLEFIELD) {
|
if (currentZone == Zone.BATTLEFIELD) {
|
||||||
controller.moveCardsToExile(creature, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName());
|
controller.moveCardsToExile(creature, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue