- Fix for Ripple not setting activating player

- Convert Force of Will to AFs
This commit is contained in:
jendave
2011-08-06 17:15:16 +00:00
parent d035ab210d
commit c9320970c6
4 changed files with 6 additions and 116 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"))
{

View File

@@ -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);
}