mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
Merge pull request #7282 from weirddan455/court-of-ambition-fix
Fixed Court of Ambition incorrectly causing you to discard cards (fixes #7263)
This commit is contained in:
commit
a1c82f91d7
1 changed files with 2 additions and 1 deletions
|
@ -70,7 +70,7 @@ class CourtOfAmbitionEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
int discardCount = source.isControlledBy(game.getMonarchId()) ? 2 : 1;
|
int discardCount = source.isControlledBy(game.getMonarchId()) ? 2 : 1;
|
||||||
String message = "Discard " + CardUtil.numberToText(discardCount, "a")
|
String message = "Discard " + CardUtil.numberToText(discardCount, "a")
|
||||||
+ "card" + (discardCount > 1 ? 's' : "") + "? If not you lose " + (discardCount * 3) + " life";
|
+ " card" + (discardCount > 1 ? 's' : "") + "? If not you lose " + (discardCount * 3) + " life";
|
||||||
Map<UUID, Cards> discardMap = new HashMap<>();
|
Map<UUID, Cards> discardMap = new HashMap<>();
|
||||||
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
for (UUID playerId : game.getOpponents(source.getControllerId())) {
|
||||||
Player player = game.getPlayer(playerId);
|
Player player = game.getPlayer(playerId);
|
||||||
|
@ -79,6 +79,7 @@ class CourtOfAmbitionEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
if (player.getHand().size() < discardCount || !player.chooseUse(outcome, message, source, game)) {
|
if (player.getHand().size() < discardCount || !player.chooseUse(outcome, message, source, game)) {
|
||||||
player.loseLife(discardCount * 3, game, source, false);
|
player.loseLife(discardCount * 3, game, source, false);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
TargetDiscard target = new TargetDiscard(discardCount, StaticFilters.FILTER_CARD, playerId);
|
TargetDiscard target = new TargetDiscard(discardCount, StaticFilters.FILTER_CARD, playerId);
|
||||||
player.choose(outcome, target, source.getSourceId(), game);
|
player.choose(outcome, target, source.getSourceId(), game);
|
||||||
|
|
Loading…
Reference in a new issue