mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Emerge Ability - Fixed that the creature to sacrifice had to be selcted twice.
This commit is contained in:
parent
42ed2f64e7
commit
9933420f57
1 changed files with 10 additions and 7 deletions
|
@ -2,7 +2,6 @@ package mage.abilities.keyword;
|
|||
|
||||
import mage.Mana;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.mana.ManaOptions;
|
||||
|
@ -11,7 +10,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.SpellAbilityType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
@ -92,11 +90,16 @@ public class EmergeAbility extends SpellAbility {
|
|||
TargetPermanent target = new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("creature to sacrifice for emerge"));
|
||||
if (controller.choose(Outcome.Sacrifice, target, this.getSourceId(), game)) {
|
||||
Permanent creature = game.getPermanent(target.getFirstTarget());
|
||||
CardUtil.reduceCost(this, creature.getConvertedManaCost());
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(creature.getLogName());
|
||||
filter.add(new CardIdPredicate(creature.getId()));
|
||||
this.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter)));
|
||||
return super.activate(game, false);
|
||||
if (creature != null) {
|
||||
CardUtil.reduceCost(this, creature.getConvertedManaCost());
|
||||
if (super.activate(game, false)) {
|
||||
if (creature.sacrifice(getSourceId(), game)) {
|
||||
return true;
|
||||
} else {
|
||||
activated = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue