Fixed casting error in Blood Seeker and Suture Priest.

This commit is contained in:
LevelX2 2013-04-13 13:57:42 +02:00
parent ae838c315c
commit 6dd99350a3
3 changed files with 13 additions and 14 deletions

View file

@ -45,6 +45,7 @@ import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent; import mage.game.events.ZoneChangeEvent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -103,7 +104,7 @@ class SuturePriestSecondTriggeredAbility extends TriggeredAbilityImpl<SuturePrie
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent)event; EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent)event;
Card card = zEvent.getTarget(); Card card = zEvent.getTarget();
if (card != null && card.getCardType().contains(CardType.CREATURE)) { if (card != null && card.getCardType().contains(CardType.CREATURE)) {
for (Effect effect : this.getEffects()) { for (Effect effect : this.getEffects()) {

View file

@ -28,10 +28,10 @@
package mage.sets.tenth; package mage.sets.tenth;
import java.util.UUID; import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity; import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continious.BoostAllEffect; import mage.abilities.effects.common.continious.BoostAllEffect;
@ -48,7 +48,6 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
public class ElvishChampion extends CardImpl<ElvishChampion> { public class ElvishChampion extends CardImpl<ElvishChampion> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures");
static { static {
filter.add(new SubtypePredicate("Elf")); filter.add(new SubtypePredicate("Elf"));
} }
@ -60,8 +59,10 @@ public class ElvishChampion extends CardImpl<ElvishChampion> {
this.color.setGreen(true); this.color.setGreen(true);
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Constants.Duration.WhileOnBattlefield, filter, true)));
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAllEffect(new ForestwalkAbility(), Constants.Duration.WhileOnBattlefield, filter, true))); // Other Elf creatures get +1/+1 and have forestwalk. (They're unblockable as long as defending player controls a Forest.)
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new ForestwalkAbility(), Duration.WhileOnBattlefield, filter, true)));
} }
public ElvishChampion(final ElvishChampion card) { public ElvishChampion(final ElvishChampion card) {

View file

@ -28,20 +28,19 @@
package mage.sets.zendikar; package mage.sets.zendikar;
import java.util.UUID; import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity; import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.game.Game; import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent; import mage.game.events.ZoneChangeEvent;
import mage.target.TargetPlayer;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
/** /**
@ -61,9 +60,7 @@ public class BloodSeeker extends CardImpl<BloodSeeker> {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Whenever a creature enters the battlefield under an opponent's control, you may have that player lose 1 life. // Whenever a creature enters the battlefield under an opponent's control, you may have that player lose 1 life.
Ability ability = new BloodSeekerTriggeredAbility(); this.addAbility(new BloodSeekerTriggeredAbility());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
} }
public BloodSeeker(final BloodSeeker card) { public BloodSeeker(final BloodSeeker card) {
@ -78,7 +75,7 @@ public class BloodSeeker extends CardImpl<BloodSeeker> {
class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl<BloodSeekerTriggeredAbility> { class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl<BloodSeekerTriggeredAbility> {
BloodSeekerTriggeredAbility() { BloodSeekerTriggeredAbility() {
super(Constants.Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), true); super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), true);
} }
BloodSeekerTriggeredAbility(final BloodSeekerTriggeredAbility ability) { BloodSeekerTriggeredAbility(final BloodSeekerTriggeredAbility ability) {
@ -93,7 +90,7 @@ class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl<BloodSeekerTrigge
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent)event; EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent) event;
Card card = zEvent.getTarget(); Card card = zEvent.getTarget();
if (card != null && card.getCardType().contains(CardType.CREATURE)) { if (card != null && card.getCardType().contains(CardType.CREATURE)) {
for (Effect effect : this.getEffects()) { for (Effect effect : this.getEffects()) {