[CMR] Fix Explosion of Riches (#8760)

This commit is contained in:
Alex W. Jackson 2022-03-12 03:32:08 -05:00
parent 57d1c1455b
commit 2bd82864b1

View file

@ -56,6 +56,7 @@ class ExplosionOfRichesEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int cardsDrawn = 0;
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) {
@ -65,9 +66,9 @@ class ExplosionOfRichesEffect extends OneShotEffect {
&& !player.chooseUse(outcome, "Draw a card?", source, game)) {
continue;
}
if (player.drawCards(1, source, game) >= 1) {
continue;
}
cardsDrawn += player.drawCards(1, source, game);
}
for (int i = 0; i < cardsDrawn; i++) {
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
new DamageTargetEffect(5), false,
"{this} deals damage to target opponent chosen at random"