mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
fix and test [CMM] Narci, Fable Singer
This commit is contained in:
parent
2709614508
commit
5016a57397
2 changed files with 48 additions and 11 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package mage.cards.n;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.FinalChapterAbilityResolvesTriggeredAbility;
|
||||
import mage.abilities.common.SacrificePermanentTriggeredAbility;
|
||||
|
|
@ -18,7 +17,7 @@ import mage.constants.SubType;
|
|||
import mage.constants.SuperType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -41,13 +40,13 @@ public final class NarciFableSinger extends CardImpl {
|
|||
|
||||
// Whenever you sacrifice an enchantment, draw a card.
|
||||
this.addAbility(new SacrificePermanentTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1),
|
||||
StaticFilters.FILTER_PERMANENT_ENCHANTMENT
|
||||
new DrawCardSourceControllerEffect(1),
|
||||
StaticFilters.FILTER_PERMANENT_ENCHANTMENT
|
||||
));
|
||||
|
||||
// Whenever the final chapter ability of a Saga you control resolves, each opponent loses X life and you gain X life, where X is that Saga's mana value.
|
||||
this.addAbility(new FinalChapterAbilityResolvesTriggeredAbility(
|
||||
new NarciFableSingerEffect(), true
|
||||
new NarciFableSingerEffect(), true
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -79,12 +78,7 @@ class NarciFableSingerEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FixedTarget fixedTarget = getTargetPointer().getFirstAsFixedTarget(game, source);
|
||||
if (fixedTarget == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MageObject saga = game.getObject(fixedTarget.getTarget());
|
||||
Permanent saga = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (saga == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
package org.mage.test.cards.single.cmm;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public class NarciFableSingerTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* {@link mage.cards.n.NarciFableSinger Narci, Fable Singer} {1}{W}{B}{G}
|
||||
* Legendary Creature — Human Bard
|
||||
* Lifelink
|
||||
* Whenever you sacrifice an enchantment, draw a card.
|
||||
* Whenever the final chapter ability of a Saga you control resolves, each opponent loses X life and you gain X life, where X is that Saga’s mana value.
|
||||
* 3/3
|
||||
*/
|
||||
private static final String narci = "Narci, Fable Singer";
|
||||
|
||||
@Test
|
||||
public void test_Simple() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, narci);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
addCard(Zone.HAND, playerA, "History of Benalia");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "History of Benalia");
|
||||
|
||||
setChoice(playerA, "Whenever you sacrifice an enchantment, draw a card."); // stack both triggers
|
||||
|
||||
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "History of Benalia", 1);
|
||||
assertHandCount(playerA, 3); // 2 from draw step, 1 from Narci
|
||||
assertLife(playerA, 20 + 3);
|
||||
assertLife(playerB, 20 - 3);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue