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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations