- Revert changes made for bug #5437. See 2ca1643b54

This commit is contained in:
jeffwadsworth 2020-01-23 08:31:22 -06:00
parent b2af8a3887
commit cb340e4709
4 changed files with 2 additions and 19 deletions

View file

@ -68,22 +68,8 @@ class ArcaneDenialEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Card originalSourceCard; // needed for copies of Arcane Denial See Bug #5437
Player controller = null;
boolean countered = false;
// If the source originates from a copy (Isochron Scepter for example),
// then we set the source's sourceId to the original card, otherwise it
// uses the spell on the stack as its sourceObject which won't work
// correctly with any cards that make use of Delayed Triggers.
// see Bug #5437
Card cardToCheck = game.getCard(source.getSourceId());
if (cardToCheck != null
&& cardToCheck.isCopy()) { // Isochron Scepter imprinted card for example
originalSourceCard = (Card) game.getState().getValue("RememberSourceObject" + source.getSourceId());
if (originalSourceCard != null) {
source.setSourceId(originalSourceCard.getId());
}
}
UUID targetId = this.getTargetPointer().getFirst(game, source);
if (targetId != null) {
controller = game.getPlayer(game.getControllerId(targetId));

View file

@ -143,9 +143,6 @@ class IsochronScepterCopyEffect extends OneShotEffect {
if (controller.chooseUse(outcome, "Create a copy of " + imprintedInstant.getName() + '?', source, game)) {
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
if (copiedCard != null) {
// Need to record the sourceObject info for the copy (example Arcane Denial)
// TODO implement this within the codebase. See Bug #5437
game.getState().setValue("RememberSourceObject" + copiedCard.getId(), imprintedInstant);
game.getExile().add(source.getSourceId(), "", copiedCard);
game.getState().setZone(copiedCard.getId(), Zone.EXILED);
if (controller.chooseUse(outcome, "Cast the copied card without paying mana cost?", source, game)) {

View file

@ -53,7 +53,7 @@ public class DrawCardSourceControllerEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null
&& player.isInGame()) {
&& player.canRespond()) {
player.drawCards(amount.calculate(game, source, this), game);
return true;
}

View file

@ -63,7 +63,7 @@ public class DrawCardTargetEffect extends OneShotEffect {
for (UUID playerId : getTargetPointer().getTargets(game, source)) {
Player player = game.getPlayer(playerId);
if (player != null
&& player.isInGame()) {
&& player.canRespond()) {
int cardsToDraw = amount.calculate(game, source, this);
if (upTo) {
cardsToDraw = player.getAmount(0, cardsToDraw, "Draw how many cards?", game);