Oracle Text fixes. NPE fixes

This commit is contained in:
drmDev 2016-04-08 00:16:12 -04:00
parent d3f1f811ce
commit 04de56860a
8 changed files with 45 additions and 27 deletions

View file

@ -28,9 +28,6 @@
package mage.sets.darkascension;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@ -39,6 +36,9 @@ import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
@ -49,9 +49,9 @@ public class MondronenShaman extends CardImpl {
public MondronenShaman(UUID ownerId) {
super(ownerId, 98, "Mondronen Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "DKA";
this.subtype.add("Human");
this.subtype.add("Werewolf");
this.subtype.add("Human");
this.subtype.add("Shaman");
this.subtype.add("Werewolf");
this.power = new MageInt(3);
this.toughness = new MageInt(2);

View file

@ -62,7 +62,7 @@ public class NivixAerieOfTheFiremind extends CardImpl {
// {tap}: Add {C} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {2}{U}{R}, {tap}: Exile the top card of your library. Until your next turn, you may cast that card if it's an instant or sorcery.
// {2}{U}{R}, {tap}: Exile the top card of your library. Until your next turn, you may cast that card if it's an instant or sorcery card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NivixAerieOfTheFiremindEffect(), new ManaCostsImpl<>("{2}{U}{R}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
@ -82,7 +82,7 @@ class NivixAerieOfTheFiremindEffect extends OneShotEffect {
NivixAerieOfTheFiremindEffect() {
super(Outcome.Benefit);
this.staticText = "Exile the top card of your library. Until your next turn, you may cast that card if it's an instant or sorcery";
this.staticText = "Exile the top card of your library. Until your next turn, you may cast that card if it's an instant or sorcery card";
}
NivixAerieOfTheFiremindEffect(final NivixAerieOfTheFiremindEffect effect) {

View file

@ -80,7 +80,7 @@ public class AnafenzaTheForemost extends CardImpl {
ability.addTarget(new TargetControlledCreaturePermanent(filter));
this.addAbility(ability);
// If a creature card would be put into an opponent's graveyard from anywhere, exile it instead.
// If a nontoken creature an opponent owns would die or a creature card not on the battlefield would be put into an opponent's graveyard, exile that card instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnafenzaTheForemostEffect()));
}
@ -98,7 +98,7 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl {
public AnafenzaTheForemostEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "If a creature card would be put into an opponent's graveyard from anywhere, exile it instead";
staticText = "If a nontoken creature an opponent owns would die or a creature card not on the battlefield would be put into an opponent's graveyard, exile that card instead";
}
public AnafenzaTheForemostEffect(final AnafenzaTheForemostEffect effect) {

View file

@ -72,7 +72,7 @@ public class RealityAcid extends CardImpl {
ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingUpkeepAbility(3, "aura"));
this.addAbility(new VanishingSacrificeAbility());
// When Reality Acid leaves the battlefield, enchanted permanent's controller sacrifices it.

View file

@ -27,6 +27,7 @@
*/
package mage.sets.shadowsoverinnistrad;
import java.util.List;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.OnEventTriggeredAbility;
@ -87,13 +88,21 @@ class CrawlingSensationTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
if (Zone.GRAVEYARD == zEvent.getToZone()) {
if (zEvent != null && Zone.GRAVEYARD == zEvent.getToZone() && zEvent.getCards() != null) {
Integer usedOnTurn = (Integer) game.getState().getValue("usedOnTurn" + getOriginalId());
if (usedOnTurn == null || usedOnTurn < game.getTurnNum()) {
for (Card card : zEvent.getCards()) {
if (card.getOwnerId().equals(getControllerId()) && card.getCardType().contains(CardType.LAND)) {
game.getState().setValue("usedOnTurn" + getOriginalId(), game.getTurnNum());
return true;
for (Card card : zEvent.getCards()) {
if (card != null) {
UUID cardOwnerId = card.getOwnerId();
List<CardType> cardType = card.getCardType();
if (cardOwnerId != null
&& card.getOwnerId().equals(getControllerId())
&& cardType != null
&& card.getCardType().contains(CardType.LAND)) {
game.getState().setValue("usedOnTurn" + getOriginalId(), game.getTurnNum());
return true;
}
}
}
}

View file

@ -107,15 +107,17 @@ class TheGitrogMonsterTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
if (Zone.GRAVEYARD == zEvent.getToZone() && zEvent.getCards() != null) {
if (zEvent != null && Zone.GRAVEYARD == zEvent.getToZone() && zEvent.getCards() != null) {
for (Card card : zEvent.getCards()) {
UUID cardOwnerId = card.getOwnerId();
List<CardType> cardType = card.getCardType();
if (cardOwnerId != null
&& card.getOwnerId().equals(getControllerId())
&& cardType != null
&& cardType.contains(CardType.LAND)) {
return true;
if (card != null) {
UUID cardOwnerId = card.getOwnerId();
List<CardType> cardType = card.getCardType();
if (cardOwnerId != null
&& card.getOwnerId().equals(getControllerId())
&& cardType != null
&& cardType.contains(CardType.LAND)) {
return true;
}
}
}
}