mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
* Alesha, Who Smiles at Death - Fixed that the move card to battlefield worked not correctly.
This commit is contained in:
parent
d26b8aeae0
commit
af67e27bcd
2 changed files with 10 additions and 8 deletions
|
|
@ -45,7 +45,6 @@ import mage.filter.Filter;
|
||||||
import mage.filter.common.FilterCreatureCard;
|
import mage.filter.common.FilterCreatureCard;
|
||||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
|
|
@ -72,11 +71,11 @@ public class AleshaWhoSmilesAtDeath extends CardImpl {
|
||||||
|
|
||||||
// First strike
|
// First strike
|
||||||
this.addAbility(FirstStrikeAbility.getInstance());
|
this.addAbility(FirstStrikeAbility.getInstance());
|
||||||
|
|
||||||
// Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card with power 2 or less from your graveyard to the battlefield tapped and attacking.
|
// Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card with power 2 or less from your graveyard to the battlefield tapped and attacking.
|
||||||
Ability ability = new AttacksTriggeredAbility(new DoIfCostPaid(new AleshaWhoSmilesAtDeathEffect(), new ManaCostsImpl("{W/B}{W/B}")), false);
|
Ability ability = new AttacksTriggeredAbility(new DoIfCostPaid(new AleshaWhoSmilesAtDeathEffect(), new ManaCostsImpl("{W/B}{W/B}")), false);
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AleshaWhoSmilesAtDeath(final AleshaWhoSmilesAtDeath card) {
|
public AleshaWhoSmilesAtDeath(final AleshaWhoSmilesAtDeath card) {
|
||||||
|
|
@ -107,9 +106,8 @@ class AleshaWhoSmilesAtDeathEffect extends OneShotEffect {
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId(), true)) {
|
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null)) {
|
||||||
Permanent permanent = game.getPermanent(card.getId());
|
game.getCombat().addAttackingCreature(card.getId(), game);
|
||||||
game.getCombat().addAttackingCreature(permanent.getId(), game);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -614,14 +614,18 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
||||||
* @param count Expected count.
|
* @param count Expected count.
|
||||||
*/
|
*/
|
||||||
public void assertCounterCount(String cardName, CounterType type, int count) throws AssertionError {
|
public void assertCounterCount(String cardName, CounterType type, int count) throws AssertionError {
|
||||||
|
this.assertCounterCount(null, cardName, type, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void assertCounterCount(Player player, String cardName, CounterType type, int count) throws AssertionError {
|
||||||
Permanent found = null;
|
Permanent found = null;
|
||||||
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) {
|
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) {
|
||||||
if (permanent.getName().equals(cardName)) {
|
if (permanent.getName().equals(cardName) && (player == null || permanent.getControllerId().equals(player.getId()))) {
|
||||||
found = permanent;
|
found = permanent;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found);
|
Assert.assertNotNull("There is no such permanent " + (player == null ? "" : "for player " + player.getName()) + " on the battlefield, cardName=" + cardName, found);
|
||||||
Assert.assertEquals("(Battlefield) Counter counts are not equal (" + cardName + ":" + type + ")", count, found.getCounters().getCount(type));
|
Assert.assertEquals("(Battlefield) Counter counts are not equal (" + cardName + ":" + type + ")", count, found.getCounters().getCount(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue