Merge pull request #3957 from ingmargoudt/master

small fixes
This commit is contained in:
ingmargoudt 2017-09-08 13:16:41 +02:00 committed by GitHub
commit 241a118456
12 changed files with 40 additions and 27 deletions

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.f; package mage.cards.f;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.AttacksTriggeredAbility;
@ -41,6 +40,8 @@ import mage.constants.Duration;
import mage.target.Target; import mage.target.Target;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -57,7 +58,7 @@ public class FrenziedGoblin extends CardImpl {
// Whenever Frenzied Goblin attacks, you may pay {R}. If you do, target creature can't block this turn. // Whenever Frenzied Goblin attacks, you may pay {R}. If you do, target creature can't block this turn.
Ability ability = new AttacksTriggeredAbility(new DoIfCostPaid(new CantBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{R}")),false, Ability ability = new AttacksTriggeredAbility(new DoIfCostPaid(new CantBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{R}")),false,
"Whenever {this} attacks you may pay {R}. If you do, target creature can't block this turn."); "Whenever {this} attacks you, may pay {R}. If you do, target creature can't block this turn.");
Target target = new TargetCreaturePermanent(); Target target = new TargetCreaturePermanent();
ability.addTarget(target); ability.addTarget(target);
this.addAbility(ability); this.addAbility(ability);

View file

@ -27,9 +27,6 @@
*/ */
package mage.cards.l; package mage.cards.l;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility; import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
@ -49,6 +46,10 @@ import mage.players.Player;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
@ -89,7 +90,7 @@ class LilianaVessEffect extends OneShotEffect {
public LilianaVessEffect() { public LilianaVessEffect() {
super(Outcome.PutCreatureInPlay); super(Outcome.PutCreatureInPlay);
staticText = "Put all creature cards in all graveyards onto the battlefield under your control"; staticText = "Put all creature cards from all graveyards onto the battlefield under your control";
} }
public LilianaVessEffect(final LilianaVessEffect effect) { public LilianaVessEffect(final LilianaVessEffect effect) {

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.n; package mage.cards.n;
import java.util.UUID;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
@ -37,13 +36,15 @@ import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
*/ */
public class NaturesLore extends CardImpl { public class NaturesLore extends CardImpl {
private static final FilterCard filter = new FilterCard("a Forest card"); private static final FilterCard filter = new FilterCard("Forest card");
static { static {
filter.add(new SubtypePredicate(SubType.FOREST)); filter.add(new SubtypePredicate(SubType.FOREST));

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.n; package mage.cards.n;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility; import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
@ -54,13 +53,15 @@ import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author spjspj * @author spjspj
*/ */
public class NazahnReveredBladesmith extends CardImpl { public class NazahnReveredBladesmith extends CardImpl {
private static final FilterControlledCreaturePermanent equippedFilter = new FilterControlledCreaturePermanent("equipped creatures you control"); private static final FilterControlledCreaturePermanent equippedFilter = new FilterControlledCreaturePermanent("equipped creature you control");
static { static {
equippedFilter.add(new EquippedPredicate()); equippedFilter.add(new EquippedPredicate());
@ -88,7 +89,7 @@ public class NazahnReveredBladesmith extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandOrOnBattlefieldEffect(target, true, true, "Hammer of Nazahn"), true)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandOrOnBattlefieldEffect(target, true, true, "Hammer of Nazahn"), true));
// Whenever an equipped creature you control attacks, you may tap target creature defending player controls. // Whenever an equipped creature you control attacks, you may tap target creature defending player controls.
Ability ability = new AttacksCreatureYouControlTriggeredAbility(new NazahnTapEffect(), false, equippedFilter, true); Ability ability = new AttacksCreatureYouControlTriggeredAbility(new NazahnTapEffect(), true, equippedFilter, true);
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls"))); ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.r; package mage.cards.r;
import java.util.UUID;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
@ -39,13 +38,15 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author Loki * @author Loki
*/ */
public class RecklessSpite extends CardImpl { public class RecklessSpite extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creatures");
static { static {
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));

View file

@ -55,7 +55,7 @@ public class SylvanRanger extends CardImpl {
// When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. // When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.
TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD); TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD);
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true))); this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true));
} }
public SylvanRanger(final SylvanRanger card) { public SylvanRanger(final SylvanRanger card) {

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.t; package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
@ -39,7 +38,9 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
* *
@ -51,8 +52,8 @@ public class TrueConviction extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}{W}");
// Creatures you control have double strike and lifelink. // Creatures you control have double strike and lifelink.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent())); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES));
Effect effect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()); Effect effect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES);
effect.setText(" and lifelink"); effect.setText(" and lifelink");
ability.addEffect(effect); ability.addEffect(effect);
this.addAbility(ability); this.addAbility(ability);

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.w; package mage.cards.w;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.ActivateIfConditionActivatedAbility;
@ -49,6 +48,8 @@ import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -72,7 +73,7 @@ public class WalkerOfSecretWays extends CardImpl {
this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}")));
// Whenever Walker of Secret Ways deals combat damage to a player, look at that player's hand. // Whenever Walker of Secret Ways deals combat damage to a player, look at that player's hand.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new WalkerOfSecretWaysEffect(), true, true)); this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new WalkerOfSecretWaysEffect(), false, true));
// {1}{U}: Return target Ninja you control to its owner's hand. Activate this ability only during your turn. // {1}{U}: Return target Ninja you control to its owner's hand. Activate this ability only during your turn.
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"), MyTurnCondition.instance); Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"), MyTurnCondition.instance);

View file

@ -97,7 +97,7 @@ public class AttacksCreatureYouControlTriggeredAbility extends TriggeredAbilityI
@Override @Override
public String getRule() { public String getRule() {
return "Whenever a " + filter.getMessage() + " attacks, " + super.getRule(); return "Whenever a" + (filter.getMessage().startsWith("a") ? "n " : " ") + " attacks, " + super.getRule();
} }
} }

View file

@ -95,7 +95,7 @@ public class EntersBattlefieldAbility extends StaticAbility {
return; return;
} }
} }
super.addEffect(effect); //To change body of generated methods, choose Tools | Templates. super.addEffect(effect);
} }
@Override @Override
@ -108,6 +108,6 @@ public class EntersBattlefieldAbility extends StaticAbility {
if (abilityRule != null && !abilityRule.isEmpty()) { if (abilityRule != null && !abilityRule.isEmpty()) {
return abilityRule; return abilityRule;
} }
return (optional ? "you may have " : "") + "{this} enter" + (optional ? "" : "s") + " the battlefield " + super.getRule(); return (optional ? "you may have " : "") + "{this} enter" + (optional ? "" : "s") + " the battlefield" + super.getRule();
} }
} }

View file

@ -27,8 +27,6 @@
*/ */
package mage.abilities.effects.common; package mage.abilities.effects.common;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
@ -43,6 +41,9 @@ import mage.game.permanent.token.Token;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.ArrayList;
import java.util.UUID;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
@ -151,7 +152,7 @@ public class CreateTokenEffect extends OneShotEffect {
} }
sb.append(token.getDescription()); sb.append(token.getDescription());
if (token.getDescription().endsWith("token")) { if (token.getDescription().endsWith("token")) {
sb.append("s "); sb.append("s");
} }
int tokenLocation = sb.indexOf("token "); int tokenLocation = sb.indexOf("token ");
if (tokenLocation != -1) { if (tokenLocation != -1) {

View file

@ -66,7 +66,12 @@ public class ReturnToHandChosenControlledPermanentEffect extends ReturnToHandCho
protected String getText() { protected String getText() {
StringBuilder sb = new StringBuilder("return "); StringBuilder sb = new StringBuilder("return ");
if (!filter.getMessage().startsWith("another")) { if (!filter.getMessage().startsWith("another")) {
sb.append(CardUtil.numberToText(number, "a")); if(filter.getMessage().startsWith("a")){
sb.append("an");
}
else {
sb.append(CardUtil.numberToText(number, "a"));
}
} }
sb.append(' ').append(filter.getMessage()); sb.append(' ').append(filter.getMessage());
if (number > 1) { if (number > 1) {