- Added the keyword "Flashback" which represents Flashback with cost equal to the cards mana cost.

- Added Snapcaster Mage.
This commit is contained in:
Sloth
2011-11-12 11:05:09 +00:00
parent ae09fec11f
commit 12d85dabff
6 changed files with 35 additions and 6 deletions

1
.gitattributes vendored
View File

@@ -7597,6 +7597,7 @@ res/cardsfolder/s/snake_pit.txt svneol=native#text/plain
res/cardsfolder/s/snake_umbra.txt svneol=native#text/plain
res/cardsfolder/s/snap.txt svneol=native#text/plain
res/cardsfolder/s/snapback.txt svneol=native#text/plain
res/cardsfolder/s/snapcaster_mage.txt -text
res/cardsfolder/s/snapping_creeper.txt svneol=native#text/plain
res/cardsfolder/s/snapping_drake.txt svneol=native#text/plain
res/cardsfolder/s/snapping_thragg.txt -text svneol=unset#text/plain

View File

@@ -0,0 +1,14 @@
Name:Snapcaster Mage
ManaCost:1 U
Types:Creature Human Wizard
Text:no text
PT:2/1
K:Flash
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigRearrange | TriggerDescription$ When CARDNAME enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (You may cast that card from your graveyard for its flashback cost. Then exile it.)
SVar:TrigRearrange:AB$ Pump | Cost$ 0 | ValidTgts$ Instant.YouCtrl,Sorcery.YouCtrl | TgtZone$ Graveyard | TgtPrompt$ Select target instant or sorcery card | KW$ Flashback | PumpZone$ Graveyard
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/snapcaster_mage.jpg
SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/78.jpg
Oracle:Flash\nWhen Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. (You may cast that card from your graveyard for its flashback cost. Then exile it.)
End

View File

@@ -2402,6 +2402,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|| (kw.get(i).startsWith("Dredge") && !sb.toString().contains("Dredge"))
|| (kw.get(i).startsWith("Madness") && !sb.toString().contains("Madness"))
|| (kw.get(i).startsWith("CARDNAME is ") && !sb.toString().contains("CARDNAME is "))
|| (kw.get(i).equals("Flashback") && !sb.toString().contains("Flashback"))
|| (kw.get(i).startsWith("Recover") && !sb.toString().contains("Recover"))) {
sb.append(kw.get(i).replace(":", " ")).append("\r\n");
}

View File

@@ -1783,10 +1783,19 @@ public class GameAction {
// for uncastables like lotus bloom, check if manaCost is blank
sa.setActivatingPlayer(human);
if (sa.canPlay() && (!sa.isSpell() || !sa.getManaCost().equals(""))) {
if (c.hasKeyword("Flashback") && c.isInZone(Constant.Zone.Graveyard)
&& c.getSpells().get(0).equals(sa) && !c.hasStartOfKeyword("May be played")) {
SpellAbility flashback = sa.copy();
flashback.setSourceCard(c);
flashback.setFlashBackAbility(true);
choices.add(flashback.toString());
map.put(flashback.toString(), flashback);
} else {
choices.add(sa.toString());
map.put(sa.toString(), sa);
}
}
}
String choice;
if (choices.size() == 0) {

View File

@@ -899,6 +899,7 @@ public class CardFactoryUtil {
};
flashback.setPayCosts(fbCost);
flashback.getRestrictions().setZone(Constant.Zone.Graveyard);
final String costString = fbCost.toString().replace(":", ".");
@@ -2613,7 +2614,8 @@ public class CardFactoryUtil {
return true;
}
if (sa.isSpell() && !zone.is(Zone.Battlefield) && c.hasStartOfKeyword("May be played")
if (sa.isSpell() && !zone.is(Zone.Battlefield) && (c.hasStartOfKeyword("May be played")
|| (c.hasKeyword("Flashback") && zone.is(Zone.Graveyard)))
&& restrictZone.equals(Zone.Hand)) {
return true;
}
@@ -4480,7 +4482,7 @@ public class CardFactoryUtil {
}
} // TypeCycling
if (CardFactoryUtil.hasKeyword(card, "Flashback") != -1) {
if (CardFactoryUtil.hasKeyword(card, "Flashback:") != -1) {
final int n = CardFactoryUtil.hasKeyword(card, "Flashback");
if (n != -1) {
final String parse = card.getKeyword().get(n).toString();

View File

@@ -180,9 +180,11 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
// If Card is not in the default activating zone, do some additional
// checks
// Not a Spell, or on Battlefield, return false
if (!sa.isSpell() || cardZone.is(Zone.Battlefield)) {
if (!sa.isSpell() || cardZone.is(Zone.Battlefield) || !this.getZone().equals(Zone.Hand)) {
return false;
} else if (!c.hasStartOfKeyword("May be played") || !this.getZone().equals(Zone.Hand)) {
} else if (!c.hasStartOfKeyword("May be played")
&& !(c.hasKeyword("Flashback") && cardZone.is(Zone.Graveyard)
&& c.getSpells().get(0).equals(sa))) {
return false;
}
}