Skip to content

Commit

Permalink
Fix for Giedon of the Trials emblem.
Browse files Browse the repository at this point in the history
Resolves #3179
  • Loading branch information
JRHerlehy committed Jul 6, 2017
1 parent 5cfef7f commit 53cb5ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 49 deletions.
52 changes: 4 additions & 48 deletions Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -42,15 +38,14 @@
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
Expand Down Expand Up @@ -94,45 +89,6 @@ public GideonOfTheTrials copy() {
}
}

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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down

0 comments on commit 53cb5ae

Please sign in to comment.