mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
fixed Goryo's Vengeance targeting noncreature legendary cards (fixes #5992)
This commit is contained in:
parent
3f125dcca7
commit
c6b95b02d2
1 changed files with 27 additions and 28 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
|
@ -16,6 +15,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
@ -26,12 +26,11 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class GoryosVengeance extends CardImpl {
|
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 {
|
static {
|
||||||
filter.add(new SupertypePredicate(SuperType.LEGENDARY));
|
filter.add(new SupertypePredicate(SuperType.LEGENDARY));
|
||||||
|
|
@ -49,7 +48,7 @@ public final class GoryosVengeance extends CardImpl {
|
||||||
this.addAbility(new SpliceOntoArcaneAbility("{2}{B}"));
|
this.addAbility(new SpliceOntoArcaneAbility("{2}{B}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public GoryosVengeance(final GoryosVengeance card) {
|
private GoryosVengeance(final GoryosVengeance card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,12 +60,12 @@ public final class GoryosVengeance extends CardImpl {
|
||||||
|
|
||||||
class GoryosVengeanceEffect extends OneShotEffect {
|
class GoryosVengeanceEffect extends OneShotEffect {
|
||||||
|
|
||||||
public GoryosVengeanceEffect() {
|
GoryosVengeanceEffect() {
|
||||||
super(Outcome.PutCardInPlay);
|
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";
|
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);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,12 +77,17 @@ class GoryosVengeanceEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||||
if (card != null) {
|
if (card == null || !controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||||
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
return false;
|
||||||
|
}
|
||||||
Permanent permanent = game.getPermanent(card.getId());
|
Permanent permanent = game.getPermanent(card.getId());
|
||||||
if (permanent != null) {
|
if (permanent == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Haste
|
// Haste
|
||||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
|
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
|
||||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||||
|
|
@ -97,8 +101,3 @@ class GoryosVengeanceEffect extends OneShotEffect {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue