Fixed Gideon's Triumph that it can sacrifice any creatures, not from current turn;

This commit is contained in:
Oleg Agafonov 2019-04-23 16:22:03 +04:00
parent 081ac7ca3c
commit 00915c65d7

View file

@ -49,13 +49,13 @@ public final class GideonsTriumph extends CardImpl {
class GideonsTriumphEffect extends OneShotEffect { class GideonsTriumphEffect extends OneShotEffect {
private static final FilterControlledPlaneswalkerPermanent filter private static final FilterControlledPlaneswalkerPermanent filterGideon
= new FilterControlledPlaneswalkerPermanent(SubType.GIDEON); = new FilterControlledPlaneswalkerPermanent(SubType.GIDEON);
private static final FilterPermanent filter2 private static final FilterPermanent filterSacrifice
= new FilterPermanent("creature that attacked or blocked this turn"); = new FilterPermanent("creature that attacked or blocked this turn");
static { static {
filter2.add(GideonsTriumphCondition.instance); filterSacrifice.add(GideonsTriumphPredicate.instance);
} }
GideonsTriumphEffect() { GideonsTriumphEffect() {
@ -76,14 +76,14 @@ class GideonsTriumphEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int count = 1; int count = 1;
if (!game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game).isEmpty()) { if (!game.getBattlefield().getActivePermanents(filterGideon, source.getControllerId(), game).isEmpty()) {
count++; count++;
} }
return new SacrificeEffect(filter2, count, "Target opponent").apply(game, source); return new SacrificeEffect(filterSacrifice, count, "Target opponent").apply(game, source);
} }
} }
enum GideonsTriumphCondition implements Predicate<Permanent> { enum GideonsTriumphPredicate implements Predicate<Permanent> {
instance; instance;
@Override @Override
@ -123,4 +123,9 @@ class GideonsTriumphWatcher extends Watcher {
return new GideonsTriumphWatcher(this); return new GideonsTriumphWatcher(this);
} }
@Override
public void reset() {
attackedOrBlockedThisTurnCreatures.clear();
}
} }