* River Kelpie - Fixed that the first ability did not always trigger as intended.

This commit is contained in:
LevelX2 2015-05-01 17:37:57 +02:00
parent e131caa453
commit 85d7f099bd
9 changed files with 68 additions and 29 deletions

View file

@ -114,7 +114,7 @@ class DragonlordsPrerogativeCondition implements Condition {
public boolean apply(Game game, Ability source) {
boolean applies = false;
Spell spell = game.getStack().getSpell(source.getSourceId());
if (spell != null) {
if (spell != null && spell.getSpellAbility() != null) {
for(Cost cost: spell.getSpellAbility().getCosts()) {
if (cost instanceof RevealTargetFromHandCost) {
applies = !((RevealTargetFromHandCost)cost).getTargets().isEmpty();

View file

@ -39,7 +39,6 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
/**
*
@ -52,7 +51,6 @@ public class RiverKelpie extends CardImpl {
this.expansionSetCode = "SHM";
this.subtype.add("Beast");
this.color.setBlue(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
@ -91,21 +89,20 @@ class RiverKelpieTriggeredAbility extends TriggeredAbilityImpl {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.GRAVEYARD && zEvent.getToZone() == Zone.BATTLEFIELD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
return permanent != null;
}
}
return false;
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getFromZone() == Zone.GRAVEYARD && zEvent.getToZone() == Zone.BATTLEFIELD;
}
@Override
public String getRule() {
return "Whenever River Kelpie or another permanent is put onto the battlefield from a graveyard, draw a card.";
return "Whenever {this} or another permanent is put onto the battlefield from a graveyard, draw a card.";
}
}
@ -124,9 +121,14 @@ class RiverKelpieTriggeredAbility2 extends TriggeredAbilityImpl {
return new RiverKelpieTriggeredAbility2(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.GRAVEYARD);
return event.getZone() == Zone.GRAVEYARD;
}
@Override

View file

@ -55,6 +55,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget;
@ -70,8 +71,6 @@ public class WhipOfErebos extends CardImpl {
this.expansionSetCode = "THS";
this.supertype.add("Legendary");
this.color.setBlack(true);
// Creatures you control have lifelink.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures"))));
// {2}{B}{B}, {T}: Return target creature card from your graveyard to the battlefield.
@ -154,10 +153,10 @@ class WhipOfErebosReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Card card = game.getCard(source.getFirstTarget());
Permanent permanent = game.getPermanent(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId());
if (card != null && controller != null) {
controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true);
if (permanent != null && controller != null) {
controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true);
}
return true;
}

View file

@ -48,7 +48,6 @@ public class ArrogantWurm extends CardImpl {
this.expansionSetCode = "TOR";
this.subtype.add("Wurm");
this.color.setGreen(true);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
@ -56,7 +55,7 @@ public class ArrogantWurm extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Madness {2}{G}
this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{2}{G}")));
this.addAbility(new MadnessAbility(this, new ManaCostsImpl<>("{2}{G}")));
}
public ArrogantWurm(final ArrogantWurm card) {