Fix for Giedon of the Trials emblem.

Resolves #3179
This commit is contained in:
Justin Herlehy 2017-07-06 13:01:47 -07:00
parent 5cfef7f481
commit 53cb5ae478
2 changed files with 5 additions and 49 deletions

View file

@ -27,13 +27,9 @@
*/
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
@ -42,15 +38,14 @@ import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterPlaneswalkerPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.game.command.emblems.GideonOfTheTrialsEmblem;
import mage.game.permanent.token.Token;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
*
* @author JRHerlehy
@ -94,45 +89,6 @@ public class GideonOfTheTrials extends CardImpl {
}
}
class GideonOfTheTrialsCantLoseEffect extends ContinuousRuleModifyingEffectImpl {
private static final FilterPlaneswalkerPermanent filter = new FilterPlaneswalkerPermanent("a Gideon planeswalker");
static {
filter.add(new SubtypePredicate(SubType.GIDEON));
}
public GideonOfTheTrialsCantLoseEffect() {
super(Duration.EndOfGame, Outcome.Benefit);
staticText = "As long as you control a Gideon planeswalker, you can't lose the game and your opponents can't win the game";
}
public GideonOfTheTrialsCantLoseEffect(final GideonOfTheTrialsCantLoseEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if ((event.getType() == GameEvent.EventType.WINS && game.getOpponents(source.getControllerId()).contains(event.getPlayerId()))
|| (event.getType() == GameEvent.EventType.LOSES && event.getPlayerId().equals(source.getControllerId()))) {
if (game.getBattlefield().contains(filter, source.getControllerId(), 1, game)) {
return true;
}
}
return false;
}
@Override
public GideonOfTheTrialsCantLoseEffect copy() {
return new GideonOfTheTrialsCantLoseEffect(this);
}
}
class GideonOfTheTrialsToken extends Token {
public GideonOfTheTrialsToken() {

View file

@ -62,7 +62,7 @@ class GideonOfTheTrialsCantLoseEffect extends ContinuousRuleModifyingEffectImpl
}
public GideonOfTheTrialsCantLoseEffect() {
super(Duration.EndOfGame, Outcome.Benefit);
super(Duration.EndOfGame, Outcome.Benefit, false, false);
staticText = "As long as you control a Gideon planeswalker, you can't lose the game and your opponents can't win the game";
}