mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Test framework: added fast command to add cost modification effect in test game (addCustomEffect_SpellCostModification)
This commit is contained in:
parent
5fa660a1d8
commit
586538a66c
1 changed files with 27 additions and 1 deletions
|
@ -5,6 +5,10 @@ import mage.abilities.Abilities;
|
|||
import mage.abilities.AbilitiesImpl;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect;
|
||||
import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -12,6 +16,7 @@ import mage.cards.decks.DeckCardLists;
|
|||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.match.MatchType;
|
||||
import mage.game.permanent.PermanentCard;
|
||||
|
@ -415,6 +420,27 @@ public abstract class MageTestPlayerBase {
|
|||
Assert.fail("Unsupported zone: " + putAtZone);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add cost modification effect to the game (all cast cost will be increaded or decreased for controller)
|
||||
*
|
||||
* @param controller
|
||||
* @param modificationAmount
|
||||
*/
|
||||
protected void addCustomEffect_SpellCostModification(TestPlayer controller, int modificationAmount) {
|
||||
Effect effect;
|
||||
if (modificationAmount >= 0) {
|
||||
effect = new SpellsCostIncreasingAllEffect(modificationAmount, StaticFilters.FILTER_CARD, TargetController.YOU);
|
||||
} else {
|
||||
effect = new SpellsCostReductionAllEffect(StaticFilters.FILTER_CARD, -1 * modificationAmount, false, true);
|
||||
}
|
||||
|
||||
addCustomCardWithAbility(
|
||||
"cost modification " + controller.getName(),
|
||||
controller,
|
||||
new SimpleStaticAbility(effect)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// custom card with global abilities list to init (can contains abilities per card name)
|
||||
|
|
Loading…
Reference in a new issue