mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
Improve text generation for DamageMultiEffect
This commit is contained in:
parent
c4a0a18066
commit
faf2e4ec82
37 changed files with 94 additions and 168 deletions
|
|
@ -12,9 +12,7 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -79,10 +77,21 @@ public class DamageMultiEffect extends OneShotEffect {
|
|||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
if (amount.toString().equals("3")) {
|
||||
return this.sourceName + " deals 3 damage divided as you choose among one, two, or three targets";
|
||||
StringBuilder sb = new StringBuilder(sourceName);
|
||||
sb.append(" deals ");
|
||||
|
||||
String amountString = amount.toString();
|
||||
sb.append(amountString);
|
||||
sb.append(" damage divided as you choose among ");
|
||||
sb.append(amountString.equals("2") ? "one or two " : amountString.equals("3") ? "one, two, or three " : "any number of ");
|
||||
|
||||
String targetName = mode.getTargets().get(0).getTargetName();
|
||||
if (!targetName.contains("target")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
return this.sourceName + " deals " + amount.toString() + " damage divided as you choose among any number of " + mode.getTargets().get(0).getTargetName();
|
||||
sb.append(targetName);
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getSourceName() {
|
||||
|
|
|
|||
|
|
@ -756,6 +756,12 @@ public final class StaticFilters {
|
|||
FILTER_ATTACKING_CREATURES.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterAttackingOrBlockingCreature FILTER_ATTACKING_OR_BLOCKING_CREATURES = new FilterAttackingOrBlockingCreature("attacking or blocking creatures");
|
||||
|
||||
static {
|
||||
FILTER_ATTACKING_OR_BLOCKING_CREATURES.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterPermanent FILTER_PERMANENT_AURA = new FilterPermanent();
|
||||
|
||||
static {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue