mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Make it possible to play lands using hideaway
Previously lands were not playable due to the ignoreTimings flag being set to false. Added checks for the hideaway rulings regarding lands.
This commit is contained in:
parent
a34cf7115c
commit
f06e6a7bbb
2 changed files with 87 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ package mage.abilities.effects.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
|
|
@ -68,7 +69,18 @@ public class HideawayPlayEffect extends OneShotEffect {
|
|||
if (controller.chooseUse(Outcome.PlayForFree, "Do you want to play " + card.getIdName() + " for free now?", source, game)) {
|
||||
card.setFaceDown(false, game);
|
||||
int zcc = card.getZoneChangeCounter(game);
|
||||
if (!controller.playCard(card, game, true, false)) {
|
||||
|
||||
/* 702.74. Hideaway, rulings:
|
||||
* If the removed card is a land, you may play it as a result of the last ability only if it's your turn
|
||||
* and you haven't already played a land that turn. This counts as your land play for the turn.
|
||||
*/
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (controller.getLandsPlayed() > 0 || !game.getActivePlayerId().equals(controller.getId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!controller.playCard(card, game, true, true)) {
|
||||
if (card.getZoneChangeCounter(game) == zcc) {
|
||||
card.setFaceDown(true, game);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue