mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Added evoke trigger to Aethersnipe
- Added evoke keyword
This commit is contained in:
@@ -6,6 +6,8 @@ PT:4/4
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigBounce | TriggerDescription$ When CARDNAME enters the battlefield, return target nonland permanent to its owner's hand.
|
||||
K:Evoke:1 U U
|
||||
SVar:TrigBounce:AB$ChangeZone | Cost$ 0 | ValidTgts$ Permanent.nonLand | TgtPrompt$ Choose target non-Land permanent. | Origin$ Battlefield | Destination$ Hand
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+evoked | Execute$ TrigSac | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield, if you cast it by it's evoke cost, sacrifice it.
|
||||
SVar:TrigSac:AB$Sacrifice | Cost$ 0
|
||||
SVar:Rarity:Common
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/aethersnipe.jpg
|
||||
SetInfo:LRW|Common|http://magiccards.info/scans/en/lw/50.jpg
|
||||
|
||||
@@ -68,6 +68,7 @@ public class Card extends MyObservable {
|
||||
private boolean faceDown = false;
|
||||
private boolean sacrificeAtEOT = false;
|
||||
private boolean kicked = false;
|
||||
private boolean evoked = false;
|
||||
private boolean reflectedLand = false;
|
||||
private boolean levelUp = false;
|
||||
private boolean bounceAtUntap = false;
|
||||
@@ -2716,6 +2717,8 @@ public class Card extends MyObservable {
|
||||
else if (Property.startsWith("kicked")) { if(!isKicked()) return false; }
|
||||
|
||||
else if (Property.startsWith("notkicked")) { if(isKicked()) return false; }
|
||||
|
||||
else if (Property.startsWith("evoked")) { if(!isEvoked()) return false; }
|
||||
|
||||
else if(Property.startsWith("non")) // ... Other Card types
|
||||
{ if(isType(Property.substring(3))) return false;}
|
||||
@@ -3261,5 +3264,13 @@ public class Card extends MyObservable {
|
||||
{
|
||||
return ImageFilename;
|
||||
}
|
||||
|
||||
public void setEvoked(boolean evoked) {
|
||||
this.evoked = evoked;
|
||||
}
|
||||
|
||||
public boolean isEvoked() {
|
||||
return evoked;
|
||||
}
|
||||
|
||||
}//end Card class
|
||||
|
||||
@@ -7927,6 +7927,7 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
// todo: certain cards have two different kicker types, kicker will need to be written differently to handle this
|
||||
// todo: kicker costs can only be mana right now i think?
|
||||
// todo: this kicker only works for pemanents. maybe we can create an optional cost class for buyback, kicker, that type of thing
|
||||
int kicker = hasKeyword(card, "Kicker");
|
||||
if (kicker != -1){
|
||||
final SpellAbility kickedSpell = new Spell(card) {
|
||||
@@ -7937,12 +7938,6 @@ public class CardFactory implements NewConstants {
|
||||
card.setKicked(true);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
return super.canPlay() && Phase.canCastSorcery(card.getController());
|
||||
}
|
||||
|
||||
};
|
||||
String parse = card.getKeyword().get(kicker).toString();
|
||||
card.removeIntrinsicKeyword(parse);
|
||||
@@ -7970,6 +7965,38 @@ public class CardFactory implements NewConstants {
|
||||
card.addSpellAbility(kickedSpell);
|
||||
}
|
||||
|
||||
int evokeKeyword = hasKeyword(card, "Evoke");
|
||||
if (evokeKeyword != -1){
|
||||
final SpellAbility evokedSpell = new Spell(card) {
|
||||
private static final long serialVersionUID = -1598664196463358630L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
card.setEvoked(true);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
}
|
||||
};
|
||||
String parse = card.getKeyword().get(evokeKeyword).toString();
|
||||
card.removeIntrinsicKeyword(parse);
|
||||
|
||||
String k[] = parse.split(":");
|
||||
final String evokedCost = k[1];
|
||||
|
||||
evokedSpell.setManaCost(evokedCost);
|
||||
|
||||
StringBuilder desc = new StringBuilder();
|
||||
desc.append("Evoke ").append(evokedCost);
|
||||
desc.append(" (You may cast this spell for its evoke cost. If you do, when it enters the battlefield, sacrifice it.)");
|
||||
|
||||
evokedSpell.setDescription(desc.toString());
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(card.getName()).append(" (Evoked)");
|
||||
evokedSpell.setStackDescription(sb.toString());
|
||||
|
||||
card.addSpellAbility(evokedSpell);
|
||||
}
|
||||
|
||||
if(hasKeyword(card, "Cycling") != -1) {
|
||||
int n = hasKeyword(card, "Cycling");
|
||||
if(n != -1) {
|
||||
|
||||
@@ -41,7 +41,7 @@ abstract public class Spell extends SpellAbility implements java.io.Serializable
|
||||
if (!this.getRestrictions().canPlay(card, this))
|
||||
return false;
|
||||
|
||||
return (card.isInstant() || Phase.canCastSorcery(card.getController()));
|
||||
return (card.isInstant() || card.hasKeyword("Flash") || Phase.canCastSorcery(card.getController()));
|
||||
}//canPlay()
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user