mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Added test (failing because bug not fixed yet). Some minor changes.
This commit is contained in:
parent
9dde5c2810
commit
fb819f1f51
4 changed files with 96 additions and 10 deletions
|
|
@ -72,4 +72,42 @@ public class FlameshadowConjuringTest extends CardTestPlayerBase {
|
|||
assertLife(playerA, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* I created a token copy of Wurmcoil Engine and sacrificed it. This gave me
|
||||
* 4 tokens
|
||||
*/
|
||||
@Test
|
||||
public void testWurmcoilEngine() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7);
|
||||
// Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature.
|
||||
// That token gains haste. Exile it at the beginning of the next end step.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Flameshadow Conjuring", 1);
|
||||
// Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Nantuko Husk", 1);
|
||||
|
||||
// Deathtouch, lifelink
|
||||
// When Wurmcoil Engine dies, put a 3/3 colorless Wurm artifact creature token with deathtouch and a 3/3 colorless Wurm artifact creature token with lifelink onto the battlefield.
|
||||
addCard(Zone.HAND, playerA, "Wurmcoil Engine", 1); // 6/6 - {6}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wurmcoil Engine");
|
||||
setChoice(playerA, "Yes");
|
||||
|
||||
attack(1, playerA, "Wurmcoil Engine");
|
||||
attack(1, playerA, "Nantuko Husk");
|
||||
|
||||
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sacrifice a creature");
|
||||
// addTarget(playerA, "Wurmcoil Engine[only copy]");
|
||||
setChoice(playerA, "Wurmcoil Engine[only copy]");
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Wurmcoil Engine", 1);
|
||||
assertPowerToughness(playerA, "Nantuko Husk", 4, 4);
|
||||
assertLife(playerB, 12);
|
||||
assertLife(playerA, 26);
|
||||
|
||||
assertPermanentCount(playerA, "Wurm", 2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ import mage.filter.predicate.Predicates;
|
|||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.filter.predicate.permanent.BlockingPredicate;
|
||||
import mage.filter.predicate.permanent.SummoningSicknessPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.Graveyard;
|
||||
import mage.game.Table;
|
||||
|
|
@ -478,6 +479,7 @@ public class TestPlayer implements Player {
|
|||
FilterCreatureForCombat filter = new FilterCreatureForCombat();
|
||||
filter.add(new NamePredicate(groups[0]));
|
||||
filter.add(Predicates.not(new AttackingPredicate()));
|
||||
filter.add(Predicates.not(new SummoningSicknessPredicate()));
|
||||
Permanent attacker = findPermanent(filter, computerPlayer.getId(), game);
|
||||
if (attacker != null && attacker.canAttack(defenderId, game)) {
|
||||
computerPlayer.declareAttacker(attacker.getId(), defenderId, game, false);
|
||||
|
|
@ -571,21 +573,37 @@ public class TestPlayer implements Player {
|
|||
String[] targetList = choose2.split("\\^");
|
||||
boolean targetFound = false;
|
||||
for (String targetName : targetList) {
|
||||
boolean originOnly = false;
|
||||
boolean copyOnly = false;
|
||||
if (targetName.endsWith("]")) {
|
||||
if (targetName.endsWith("[no copy]")) {
|
||||
originOnly = true;
|
||||
targetName = targetName.substring(0, targetName.length() - 9);
|
||||
}
|
||||
if (targetName.endsWith("[only copy]")) {
|
||||
copyOnly = true;
|
||||
targetName = targetName.substring(0, targetName.length() - 11);
|
||||
}
|
||||
}
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filterPermanent, game)) {
|
||||
if (target.getTargets().contains(permanent.getId())) {
|
||||
continue;
|
||||
}
|
||||
if (permanent.getName().equals(targetName)) {
|
||||
if (target.isNotTarget() || ((TargetPermanent) target).canTarget(computerPlayer.getId(), permanent.getId(), null, game)) {
|
||||
target.add(permanent.getId(), game);
|
||||
targetFound = true;
|
||||
break;
|
||||
if ((permanent.isCopy() && !originOnly) || (!permanent.isCopy() && !copyOnly)) {
|
||||
target.add(permanent.getId(), game);
|
||||
targetFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ((permanent.getName() + "-" + permanent.getExpansionSetCode()).equals(targetName)) {
|
||||
if (target.isNotTarget() || ((TargetPermanent) target).canTarget(computerPlayer.getId(), permanent.getId(), null, game)) {
|
||||
target.add(permanent.getId(), game);
|
||||
targetFound = true;
|
||||
break;
|
||||
if ((permanent.isCopy() && !originOnly) || (!permanent.isCopy() && !copyOnly)) {
|
||||
target.add(permanent.getId(), game);
|
||||
targetFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue