Adding targets (Part 2/3) (#13765)

Adds target and/or target adjuster to cards whose abilities have the word "target", cards H-R.
fix EffectKeyValue text, NestOfScarabs
Add X value to effects for CycleTriggeredAbility, use with ValorsFlagship and SharkTyphoon, add test
This commit is contained in:
ssk97 2025-06-18 21:14:16 -07:00 committed by GitHub
parent 7be454fb92
commit 219cc53cf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 321 additions and 817 deletions

View file

@ -6,6 +6,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.StackObject;
import mage.util.CardUtil;
/**
* @author Plopman
@ -40,6 +41,7 @@ public class CycleTriggeredAbility extends ZoneChangeTriggeredAbility {
return false;
}
this.getEffects().setValue("cycleCosts", object.getStackAbility().getCosts());
this.getEffects().setValue("cycleXValue", CardUtil.getSourceCostsTag(game, object.getStackAbility(), "X", 0));
return true;
}

View file

@ -10,8 +10,8 @@ import mage.game.Game;
* @author stravant
*/
public class EffectKeyValue implements DynamicValue {
private String key;
private String description;
private final String key;
private final String description;
public EffectKeyValue(String key) {
this.key = key;
@ -19,7 +19,7 @@ public class EffectKeyValue implements DynamicValue {
}
public EffectKeyValue(String key, String description) {
this(key);
this.key = key;
this.description = description;
}
@ -35,11 +35,11 @@ public class EffectKeyValue implements DynamicValue {
@Override
public String toString() {
return "equal to";
return description;
}
@Override
public String getMessage() {
return description;
return "";
}
}
}

View file

@ -111,7 +111,7 @@ public abstract class TargetImpl implements Target {
if (min > 0 && max == Integer.MAX_VALUE) {
sb.append(CardUtil.numberToText(min));
sb.append(" or more ");
} else if (!targetName.startsWith("X ") && (min != 1 || max != 1)) {
} else if (!targetName.startsWith("X ") && !targetName.startsWith("up to ") && (min != 1 || max != 1)) {
targetName = targetName.replace("another", "other"); //If non-singular, use "other" instead of "another"
if (getUseAnyNumber()) {