mirror of
https://github.com/correl/mage.git
synced 2025-04-11 09:11:12 -09:00
* Praetor's Grasp - fixed that it freeze the game after cast;
This commit is contained in:
parent
9a08ccda95
commit
2197d8ee4a
3 changed files with 40 additions and 15 deletions
Mage.Sets/src/mage/cards/p
Mage.Tests/src/test/java/org/mage/test/cards/continuous
Mage/src/main/java/mage/constants
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.AsThoughEffectImpl;
|
import mage.abilities.effects.AsThoughEffectImpl;
|
||||||
|
@ -9,11 +8,7 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.AsThoughEffectType;
|
import mage.constants.*;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.game.ExileZone;
|
import mage.game.ExileZone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
@ -21,8 +16,9 @@ import mage.target.common.TargetCardInLibrary;
|
||||||
import mage.target.common.TargetOpponent;
|
import mage.target.common.TargetOpponent;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author BetaSteward
|
* @author BetaSteward
|
||||||
*/
|
*/
|
||||||
public final class PraetorsGrasp extends CardImpl {
|
public final class PraetorsGrasp extends CardImpl {
|
||||||
|
@ -120,12 +116,8 @@ class PraetorsGraspPlayEffect extends AsThoughEffectImpl {
|
||||||
if (exileId != null && controller != null) {
|
if (exileId != null && controller != null) {
|
||||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||||
if (exileZone != null && exileZone.contains(cardId)) {
|
if (exileZone != null && exileZone.contains(cardId)) {
|
||||||
if (controller.chooseUse(outcome, "Play the exiled card?", source, game)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
discard();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
package org.mage.test.cards.continuous;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author JayDi85
|
||||||
|
*/
|
||||||
|
public class PraetorsGraspTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_SimpleCast() {
|
||||||
|
// Search target opponent’s library for a card and exile it face down. Then that player shuffles their library.
|
||||||
|
// You may look at and play that card for as long as it remains exiled.
|
||||||
|
addCard(Zone.HAND, playerA, "Praetor's Grasp", 1); // {1}{B}{B}
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||||
|
addCard(Zone.LIBRARY, playerB, "Mountain", 1);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Praetor's Grasp");
|
||||||
|
addTarget(playerA, playerB);
|
||||||
|
addTarget(playerA, "Mountain");
|
||||||
|
|
||||||
|
showAvaileableAbilities("after", 1, PhaseStep.POSTCOMBAT_MAIN, playerA);
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
|
assertGraveyardCount(playerA, "Praetor's Grasp", 1);
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,7 +5,6 @@ package mage.constants;
|
||||||
* @author North
|
* @author North
|
||||||
*/
|
*/
|
||||||
public enum AsThoughEffectType {
|
public enum AsThoughEffectType {
|
||||||
|
|
||||||
ATTACK,
|
ATTACK,
|
||||||
ATTACK_AS_HASTE,
|
ATTACK_AS_HASTE,
|
||||||
ACTIVATE_HASTE,
|
ACTIVATE_HASTE,
|
||||||
|
@ -20,7 +19,7 @@ public enum AsThoughEffectType {
|
||||||
BLOCK_FORESTWALK,
|
BLOCK_FORESTWALK,
|
||||||
DAMAGE_NOT_BLOCKED,
|
DAMAGE_NOT_BLOCKED,
|
||||||
BE_BLOCKED,
|
BE_BLOCKED,
|
||||||
PLAY_FROM_NOT_OWN_HAND_ZONE,
|
PLAY_FROM_NOT_OWN_HAND_ZONE, // do not use dialogs in "applies" method for that type of effect (it calls multiple times)
|
||||||
CAST_AS_INSTANT,
|
CAST_AS_INSTANT,
|
||||||
ACTIVATE_AS_INSTANT,
|
ACTIVATE_AS_INSTANT,
|
||||||
DAMAGE,
|
DAMAGE,
|
||||||
|
|
Loading…
Add table
Reference in a new issue