mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[KLD] Some minor fixes.
This commit is contained in:
parent
d9c804602e
commit
346b6654f8
4 changed files with 9 additions and 7 deletions
|
|
@ -29,18 +29,19 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (player != null && sourcePermanent != null) {
|
||||
if (controller != null && sourcePermanent != null) {
|
||||
StringBuilder sb = new StringBuilder(cost.getText()).append("?");
|
||||
if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) {
|
||||
sb.insert(0, "Pay ");
|
||||
}
|
||||
String message = CardUtil.replaceSourceName(sb.toString(), sourcePermanent.getLogName());
|
||||
message = Character.toUpperCase(message.charAt(0)) + message.substring(1);
|
||||
if (player.chooseUse(Outcome.Benefit, message, source, game)) {
|
||||
if (controller.chooseUse(Outcome.Benefit, message, source, game)) {
|
||||
cost.clearPaid();
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
game.informPlayers(controller.getLogName() + " pays " + cost.toString());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue