mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 06:22:01 -08:00
Some minor changes to tooltip generation.
This commit is contained in:
parent
2c6c3e0311
commit
a75dda1464
8 changed files with 72 additions and 27 deletions
|
|
@ -68,29 +68,26 @@ public class DiscardTargetCost extends CostImpl {
|
|||
|
||||
@Override
|
||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||
this.cards.clear();
|
||||
Player player = game.getPlayer(controllerId);
|
||||
if (randomDiscard) {
|
||||
int amount = this.getTargets().get(0).getMaxNumberOfTargets();
|
||||
int maxAmount = Math.min(amount, player.getHand().size());
|
||||
for (int i = 0; i < maxAmount; i++) {
|
||||
Card card = player.getHand().getRandom(game);
|
||||
if (card != null) {
|
||||
paid |= player.discard(card, null, game);
|
||||
}
|
||||
}
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int amount = this.getTargets().get(0).getNumberOfTargets();
|
||||
if (randomDiscard) {
|
||||
this.cards.addAll(player.discard(amount, true, ability, game).getCards(game));
|
||||
} else {
|
||||
if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) {
|
||||
|
||||
if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) {
|
||||
for (UUID targetId: targets.get(0).getTargets()) {
|
||||
Card card = player.getHand().get(targetId, game);
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
this.cards.add(card.copy());
|
||||
paid |= player.discard(card, ability, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
paid = cards.size() >= amount;
|
||||
return paid;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class ExileCardFromOwnGraveyardControllerEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
private String setText() {
|
||||
StringBuilder sb = new StringBuilder("Exile ");
|
||||
StringBuilder sb = new StringBuilder("exile ");
|
||||
if (amount == 1) {
|
||||
sb.append(" a card ");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -73,6 +73,9 @@ public class PreventDamageToTargetEffect extends PreventionEffectImpl {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (amountToPrevent == Integer.MAX_VALUE) {
|
||||
sb.append("Prevent all damage that would be dealt to target ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue