use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class ConditionalCostModificationTest method test_ModificationConditionalNotActive.
@Test
public void test_ModificationConditionalNotActive() {
addCustomCardWithAbility("mod", playerA, new SimpleStaticAbility(new ConditionalCostModificationEffect(new AbilitiesCostReductionControllerEffect(EquipAbility.class, "equip"), NotMyTurnCondition.instance, "")));
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1);
addCard(Zone.BATTLEFIELD, playerA, "Dagger of the Worthy", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Balduvian Bears");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertTappedCount("Mountain", true, 2);
assertTappedCount("Mountain", false, 0);
}
use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class EndOfTurnOneOpponentTest method test_UntilEndOfYourNextTurnSingle.
@Test
public void test_UntilEndOfYourNextTurnSingle() {
addCustomCardWithAbility("boost1", playerA, new SimpleStaticAbility(Zone.ALL, new BoostAllEffect(1, 1, Duration.UntilEndOfYourNextTurn)));
prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 1, playerA, true, PhaseStep.END_TURN);
prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 2, playerA, true, PhaseStep.END_TURN);
prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 3, playerA, true, PhaseStep.END_TURN);
prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 4, playerA, true, null);
addCard(Zone.BATTLEFIELD, playerA, cardBear2, 1);
addCard(Zone.BATTLEFIELD, playerB, cardBear2, 1);
attack(1, playerA, cardBear2);
attack(2, playerB, cardBear2);
attack(3, playerA, cardBear2);
attack(4, playerB, cardBear2);
setStopAt(4, PhaseStep.CLEANUP);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class EndOfTurnOneOpponentTest method test_UntilYourNextTurnSingle.
@Test
public void test_UntilYourNextTurnSingle() {
addCustomCardWithAbility("boost1", playerA, new SimpleStaticAbility(Zone.ALL, new BoostAllEffect(1, 1, Duration.UntilYourNextTurn)));
prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 1, playerA, true, PhaseStep.END_TURN);
prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 2, playerA, true, PhaseStep.END_TURN);
prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 3, playerA, true, null);
prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 4, playerA, true, null);
addCard(Zone.BATTLEFIELD, playerA, cardBear2, 1);
addCard(Zone.BATTLEFIELD, playerB, cardBear2, 1);
attack(1, playerA, cardBear2);
attack(2, playerB, cardBear2);
attack(3, playerA, cardBear2);
attack(4, playerB, cardBear2);
setStopAt(4, PhaseStep.CLEANUP);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class ConditionalAsThoughTest method test_PlayFromNotOwnHandZoneAllEffect.
@Test
public void test_PlayFromNotOwnHandZoneAllEffect() {
removeAllCardsFromLibrary(playerA);
removeAllCardsFromLibrary(playerB);
addCustomCardWithAbility("play any library on any creature", playerA, new SimpleStaticAbility(Zone.ALL, new ConditionalAsThoughEffect(new PlayFromNotOwnHandZoneAllEffect(StaticFilters.FILTER_CARD, Zone.LIBRARY, false, TargetController.ANY, Duration.EndOfTurn), new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_PERMANENT_CREATURE, ComparisonType.MORE_THAN, 0))));
addCard(Zone.HAND, playerA, "Grizzly Bears");
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
addCard(Zone.LIBRARY, playerB, "Lightning Bolt");
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 5);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
// can't play lib's card before good condition
checkPlayableAbility("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Grizzly Bears", true);
checkPlayableAbility("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Silvercoat Lion", false);
checkPlayableAbility("before", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Lightning Bolt", false);
// make good condition - now we can play any lib's card
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkPlayableAbility("after", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Grizzly Bears", false);
checkPlayableAbility("after", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Silvercoat Lion", true);
checkPlayableAbility("after", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Lightning Bolt", true);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
}
use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class InfoEffect method addCardHintToPermanentConditional.
/**
* Add temporary card hint to permanent (visible in rules list)
* Will be visible on conditional only
*
* @param game
* @param source
* @param permanent
* @param cardHint
* @param duration
* @param condition
*/
public static void addCardHintToPermanentConditional(Game game, Ability source, Permanent permanent, Hint cardHint, Duration duration, Condition condition) {
SimpleStaticAbility ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new InfoEffect("hint"));
ability.setRuleVisible(false);
ability.addHint(cardHint);
GainAbilityTargetEffect gainEffect = new GainAbilityTargetEffect(ability, duration);
gainEffect.setTargetPointer(new FixedTarget(permanent, game));
ConditionalContinuousEffect conditionalEffect = new ConditionalContinuousEffect(gainEffect, condition, "test");
conditionalEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(conditionalEffect, source);
}
Aggregations