Esempio n. 1
0
  /** Check if a face down Morph creature gets exiled, it will be face up in exile zone. */
  @Test
  public void testExileFaceDownCreature() {
    addCard(Zone.HAND, playerA, "Birchlore Rangers", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);

    addCard(Zone.HAND, playerB, "Swords to Plowshares", 1);
    addCard(Zone.BATTLEFIELD, playerB, "Plains", 1);

    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Birchlore Rangers");
    setChoice(playerA, "Yes"); // cast it face down as 2/2 creature

    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Swords to Plowshares", "");

    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();

    assertLife(playerA, 22); // + 2 from Swords to Plowshares
    assertLife(playerB, 20);

    assertGraveyardCount(playerB, "Swords to Plowshares", 1);
    assertExileCount("Birchlore Rangers", 1);

    for (Card card : currentGame.getExile().getAllCards(currentGame)) {
      if (card.getName().equals("Birchlore Rangers")) {
        Assert.assertEquals(
            "Birchlore Rangers has to be face up in exile", false, card.isFaceDown(currentGame));
        break;
      }
    }
  }
Esempio n. 2
0
  /**
   * Check that a DiesTriggeredAbility of a creature does not trigger if the creature dies face down
   */
  @Test
  public void testDiesTriggeredDoesNotTriggerIfFaceDown() {
    // Flying
    // When Ashcloud Phoenix dies, return it to the battlefield face down.
    // Morph (You may cast this card face down as a 2/2 creature for . Turn it face up any time for
    // its morph cost.)
    // When Ashcloud Phoenix is turned face up, it deals 2 damage to each player.
    addCard(Zone.HAND, playerA, "Ashcloud Phoenix", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);

    addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
    addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);

    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ashcloud Phoenix");
    setChoice(playerA, "Yes"); // cast it face down as 2/2 creature

    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "");

    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();

    assertLife(playerA, 20);
    assertLife(playerB, 20);

    assertGraveyardCount(playerB, "Lightning Bolt", 1);
    assertGraveyardCount(playerA, "Ashcloud Phoenix", 1);

    for (Card card : playerA.getGraveyard().getCards(currentGame)) {
      if (card.getName().equals("Ashcloud Phoenix")) {
        Assert.assertEquals(
            "Ashcloud Phoenix has to be face up in graveyard", false, card.isFaceDown(currentGame));
        break;
      }
    }
  }
Esempio n. 3
0
 public SimpleCardsView(Collection<Card> cards) {
   for (Card card : cards) {
     this.put(
         card.getId(),
         new SimpleCardView(
             card.getId(),
             card.getExpansionSetCode(),
             card.getCardNumber(),
             card.isFaceDown(),
             card.getUsesVariousArt()));
   }
 }
Esempio n. 4
0
  /**
   * Check that a DiesTriggeredAbility of a creature does not trigger if the creature dies face down
   * in combat
   */
  @Test
  public void testDiesTriggeredDoesNotTriggerInCombatIfFaceDown() {
    // Flying
    // When Ashcloud Phoenix dies, return it to the battlefield face down.
    // Morph (You may cast this card face down as a 2/2 creature for . Turn it face up any time for
    // its morph cost.)
    // When Ashcloud Phoenix is turned face up, it deals 2 damage to each player.
    addCard(Zone.HAND, playerA, "Ashcloud Phoenix", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);

    // First strike, forestwalk, vigilance
    // (This creature deals combat damage before creatures without first strike, it can't be blocked
    // as long as defending player controls a Forest, and attacking doesn't cause this creature to
    // tap.)
    addCard(Zone.BATTLEFIELD, playerB, "Mirri, Cat Warrior");

    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ashcloud Phoenix");
    setChoice(playerA, "Yes"); // cast it face down as 2/2 creature

    attack(2, playerB, "Mirri, Cat Warrior");
    block(2, playerA, "", "Mirri, Cat Warrior");

    setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
    execute();

    assertGraveyardCount(playerA, "Ashcloud Phoenix", 1);

    for (Card card : playerA.getGraveyard().getCards(currentGame)) {
      if (card.getName().equals("Ashcloud Phoenix")) {
        Assert.assertEquals(
            "Ashcloud Phoenix has to be face up in graveyard", false, card.isFaceDown(currentGame));
        break;
      }
    }

    assertLife(playerA, 20);
    assertLife(playerB, 20);
  }