mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
Update showCardInfo for Adventure/Omen
* formats implemented text to show main card followed by spell card * reference card also shows spell card information
This commit is contained in:
parent
63781e9ca1
commit
94c6b03ded
1 changed files with 14 additions and 1 deletions
|
|
@ -2403,7 +2403,12 @@ public class VerifyCardDataTest {
|
||||||
|
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.out.println(card.getName() + " " + card.getManaCost().getText());
|
System.out.println(card.getName() + " " + card.getManaCost().getText());
|
||||||
if (card instanceof SplitCard || card instanceof ModalDoubleFacedCard) {
|
if (card instanceof CardWithSpellOption) {
|
||||||
|
// format to print main card then spell card
|
||||||
|
card.getInitAbilities().getRules().forEach(this::printAbilityText);
|
||||||
|
((CardWithSpellOption) card).getSpellCard().getAbilities().getRules().forEach(r -> printAbilityText(r.replace("— ", "\n")));
|
||||||
|
}
|
||||||
|
else if (card instanceof SplitCard || card instanceof ModalDoubleFacedCard) {
|
||||||
card.getAbilities().getRules().forEach(this::printAbilityText);
|
card.getAbilities().getRules().forEach(this::printAbilityText);
|
||||||
} else {
|
} else {
|
||||||
card.getRules().forEach(this::printAbilityText);
|
card.getRules().forEach(this::printAbilityText);
|
||||||
|
|
@ -2412,12 +2417,20 @@ public class VerifyCardDataTest {
|
||||||
// ref card
|
// ref card
|
||||||
System.out.println();
|
System.out.println();
|
||||||
MtgJsonCard ref = MtgJsonService.card(card.getName());
|
MtgJsonCard ref = MtgJsonService.card(card.getName());
|
||||||
|
MtgJsonCard ref2 = null;
|
||||||
|
if (card instanceof CardWithSpellOption) {
|
||||||
|
ref2 = MtgJsonService.card(((CardWithSpellOption) card).getSpellCard().getName());
|
||||||
|
}
|
||||||
if (ref == null) {
|
if (ref == null) {
|
||||||
ref = MtgJsonService.cardByClassName(foundClassName);
|
ref = MtgJsonService.cardByClassName(foundClassName);
|
||||||
}
|
}
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
System.out.println("ref: " + ref.getNameAsFace() + " " + ref.manaCost);
|
System.out.println("ref: " + ref.getNameAsFace() + " " + ref.manaCost);
|
||||||
System.out.println(ref.text);
|
System.out.println(ref.text);
|
||||||
|
if (ref2 != null) {
|
||||||
|
System.out.println(ref2.getNameAsFace() + " " + ref2.manaCost);
|
||||||
|
System.out.println(ref2.text);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("WARNING, can't find mtgjson ref for " + card.getName());
|
System.out.println("WARNING, can't find mtgjson ref for " + card.getName());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue