Fixed wrong/miss numbers in card rules (see #10067 and prev commit)

This commit is contained in:
Oleg Agafonov 2023-02-25 14:34:26 +04:00
parent 99d1800214
commit 5c30467c48
75 changed files with 105 additions and 88 deletions

View file

@ -30,7 +30,7 @@ public class DiscardTargetCost extends CostImpl {
public DiscardTargetCost(TargetCardInHand target, boolean randomDiscard) {
this.addTarget(target);
this.randomDiscard = randomDiscard;
this.text = "discard " + target.getTargetName();
this.text = "discard " + target.getDescription();
}
public DiscardTargetCost(DiscardTargetCost cost) {

View file

@ -60,7 +60,7 @@ public class ExileFromGraveCost extends CostImpl {
public ExileFromGraveCost(TargetCardInASingleGraveyard target) {
target.setNotTarget(true);
this.addTarget(target);
this.text = "exile " + target.getTargetName();
this.text = "exile " + target.getDescription();
}
public ExileFromGraveCost(TargetCardInYourGraveyard target, boolean setTargetPointer) {

View file

@ -37,7 +37,7 @@ public class ExileFromHandCost extends CostImpl {
*/
public ExileFromHandCost(TargetCardInHand target, boolean setXFromCMC) {
this.addTarget(target);
this.text = "exile " + target.getTargetName();
this.text = "exile " + target.getDescription();
this.setXFromCMC = setXFromCMC;
}

View file

@ -28,7 +28,7 @@ public class ExileTargetCost extends CostImpl {
public ExileTargetCost(TargetControlledPermanent target) {
target.setNotTarget(true);
this.addTarget(target);
this.text = "exile " + target.getTargetName();
this.text = "exile " + target.getDescription();
}
public ExileTargetCost(TargetControlledPermanent target, boolean noText) {

View file

@ -22,11 +22,7 @@ public class ReturnToHandFromGraveyardCost extends CostImpl {
public ReturnToHandFromGraveyardCost(TargetCardInYourGraveyard target) {
this.addTarget(target);
if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) {
this.text = new StringBuilder("return ").append(target.getMaxNumberOfTargets()).append(' ').append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString();
} else {
this.text = new StringBuilder("return ").append(target.getTargetName()).append(" from graveyard to it's owner's hand").toString();
}
this.text = "return " + target.getDescription() + " from graveyard to it's owner's hand";
}
public ReturnToHandFromGraveyardCost(ReturnToHandFromGraveyardCost cost) {

View file

@ -27,7 +27,7 @@ public class RevealTargetFromHandCost extends CostImpl {
public RevealTargetFromHandCost(TargetCardInHand target) {
this.addTarget(target);
this.text = (target.getNumberOfTargets() == 0 ? "you may reveal " : "reveal ") + target.getTargetName();
this.text = (target.getNumberOfTargets() == 0 ? "you may reveal " : "reveal ") + target.getDescription();
this.revealedCards = new ArrayList<>();
}

View file

@ -88,10 +88,16 @@ public interface Target extends Serializable {
void updateTarget(UUID targetId, Game game);
/**
* @return full description with target name, amount, etc (uses in abilities/rules/cost)
*/
String getDescription();
String getMessage();
/**
* @return single target name
*/
String getTargetName();
void setTargetName(String name);