Minor changes to Grave Betrayal and Chord of Calling.

This commit is contained in:
LevelX2 2013-03-20 19:36:17 +01:00
parent 8ba38f22e5
commit cb16edcbbd
2 changed files with 8 additions and 4 deletions

View file

@ -58,6 +58,7 @@ public class ChordOfCalling extends CardImpl<ChordOfCalling> {
// Convoke
this.addAbility(new ConvokeAbility());
// Search your library for a creature card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library.
this.getSpellAbility().addEffect(new ChordofCallingSearchEffect());
}
@ -86,7 +87,8 @@ class ChordofCallingSearchEffect extends OneShotEffect<ChordofCallingSearchEffec
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
Card sourceCard = game.getCard(source.getSourceId());
if (player == null || sourceCard == null) {
return false;
}
int xCost = source.getManaCostsToPay().getX();
@ -99,7 +101,8 @@ class ChordofCallingSearchEffect extends OneShotEffect<ChordofCallingSearchEffec
if (target.getTargets().size() > 0) {
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
if (card != null) {
card.putOntoBattlefield(game, Constants.Zone.LIBRARY, source.getId(), source.getControllerId());
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": Put ").append(card.getName()).append(" onto the battlefield").toString());
card.putOntoBattlefield(game, Constants.Zone.LIBRARY, source.getSourceId(), source.getControllerId());
}
}
player.shuffleLibrary(game);

View file

@ -38,6 +38,7 @@ import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@ -147,10 +148,10 @@ class GraveBetrayalEffect extends OneShotEffect<GraveBetrayalEffect> {
Integer zoneChanges = (Integer) getValue("zoneChanges");
if (card.getZoneChangeCounter() == zoneChanges) {
Zone currentZone = game.getState().getZone(card.getId());
if (card.putOntoBattlefield(game, currentZone, source.getId(), source.getControllerId())) {
if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
Permanent creature = game.getPermanent(card.getId());
creature.addCounters(CounterType.P1P1.createInstance(), game);
ContinuousEffectImpl effect = new GraveBetrayalContiniousEffect();
ContinuousEffect effect = new GraveBetrayalContiniousEffect();
effect.setTargetPointer(new FixedTarget(creature.getId()));
game.addEffect(effect, source);
return true;