Search in sources :

Example 1 with MenaceAbility

use of mage.abilities.keyword.MenaceAbility in project mage by magefree.

the class RenownTest method testRenownGainedGainAfterZoneChange.

/*
     Test renown can be gained again after zone change
     */
@Test
public void testRenownGainedGainAfterZoneChange() {
    addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
    // Renown 1
    // As long as Goblin Glory Chaser is renowned, it has menace.
    // 1/1 {R}
    addCard(Zone.HAND, playerA, "Goblin Glory Chaser");
    addCard(Zone.HAND, playerA, "Cloudshift");
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goblin Glory Chaser");
    castSpell(5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Goblin Glory Chaser");
    // 1 damage
    attack(3, playerA, "Goblin Glory Chaser");
    // 2 damage
    attack(5, playerA, "Goblin Glory Chaser");
    // 1 damage
    attack(7, playerA, "Goblin Glory Chaser");
    // 2 damage
    attack(9, playerA, "Goblin Glory Chaser");
    setStopAt(9, PhaseStep.POSTCOMBAT_MAIN);
    execute();
    Permanent goblin = getPermanent("Goblin Glory Chaser", playerA);
    Assert.assertEquals("has has renown", true, goblin.isRenowned());
    assertAbility(playerA, "Goblin Glory Chaser", new MenaceAbility(), true);
    assertPowerToughness(playerA, "Goblin Glory Chaser", 2, 2);
    assertLife(playerA, 20);
    assertLife(playerB, 14);
}
Also used : MenaceAbility(mage.abilities.keyword.MenaceAbility) Permanent(mage.game.permanent.Permanent) Test(org.junit.Test)

Example 2 with MenaceAbility

use of mage.abilities.keyword.MenaceAbility in project mage by magefree.

the class TwoHeadedGiantEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
        return false;
    }
    boolean head1 = player.flipCoin(source, game, false);
    boolean head2 = player.flipCoin(source, game, false);
    if (head1 == head2) {
        if (head1) {
            game.addEffect(new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn), source);
        } else {
            game.addEffect(new GainAbilitySourceEffect(new MenaceAbility(), Duration.EndOfTurn), source);
        }
    }
    return true;
}
Also used : Player(mage.players.Player) MenaceAbility(mage.abilities.keyword.MenaceAbility) GainAbilitySourceEffect(mage.abilities.effects.common.continuous.GainAbilitySourceEffect)

Example 3 with MenaceAbility

use of mage.abilities.keyword.MenaceAbility in project mage by magefree.

the class NissaOfShadowedBoughsCreatureEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null || !player.chooseUse(Outcome.BecomeCreature, "Have it become a creature?", source, game)) {
        return false;
    }
    game.addEffect(new BecomesCreatureTargetEffect(new CreatureToken(3, 3, "", SubType.ELEMENTAL).withAbility(HasteAbility.getInstance()).withAbility(new MenaceAbility()), false, true, Duration.EndOfTurn), source);
    return true;
}
Also used : Player(mage.players.Player) MenaceAbility(mage.abilities.keyword.MenaceAbility) BecomesCreatureTargetEffect(mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect) CreatureToken(mage.game.permanent.token.custom.CreatureToken)

Example 4 with MenaceAbility

use of mage.abilities.keyword.MenaceAbility in project mage by magefree.

the class ExertTest method exertEmberhornMinotaur.

@Test
public void exertEmberhornMinotaur() {
    String minotaur = "Emberhorn Minotaur";
    addCard(Zone.BATTLEFIELD, playerA, minotaur);
    attack(1, playerA, minotaur);
    setChoice(playerA, true);
    setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
    execute();
    assertAbility(playerA, minotaur, new MenaceAbility(), true);
    assertPowerToughness(playerA, minotaur, 5, 4);
}
Also used : MenaceAbility(mage.abilities.keyword.MenaceAbility) Test(org.junit.Test)

Example 5 with MenaceAbility

use of mage.abilities.keyword.MenaceAbility in project mage by magefree.

the class GainMenaceAbilityAsSingletonTest method test_SingletonNonMultiInstances.

@Test
// enable it after MenaceAbility will be singleton, see https://github.com/magefree/mage/issues/6720
@Ignore
public void test_SingletonNonMultiInstances() {
    // bug: permanent shows multiple instances of one ability in card's text
    // https://github.com/magefree/mage/issues/6720
    // {3}{R}{R}
    // Whenever Sethron, Hurloon General or another nontoken Minotaur enters the battlefield under your control, create a 2/3 red Minotaur creature token.
    // {2}{B/R}: Minotaurs you control get +1/+0 and gain menace and haste until end of turn. ({B/R} can be paid with either {B} or {R}.)
    addCard(Zone.HAND, playerA, "Sethron, Hurloon General", 7);
    addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5 + 3 * 3);
    // prepare minotaur token
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sethron, Hurloon General");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkPermanentCount("token", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Minotaur", 1);
    // boost 1
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{B/R}");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkPT("boost 1", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Minotaur", 2 + 1, 3);
    // boost 2
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{B/R}");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkPT("boost 2", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Minotaur", 2 + 1 * 2, 3);
    // boost 3
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{B/R}");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkPT("boost 3", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Minotaur", 2 + 1 * 3, 3);
    setStrictChooseMode(true);
    setStopAt(1, PhaseStep.END_TURN);
    execute();
    assertAllCommandsUsed();
    Permanent permanent = getPermanent("Minotaur", playerA);
    Assert.assertEquals("must have only 1 Menace instance", 1, permanent.getAbilities(currentGame).stream().filter(a -> a instanceof MenaceAbility).count());
}
Also used : MenaceAbility(mage.abilities.keyword.MenaceAbility) Permanent(mage.game.permanent.Permanent) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

MenaceAbility (mage.abilities.keyword.MenaceAbility)7 Permanent (mage.game.permanent.Permanent)3 Test (org.junit.Test)3 Player (mage.players.Player)2 UUID (java.util.UUID)1 BecomesCreatureTargetEffect (mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect)1 GainAbilitySourceEffect (mage.abilities.effects.common.continuous.GainAbilitySourceEffect)1 GainAbilityTargetEffect (mage.abilities.effects.common.continuous.GainAbilityTargetEffect)1 SamuraiToken (mage.game.permanent.token.SamuraiToken)1 Token (mage.game.permanent.token.Token)1 CreatureToken (mage.game.permanent.token.custom.CreatureToken)1 FixedTargets (mage.target.targetpointer.FixedTargets)1 Ignore (org.junit.Ignore)1