From c9320970c6fb24c5974f63ce0ea9a2a8622b6eb6 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 17:15:16 +0000 Subject: [PATCH] - Fix for Ripple not setting activating player - Convert Force of Will to AFs --- res/cardsfolder/force_of_will.txt | 2 + res/cardsfolder/vision_skeins.txt | 2 +- src/forge/CardFactory_Instants.java | 115 ---------------------------- src/forge/GameAction.java | 3 + 4 files changed, 6 insertions(+), 116 deletions(-) diff --git a/res/cardsfolder/force_of_will.txt b/res/cardsfolder/force_of_will.txt index 90a7a710759..7b7c54bb22e 100644 --- a/res/cardsfolder/force_of_will.txt +++ b/res/cardsfolder/force_of_will.txt @@ -2,6 +2,8 @@ Name:Force of Will ManaCost:3 U U Types:Instant Text:no text +A:SP$ Counter | Cost$ 3 U U | Type$ Spell | Destination$ Graveyard | SpellDescription$ Counter target spell. +SVar:AltCost:PayLife<1> ExileFromHand<1/Card.Blue>$You may pay 1 life and exile a blue card from your hand rather than pay CARDNAME's mana cost. SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/force_of_will.jpg diff --git a/res/cardsfolder/vision_skeins.txt b/res/cardsfolder/vision_skeins.txt index 4af65c31af8..b6556ac0492 100644 --- a/res/cardsfolder/vision_skeins.txt +++ b/res/cardsfolder/vision_skeins.txt @@ -2,7 +2,7 @@ Name:Vision Skeins ManaCost:1 U Types:Instant Text:no text -A:SP$Draw | Cost$ 1 U | NumCards$ 2 | SpellDescription$ Each player draws two cards. | SubAbility$ OppDraw/2 +A:SP$Draw | Cost$ 1 U | Defined$ Each | NumCards$ 2 | SpellDescription$ Each player draws two cards. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/vision_skeins.jpg SetInfo:DIS|Common|http://magiccards.info/scans/en/di/36.jpg diff --git a/src/forge/CardFactory_Instants.java b/src/forge/CardFactory_Instants.java index 090f3e978dc..e042348de67 100644 --- a/src/forge/CardFactory_Instants.java +++ b/src/forge/CardFactory_Instants.java @@ -1567,121 +1567,6 @@ public class CardFactory_Instants { card.addSpellAbility(spell); }//*************** END ************ END ************************** - - //*************** START *********** START ************************** - else if(cardName.equals("Force of Will")) { - final SpellAbility spell = new Spell(card) { - private static final long serialVersionUID = 7960371805654673281L; - - @Override - public void resolve() { - SpellAbility sa = AllZone.Stack.pop(); - AllZone.GameAction.moveToGraveyard(sa.getSourceCard()); - } - - @Override - public boolean canPlay() { - if(AllZone.Stack.size() == 0) return false; - - //see if spell is on stack and that opponent played it - Player opponent = card.getController().getOpponent(); - SpellAbility sa = AllZone.Stack.peek(); - - return sa.isSpell() && opponent.equals(sa.getSourceCard().getController()) - && CardFactoryUtil.isCounterable(sa.getSourceCard()); - } - - @Override - public boolean canPlayAI() { - return false; - } - }; - spell.setDescription("Counter target spell."); - StringBuilder sb = new StringBuilder(); - sb.append(card.getName()).append(" - Counter target spell."); - spell.setStackDescription(sb.toString()); - - final SpellAbility alt = new Spell(card) { - private static final long serialVersionUID = -8643870743780757816L; - - @Override - public void resolve() { - SpellAbility sa = AllZone.Stack.pop(); - AllZone.GameAction.moveToGraveyard(sa.getSourceCard()); - } - - @Override - public boolean canPlay() { - if(AllZone.Stack.size() == 0) return false; - - //see if spell is on stack and that opponent played it - Player opponent = card.getController().getOpponent(); - SpellAbility sa = AllZone.Stack.peek(); - - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - CardList list = new CardList(hand.getCards()); - list = list.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isBlue() && !c.equals(card); - } - }); - return sa.isSpell() && opponent.equals(sa.getSourceCard().getController()) - && CardFactoryUtil.isCounterable(sa.getSourceCard()) && list.size() >= 1; - } - - @Override - public boolean canPlayAI() { - return false; - } - - }; - alt.setDescription("You may pay 1 life and exile a blue card from your hand rather than pay Force of Will's mana cost."); - StringBuilder sb2 = new StringBuilder(); - sb2.append(card.getName()).append(" - Counter target spell."); - alt.setStackDescription(sb2.toString()); - alt.setManaCost("0"); - - final Input exileBlue = new Input() { - private static final long serialVersionUID = 8692998689009712987L; - int stop = 1; - int count = 0; - - @Override - public void showMessage() { - AllZone.Display.showMessage("Select a blue card"); - ButtonUtil.disableAll(); - } - - @Override - public void selectButtonCancel() { - stop(); - } - - @Override - public void selectCard(Card c, PlayerZone zone) { - if(c.isBlue() && zone.is(Constant.Zone.Hand) - && !c.equals(card)) { - AllZone.GameAction.exile(c); - card.getController().loseLife(1, card); - - count++; - if(count == stop) { - AllZone.Stack.add(alt); - stop(); - } - } - }//selectCard() - }; - - - alt.setBeforePayMana(exileBlue); - - card.clearSpellAbility(); - card.addSpellAbility(alt); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - //*************** START *********** START ************************** else if(cardName.equals("Stroke of Genius")) { diff --git a/src/forge/GameAction.java b/src/forge/GameAction.java index 744e3832ac3..f5cb8bbe32a 100644 --- a/src/forge/GameAction.java +++ b/src/forge/GameAction.java @@ -2772,6 +2772,9 @@ public class GameAction { if(sa == null) return; + // Ripple causes a crash because it doesn't set the activatingPlayer in this entrance + if (sa.getActivatingPlayer() == null) + sa.setActivatingPlayer(AllZone.HumanPlayer); playSpellAbilityForFree(sa); }