mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Missed some references to instanceof AdventureCard
replaced with CardWithSpellOption
This commit is contained in:
parent
7b94324871
commit
63781e9ca1
8 changed files with 17 additions and 18 deletions
|
|
@ -2379,7 +2379,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
Card mainCard = game.getCard(CardUtil.getMainCardId(game, ability.getSourceId()));
|
Card mainCard = game.getCard(CardUtil.getMainCardId(game, ability.getSourceId()));
|
||||||
if (mainCard != null && !Zone.BATTLEFIELD.equals(game.getState().getZone(mainCard.getId()))) {
|
if (mainCard != null && !Zone.BATTLEFIELD.equals(game.getState().getZone(mainCard.getId()))) {
|
||||||
if (mainCard instanceof SplitCard
|
if (mainCard instanceof SplitCard
|
||||||
|| mainCard instanceof AdventureCard
|
|| mainCard instanceof CardWithSpellOption
|
||||||
|| mainCard instanceof ModalDoubleFacedCard) {
|
|| mainCard instanceof ModalDoubleFacedCard) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ class DraugrNecromancerSpendAnyManaEffect extends AsThoughEffectImpl implements
|
||||||
CardState cardState;
|
CardState cardState;
|
||||||
if (card instanceof SplitCard) {
|
if (card instanceof SplitCard) {
|
||||||
cardState = game.getLastKnownInformationCard(card.getId(), Zone.EXILED);
|
cardState = game.getLastKnownInformationCard(card.getId(), Zone.EXILED);
|
||||||
} else if (card instanceof AdventureCard) {
|
} else if (card instanceof CardWithSpellOption) {
|
||||||
cardState = game.getLastKnownInformationCard(card.getId(), Zone.EXILED);
|
cardState = game.getLastKnownInformationCard(card.getId(), Zone.EXILED);
|
||||||
} else if (card instanceof ModalDoubleFacedCard) {
|
} else if (card instanceof ModalDoubleFacedCard) {
|
||||||
cardState = game.getLastKnownInformationCard(((ModalDoubleFacedCard) card).getLeftHalfCard().getId(), Zone.EXILED);
|
cardState = game.getLastKnownInformationCard(((ModalDoubleFacedCard) card).getLeftHalfCard().getId(), Zone.EXILED);
|
||||||
|
|
|
||||||
|
|
@ -103,9 +103,9 @@ class DreamDevourerAddAbilityEffect extends ContinuousEffectImpl {
|
||||||
foretellAbility = new ForetellAbility(card, leftHalfCost, rightHalfCost);
|
foretellAbility = new ForetellAbility(card, leftHalfCost, rightHalfCost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (card instanceof AdventureCard) {
|
} else if (card instanceof CardWithSpellOption) {
|
||||||
String creatureCost = CardUtil.reduceCost(card.getMainCard().getManaCost(), 2).getText();
|
String creatureCost = CardUtil.reduceCost(card.getMainCard().getManaCost(), 2).getText();
|
||||||
String spellCost = CardUtil.reduceCost(((AdventureCard) card).getSpellCard().getManaCost(), 2).getText();
|
String spellCost = CardUtil.reduceCost(((CardWithSpellOption) card).getSpellCard().getManaCost(), 2).getText();
|
||||||
foretellAbility = new ForetellAbility(card, creatureCost, spellCost);
|
foretellAbility = new ForetellAbility(card, creatureCost, spellCost);
|
||||||
} else {
|
} else {
|
||||||
String costText = CardUtil.reduceCost(card.getManaCost(), 2).getText();
|
String costText = CardUtil.reduceCost(card.getManaCost(), 2).getText();
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,9 @@ class EdginLarcenousLutenistEffect extends ContinuousEffectImpl {
|
||||||
foretellAbility = new ForetellAbility(card, leftHalfCost, rightHalfCost);
|
foretellAbility = new ForetellAbility(card, leftHalfCost, rightHalfCost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (card instanceof AdventureCard) {
|
} else if (card instanceof CardWithSpellOption) {
|
||||||
String creatureCost = CardUtil.reduceCost(card.getMainCard().getManaCost(), 2).getText();
|
String creatureCost = CardUtil.reduceCost(card.getMainCard().getManaCost(), 2).getText();
|
||||||
String spellCost = CardUtil.reduceCost(((AdventureCard) card).getSpellCard().getManaCost(), 2).getText();
|
String spellCost = CardUtil.reduceCost(((CardWithSpellOption) card).getSpellCard().getManaCost(), 2).getText();
|
||||||
foretellAbility = new ForetellAbility(card, creatureCost, spellCost);
|
foretellAbility = new ForetellAbility(card, creatureCost, spellCost);
|
||||||
} else {
|
} else {
|
||||||
String costText = CardUtil.reduceCost(card.getManaCost(), 2).getText();
|
String costText = CardUtil.reduceCost(card.getManaCost(), 2).getText();
|
||||||
|
|
|
||||||
|
|
@ -110,9 +110,9 @@ class EtherealValkyrieEffect extends OneShotEffect {
|
||||||
foretellAbility = new ForetellAbility(exileCard, leftHalfCost, rightHalfCost);
|
foretellAbility = new ForetellAbility(exileCard, leftHalfCost, rightHalfCost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (exileCard instanceof AdventureCard) {
|
} else if (exileCard instanceof CardWithSpellOption) {
|
||||||
String creatureCost = CardUtil.reduceCost(exileCard.getMainCard().getManaCost(), 2).getText();
|
String creatureCost = CardUtil.reduceCost(exileCard.getMainCard().getManaCost(), 2).getText();
|
||||||
String spellCost = CardUtil.reduceCost(((AdventureCard) exileCard).getSpellCard().getManaCost(), 2).getText();
|
String spellCost = CardUtil.reduceCost(((CardWithSpellOption) exileCard).getSpellCard().getManaCost(), 2).getText();
|
||||||
game.getState().setValue(exileCard.getMainCard().getId().toString() + "Foretell Cost", creatureCost);
|
game.getState().setValue(exileCard.getMainCard().getId().toString() + "Foretell Cost", creatureCost);
|
||||||
game.getState().setValue(exileCard.getMainCard().getId().toString() + "Foretell Split Cost", spellCost);
|
game.getState().setValue(exileCard.getMainCard().getId().toString() + "Foretell Split Cost", spellCost);
|
||||||
foretellAbility = new ForetellAbility(exileCard, creatureCost, spellCost);
|
foretellAbility = new ForetellAbility(exileCard, creatureCost, spellCost);
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ class TinybonesBaubleBurglarSpendAnyManaEffect extends AsThoughEffectImpl implem
|
||||||
CardState cardState;
|
CardState cardState;
|
||||||
if (card instanceof SplitCard) {
|
if (card instanceof SplitCard) {
|
||||||
cardState = game.getLastKnownInformationCard(card.getId(), Zone.EXILED);
|
cardState = game.getLastKnownInformationCard(card.getId(), Zone.EXILED);
|
||||||
} else if (card instanceof AdventureCard) {
|
} else if (card instanceof CardWithSpellOption) {
|
||||||
cardState = game.getLastKnownInformationCard(card.getId(), Zone.EXILED);
|
cardState = game.getLastKnownInformationCard(card.getId(), Zone.EXILED);
|
||||||
} else if (card instanceof ModalDoubleFacedCard) {
|
} else if (card instanceof ModalDoubleFacedCard) {
|
||||||
cardState = game.getLastKnownInformationCard(((ModalDoubleFacedCard) card).getLeftHalfCard().getId(), Zone.EXILED);
|
cardState = game.getLastKnownInformationCard(((ModalDoubleFacedCard) card).getLeftHalfCard().getId(), Zone.EXILED);
|
||||||
|
|
|
||||||
|
|
@ -306,9 +306,9 @@ public class VerifyCardDataTest {
|
||||||
if (card instanceof CardWithHalves) {
|
if (card instanceof CardWithHalves) {
|
||||||
check(((CardWithHalves) card).getLeftHalfCard(), cardIndex);
|
check(((CardWithHalves) card).getLeftHalfCard(), cardIndex);
|
||||||
check(((CardWithHalves) card).getRightHalfCard(), cardIndex);
|
check(((CardWithHalves) card).getRightHalfCard(), cardIndex);
|
||||||
} else if (card instanceof AdventureCard) {
|
} else if (card instanceof CardWithSpellOption) {
|
||||||
check(card, cardIndex);
|
check(card, cardIndex);
|
||||||
check(((AdventureCard) card).getSpellCard(), cardIndex);
|
check(((CardWithSpellOption) card).getSpellCard(), cardIndex);
|
||||||
} else {
|
} else {
|
||||||
check(card, cardIndex);
|
check(card, cardIndex);
|
||||||
}
|
}
|
||||||
|
|
@ -2161,8 +2161,8 @@ public class VerifyCardDataTest {
|
||||||
);
|
);
|
||||||
// card can contain rules text from both sides, so must search ref card for all sides too
|
// card can contain rules text from both sides, so must search ref card for all sides too
|
||||||
String additionalName;
|
String additionalName;
|
||||||
if (card instanceof AdventureCard) {
|
if (card instanceof CardWithSpellOption) {
|
||||||
additionalName = ((AdventureCard) card).getSpellCard().getName();
|
additionalName = ((CardWithSpellOption) card).getSpellCard().getName();
|
||||||
} else if (card.isTransformable() && !card.isNightCard()) {
|
} else if (card.isTransformable() && !card.isNightCard()) {
|
||||||
additionalName = card.getSecondCardFace().getName();
|
additionalName = card.getSecondCardFace().getName();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2552,7 +2552,7 @@ public class VerifyCardDataTest {
|
||||||
String[] cardRules = card
|
String[] cardRules = card
|
||||||
.getRules()
|
.getRules()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(s -> !(card instanceof AdventureCard) || !s.startsWith("Adventure "))
|
.filter(s -> !(card instanceof CardWithSpellOption) || !s.startsWith("Adventure ") || !s.startsWith("Omen "))
|
||||||
.collect(Collectors.joining("\n"))
|
.collect(Collectors.joining("\n"))
|
||||||
.replace("<br>", "\n")
|
.replace("<br>", "\n")
|
||||||
.replace("<br/>", "\n")
|
.replace("<br/>", "\n")
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,13 @@ import mage.abilities.ActivatedAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.ModalDoubleFacedCard;
|
import mage.cards.ModalDoubleFacedCard;
|
||||||
import mage.cards.SplitCard;
|
import mage.cards.SplitCard;
|
||||||
|
import mage.cards.CardWithSpellOption;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.cards.AdventureCard;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
|
|
@ -103,9 +102,9 @@ public abstract class AsThoughEffectImpl extends ContinuousEffectImpl implements
|
||||||
if (!rightCard.isLand(game)) {
|
if (!rightCard.isLand(game)) {
|
||||||
player.setCastSourceIdWithAlternateMana(rightCard.getId(), null, rightCard.getSpellAbility().getCosts(), identifier);
|
player.setCastSourceIdWithAlternateMana(rightCard.getId(), null, rightCard.getSpellAbility().getCosts(), identifier);
|
||||||
}
|
}
|
||||||
} else if (card instanceof AdventureCard) {
|
} else if (card instanceof CardWithSpellOption) {
|
||||||
Card creatureCard = card.getMainCard();
|
Card creatureCard = card.getMainCard();
|
||||||
Card spellCard = ((AdventureCard) card).getSpellCard();
|
Card spellCard = ((CardWithSpellOption) card).getSpellCard();
|
||||||
player.setCastSourceIdWithAlternateMana(creatureCard.getId(), null, creatureCard.getSpellAbility().getCosts(), identifier);
|
player.setCastSourceIdWithAlternateMana(creatureCard.getId(), null, creatureCard.getSpellAbility().getCosts(), identifier);
|
||||||
player.setCastSourceIdWithAlternateMana(spellCard.getId(), null, spellCard.getSpellAbility().getCosts(), identifier);
|
player.setCastSourceIdWithAlternateMana(spellCard.getId(), null, spellCard.getSpellAbility().getCosts(), identifier);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue