Updated implementation of Unpredictable Cyclone (#6423)

* updated implementation of Unpredictable Cyclone, refactored drawCard method

* fixed another small implementation error

* added test for Unpredictable Cyclone

* updated Unpredictable Cyclone test
This commit is contained in:
Evan Kranzler 2020-04-16 08:04:21 -04:00 committed by GitHub
parent 80b7f8493b
commit 378dfbf89a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
279 changed files with 465 additions and 378 deletions

View file

@ -408,7 +408,7 @@ public interface Game extends MageItem, Serializable {
boolean endTurn(Ability source);
int doAction(MageAction action);
int doAction(MageAction action, UUID sourceId);
//game transaction methods
void saveState(boolean bookmark);

View file

@ -1026,7 +1026,7 @@ public abstract class GameImpl implements Game, Serializable {
player.initLife(this.getLife());
}
if (!gameOptions.testMode) {
player.drawCards(startingHandSize, this);
player.drawCards(startingHandSize, null, this);
}
}
@ -3021,9 +3021,9 @@ public abstract class GameImpl implements Game, Serializable {
}
@Override
public int doAction(MageAction action) {
public int doAction(MageAction action, UUID sourceId) {
//actions.add(action);
int value = action.doAction(this);
int value = action.doAction(sourceId, this);
// score += action.getScore(scorePlayer);
return value;
}

View file

@ -93,7 +93,7 @@ class DrawCardsActivePlayerEffect extends OneShotEffect {
}
Player player = game.getPlayer(game.getActivePlayerId());
if (player != null) {
player.drawCards(amount.calculate(game, source, this), game);
player.drawCards(amount.calculate(game, source, this), source.getSourceId(), game);
return true;
}
return false;

View file

@ -118,7 +118,7 @@ public class CanadianHighlanderMulligan extends VancouverMulligan {
.append(" mulligans to ")
.append(Integer.toString(numToMulliganTo))
.append(numToMulliganTo == 1 ? " card" : " cards").toString());
player.drawCards(numToMulliganTo, game);
player.drawCards(numToMulliganTo, null, game);
}
}

View file

@ -103,7 +103,7 @@ public class LondonMulligan extends Mulligan {
.append(newHandSize)
.append(newHandSize == 1 ? " card" : " cards").toString());
}
player.drawCards(numCards, game);
player.drawCards(numCards, null, game);
if (player.getHand().size() > newHandSize) {
int cardsToDiscard = player.getHand().size() - newHandSize;

View file

@ -53,7 +53,7 @@ public class ParisMulligan extends Mulligan {
.append(deduction == 0 ? " for free and draws " : " down to ")
.append((numCards - deduction))
.append(numCards - deduction == 1 ? " card" : " cards").toString());
player.drawCards(numCards - deduction, game);
player.drawCards(numCards - deduction, null, game);
}
@Override

View file

@ -1,15 +1,13 @@
package mage.game.turn;
import java.util.UUID;
import mage.constants.PhaseStep;
import mage.game.Game;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class DrawStep extends Step {
@ -29,7 +27,7 @@ public class DrawStep extends Step {
public void beginStep(Game game, UUID activePlayerId) {
Player activePlayer = game.getPlayer(activePlayerId);
//20091005 - 504.1/703.4c
activePlayer.drawCards(1, game);
activePlayer.drawCards(1, null, game);
// game.saveState();
game.applyEffects();
super.beginStep(game, activePlayerId);