Added some font color to object and player names output to game logging and feedback area.

This commit is contained in:
LevelX2 2015-05-09 21:18:00 +02:00
parent c3ea08b59c
commit 9c97953b6b
384 changed files with 745 additions and 636 deletions

View file

@ -71,7 +71,7 @@ public class HauntTest extends CardTestPlayerBase {
for (Card card : currentGame.getExile().getAllCards(currentGame)) {
if (card.getName().equals("Blind Hunter")) {
for (String rule : card.getRules(currentGame)) {
if (rule.startsWith("Haunting Goblin Roughrider")) {
if (rule.startsWith("Haunting") && rule.contains("Goblin Roughrider")) {
found = true;
}
}
@ -83,7 +83,7 @@ public class HauntTest extends CardTestPlayerBase {
for (Card card : currentGame.getBattlefield().getAllActivePermanents()) {
if (card.getName().equals("Goblin Roughrider")) {
for (String rule : card.getRules(currentGame)) {
if (rule.startsWith("Haunted by Blind Hunter")) {
if (rule.startsWith("Haunted by") && rule.contains("Blind Hunter")) {
found = true;
}
}
@ -117,7 +117,7 @@ public class HauntTest extends CardTestPlayerBase {
for (Card card : currentGame.getPlayer(playerA.getId()).getGraveyard().getCards(currentGame)) {
if (card.getName().equals("Goblin Roughrider")) {
for (String rule : card.getRules(currentGame)) {
if (rule.startsWith("Haunted by Blind Hunter")) {
if (rule.startsWith("Haunted by") && rule.contains("Blind Hunter")) {
found = true;
}
}

View file

@ -66,10 +66,10 @@ public class ManifestTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 20);
// a facedown creature is on the battlefield
assertPermanentCount(playerA, "face down creature", 1);
assertPowerToughness(playerA, "face down creature", 2, 2);
assertPermanentCount(playerA, "", 1);
assertPowerToughness(playerA, "", 2, 2);
// not tapped
assertTapped("face down creature", false);
assertTapped("", false);
}
/**
@ -97,8 +97,8 @@ public class ManifestTest extends CardTestPlayerBase {
assertLife(playerA, 20);
assertLife(playerB, 20);
// a facedown creature is on the battlefield
assertPermanentCount(playerA, "face down creature", 1);
assertPowerToughness(playerA, "face down creature", 2, 2);
assertPermanentCount(playerA, "", 1);
assertPowerToughness(playerA, "", 2, 2);
// PlayerB's Silvercoat Lion should not have get -1/-1/
assertPermanentCount(playerB, "Silvercoat Lion", 1);
assertPowerToughness(playerB, "Silvercoat Lion", 2, 2);
@ -132,8 +132,8 @@ public class ManifestTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Reality Shift", 1);
assertExileCount("Silvercoat Lion" , 1);
// a facedown creature is on the battlefield
assertPermanentCount(playerA, "face down creature", 1);
assertPowerToughness(playerA, "face down creature", 2, 2);
assertPermanentCount(playerA, "", 1);
assertPowerToughness(playerA, "", 2, 2);
// PlayerA's Pillarfield Ox should not have get -1/-1/
assertPermanentCount(playerB, "Pillarfield Ox", 1);
assertPowerToughness(playerB, "Pillarfield Ox", 2, 4);
@ -166,8 +166,8 @@ public class ManifestTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Reality Shift", 1);
assertExileCount("Silvercoat Lion" , 1);
// a facedown creature is on the battlefield
assertPermanentCount(playerA, "face down creature", 1);
assertPowerToughness(playerA, "face down creature", 2, 2);
assertPermanentCount(playerA, "", 1);
assertPowerToughness(playerA, "", 2, 2);
}
@ -202,8 +202,8 @@ public class ManifestTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Reality Shift", 1);
assertExileCount("Silvercoat Lion" , 1);
// a facedown creature is on the battlefield
assertPermanentCount(playerA, "face down creature", 1);
assertPowerToughness(playerA, "face down creature", 2, 2);
assertPermanentCount(playerA, "", 1);
assertPowerToughness(playerA, "", 2, 2);
assertPowerToughness(playerA, "Foundry Street Denizen", 1, 1);
}
@ -220,7 +220,7 @@ public class ManifestTest extends CardTestPlayerBase {
// Strive Silence the Believers costs more to cast for each target beyond the first.
// Exile any number of target creatures and all Auras attached to them.
addCard(Zone.HAND, playerB, "Silence the Believers");
addTarget(playerB, "face down creature");
addTarget(playerB, "");
// Gore Swine {2}{R}
// 4/1
addCard(Zone.LIBRARY, playerA, "Gore Swine");
@ -231,7 +231,7 @@ public class ManifestTest extends CardTestPlayerBase {
skipInitShuffling();
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Reality Shift", "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Silence the Believers", "face down creature");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Silence the Believers", "");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -243,7 +243,7 @@ public class ManifestTest extends CardTestPlayerBase {
assertExileCount("Silvercoat Lion" , 1);
assertExileCount("Gore Swine" , 1);
// no facedown creature is on the battlefield
assertPermanentCount(playerA, "face down creature", 0);
assertPermanentCount(playerA, "", 0);
for (Card card :currentGame.getExile().getAllCards(currentGame)){
if (card.getName().equals("Gore Swine")) {
@ -284,7 +284,7 @@ public class ManifestTest extends CardTestPlayerBase {
// a facedown creature is on the battlefield
assertPermanentCount(playerB, "face down creature", 1);
assertPermanentCount(playerB, "", 1);
}
@ -319,7 +319,7 @@ public class ManifestTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerB, "face down creature", 0);
assertPermanentCount(playerB, "", 0);
assertPermanentCount(playerB, "Sandstorm Charger", 1);
assertPowerToughness(playerB, "Sandstorm Charger", 4, 5); // 3/4 and the +1/+1 counter from Megamorph
@ -359,7 +359,7 @@ public class ManifestTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerB, "face down creature", 1);
assertPermanentCount(playerB, "", 1);
}
}

View file

@ -84,8 +84,8 @@ public class MorphTest extends CardTestPlayerBase {
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "face down creature", 1);
assertPowerToughness(playerA, "face down creature", 2, 2);
assertPermanentCount(playerA, "", 1);
assertPowerToughness(playerA, "", 2, 2);
}
/**
@ -99,7 +99,7 @@ public class MorphTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pine Walker");
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
attack(3, playerA, "face down creature");
attack(3, playerA, "");
activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "{4}{G}: Turn this face-down permanent face up.");
setStopAt(3, PhaseStep.END_TURN);
@ -107,7 +107,7 @@ public class MorphTest extends CardTestPlayerBase {
assertLife(playerB, 18);
assertPermanentCount(playerA, "face down creature", 0);
assertPermanentCount(playerA, "", 0);
assertPermanentCount(playerA, "Pine Walker", 1);
assertPowerToughness(playerA, "Pine Walker", 5, 5);
assertTapped("Pine Walker", false);
@ -133,8 +133,8 @@ public class MorphTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Icefeather Aven");
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
attack(3, playerA, "face down creature");
attack(3, playerA, "face down creature");
attack(3, playerA, "");
attack(3, playerA, "");
activateAbility(3, PhaseStep.DECLARE_BLOCKERS, playerA, "{1}{G}{U}: Turn this face-down permanent face up.");
setChoice(playerA, "No"); // Don't use return permanent to hand effect
@ -146,7 +146,7 @@ public class MorphTest extends CardTestPlayerBase {
assertHandCount(playerA, "Pine Walker", 0);
assertHandCount(playerA, "Icefeather Aven", 0);
assertPermanentCount(playerA, "face down creature", 1);
assertPermanentCount(playerA, "", 1);
assertPermanentCount(playerA, "Icefeather Aven", 1);
assertTapped("Icefeather Aven", true);
@ -178,7 +178,7 @@ public class MorphTest extends CardTestPlayerBase {
assertLife(playerB, 20); // and not 21
assertPermanentCount(playerA, "face down creature", 1);
assertPermanentCount(playerA, "", 1);
assertPermanentCount(playerB, "Soldier of the Pantheon", 1);
}
@ -204,17 +204,17 @@ public class MorphTest extends CardTestPlayerBase {
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Clever Impersonator");
setChoice(playerB, "Yes"); // use to copy a nonland permanent
addTarget(playerB, "face down creature"); // Morphed creature
addTarget(playerB, ""); // Morphed creature
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerB, 20);
assertPermanentCount(playerA, "face down creature", 1);
assertPowerToughness(playerA, "face down creature", 2,2);
assertPermanentCount(playerB, "a creature without name", 1);
assertPowerToughness(playerB, "a creature without name", 2,2);
assertPermanentCount(playerA, "", 1);
assertPowerToughness(playerA, "", 2,2);
assertPermanentCount(playerB, "", 1);
assertPowerToughness(playerB, "", 2,2);
}
@ -249,7 +249,7 @@ public class MorphTest extends CardTestPlayerBase {
assertHandCount(playerA, "Pine Walker", 0);
assertHandCount(playerB, "Doomwake Giant", 0);
assertPermanentCount(playerA, "face down creature", 0);
assertPermanentCount(playerA, "", 0);
assertPermanentCount(playerB, "Doomwake Giant", 1);
assertPermanentCount(playerA, "Pine Walker", 1);
assertPowerToughness(playerA, "Pine Walker", 4,4);
@ -289,7 +289,7 @@ public class MorphTest extends CardTestPlayerBase {
assertHandCount(playerA, "Ponyback Brigade", 0);
assertHandCount(playerB, "Doomwake Giant", 0);
assertPermanentCount(playerA, "face down creature", 0);
assertPermanentCount(playerA, "", 0);
assertPermanentCount(playerA, "Goblin", 3);
assertPowerToughness(playerA, "Goblin", 1,1,Filter.ComparisonScope.Any);
assertPermanentCount(playerB, "Doomwake Giant", 1);
@ -361,7 +361,7 @@ public class MorphTest extends CardTestPlayerBase {
assertHandCount(playerA, "Sagu Mauler", 0);
assertHandCount(playerB, "Disdainful Stroke", 1); // can't be cast
assertPermanentCount(playerA, "face down creature", 1);
assertPermanentCount(playerA, "", 1);
}
@ -390,7 +390,7 @@ public class MorphTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sagu Mauler");
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Echoing Decay", "face down creature");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Echoing Decay", "");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -400,7 +400,7 @@ public class MorphTest extends CardTestPlayerBase {
assertHandCount(playerA, "Sagu Mauler", 0);
assertHandCount(playerB, "Echoing Decay", 0);
assertPermanentCount(playerA, "face down creature", 1);
assertPermanentCount(playerA, "", 1);
}
@ -449,7 +449,7 @@ public class MorphTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Birchlore Rangers");
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Swords to Plowshares", "face down creature");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Swords to Plowshares", "");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -490,7 +490,7 @@ public class MorphTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ashcloud Phoenix");
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "face down creature");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -533,7 +533,7 @@ public class MorphTest extends CardTestPlayerBase {
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
attack(2, playerB, "Mirri, Cat Warrior");
block(2, playerA, "face down creature", "Mirri, Cat Warrior");
block(2, playerA, "", "Mirri, Cat Warrior");
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
execute();
@ -570,7 +570,7 @@ public class MorphTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Akroma, Angel of Fury");
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Supplant Form", "face down creature");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Supplant Form", "");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -581,8 +581,8 @@ public class MorphTest extends CardTestPlayerBase {
assertHandCount(playerA, "Akroma, Angel of Fury", 1);
assertPermanentCount(playerB, "Akroma, Angel of Fury", 0);
assertPermanentCount(playerB, "a creature without name", 1);
assertPowerToughness(playerB, "a creature without name", 2, 2);
assertPermanentCount(playerB, "", 1);
assertPowerToughness(playerB, "", 2, 2);
}
}

View file

@ -102,8 +102,8 @@ public class ExileAndReturnUnderYourControl extends CardTestPlayerBase {
assertExileCount("Secret Plans", 0);
assertPermanentCount(playerA, "Secret Plans", 1);
assertPermanentCount(playerA, "face down creature", 1);
assertPowerToughness(playerA, "face down creature", 2, 3);
assertPermanentCount(playerA, "", 1);
assertPowerToughness(playerA, "", 2, 3);
}
}

View file

@ -38,7 +38,7 @@ public class GhastlyConscriptionTest extends CardTestPlayerBase {
assertLife(playerB, 20);
assertGraveyardCount(playerA, 2);
assertPermanentCount(playerA, "face down creature", 2);
assertPermanentCount(playerA, "", 2);
}

View file

@ -55,7 +55,7 @@ public class DeflectingPalmTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerB, "Plains");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Deflecting Palm", "", "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Deflecting Palm", null, "Lightning Bolt");
setChoice(playerB, "Lightning Bolt");
setStopAt(1, PhaseStep.BEGIN_COMBAT);

View file

@ -75,7 +75,7 @@ public class PurphorosGodOfTheForgeTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Reach of Shadows", 1);
assertPermanentCount(playerA, "Ashcloud Phoenix", 0);
assertPermanentCount(playerA, "face down creature", 1);
assertPermanentCount(playerA, "", 1);
Permanent purphorosGodOfTheForge = getPermanent("Purphoros, God of the Forge", playerA);
Assert.assertFalse("Purphoros may not be a creature but it is", purphorosGodOfTheForge.getCardType().contains(CardType.CREATURE));
@ -107,7 +107,7 @@ public class PurphorosGodOfTheForgeTest extends CardTestPlayerBase {
execute();
assertPermanentCount(playerA, "Ashcloud Phoenix", 0);
assertPermanentCount(playerA, "face down creature", 1);
assertPermanentCount(playerA, "", 1);
assertLife(playerA, 18); // 2 damage from Eidolon of the Great Revel
assertLife(playerB, 18); // 2 damage from Purphoros for the morphed Phoenix

View file

@ -66,8 +66,8 @@ public class TidehollowScullerTest extends CardTestPlayerBase {
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tidehollow Sculler");
addTarget(playerA, "Bloodflow Connoisseur");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boomerang", "Tidehollow Sculler");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scout's Warning", "", "Boomerang");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tidehollow Sculler", "", "", "When {this} leaves the battlefield, return the exiled card to its owner's hand.");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scout's Warning", null, "Boomerang");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tidehollow Sculler", null, "", "When {this} leaves the battlefield, return the exiled card to its owner's hand.");
addTarget(playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);

View file

@ -66,7 +66,7 @@ public class WhisperwoodElementalTest extends CardTestPlayerBase {
assertGraveyardCount(playerA, "Silvercoat Lion", 1);
// Manifested creature from dying Silvercoat Lion
assertPermanentCount(playerA, "face down creature", 1);
assertPermanentCount(playerA, "", 1);
}
}

View file

@ -213,7 +213,7 @@ public class TestPlayer extends ComputerPlayer {
if (group.startsWith("planeswalker=")) {
String planeswalkerName = group.substring(group.indexOf("planeswalker=") + 13);
for (Permanent permanent :game.getBattlefield().getAllActivePermanents(new FilterPlaneswalkerPermanent(), game)) {
if (permanent.getLogName().equals(planeswalkerName)) {
if (permanent.getName().equals(planeswalkerName)) {
defenderId = permanent.getId();
}
}
@ -649,7 +649,7 @@ public class TestPlayer extends ComputerPlayer {
private boolean handleNonPlayerTargetTarget(String target, Ability ability, Game game) {
boolean result = true;
if (target.isEmpty()) {
if (target == null) {
return true; // needed if spell has no target but waits until spell is on the stack
}
String[] targetList = target.split("\\^");
@ -672,7 +672,8 @@ public class TestPlayer extends ComputerPlayer {
}
for (UUID id: ability.getTargets().get(0).possibleTargets(ability.getSourceId(), ability.getControllerId(), game)) {
MageObject object = game.getObject(id);
if (object != null && object.getLogName().startsWith(targetName)) {
if (object != null &&
((!targetName.isEmpty() && object.getName().startsWith(targetName)) || (targetName.isEmpty() && object.getName().isEmpty()))) {
if (index >= ability.getTargets().size()) {
index--;
}

View file

@ -321,7 +321,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
int foundToughness = 0;
int found = 0;
for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) {
if (permanent.getLogName().equals(cardName) && permanent.getControllerId().equals(player.getId())) {
if (permanent.getName().equals(cardName) && permanent.getControllerId().equals(player.getId())) {
count++;
if (scope.equals(Filter.ComparisonScope.All)) {
Assert.assertEquals("Power is not the same (" + power + " vs. " + permanent.getPower().getValue() + ")",
@ -450,7 +450,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
int actualCount = 0;
for (Permanent permanent : currentGame.getBattlefield().getAllPermanents()) {
if (permanent.getControllerId().equals(player.getId())) {
if (permanent.getLogName().equals(cardName)) {
if (permanent.getName().equals(cardName)) {
actualCount++;
}
}
@ -561,7 +561,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
public void assertTapped(String cardName, boolean tapped) throws AssertionError {
Permanent found = null;
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) {
if (permanent.getLogName().equals(cardName)) {
if (permanent.getName().equals(cardName)) {
found = permanent;
}
}
@ -580,7 +580,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
public void assertAttacking(String cardName, boolean attacking) throws AssertionError {
Permanent found = null;
for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) {
if (permanent.getLogName().equals(cardName)) {
if (permanent.getName().equals(cardName)) {
found = permanent;
}
}