mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
fixed Cavalier of Flame discard triggers
This commit is contained in:
parent
f64549213f
commit
8f04b9fb14
1 changed files with 3 additions and 7 deletions
|
@ -16,6 +16,7 @@ import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
|||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
|
@ -103,14 +104,9 @@ class CavalierOfFlameEffect extends OneShotEffect {
|
|||
}
|
||||
TargetCardInHand target = new TargetCardInHand(0, player.getHand().size(), StaticFilters.FILTER_CARD);
|
||||
if (player.choose(Outcome.Discard, player.getHand(), target, game)) {
|
||||
int counter = target
|
||||
.getTargets()
|
||||
.stream()
|
||||
.map(uuid -> game.getCard(uuid))
|
||||
.mapToInt(card -> card != null && player.discard(card, source, game) ? 1 : 0)
|
||||
.sum();
|
||||
int counter = player.discard(new CardsImpl(target.getTargets()), source, game).size();
|
||||
player.drawCards(counter, source.getSourceId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue