diff --git a/.gitattributes b/.gitattributes index fc6f296ada4..8c5c798a7dc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3025,6 +3025,7 @@ res/cardsfolder/e/earthlink.txt svneol=native#text/plain res/cardsfolder/e/earthlore.txt svneol=native#text/plain res/cardsfolder/e/earthquake.txt svneol=native#text/plain res/cardsfolder/e/earthshaker.txt svneol=native#text/plain +res/cardsfolder/e/earwig_squad.txt -text res/cardsfolder/e/eastern_paladin.txt svneol=native#text/plain res/cardsfolder/e/eaten_by_spiders.txt -text res/cardsfolder/e/eater_of_days.txt svneol=native#text/plain @@ -5951,6 +5952,7 @@ res/cardsfolder/l/last_thoughts.txt -text res/cardsfolder/l/last_word.txt svneol=native#text/plain res/cardsfolder/l/lat_nams_legacy.txt -text res/cardsfolder/l/latch_seeker.txt -text +res/cardsfolder/l/latchkey_faerie.txt -text res/cardsfolder/l/latulla_keldon_overseer.txt svneol=native#text/plain res/cardsfolder/l/latullas_orders.txt svneol=native#text/plain res/cardsfolder/l/launch.txt svneol=native#text/plain diff --git a/res/cardsfolder/e/earwig_squad.txt b/res/cardsfolder/e/earwig_squad.txt new file mode 100644 index 00000000000..814606f6eff --- /dev/null +++ b/res/cardsfolder/e/earwig_squad.txt @@ -0,0 +1,18 @@ +Name:Earwig Squad +ManaCost:3 B B +Types:Creature Goblin Rogue +PT:5/3 +SVar:AltCost:Cost$ 2 B | Activation$ ProwlGoblin | Description$ Prowl 2 B (You may cast this for its prowl cost if you dealt combat damage to a player this turn with a Goblin or Rogue.) +T:Mode$ SpellCast | ValidCard$ Card.Self | AltCostSpellAbility$ True | Execute$ ProwlStore | Static$ True +SVar:ProwlStore:AB$ StoreSVar | Cost$ 0 | SVar$ ProwlCheck | Type$ Number | Expression$ 1 +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | CheckSVar$ ProwlCheck | SVarCompare$ EQ1 | TriggerDescription$ When CARDNAME enters the battlefield, if its prowl cost was paid, search target opponent's library for three cards and exile them. Then that player shuffles his or her library. +SVar:ProwlCheck:Number$0 +SVar:TrigExile:AB$ ChangeZone | Cost$ 0 | ValidTgts$ Opponent | DefinedPlayer$ Targeted | Chooser$ You | ChangeType$ Card | ChangeNum$ 3 | Origin$ Library | Destination$ Exile | SubAbility$ DBReset +SVar:DBReset:DB$ StoreSVar | Cost$ 0 | SVar$ ProwlCheck | Type$ Number | Expression$ 0 +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Library | ValidCard$ Card.Self | Execute$ DBReset | Static$ True +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Hand | ValidCard$ Card.Self | Execute$ DBReset | Static$ True +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ DBReset | Static$ True +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Exile | ValidCard$ Card.Self | Execute$ DBReset | Static$ True +SVar:Picture:http://www.wizards.com/global/images/magic/general/earwig_squad.jpg +Oracle:Prowl {2}{B} (You may cast this for its prowl cost if you dealt combat damage to a player this turn with a Goblin or Rogue.)\nWhen Earwig Squad enters the battlefield, if its prowl cost was paid, search target opponent's library for three cards and exile them. Then that player shuffles his or her library. +SetInfo:MOR Rare \ No newline at end of file diff --git a/res/cardsfolder/l/latchkey_faerie.txt b/res/cardsfolder/l/latchkey_faerie.txt new file mode 100644 index 00000000000..0a3dc86d9d7 --- /dev/null +++ b/res/cardsfolder/l/latchkey_faerie.txt @@ -0,0 +1,19 @@ +Name:Latchkey Faerie +ManaCost:3 U +Types:Creature Faerie Rogue +PT:3/1 +K:Flying +SVar:AltCost:Cost$ 2 U | Activation$ ProwlFaerie | Description$ Prowl {2}{U} (You may cast this for its prowl cost if you dealt combat damage to a player this turn with a Faerie or Rogue.) +T:Mode$ SpellCast | ValidCard$ Card.Self | AltCostSpellAbility$ True | Execute$ ProwlStore | Static$ True +SVar:ProwlStore:AB$ StoreSVar | Cost$ 0 | SVar$ ProwlCheck | Type$ Number | Expression$ 1 +SVar:ProwlCheck:Number$0 +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | CheckSVar$ ProwlCheck | SVarCompare$ EQ1 | TriggerDescription$ When CARDNAME enters the battlefield, if its prowl cost was paid, draw a card. +SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | SubAbility$ DBReset +SVar:DBReset:DB$ StoreSVar | Cost$ 0 | SVar$ ProwlCheck | Type$ Number | Expression$ 0 +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Library | ValidCard$ Card.Self | Execute$ DBReset | Static$ True +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Hand | ValidCard$ Card.Self | Execute$ DBReset | Static$ True +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ DBReset | Static$ True +T:Mode$ ChangesZone | Origin$ Stack | Destination$ Exile | ValidCard$ Card.Self | Execute$ DBReset | Static$ True +SVar:Picture:http://www.wizards.com/global/images/magic/general/latchkey_faerie.jpg +Oracle:Flying\nProwl {2}{U} (You may cast this for its prowl cost if you dealt combat damage to a player this turn with a Faerie or Rogue.)\nWhen Latchkey Faerie enters the battlefield, if its prowl cost was paid, draw a card. +SetInfo:MOR Common \ No newline at end of file diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index bc8bf2ed3f6..309f8aa8a5a 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -3123,6 +3123,7 @@ public class CardFactoryUtil { altCostSA.setRestrictions(restriction); altCostSA.setDescription(sb.toString()); altCostSA.setBasicSpell(false); + altCostSA.setAltCost(true); return altCostSA; } diff --git a/src/main/java/forge/card/spellability/SpellAbility.java b/src/main/java/forge/card/spellability/SpellAbility.java index 49490d482ae..f2108b500d7 100644 --- a/src/main/java/forge/card/spellability/SpellAbility.java +++ b/src/main/java/forge/card/spellability/SpellAbility.java @@ -112,6 +112,7 @@ public abstract class SpellAbility implements ISpellAbility { private boolean undoable; private boolean isCopied = false; + private boolean isAltCost = false; public final AbilityManaPart getManaPart() { return manaPart; @@ -1756,5 +1757,23 @@ public abstract class SpellAbility implements ISpellAbility { public boolean isXCost() { CostPartMana cm = payCosts != null ? getPayCosts().getCostMana() : null; return cm != null && cm.getAmountOfX() > 0; - } + } + + /** + * @param isAltCost the isAltCost to set + */ + public void setAltCost(boolean isAltCost) { + this.isAltCost = isAltCost; + } + + /** + * @return the isAltCost + */ + public boolean isAltCost() { + // only used in prowl, cannot distinguish the alt cost type currently + // TODO : support the altcost type + return isAltCost; + } + + } diff --git a/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java b/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java index 4ff63ed8b13..7e19873426f 100644 --- a/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java +++ b/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java @@ -74,6 +74,12 @@ public class TriggerSpellAbilityCast extends Trigger { return false; } } + + if (this.getMapParams().containsKey("AltCostSpellAbility")) { + if (!spellAbility.isAltCost()) { + return false; + } + } if (this.getMapParams().containsKey("ValidControllingPlayer")) { if (!matchesValid(cast.getController(), this.getMapParams().get("ValidControllingPlayer").split(","),