mirror of
https://github.com/correl/mage.git
synced 2024-11-24 19:19:56 +00:00
some more text fixes for adding counter effects
This commit is contained in:
parent
99e8b80184
commit
c28da75ac1
7 changed files with 34 additions and 14 deletions
|
@ -1,26 +1,27 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.command.emblems.AjaniAdversaryOfTyrantsEmblem;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
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.
|
||||
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);
|
||||
|
||||
// −2: Return target creature card with converted mana cost 2 or less from your graveyard to the battlefield.
|
||||
|
|
|
@ -18,7 +18,7 @@ import mage.counters.CounterType;
|
|||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
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.
|
||||
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);
|
||||
|
||||
// −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.
|
||||
|
|
|
@ -11,8 +11,9 @@ import mage.constants.CardType;
|
|||
import mage.constants.SagaChapter;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.permanent.token.HumanMonkToken;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
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.
|
||||
sagaAbility.addChapterEffect(
|
||||
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.
|
||||
|
|
|
@ -10,6 +10,8 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -38,7 +40,7 @@ public final class JukaiPreserver extends CardImpl {
|
|||
ability = new ChannelAbility(
|
||||
"{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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
ability = new BeginningOfUpkeepTriggeredAbility(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance())
|
||||
.setText("put a +1/+1 counter on each of up to three target noncreature artifacts"),
|
||||
TargetController.YOU, false
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), TargetController.YOU, false
|
||||
);
|
||||
ability.addTarget(new TargetPermanent(0, 3, filter2));
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -2,9 +2,12 @@ package mage.verify;
|
|||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.common.SagaAbility;
|
||||
import mage.abilities.common.WerewolfBackTriggeredAbility;
|
||||
import mage.abilities.common.WerewolfFrontTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.FightTargetsEffect;
|
||||
import mage.abilities.effects.keyword.ScryEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
|
@ -1593,6 +1596,17 @@ public class VerifyCardDataTest {
|
|||
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) {
|
||||
// checks missing or wrong text
|
||||
if (!card.getExpansionSetCode().equals(FULL_ABILITIES_CHECK_SET_CODE) || !checkName(ref)) {
|
||||
|
|
|
@ -119,6 +119,9 @@ public class AddCountersTargetEffect extends OneShotEffect {
|
|||
Target target = mode.getTargets().getEffectTarget(this.targetPointer);
|
||||
if (target != null) {
|
||||
if (target.getNumberOfTargets() == 0) {
|
||||
if (target.getMaxNumberOfTargets() > 1) {
|
||||
sb.append("each of ");
|
||||
}
|
||||
sb.append("up to ");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue