mirror of
https://github.com/correl/mage.git
synced 2025-04-12 01:01:04 -09:00
* Dragonlord Kolaghan - Fixed that morphed cast spells where compared with its origin name with cards in the graveyard.
This commit is contained in:
parent
7e3b494204
commit
df9efa97b6
2 changed files with 33 additions and 3 deletions
Mage.Sets/src/mage/sets/dragonsoftarkir
Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords
|
@ -45,6 +45,7 @@ import mage.constants.Zone;
|
|||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
@ -114,12 +115,12 @@ class DragonlordKolaghanTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Player controller = game.getPlayer(getControllerId());
|
||||
if (controller != null && controller.hasOpponent(event.getPlayerId(), game)) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null && (card.getCardType().contains(CardType.CREATURE) || card.getCardType().contains(CardType.PLANESWALKER))) {
|
||||
Spell spell = game.getStack().getSpell(event.getSourceId());
|
||||
if (spell != null && !spell.isFaceDown(game) && (spell.getCardType().contains(CardType.CREATURE) || spell.getCardType().contains(CardType.PLANESWALKER))) {
|
||||
Player opponent = game.getPlayer(event.getPlayerId());
|
||||
boolean sameName = false;
|
||||
for (Card graveCard :opponent.getGraveyard().getCards(game)) {
|
||||
if (graveCard.getName().equals(card.getName())) {
|
||||
if (graveCard.getName().equals(spell.getName())) {
|
||||
sameName = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -585,4 +585,33 @@ public class MorphTest extends CardTestPlayerBase {
|
|||
assertPowerToughness(playerB, "", 2, 2);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Dragonlord Kolaghan passive of 10 damage works when you play a morph creature
|
||||
* and it isn't suposed to. Because it is nameless.
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void testDragonlordKolaghan() {
|
||||
addCard(Zone.GRAVEYARD, playerA, "Akroma, Angel of Fury", 1);
|
||||
addCard(Zone.HAND, playerA, "Akroma, Angel of Fury", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// Flying, haste
|
||||
// Other creatures you control have haste.
|
||||
// Whenever an opponent casts a creature or planeswalker spell with the same name as a card in his or her graveyard, that player loses 10 life.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Dragonlord Kolaghan", 1);
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Akroma, Angel of Fury");
|
||||
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
|
||||
assertPermanentCount(playerA, "", 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue