mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Some small improvements to framework classes.
This commit is contained in:
parent
8561234793
commit
d2c2c9b4a4
3 changed files with 10 additions and 5 deletions
|
@ -74,7 +74,7 @@ public class RevealTargetFromHandCost extends CostImpl<RevealTargetFromHandCost>
|
|||
cards.add(card);
|
||||
paid = true;
|
||||
}
|
||||
player.revealCards("Revealed card", cards, game); // this is not a boolean
|
||||
player.revealCards("card cost", cards, game); // this is not a boolean
|
||||
return paid;
|
||||
}
|
||||
paid = false;
|
||||
|
|
|
@ -33,9 +33,13 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect<SacrificeSour
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() /* + " or sacrifice " + permanent.getName() */ + "?", game)) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append("?");
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ") ) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false))
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false))
|
||||
return true;
|
||||
}
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
|
@ -53,7 +57,7 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect<SacrificeSour
|
|||
public String getText(Mode mode) {
|
||||
StringBuilder sb = new StringBuilder("sacrifice {this} unless you ");
|
||||
String costText = cost.getText();
|
||||
if (costText.toLowerCase().startsWith("discard") || costText.toLowerCase().startsWith("remove") || costText.toLowerCase().startsWith("return")) {
|
||||
if (costText.toLowerCase().startsWith("discard") || costText.toLowerCase().startsWith("remove") || costText.toLowerCase().startsWith("return") || costText.toLowerCase().startsWith("exile")) {
|
||||
sb.append(costText.substring(0, 1).toLowerCase());
|
||||
sb.append(costText.substring(1));
|
||||
}
|
||||
|
|
|
@ -59,7 +59,8 @@ public class TapSourceUnlessPaysEffect extends OneShotEffect<TapSourceUnlessPays
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, cost.getText() + " or " + permanent.getName() + " comes into play tapped?", game)) {
|
||||
if (cost.canPay(source.getSourceId(), source.getControllerId(), game)
|
||||
&& player.chooseUse(Outcome.Benefit, cost.getText() + " or " + permanent.getName() + " comes into play tapped?", game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getId(), source.getControllerId(), false))
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue