mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
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:
parent
7be454fb92
commit
219cc53cf4
24 changed files with 321 additions and 817 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue