text fixes [ALA] [CON] [ARB] (#11036)

* Tweak verify for double cycling
* small fixes
* do not verify some GUI-related rules.
This commit is contained in:
Susucre 2023-08-27 02:46:49 +02:00 committed by GitHub
parent 2ec4401cee
commit 52eaa600ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 9 deletions

View file

@ -1,8 +1,5 @@
package mage.cards.b;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.ApprovingObject;
import mage.MageObject;
import mage.abilities.Ability;
@ -17,6 +14,10 @@ import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetOpponent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -44,7 +45,10 @@ class BrilliantUltimatumEffect extends OneShotEffect {
public BrilliantUltimatumEffect() {
super(Outcome.PlayForFree);
this.staticText = "Exile the top five cards of your library. An opponent separates those cards into two piles. You may play any number of cards from one of those piles without paying their mana costs";
this.staticText = "Exile the top five cards of your library. "
+ "An opponent separates those cards into two piles. "
+ "You may play lands and cast spells from one of those piles. "
+ "If you cast a spell this way, you cast it without paying its mana cost";
}
public BrilliantUltimatumEffect(final BrilliantUltimatumEffect effect) {

View file

@ -24,7 +24,9 @@ public final class ExplodingBorders extends CardImpl {
// Domain - Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. Exploding Borders deals X damage to target player, where X is the number of basic land types among lands you control.
this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, true));
this.getSpellAbility().addEffect(new DamageTargetEffect(DomainValue.REGULAR));
this.getSpellAbility().addEffect(new DamageTargetEffect(DomainValue.REGULAR)
.setText("{this} deals X damage to target player or planeswalker, "
+ "where X is the number of basic land types among lands you control"));
this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker());
this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);

View file

@ -1,7 +1,6 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
@ -13,6 +12,8 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import java.util.UUID;
/**
* @author North
*/
@ -29,7 +30,7 @@ public final class SkywardEyeProphets extends CardImpl {
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// {tap}: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTopLandToBattlefieldElseHandEffect(), new TapSourceCost()));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTopLandToBattlefieldElseHandEffect("it"), new TapSourceCost()));
}
private SkywardEyeProphets(final SkywardEyeProphets card) {

View file

@ -29,7 +29,6 @@ import mage.filter.Filter;
import mage.game.command.Dungeon;
import mage.game.command.Plane;
import mage.game.draft.DraftCube;
import mage.cards.RateCard;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.custom.CreatureToken;
@ -53,6 +52,8 @@ import java.lang.reflect.*;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@ -2224,7 +2225,11 @@ public class VerifyCardDataTest {
refText += "<br>";
refText = refText.replace("<br>", "\n");
}
// mana ability fix
// Current implementation makes one Activated Ability per kind of color.
// We split such abilities in the reference text.
// TODO: extend to more complex ones. See https://github.com/magefree/mage/issues/10832
for (String s : refText.split("[\\$\\\n]")) {
if (!(s.startsWith("{T}: Add {") || s.startsWith("({T}: Add {"))
|| !(s.contains("} or {") || s.contains("}, or {"))) {
@ -2242,6 +2247,30 @@ public class VerifyCardDataTest {
refText = refText.replace(s, newStr);
}
// cycling fix
// Current implementation makes one CyclingAbility per quality,
// We split such abilities in the reference text.
//
// For instance "Swampcycling {2}, mountaincycling {2}"
// becomes "Swampcycling {2}\nMountaincycling {2}"
for (String s : refText.split("[\\$\\\n]")) {
if (!Pattern.matches("^[a-zA-Z]*cycling .*, [a-zA-Z]*cycling.*", s)) {
continue;
}
String newStr = "";
Pattern p = Pattern.compile(", [a-zA-Z]*cycling");
Matcher m = p.matcher(s);
int start = 0;
while (m.find()) {
String group = m.group();
int newStart = m.start();
newStr += s.substring(start, newStart) + "\n" + group.substring(2, 3).toUpperCase() + group.substring(3);
start = newStart + group.length();
}
newStr += s.substring(start);
refText = refText.replace(s, newStr);
}
String[] refRules = refText.split("[\\$\\\n]"); // ref card's abilities can be splited by \n or $ chars
for (int i = 0; i < refRules.length; i++) {
@ -2279,6 +2308,12 @@ public class VerifyCardDataTest {
boolean isFine = true;
for (int i = 0; i < cardRules.length; i++) {
if (cardRules[i].startsWith("Use the Special button")) {
// This is a rules text for GUI implication like Quenchable Fire
cardRules[i] = "+ " + cardRules[i];
continue;
}
boolean isAbilityFounded = false;
for (int j = 0; j < refRules.length; j++) {
String refRule = refRules[j];

View file

@ -13,8 +13,14 @@ import mage.players.Player;
public class RevealTopLandToBattlefieldElseHandEffect extends OneShotEffect {
public RevealTopLandToBattlefieldElseHandEffect() {
this("that card");
}
public RevealTopLandToBattlefieldElseHandEffect(String cardTextOtherwise) {
super(Outcome.DrawCard);
this.staticText = "reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put that card into your hand";
this.staticText = "reveal the top card of your library. "
+ "If it's a land card, put it onto the battlefield. "
+ "Otherwise, put " + cardTextOtherwise + " into your hand";
}
protected RevealTopLandToBattlefieldElseHandEffect(final RevealTopLandToBattlefieldElseHandEffect effect) {