fix Discover text

This commit is contained in:
xenohedron 2023-10-29 02:44:09 -04:00
parent 3abdb72910
commit e802db32d3
2 changed files with 9 additions and 4 deletions

View file

@ -29,9 +29,14 @@ public class ActivateAsSorceryActivatedAbility extends ActivatedAbilityImpl {
@Override
public String getRule() {
if (mayActivate == TargetController.OPPONENT) {
return super.getRule() + " Only your opponents may activate this ability and only as a sorcery.";
String superRule = super.getRule();
String newText = (mayActivate == TargetController.OPPONENT
? " Only your opponents may activate this ability and only as a sorcery."
: " Activate only as a sorcery.");
if (superRule.endsWith("</i>")) {
return superRule.replaceFirst(" <i>", newText + " <i>");
} else {
return superRule + newText;
}
return super.getRule() + " Activate only as a sorcery.";
}
}