mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
* 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:
parent
42d30f5311
commit
dbc9113d52
2 changed files with 19 additions and 12 deletions
|
|
@ -33,11 +33,13 @@ import mage.abilities.costs.CostImpl;
|
|||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
|
|
@ -52,14 +54,11 @@ public class ScarscaleRitual extends CardImpl {
|
|||
this.expansionSetCode = "SHM";
|
||||
|
||||
// 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());
|
||||
|
||||
|
||||
// Draw two cards.
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public ScarscaleRitual(final ScarscaleRitual card) {
|
||||
|
|
@ -84,7 +83,7 @@ class ScarscaleRitualCost extends CostImpl {
|
|||
|
||||
@Override
|
||||
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 false;
|
||||
|
|
@ -92,10 +91,18 @@ class ScarscaleRitualCost extends CostImpl {
|
|||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
Permanent permanent = game.getPermanent(ability.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addCounters(CounterType.M1M1.createInstance(), game);
|
||||
this.paid = true;
|
||||
Player controller = game.getPlayer(ability.getControllerId());
|
||||
if (controller != null) {
|
||||
Target target = new TargetControlledCreaturePermanent();
|
||||
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;
|
||||
}
|
||||
|
|
@ -104,4 +111,4 @@ class ScarscaleRitualCost extends CostImpl {
|
|||
public ScarscaleRitualCost copy() {
|
||||
return new ScarscaleRitualCost(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ git log 23039572f2206ade860f5835e9b85e82a9c4b2a1..HEAD --diff-filter=A --name-st
|
|||
|
||||
|
||||
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
|
||||
git log 3d8494edb5c0fddcb972758f7d983b8b66a9651e..0a458707ddaaa5e7e82ab06d17633084f67077c1 --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue