* Scarscale Ritual - Fixed that the spell fizzled as the creature the -1/-1 counter was placed on died by the impact of the counter.

This commit is contained in:
LevelX2 2015-09-14 22:12:42 +02:00
parent 42d30f5311
commit dbc9113d52
2 changed files with 19 additions and 12 deletions

View file

@ -33,11 +33,13 @@ import mage.abilities.costs.CostImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target; import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
@ -52,14 +54,11 @@ public class ScarscaleRitual extends CardImpl {
this.expansionSetCode = "SHM"; this.expansionSetCode = "SHM";
// As an additional cost to cast Scarscale Ritual, put a -1/-1 counter on a creature you control. // As an additional cost to cast Scarscale Ritual, put a -1/-1 counter on a creature you control.
Target target = new TargetControlledCreaturePermanent();
target.setNotTarget(true);
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addCost(new ScarscaleRitualCost()); this.getSpellAbility().addCost(new ScarscaleRitualCost());
// Draw two cards. // Draw two cards.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
} }
public ScarscaleRitual(final ScarscaleRitual card) { public ScarscaleRitual(final ScarscaleRitual card) {
@ -84,7 +83,7 @@ class ScarscaleRitualCost extends CostImpl {
@Override @Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
for (Permanent permanent :game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) {
return permanent != null; return permanent != null;
} }
return false; return false;
@ -92,10 +91,18 @@ class ScarscaleRitualCost extends CostImpl {
@Override @Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
Permanent permanent = game.getPermanent(ability.getFirstTarget()); Player controller = game.getPlayer(ability.getControllerId());
if (permanent != null) { if (controller != null) {
permanent.addCounters(CounterType.M1M1.createInstance(), game); Target target = new TargetControlledCreaturePermanent();
this.paid = true; target.setNotTarget(true);
controller.chooseTarget(Outcome.UnboostCreature, target, ability, game);
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) {
permanent.addCounters(CounterType.M1M1.createInstance(), game);
game.informPlayers(controller.getLogName() + " puts a -1/-1 counter on " + permanent.getLogName());
this.paid = true;
}
} }
return paid; return paid;
} }
@ -104,4 +111,4 @@ class ScarscaleRitualCost extends CostImpl {
public ScarscaleRitualCost copy() { public ScarscaleRitualCost copy() {
return new ScarscaleRitualCost(this); return new ScarscaleRitualCost(this);
} }
} }

View file

@ -22,7 +22,7 @@ git log 23039572f2206ade860f5835e9b85e82a9c4b2a1..HEAD --diff-filter=A --name-st
since 1.4.4.v0 since 1.4.4.v0
git log 0a458707ddaaa5e7e82ab06d17633084f67077c1..23039572f2206ade860f5835e9b85e82a9c4b2a1 --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt git log 0a458707ddaaa5e7e82ab06d17633084f67077c1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
since 1.4.4.v3 since 1.4.4.v3
git log 3d8494edb5c0fddcb972758f7d983b8b66a9651e..0a458707ddaaa5e7e82ab06d17633084f67077c1 --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt git log 3d8494edb5c0fddcb972758f7d983b8b66a9651e..0a458707ddaaa5e7e82ab06d17633084f67077c1 --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt