mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 19:59:54 -08:00
fixed error with Sunbird's Invocation (#4022)
This commit is contained in:
parent
a5f71ba3f3
commit
4e194d965e
1 changed files with 11 additions and 3 deletions
|
|
@ -92,7 +92,7 @@ class SunbirdsInvocationTriggeredAbility extends SpellCastControllerTriggeredAbi
|
|||
if (spell != null && spell.getFromZone() == Zone.HAND) {
|
||||
if (spell.getCard() != null) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(spell.getId(), spell.getZoneChangeCounter(game)));
|
||||
effect.setTargetPointer(new FixedTarget(spell.getId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -125,8 +125,16 @@ class SunbirdsInvocationEffect extends OneShotEffect {
|
|||
if (controller == null || sourceObject == null) {
|
||||
return false;
|
||||
}
|
||||
Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source));
|
||||
int xValue = 0;
|
||||
if (spell == null) {
|
||||
spell = (Spell) game.getLastKnownInformation(this.getTargetPointer().getFirst(game, source), Zone.STACK);
|
||||
}
|
||||
if (spell == null) {
|
||||
return false;
|
||||
}
|
||||
xValue = spell.getConvertedManaCost();
|
||||
Cards cards = new CardsImpl();
|
||||
int xValue = game.getLastKnownInformation(this.getTargetPointer().getFirst(game, source), Zone.STACK).getConvertedManaCost();
|
||||
cards.addAll(controller.getLibrary().getTopCards(game, xValue));
|
||||
if (!cards.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
|
|
@ -138,7 +146,7 @@ class SunbirdsInvocationEffect extends OneShotEffect {
|
|||
if (controller.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
if (controller.chooseUse(outcome, "Do you wish to cast " + card.getName(), source, game)) {
|
||||
if (controller.chooseUse(outcome, "Cast " + card.getLogName() + " without paying its mana cost?", source, game)) {
|
||||
controller.cast(card.getSpellAbility(), game, true);
|
||||
cards.remove(card);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue