* Basri's Lieutenant - Fixed that it created also the token if Lieutenant dies without a +1/+1 token (fixes #6863).

This commit is contained in:
LevelX2 2020-07-20 10:35:18 +02:00
parent 048ce3f2a7
commit 5cb950e53f
2 changed files with 11 additions and 6 deletions

View file

@ -1,5 +1,6 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -22,8 +23,6 @@ import mage.filter.predicate.permanent.CounterPredicate;
import mage.game.permanent.token.KnightToken;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
*
* @author htrajan
@ -41,7 +40,7 @@ public final class BasrisLieutenant extends CardImpl {
public BasrisLieutenant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(3);
@ -63,7 +62,7 @@ public final class BasrisLieutenant extends CardImpl {
new CreateTokenEffect(new KnightToken()).setText("if it had a +1/+1 counter on it, create a 2/2 white Knight creature token with vigilance"),
false,
controlledCreatureWithP1P1CounterFilter
));
).setApplyFilterOnSource(true));
}
private BasrisLieutenant(final BasrisLieutenant card) {

View file

@ -1,4 +1,3 @@
package mage.abilities.common;
import mage.MageObject;
@ -17,6 +16,7 @@ import mage.game.permanent.Permanent;
public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityImpl {
protected FilterCreaturePermanent filter;
private boolean applyFilterOnSource = false;
public DiesThisOrAnotherCreatureTriggeredAbility(Effect effect, boolean optional) {
this(effect, optional, new FilterCreaturePermanent());
@ -30,6 +30,12 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI
public DiesThisOrAnotherCreatureTriggeredAbility(DiesThisOrAnotherCreatureTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.applyFilterOnSource = ability.applyFilterOnSource;
}
public DiesThisOrAnotherCreatureTriggeredAbility setApplyFilterOnSource(boolean applyFilterOnSource) {
this.applyFilterOnSource = applyFilterOnSource;
return this;
}
@Override
@ -68,7 +74,7 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI
if (zEvent.isDiesEvent()) {
if (zEvent.getTarget() != null) {
if (zEvent.getTarget().getId().equals(this.getSourceId())) {
if (!applyFilterOnSource && zEvent.getTarget().getId().equals(this.getSourceId())) {
return true;
} else {
if (filter.match(zEvent.getTarget(), getSourceId(), getControllerId(), game)) {