* Fixed some possible exceptions.

This commit is contained in:
LevelX2 2018-06-05 23:57:45 +02:00
parent 8bdb6665d9
commit 0051f70b8a
6 changed files with 30 additions and 30 deletions

View file

@ -1,4 +1,3 @@
package mage.cards.p;
import java.util.Iterator;
@ -75,7 +74,7 @@ class PathOfAncestryTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getSourceId().equals(getSourceId())) {
if (getSourceId().equals(event.getSourceId())) {
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(getSourceId());
if (sourcePermanent != null) {
boolean found = false;

View file

@ -1,4 +1,3 @@
package mage.cards.s;
import java.util.UUID;
@ -16,6 +15,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.ExileZone;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
@ -27,7 +27,7 @@ import mage.target.common.TargetCardInHand;
public final class ScrollRack extends CardImpl {
public ScrollRack(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
// {1}, {tap}: Exile any number of cards from your hand face down. Put that many cards from the top of your library into your hand. Then look at the exiled cards and put them on top of your library in any order.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScrollRackEffect(), new GenericManaCost(1));
@ -62,7 +62,6 @@ class ScrollRackEffect extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
FilterCard filter = new FilterCard("card in your hand to exile");
// FilterCard filter2 = new FilterCard("(move the window) card exiled by " + sourceObject.getIdName() + " to put on top of library");
TargetCardInHand target = new TargetCardInHand(0, controller.getHand().size(), filter);
target.setRequired(false);
int amountExiled = 0;
@ -76,8 +75,11 @@ class ScrollRackEffect extends OneShotEffect {
}
}
controller.moveCardsToExile(new CardsImpl(target.getTargets()).getCards(game), source, game, false, source.getSourceId(), sourceObject.getIdName());
for (Card card : game.getExile().getExileZone(source.getSourceId()).getCards(game)) {
card.setFaceDown(true, game);
ExileZone exileZone = game.getExile().getExileZone(source.getSourceId());
if (exileZone != null) {
for (Card card : exileZone.getCards(game)) {
card.setFaceDown(true, game);
}
}
}
}

View file

@ -1,19 +1,18 @@
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.TapForManaAllTriggeredManaAbility;
import mage.abilities.effects.mana.AddManaOfAnyTypeProducedEffect;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.effects.mana.AddManaOfAnyTypeProducedEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SetTargetPointer;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
@ -30,7 +29,7 @@ import mage.target.targetpointer.FixedTarget;
public final class VorinclexVoiceOfHunger extends CardImpl {
public VorinclexVoiceOfHunger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{G}{G}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.PRAETOR);
@ -63,8 +62,6 @@ public final class VorinclexVoiceOfHunger extends CardImpl {
class VorinclexTriggeredAbility2 extends TriggeredAbilityImpl {
private static final String staticText = "Whenever an opponent taps a land for mana, that land doesn't untap during its controller's next untap step.";
public VorinclexTriggeredAbility2() {
super(Zone.BATTLEFIELD, new DontUntapInControllersNextUntapStepTargetEffect());
}
@ -97,6 +94,6 @@ class VorinclexTriggeredAbility2 extends TriggeredAbilityImpl {
@Override
public String getRule() {
return staticText;
return "Whenever an opponent taps a land for mana, that land doesn't untap during its controller's next untap step.";
}
}