Little refactor, additional logs for CheckPlayableState error;

This commit is contained in:
Oleg Agafonov 2021-08-28 12:09:22 +04:00
parent 7b298f84a7
commit 2efdb464fc
5 changed files with 12 additions and 9 deletions

View file

@ -241,7 +241,7 @@ public abstract class ManaCostImpl extends CostImpl implements ManaCost {
assignPayment(game, ability, player.getManaPool(), costToPay != null ? costToPay : this);
}
game.getState().getSpecialActions().removeManaActions();
while (!isPaid()) {
while (player.canRespond() && !isPaid()) {
ManaCost unpaid = this.getUnpaid();
String promptText = ManaUtil.addSpecialManaPayAbilities(ability, game, unpaid);
if (player.playMana(ability, unpaid, promptText, game)) {
@ -251,7 +251,7 @@ public abstract class ManaCostImpl extends CostImpl implements ManaCost {
}
game.getState().getSpecialActions().removeManaActions();
}
return true;
return isPaid();
}
@Override

View file

@ -128,7 +128,7 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements M
assignPayment(game, ability, player.getManaPool(), this);
}
game.getState().getSpecialActions().removeManaActions();
while (!isPaid()) {
while (player.canRespond() && !isPaid()) {
ManaCost unpaid = this.getUnpaid();
String promptText = ManaUtil.addSpecialManaPayAbilities(ability, game, unpaid);
if (player.playMana(ability, unpaid, promptText, game)) {
@ -138,7 +138,7 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements M
}
game.getState().getSpecialActions().removeManaActions();
}
return true;
return isPaid();
}
/**