* Adventure cards - added adventure spell info in permanent's rules on battlefield;

This commit is contained in:
Oleg Agafonov 2020-01-02 06:15:17 +04:00
parent 5e5b4713ea
commit b4c55039e5
2 changed files with 8 additions and 9 deletions

View file

@ -329,7 +329,7 @@ public class AdventureCardsTest extends CardTestPlayerBase {
* Creature Human Soldier
* 1/1
*/
/*
/*
* Rimrock Knight {1}{R}
* Creature Dwarf Knight
* Rimrock Knight can't block.
@ -380,7 +380,8 @@ public class AdventureCardsTest extends CardTestPlayerBase {
assertGraveyardCount(playerA, 0);
Permanent rimrock = getPermanent("Rimrock Knight");
Assert.assertEquals(rimrock.getRules(currentGame).get(0), "{this} can't block.");
Assert.assertEquals(rimrock.getRules(currentGame).get(0), "Adventure Instant"); // must have adventure spell info on battlefield
Assert.assertEquals(rimrock.getRules(currentGame).get(1), "{this} can't block.");
}
/*

View file

@ -1,23 +1,18 @@
package mage.game.permanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.keyword.TransformAbility;
import mage.cards.AdventureCard;
import mage.cards.Card;
import mage.cards.LevelerCard;
import mage.constants.SpellAbilityType;
import mage.game.Game;
import mage.game.events.ZoneChangeEvent;
import java.util.UUID;
/**
* @author BetaSteward_at_googlemail.com
*/
@ -92,6 +87,8 @@ public class PermanentCard extends PermanentImpl {
} else {
this.abilities = card.getAbilities().copy();
}
// adventure cards must show adventure spell info on battlefield too
/*
if (card instanceof AdventureCard) {
// Adventure card spell abilities should not appear on permanents.
List<Ability> toRemove = new ArrayList<Ability>();
@ -104,6 +101,7 @@ public class PermanentCard extends PermanentImpl {
}
toRemove.forEach(ability -> this.abilities.remove(ability));
}
*/
this.abilities.setControllerId(this.controllerId);
this.abilities.setSourceId(objectId);
this.cardType.clear();