Add common effect class for "Its controller searches..." (Path to Exile, etc) Fixes #9654

This commit is contained in:
Alex W. Jackson 2022-10-15 21:27:55 -04:00
parent 58c55bf08c
commit 76fcfafc8b
19 changed files with 243 additions and 653 deletions

View file

@ -62,14 +62,9 @@ public class SacrificeTargetEffect extends OneShotEffect {
@Override
public String getText(Mode mode) {
if (staticText.isEmpty() && !mode.getTargets().isEmpty()) {
if (mode.getTargets().get(0).getNumberOfTargets() == 1) {
return "The controller of target " + mode.getTargets().get(0).getTargetName() + " sacrifices it";
} else {
return "The controller of " + mode.getTargets().get(0).getNumberOfTargets() + " target " + mode.getTargets().get(0).getTargetName() + " sacrifices it";
}
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
return staticText;
return getTargetPointer().describeTargets(mode.getTargets(), "that permanent") + "'s controller sacrifices it";
}
}