From e49147f5c28469e27706f7a348226f5c1aa7a34e Mon Sep 17 00:00:00 2001 From: swordshine Date: Wed, 31 Jul 2013 11:13:45 +0000 Subject: [PATCH] - Plane: Eloren Wilds, Norn's Dominion, and Prahv - Added Mishra's War Machine --- .gitattributes | 4 ++ res/cardsfolder/e/eloren_wilds.txt | 13 ++++++ res/cardsfolder/m/minion_of_leshrac.txt | 3 +- res/cardsfolder/m/mishras_war_machine.txt | 11 +++++ res/cardsfolder/n/norns_dominion.txt | 11 +++++ res/cardsfolder/p/prahv.txt | 18 ++++++++ res/cardsfolder/s/sekki_seasons_guide.txt | 2 +- res/cardsfolder/s/spatial_merging.txt | 1 + .../forge/card/ability/ai/CountersAi.java | 5 ++- .../spellability/SpellAbilityCondition.java | 19 ++++++++ .../spellability/SpellAbilityVariables.java | 43 +++++++++++++++++++ .../card/trigger/TriggerSpellAbilityCast.java | 6 --- 12 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 res/cardsfolder/e/eloren_wilds.txt create mode 100644 res/cardsfolder/m/mishras_war_machine.txt create mode 100644 res/cardsfolder/n/norns_dominion.txt create mode 100644 res/cardsfolder/p/prahv.txt diff --git a/.gitattributes b/.gitattributes index 044cad00a8e..44ba2acb22f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3234,6 +3234,7 @@ res/cardsfolder/e/elite_vanguard.txt svneol=native#text/plain res/cardsfolder/e/elixir_of_immortality.txt svneol=native#text/plain res/cardsfolder/e/elixir_of_vitality.txt svneol=native#text/plain res/cardsfolder/e/elkin_bottle.txt -text +res/cardsfolder/e/eloren_wilds.txt -text res/cardsfolder/e/elsewhere_flask.txt -text svneol=unset#text/plain res/cardsfolder/e/elspeth_knight_errant.txt svneol=native#text/plain res/cardsfolder/e/elspeth_tirel.txt svneol=native#text/plain @@ -7056,6 +7057,7 @@ res/cardsfolder/m/mishras_bauble.txt -text res/cardsfolder/m/mishras_factory.txt svneol=native#text/plain res/cardsfolder/m/mishras_groundbreaker.txt svneol=native#text/plain res/cardsfolder/m/mishras_helix.txt svneol=native#text/plain +res/cardsfolder/m/mishras_war_machine.txt -text res/cardsfolder/m/mishras_workshop.txt -text res/cardsfolder/m/misinformation.txt svneol=native#text/plain res/cardsfolder/m/misshapen_fiend.txt svneol=native#text/plain @@ -7618,6 +7620,7 @@ res/cardsfolder/n/nomads_assembly.txt -text res/cardsfolder/n/nomads_en_kor.txt -text res/cardsfolder/n/norin_the_wary.txt svneol=native#text/plain res/cardsfolder/n/norns_annex.txt -text +res/cardsfolder/n/norns_dominion.txt -text res/cardsfolder/n/norritt.txt -text res/cardsfolder/n/northern_paladin.txt svneol=native#text/plain res/cardsfolder/n/norwood_archers.txt svneol=native#text/plain @@ -8327,6 +8330,7 @@ res/cardsfolder/p/pox.txt -text res/cardsfolder/p/pradesh_gypsies.txt svneol=native#text/plain res/cardsfolder/p/praetors_counsel.txt svneol=native#text/plain res/cardsfolder/p/praetors_grasp.txt -text +res/cardsfolder/p/prahv.txt -text res/cardsfolder/p/prahv_spires_of_order.txt -text res/cardsfolder/p/precinct_captain.txt -text res/cardsfolder/p/precognition.txt svneol=native#text/plain diff --git a/res/cardsfolder/e/eloren_wilds.txt b/res/cardsfolder/e/eloren_wilds.txt new file mode 100644 index 00000000000..276f1fee193 --- /dev/null +++ b/res/cardsfolder/e/eloren_wilds.txt @@ -0,0 +1,13 @@ +Name:Eloren Wilds +ManaCost:no cost +Types:Plane Shandalar +T:Mode$ TapsForMana | ValidCard$ Permanent | Execute$ TrigMana | TriggerZones$ Command | Static$ True | TriggerDescription$ Whenever a player taps a permanent for mana, that player adds one mana to his or her mana pool of any type that permanent produced. +SVar:TrigMana:AB$ ManaReflected | Cost$ 0 | ColorOrType$ Type | Valid$ Defined.Triggered | ReflectProperty$ Produced | Defined$ TriggeredPlayer +T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll Chaos, target player can't cast spells until a player planeswalks. +SVar:RolledChaos:AB$ Effect | Cost$ 0 | ValidTgts$ Player | IsCurse$ True | Name$ Eloren Wilds Effect | StaticAbilities$ STCantCast | Triggers$ TrigPlaneswalk | SVars$ ExileSelf | RememberObjects$ Targeted | Duration$ Permanent +SVar:STCantCast:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Card | Caster$ Player.IsRemembered | Description$ Target player can't cast spells until a player planeswalks. +SVar:TrigPlaneswalk:Mode$ PlaneswalkedFrom | Execute$ ExileSelf | Static$ True +SVar:ExileSelf:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile +SVar:AIRollPlanarDieParams:Mode$ Always +SVar:Picture:http://www.wizards.com/global/images/magic/general/eloren_wilds.jpg +Oracle:Whenever a player taps a permanent for mana, that player adds one mana to his or her mana pool of any type that permanent produced.\nWhenever you roll {C}, target player can't cast spells until a player planeswalks. diff --git a/res/cardsfolder/m/minion_of_leshrac.txt b/res/cardsfolder/m/minion_of_leshrac.txt index 4de6c205a47..d81927ea1d2 100644 --- a/res/cardsfolder/m/minion_of_leshrac.txt +++ b/res/cardsfolder/m/minion_of_leshrac.txt @@ -5,9 +5,8 @@ PT:5/5 K:Protection from black T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDmg | TriggerDescription$ At the beginning of your upkeep, CARDNAME deals 5 damage to you unless you sacrifice a creature other than CARDNAME. If CARDNAME deals damage to you this way, tap it. SVar:TrigDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 5 | UnlessCost$ Sac<1/Creature.Other/a creature other than CARDNAME> | RememberDamaged$ True | UnlessPayer$ TriggeredPlayer | UnlessResolveSubs$ WhenNotPaid | SubAbility$ DBTap -SVar:DBTap:DB$ Tap | Defined$ Self | ConditionCheckSVar$ CheckDamaged | ConditionSVarCompare$ GE1 | References$ CheckDamaged | SubAbility$ DBCleanup +SVar:DBTap:DB$ Tap | Defined$ Self | ConditionPlayerDefined$ Remembered | ConditionPlayerContains$ You | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:CheckDamaged:Count$RememberedSize A:AB$ Destroy | Cost$ T | ValidTgts$ Land,Creature | TgtPrompt$ Select target creature or land | SpellDescription$ Destroy target creature or land. SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/minion_of_leshrac.jpg diff --git a/res/cardsfolder/m/mishras_war_machine.txt b/res/cardsfolder/m/mishras_war_machine.txt new file mode 100644 index 00000000000..7a090c49093 --- /dev/null +++ b/res/cardsfolder/m/mishras_war_machine.txt @@ -0,0 +1,11 @@ +Name:Mishra's War Machine +ManaCost:7 +Types:Artifact Creature Juggernaut +PT:5/5 +K:Banding +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ At the beginning of your upkeep, CARDNAME deals 3 damage to you unless you discard a card. If CARDNAME deals damage to you this way, tap it. +SVar:TrigDealDamage:AB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 3 | UnlessPayer$ You | UnlessCost$ Discard<1/Card> | RememberDamaged$ True | SubAbility$ DBTap +SVar:DBTap:DB$ Tap | ConditionPlayerDefined$ Remembered | ConditionPlayerContains$ You | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Picture:http://www.wizards.com/global/images/magic/general/mishras_war_machine.jpg +Oracle:Banding (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)\nAt the beginning of your upkeep, Mishra's War Machine deals 3 damage to you unless you discard a card. If Mishra's War Machine deals damage to you this way, tap it. diff --git a/res/cardsfolder/n/norns_dominion.txt b/res/cardsfolder/n/norns_dominion.txt new file mode 100644 index 00000000000..6744a8c0b2d --- /dev/null +++ b/res/cardsfolder/n/norns_dominion.txt @@ -0,0 +1,11 @@ +Name:Norn's Dominion +ManaCost:no cost +Types:Plane New Phyrexia +T:Mode$ PlaneswalkedFrom | ValidCard$ Plane.Self | Execute$ TrigDestroy | TriggerDescription$ When you planeswalk away from CARDNAME, destroy each nonland permanent without a fate counter on it, then remove all fate counters from all permanents. +SVar:TrigDestroy:AB$ DestroyAll | Cost$ 0 | ValidCards$ Permanent.nonLand+counters_LT1_FATE | SubAbility$ DBRemove +SVar:DBRemove:DB$ RemoveCounterAll | Cost$ 0 | ValidCards$ Permanent | CounterType$ FATE | AllCounters$ True +T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | OptionalDecider$ You | TriggerDescription$ Whenever you roll Chaos, you may put a fate counter on target permanent. +SVar:RolledChaos:AB$ PutCounter | Cost$ 0 | ValidTgts$ Permanent | CounterType$ FATE | CounterNum$ 1 +SVar:AIRollPlanarDieParams:Mode$ Always +SVar:Picture:http://www.wizards.com/global/images/magic/general/norns_dominion.jpg +Oracle:When you planeswalk away from Norn's Dominion, destroy each nonland permanent without a fate counter on it, then remove all fate counters from all permanents.\nWhenever you roll {C}, you may put a fate counter on target permanent. diff --git a/res/cardsfolder/p/prahv.txt b/res/cardsfolder/p/prahv.txt new file mode 100644 index 00000000000..83ad5837161 --- /dev/null +++ b/res/cardsfolder/p/prahv.txt @@ -0,0 +1,18 @@ +Name:Prahv +ManaCost:no cost +Types:Plane Ravnica +S:Mode$ CantAttack | EffectZone$ Command | ValidCard$ Creature.YouCtrl | CheckSVar$ CheckThisTurnCast | Description$ If you cast a spell this turn, you can't attack with creatures. +SVar:CheckThisTurnCast:Count$ThisTurnCast_Card.YouCtrl +S:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Card | Caster$ You | CheckSVar$ CheckThisTurnAttacked | Description$ If you attacked with creatures this turn, you can't cast spells. +SVar:CheckThisTurnAttacked:Number$0 +T:Mode$ Attacks | ValidCard$ Creature.YouCtrl | Execute$ DBStoreSVar | Static$ True +SVar:DBStoreSVar:DB$ StoreSVar | SVar$ CheckThisTurnAttacked | Type$ Number | Expression$ 1 +T:Mode$ PlaneswalkedFrom | ValidCard$ Plane.Self | Execute$ DBReset | Static$ True +T:Mode$ Phase | Phase$ Cleanup | Execute$ DBReset | Static$ True +SVar:DBReset:DB$ StoreSVar | SVar$ CheckThisTurnAttacked | Type$ Number | Expression$ 0 +T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll Chaos, you gain life equal to the number of cards in your hand. +SVar:RolledChaos:AB$ GainLife | Cost$ 0 | LifeAmount$ PrahvX | References$ PrahvX | Defined$ You +SVar:PrahvX:Count$InYourHand +SVar:AIRollPlanarDieParams:Mode$ Always | CardsInHandGE$ 2 +SVar:Picture:http://www.wizards.com/global/images/magic/general/prahv.jpg +Oracle:If you cast a spell this turn, you can't attack with creatures.\nIf you attacked with creatures this turn, you can't cast spells.\nWhenever you roll {C}, you gain life equal to the number of cards in your hand. diff --git a/res/cardsfolder/s/sekki_seasons_guide.txt b/res/cardsfolder/s/sekki_seasons_guide.txt index 0c50749498d..8161da3c347 100644 --- a/res/cardsfolder/s/sekki_seasons_guide.txt +++ b/res/cardsfolder/s/sekki_seasons_guide.txt @@ -4,7 +4,7 @@ Types:Legendary Creature Spirit PT:0/0 K:etbCounters:P1P1:8 R:Event$ DamageDone | ActiveZones$ Battlefield | ValidTarget$ Card.Self | ReplaceWith$ SekkiCounters | PreventionEffect$ True | Description$ If damage would be dealt to Sekki, prevent that damage, remove that many +1/+1 counters from Sekki, and put that many 1/1 colorless Spirit creature tokens onto the battlefield. -SVar:SekkiCounters:AB$ RemoveCounter | Cost$ 0 | CounterType$ P1P1 | CounterNum$ SekkiX | SubAbility$ DBSekkiToken | References$ X +SVar:SekkiCounters:AB$ RemoveCounter | Cost$ 0 | CounterType$ P1P1 | CounterNum$ SekkiX | SubAbility$ DBSekkiToken | References$ SekkiX SVar:DBSekkiToken:DB$ Token | Cost$ 0 | TokenAmount$ SekkiX | TokenName$ Spirit | TokenTypes$ Creature,Spirit | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | References$ SekkiX A:AB$ ChangeZone | Cost$ Sac<8/Spirit> | Defined$ Self | ActivationZone$ Graveyard | Origin$ Graveyard | Destination$ Battlefield | SpellDescription$ Return Sekki from your graveyard to the battlefield. SVar:SekkiX:ReplaceCount$DamageAmount diff --git a/res/cardsfolder/s/spatial_merging.txt b/res/cardsfolder/s/spatial_merging.txt index 559c7a320b8..a75936bd6ea 100644 --- a/res/cardsfolder/s/spatial_merging.txt +++ b/res/cardsfolder/s/spatial_merging.txt @@ -5,4 +5,5 @@ T:Mode$ PlaneswalkedTo | ValidCard$ Card.Self | TriggerZones$ Command | Execute$ SVar:TrigDig:DB$ DigUntil | Amount$ 2 | Valid$ Plane | DigZone$ PlanarDeck | RememberFound$ True | FoundDestination$ PlanarDeck | RevealedDestination$ PlanarDeck | RevealedLibraryPosition$ -1 | SubAbility$ DBPWTo SVar:DBPWTo:DB$ Planeswalk | Defined$ Remembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Picture:http://www.wizards.com/global/images/magic/general/spatial_merging.jpg Oracle:When you encounter Spatial Merging, reveal cards from the top of your planar deck until you reveal two plane cards. Simultaneously planeswalk to both of them. Put all other cards revealed this way on the bottom of your planar deck in any order. \ No newline at end of file diff --git a/src/main/java/forge/card/ability/ai/CountersAi.java b/src/main/java/forge/card/ability/ai/CountersAi.java index 634d3292938..d22810a0b8b 100644 --- a/src/main/java/forge/card/ability/ai/CountersAi.java +++ b/src/main/java/forge/card/ability/ai/CountersAi.java @@ -89,11 +89,12 @@ public abstract class CountersAi { Card choice; if (type.equals("P1P1")) { choice = ComputerUtilCard.getBestCreatureAI(list); - } else if (type.equals("DIVINITY")) { + } else if (type.equals("DIVINITY") || type.equals("FATE")) { final List boon = CardLists.filter(list, new Predicate() { @Override public boolean apply(final Card c) { - return c.getCounters(CounterType.DIVINITY) == 0; + return c.getCounters(CounterType.DIVINITY) == 0 + && c.getCounters(CounterType.FATE) == 0; } }); choice = ComputerUtilCard.getMostExpensivePermanentAI(boon, null, false); diff --git a/src/main/java/forge/card/spellability/SpellAbilityCondition.java b/src/main/java/forge/card/spellability/SpellAbilityCondition.java index 254bbffba7e..75a5d490485 100644 --- a/src/main/java/forge/card/spellability/SpellAbilityCondition.java +++ b/src/main/java/forge/card/spellability/SpellAbilityCondition.java @@ -132,6 +132,14 @@ public class SpellAbilityCondition extends SpellAbilityVariables { this.setPresentDefined(params.get("ConditionDefined")); } + if (params.containsKey("ConditionPlayerDefined")) { + this.setPlayerDefined(params.get("ConditionPlayerDefined")); + } + + if (params.containsKey("ConditionPlayerContains")) { + this.setPlayerContains(params.get("ConditionPlayerContains")); + } + if (params.containsKey("ConditionNotPresent")) { this.setIsPresent(params.get("ConditionNotPresent")); this.setPresentCompare("EQ0"); @@ -266,6 +274,17 @@ public class SpellAbilityCondition extends SpellAbilityVariables { } } + if (this.getPlayerContains() != null) { + List list = new ArrayList(); + if (this.getPlayerDefined() != null) { + list.addAll(AbilityUtils.getDefinedPlayers(sa.getSourceCard(), this.getPlayerDefined(), sa)); + } + List contains = AbilityUtils.getDefinedPlayers(sa.getSourceCard(), this.getPlayerContains(), sa); + if (!list.containsAll(contains)) { + return false; + } + } + if (this.getLifeTotal() != null) { int life = 1; if (this.getLifeTotal().equals("You")) { diff --git a/src/main/java/forge/card/spellability/SpellAbilityVariables.java b/src/main/java/forge/card/spellability/SpellAbilityVariables.java index 3f957806062..19c5bdcfd19 100644 --- a/src/main/java/forge/card/spellability/SpellAbilityVariables.java +++ b/src/main/java/forge/card/spellability/SpellAbilityVariables.java @@ -74,6 +74,8 @@ public class SpellAbilityVariables { this.isPresent = sav.getIsPresent(); this.presentCompare = sav.getPresentCompare(); this.presentDefined = sav.getPresentDefined(); + this.playerDefined = sav.getPlayerDefined(); + this.playerContains = sav.getPlayerContains(); this.presentZone = sav.getPresentZone(); this.sVarToCheck = sav.getsVarToCheck(); this.sVarOperator = sav.getsVarOperator(); @@ -148,6 +150,12 @@ public class SpellAbilityVariables { /** The present defined. */ private String presentDefined = null; + /** The player defined. */ + private String playerDefined = null; + + /** The player contains. */ + private String playerContains = null; + /** The present zone. */ private ZoneType presentZone = ZoneType.Battlefield; @@ -764,6 +772,41 @@ public class SpellAbilityVariables { public final String getPresentDefined() { return this.presentDefined; } + + /** + * Set the player defined. + * + */ + public final void setPlayerDefined(final String b) { + this.playerDefined = b; + } + + /** + * Gets the player defined. + * + * @return the playerDefined + */ + public final String getPlayerDefined() { + return this.playerDefined; + } + + /** + * Gets the player contains. + * + * @return the playerContains + */ + public final String getPlayerContains() { + return this.playerContains; + } + + /** + * Set the player contains. + * + */ + public final void setPlayerContains(final String contains) { + this.playerContains = contains; + } + /** * Gets the s var operand. * diff --git a/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java b/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java index 8d437d8cbf1..996409302b9 100644 --- a/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java +++ b/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java @@ -80,12 +80,6 @@ public class TriggerSpellAbilityCast extends Trigger { return false; } } - - if (this.mapParams.containsKey("AltCostSpellAbility")) { - if (!spellAbility.isOptionalCostPaid(OptionalCost.AltCost)) { - return false; - } - } if (this.mapParams.containsKey("ValidControllingPlayer")) { if (!matchesValid(cast.getController(), this.mapParams.get("ValidControllingPlayer").split(","),