some more text fixes for adding counter effects

This commit is contained in:
Evan Kranzler 2022-02-14 21:35:07 -05:00
parent 99e8b80184
commit c28da75ac1
7 changed files with 34 additions and 14 deletions

View file

@ -1,26 +1,27 @@
package mage.cards.a; package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility; import mage.abilities.LoyaltyAbility;
import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.ComparisonType; import mage.constants.ComparisonType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ManaValuePredicate; import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.command.emblems.AjaniAdversaryOfTyrantsEmblem; import mage.game.command.emblems.AjaniAdversaryOfTyrantsEmblem;
import mage.target.TargetPermanent;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
*
* @author TheElk801 * @author TheElk801
*/ */
public final class AjaniAdversaryOfTyrants extends CardImpl { public final class AjaniAdversaryOfTyrants extends CardImpl {
@ -41,7 +42,7 @@ public final class AjaniAdversaryOfTyrants extends CardImpl {
// +1: Put a +1/+1 counter on each of up to two target creatures. // +1: Put a +1/+1 counter on each of up to two target creatures.
Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), 1); Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), 1);
ability.addTarget(new TargetCreaturePermanent(0, 2)); ability.addTarget(new TargetPermanent(0, 2, StaticFilters.FILTER_PERMANENT_CREATURES));
this.addAbility(ability); this.addAbility(ability);
// 2: Return target creature card with converted mana cost 2 or less from your graveyard to the battlefield. // 2: Return target creature card with converted mana cost 2 or less from your graveyard to the battlefield.

View file

@ -18,7 +18,7 @@ import mage.counters.CounterType;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.NamePredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.TargetPermanent;
import java.util.UUID; import java.util.UUID;
@ -42,7 +42,7 @@ public final class ElspethUndauntedHero extends CardImpl {
// +2: Put a +1/+1 counter on each of up to two target creatures. // +2: Put a +1/+1 counter on each of up to two target creatures.
Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), 2); Ability ability = new LoyaltyAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), 2);
ability.addTarget(new TargetCreaturePermanent(0, 2)); ability.addTarget(new TargetPermanent(0, 2, StaticFilters.FILTER_PERMANENT_CREATURES));
this.addAbility(ability); this.addAbility(ability);
// 2: Search your library and/or graveyard for a card named Sunlit Hoplite and put it onto the battlefield. If you search your library this way, shuffle it. // 2: Search your library and/or graveyard for a card named Sunlit Hoplite and put it onto the battlefield. If you search your library this way, shuffle it.

View file

@ -11,8 +11,9 @@ import mage.constants.CardType;
import mage.constants.SagaChapter; import mage.constants.SagaChapter;
import mage.constants.SubType; import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.permanent.token.HumanMonkToken; import mage.game.permanent.token.HumanMonkToken;
import mage.target.common.TargetCreaturePermanent; import mage.target.TargetPermanent;
import java.util.UUID; import java.util.UUID;
@ -36,7 +37,8 @@ public final class JuganDefendsTheTemple extends CardImpl {
// II Put a +1/+1 counter on each of up to two target creatures. // II Put a +1/+1 counter on each of up to two target creatures.
sagaAbility.addChapterEffect( sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_II, SagaChapter.CHAPTER_II, this, SagaChapter.CHAPTER_II, SagaChapter.CHAPTER_II,
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new TargetCreaturePermanent(0, 2) new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
new TargetPermanent(0, 2, StaticFilters.FILTER_PERMANENT_CREATURES)
); );
// III Exile this Saga, then return it to the battlefield transformed under your control. // III Exile this Saga, then return it to the battlefield transformed under your control.

View file

@ -10,6 +10,8 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID; import java.util.UUID;
@ -38,7 +40,7 @@ public final class JukaiPreserver extends CardImpl {
ability = new ChannelAbility( ability = new ChannelAbility(
"{2}{G}", new AddCountersTargetEffect(CounterType.P1P1.createInstance()) "{2}{G}", new AddCountersTargetEffect(CounterType.P1P1.createInstance())
); );
ability.addTarget(new TargetControlledCreaturePermanent(0, 2)); ability.addTarget(new TargetPermanent(0, 2, StaticFilters.FILTER_CONTROLLED_CREATURES));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -59,9 +59,7 @@ public final class KatsumasaTheAnimator extends CardImpl {
// At the beginning of your upkeep, put a +1/+1 counter on each of up to three target noncreature artifacts. // At the beginning of your upkeep, put a +1/+1 counter on each of up to three target noncreature artifacts.
ability = new BeginningOfUpkeepTriggeredAbility( ability = new BeginningOfUpkeepTriggeredAbility(
new AddCountersTargetEffect(CounterType.P1P1.createInstance()) new AddCountersTargetEffect(CounterType.P1P1.createInstance()), TargetController.YOU, false
.setText("put a +1/+1 counter on each of up to three target noncreature artifacts"),
TargetController.YOU, false
); );
ability.addTarget(new TargetPermanent(0, 3, filter2)); ability.addTarget(new TargetPermanent(0, 3, filter2));
this.addAbility(ability); this.addAbility(ability);

View file

@ -2,9 +2,12 @@ package mage.verify;
import com.google.common.base.CharMatcher; import com.google.common.base.CharMatcher;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.SagaAbility; import mage.abilities.common.SagaAbility;
import mage.abilities.common.WerewolfBackTriggeredAbility; import mage.abilities.common.WerewolfBackTriggeredAbility;
import mage.abilities.common.WerewolfFrontTriggeredAbility; import mage.abilities.common.WerewolfFrontTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.FightTargetsEffect; import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.keyword.ScryEffect; import mage.abilities.effects.keyword.ScryEffect;
import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.EnchantAbility;
@ -1593,6 +1596,17 @@ public class VerifyCardDataTest {
return cardText.replace(name, name.split(" ")[0]).equals(refText); return cardText.replace(name, name.split(" ")[0]).equals(refText);
} }
private static final boolean checkForEffect(Card card, Class<? extends Effect> effectClazz) {
return card.getAbilities()
.stream()
.map(Ability::getModes)
.map(LinkedHashMap::values)
.flatMap(Collection::stream)
.map(Mode::getEffects)
.flatMap(Collection::stream)
.anyMatch(effectClazz::isInstance);
}
private void checkWrongAbilitiesText(Card card, MtgJsonCard ref, int cardIndex) { private void checkWrongAbilitiesText(Card card, MtgJsonCard ref, int cardIndex) {
// checks missing or wrong text // checks missing or wrong text
if (!card.getExpansionSetCode().equals(FULL_ABILITIES_CHECK_SET_CODE) || !checkName(ref)) { if (!card.getExpansionSetCode().equals(FULL_ABILITIES_CHECK_SET_CODE) || !checkName(ref)) {

View file

@ -119,6 +119,9 @@ public class AddCountersTargetEffect extends OneShotEffect {
Target target = mode.getTargets().getEffectTarget(this.targetPointer); Target target = mode.getTargets().getEffectTarget(this.targetPointer);
if (target != null) { if (target != null) {
if (target.getNumberOfTargets() == 0) { if (target.getNumberOfTargets() == 0) {
if (target.getMaxNumberOfTargets() > 1) {
sb.append("each of ");
}
sb.append("up to "); sb.append("up to ");
} }