forked from External/mage
- fixed wrong Elemental token images in BFZ's cards (Omnath, Locus of Rage and Seed Guardian); - fixed wrong Elemental token image in OGW's cards (Chandra Flamecaller); - removed unnecessary tokens from AKH, HOU and EMN (card duplicates); - fixed missing Goblin token in DOM; - fixed missing Bird Illusion token in GRN; - fixed same Zombie token in C19;
63 lines
2.1 KiB
Java
63 lines
2.1 KiB
Java
package mage.game.command.emblems;
|
|
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.common.SimpleStaticAbility;
|
|
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
|
import mage.constants.Duration;
|
|
import mage.constants.Outcome;
|
|
import mage.constants.SubType;
|
|
import mage.constants.Zone;
|
|
import mage.filter.common.FilterPlaneswalkerPermanent;
|
|
import mage.filter.predicate.mageobject.SubtypePredicate;
|
|
import mage.game.Game;
|
|
import mage.game.command.Emblem;
|
|
import mage.game.events.GameEvent;
|
|
|
|
/**
|
|
* @author spjspj
|
|
*/
|
|
public final class GideonOfTheTrialsEmblem extends Emblem {
|
|
|
|
public GideonOfTheTrialsEmblem() {
|
|
this.setName("Emblem Gideon");
|
|
Ability ability = new SimpleStaticAbility(Zone.COMMAND, new GideonOfTheTrialsCantLoseEffect());
|
|
this.getAbilities().add(ability);
|
|
}
|
|
}
|
|
|
|
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, 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";
|
|
}
|
|
|
|
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()))) {
|
|
return game.getBattlefield().contains(filter, source.getControllerId(), 1, game);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public GideonOfTheTrialsCantLoseEffect copy() {
|
|
return new GideonOfTheTrialsCantLoseEffect(this);
|
|
}
|
|
}
|