mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Check if exists a target to counter in Stack before counter
This commit is contained in:
parent
d98e43ded2
commit
3c5bd9acce
1 changed files with 17 additions and 1 deletions
|
@ -126,7 +126,8 @@ class SpellstutterSpriteCounterTargetEffect extends OneShotEffect {
|
|||
*/
|
||||
int numberFaeries = game.getState().getBattlefield().countAll(SpellstutterSprite.filter, source.getControllerId(), game);
|
||||
StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget());
|
||||
if (stackObject.getConvertedManaCost() <= numberFaeries) {
|
||||
// If do'nt have any spell targeted
|
||||
if (stackObject != null && stackObject.getConvertedManaCost() <= numberFaeries) {
|
||||
if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -134,6 +135,21 @@ class SpellstutterSpriteCounterTargetEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean apply(Game game, Ability source) {
|
||||
// Player controller = game.getPlayer(source.getControllerId());
|
||||
// MageObject sourceObject = source.getSourceObject(game);
|
||||
// if (controller != null && sourceObject != null) {
|
||||
// Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
|
||||
// if (spell != null) {
|
||||
// UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
// return controller.moveCardsToExile(spell, source, game, true, exileId, sourceObject.getIdName());
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return "counter target spell with converted mana cost X or less, where X is the number of Faeries you control";
|
||||
|
|
Loading…
Reference in a new issue