fixed Goryo's Vengeance targeting noncreature legendary cards (fixes
-
package mage.cards.g;
import mage.abilities.Ability;
@@ -16,6 +15,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
+import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -26,12 +26,11 @@ import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
- *
* @author LevelX2
*/
public final class GoryosVengeance extends CardImpl {
- private static final FilterCard filter = new FilterCard("legendary creature card");
+ private static final FilterCard filter = new FilterCreatureCard("legendary creature card");
static {
filter.add(new SupertypePredicate(SuperType.LEGENDARY));
@@ -49,7 +48,7 @@ public final class GoryosVengeance extends CardImpl {
this.addAbility(new SpliceOntoArcaneAbility("{2}{B}"));
}
- public GoryosVengeance(final GoryosVengeance card) {
+ private GoryosVengeance(final GoryosVengeance card) {
super(card);
}
@@ -61,12 +60,12 @@ public final class GoryosVengeance extends CardImpl {
class GoryosVengeanceEffect extends OneShotEffect {
- public GoryosVengeanceEffect() {
+ GoryosVengeanceEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "Return target legendary creature card from your graveyard to the battlefield. That creature gains haste. Exile it at the beginning of the next end step";
}
- public GoryosVengeanceEffect(final GoryosVengeanceEffect effect) {
+ private GoryosVengeanceEffect(final GoryosVengeanceEffect effect) {
super(effect);
}
@@ -78,12 +77,17 @@ class GoryosVengeanceEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
+ if (controller == null) {
+ return false;
+ }
Card card = game.getCard(targetPointer.getFirst(game, source));
- if (card != null) {
- if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
+ if (card == null || !controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
+ return false;
+ }
Permanent permanent = game.getPermanent(card.getId());
- if (permanent != null) {
+ if (permanent == null) {
+ return false;
+ }
// Haste
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
effect.setTargetPointer(new FixedTarget(permanent, game));
@@ -97,8 +101,3 @@ class GoryosVengeanceEffect extends OneShotEffect {
}
}
- }
- }
- return false;
- }
-}
