Search in sources :

Example 1 with RiotAbility

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

the class DomriChaosBringerTriggeredAbility method checkTrigger.

@Override
public boolean checkTrigger(GameEvent event, Game game) {
    if (!event.getSourceId().equals(spellId)) {
        return false;
    }
    if (game.getTurnNum() != turnNumber) {
        return false;
    }
    MageObject mo = game.getObject(event.getTargetId());
    if (mo == null || !mo.isCreature(game)) {
        return false;
    }
    StackObject stackObject = game.getStack().getStackObject(event.getTargetId());
    if (stackObject == null) {
        return false;
    }
    this.getEffects().clear();
    FilterCard filter = new FilterCard();
    filter.add(new CardIdPredicate(stackObject.getSourceId()));
    this.addEffect(new GainAbilityControlledSpellsEffect(new RiotAbility(), filter));
    return true;
}
Also used : FilterCard(mage.filter.FilterCard) RiotAbility(mage.abilities.keyword.RiotAbility) MageObject(mage.MageObject) StackObject(mage.game.stack.StackObject) CardIdPredicate(mage.filter.predicate.mageobject.CardIdPredicate) GainAbilityControlledSpellsEffect(mage.abilities.effects.common.continuous.GainAbilityControlledSpellsEffect)

Example 2 with RiotAbility

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

the class RiotTest method RiotRhythmOfTheWildNotCastBoost.

@Test
public void RiotRhythmOfTheWildNotCastBoost() {
    addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
    // Creature spells you control can't be countered.
    // Nontoken creatures you control have riot.
    addCard(Zone.BATTLEFIELD, playerA, "Rhythm of the Wild", 1);
    // Riot (This creature enters the battleifled with your choice of a +1/+1 counter or haste.)
    // Each player returns a creature card from their graveyard to the battlefield
    addCard(Zone.HAND, playerA, "Exhume", 1);
    // Creature {1}{W}  2/2
    addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 1);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exhume");
    // yes - counter
    setChoice(playerA, true);
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    assertPermanentCount(playerA, "Silvercoat Lion", 1);
    assertPowerToughness(playerA, "Silvercoat Lion", 3, 3);
    assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), false);
    assertAbility(playerA, "Silvercoat Lion", new RiotAbility(), true);
}
Also used : RiotAbility(mage.abilities.keyword.RiotAbility) Test(org.junit.Test)

Example 3 with RiotAbility

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

the class RiotTest method RiotRhythmOfTheWildNotCastHaste.

@Test
public void RiotRhythmOfTheWildNotCastHaste() {
    addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
    // Creature spells you control can't be countered.
    // Nontoken creatures you control have riot.
    addCard(Zone.BATTLEFIELD, playerA, "Rhythm of the Wild", 1);
    // Riot (This creature enters the battleifled with your choice of a +1/+1 counter or haste.)
    // Each player returns a creature card from their graveyard to the battlefield
    addCard(Zone.HAND, playerA, "Exhume", 1);
    // Creature {1}{W}  2/2
    addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 1);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exhume");
    // no - haste
    setChoice(playerA, false);
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    assertPermanentCount(playerA, "Silvercoat Lion", 1);
    assertPowerToughness(playerA, "Silvercoat Lion", 2, 2);
    assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true);
    assertAbility(playerA, "Silvercoat Lion", new RiotAbility(), true);
}
Also used : RiotAbility(mage.abilities.keyword.RiotAbility) Test(org.junit.Test)

Example 4 with RiotAbility

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

the class RiotTest method RiotRhythmOfTheWildBoost.

@Test
public void RiotRhythmOfTheWildBoost() {
    addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
    // Creature spells you control can't be countered.
    // Nontoken creatures you control have riot.
    addCard(Zone.BATTLEFIELD, playerA, "Rhythm of the Wild", 1);
    // Riot (This creature enters the battleifled with your choice of a +1/+1 counter or haste.)
    // Creature {1}{W}  2/2
    addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
    // yes - counter
    setChoice(playerA, true);
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
    assertPermanentCount(playerA, "Silvercoat Lion", 1);
    assertPowerToughness(playerA, "Silvercoat Lion", 3, 3);
    assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), false);
    assertAbility(playerA, "Silvercoat Lion", new RiotAbility(), true);
}
Also used : RiotAbility(mage.abilities.keyword.RiotAbility) Test(org.junit.Test)

Example 5 with RiotAbility

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

the class RiotTest method RiotRhythmOfTheWildDoubleBoost.

@Test
public void RiotRhythmOfTheWildDoubleBoost() {
    addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
    // Creature spells you control can't be countered.
    // Nontoken creatures you control have riot.
    addCard(Zone.BATTLEFIELD, playerA, "Rhythm of the Wild", 2);
    // Riot (This creature enters the battleifled with your choice of a +1/+1 counter or haste.)
    // Creature {1}{W}  2/2
    addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
    // choose replacement effect
    setChoice(playerA, "Rhythm of the Wild");
    // yes - counter
    setChoice(playerA, true);
    // yes - counter
    setChoice(playerA, true);
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
    assertPermanentCount(playerA, "Silvercoat Lion", 1);
    assertPowerToughness(playerA, "Silvercoat Lion", 2 + 2, 2 + 2);
    assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), false);
    assertAbility(playerA, "Silvercoat Lion", new RiotAbility(), true);
}
Also used : RiotAbility(mage.abilities.keyword.RiotAbility) Test(org.junit.Test)

Aggregations

RiotAbility (mage.abilities.keyword.RiotAbility)6 Test (org.junit.Test)5 MageObject (mage.MageObject)1 GainAbilityControlledSpellsEffect (mage.abilities.effects.common.continuous.GainAbilityControlledSpellsEffect)1 FilterCard (mage.filter.FilterCard)1 CardIdPredicate (mage.filter.predicate.mageobject.CardIdPredicate)1 StackObject (mage.game.stack.StackObject)1