forked from External/mage
* Fixed a lot of cards where order of card discarding/hand,graveyard,permanents into library shuffling and card draw order was not correctly implemented. This could cause bugs for draw replacement effects (e.g. Notion Thief).
This commit is contained in:
parent
72c4f458ce
commit
bd6fa770aa
17 changed files with 329 additions and 215 deletions
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.sets.commander2013;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
|
@ -54,8 +56,7 @@ public class IncendiaryCommand extends CardImpl {
|
|||
super(ownerId, 113, "Incendiary Command", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}");
|
||||
this.expansionSetCode = "C13";
|
||||
|
||||
|
||||
// Choose two -
|
||||
// Choose two -
|
||||
this.getSpellAbility().getModes().setMinModes(2);
|
||||
this.getSpellAbility().getModes().setMaxModes(2);
|
||||
// Incendiary Command deals 4 damage to target player;
|
||||
|
|
@ -107,16 +108,23 @@ class IncendiaryCommandDrawEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId : controller.getInRange()) {
|
||||
Map<UUID, Integer> cardsToDraw = new HashMap<>();
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int cards = player.getHand().size();
|
||||
if (cards > 0) {
|
||||
player.discard(cards, source, game);
|
||||
player.drawCards(cards, game);
|
||||
int cardsInHand = player.getHand().size();
|
||||
player.discard(cardsInHand, false, source, game);
|
||||
if (cardsInHand > 0) {
|
||||
cardsToDraw.put(playerId, cardsInHand);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (UUID playerId : cardsToDraw.keySet()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.drawCards(cardsToDraw.get(playerId), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue