From dd86849e7c009b9991557981ae00d1e77fc16f9f Mon Sep 17 00:00:00 2001 From: Hellfish Date: Mon, 19 Nov 2012 19:53:49 +0000 Subject: [PATCH 01/36] *Created Variants branch. *Variants: Created command zone view. *Variants: Moved effects and emblems to command zone. *Variants: Added a bunch of Vanguard cards (Thanks, Marc!) *Variants: Added a Vanguard home screen. From a77eeab71dd986def37f9f3a7d7c8e202ea140cd Mon Sep 17 00:00:00 2001 From: Hellfish Date: Mon, 19 Nov 2012 20:03:00 +0000 Subject: [PATCH 02/36] *Variants: Created command zone view. *Variants: Moved effects and emblems to command zone. *Variants: Added a bunch of Vanguard cards (Thanks, Marc!) *Variants: Added a Vanguard home screen. --- .gitattributes | 17 +- res/cardsfolder/a/al_abaras_carpet.txt | 2 +- res/cardsfolder/a/alchemists_refuge.txt | 2 +- res/cardsfolder/a/angels_grace.txt | 4 +- res/cardsfolder/a/aquitects_will.txt | 2 +- .../a/arcbound_overseer_avatar.txt | 12 + res/cardsfolder/a/archangel_of_strife.txt | 8 +- .../a/ashling_the_pilgrim_avatar.txt | 9 + res/cardsfolder/a/ashnod.txt | 10 + res/cardsfolder/a/aven_mimeomancer.txt | 2 +- res/cardsfolder/b/barrin.txt | 9 + .../b/birds_of_paradise_avatar.txt | 10 + res/cardsfolder/b/blinding_beam.txt | 2 +- res/cardsfolder/c/cease_fire.txt | 2 +- res/cardsfolder/c/chameleon_blur.txt | 2 +- res/cardsfolder/c/channel.txt | 2 +- res/cardsfolder/c/chronatog_avatar.txt | 12 + res/cardsfolder/c/chronomantic_escape.txt | 2 +- res/cardsfolder/c/crovax.txt | 11 + res/cardsfolder/d/dauntless_escort.txt | 2 +- res/cardsfolder/d/dauntless_escort_avatar.txt | 9 + res/cardsfolder/d/deep_wood.txt | 2 +- res/cardsfolder/d/demoralize.txt | 4 +- res/cardsfolder/d/diamond_faerie_avatar.txt | 9 + res/cardsfolder/d/divine_light.txt | 2 +- res/cardsfolder/d/druids_deliverance.txt | 2 +- res/cardsfolder/d/due_respect.txt | 2 +- res/cardsfolder/e/eladamri.txt | 20 ++ .../e/eladamri_lord_of_leaves_avatar.txt | 10 + res/cardsfolder/e/elspeth_knight_errant.txt | 2 +- res/cardsfolder/e/endure.txt | 2 +- res/cardsfolder/e/ethereal_haze.txt | 2 +- res/cardsfolder/e/ethersworn_shieldmage.txt | 2 +- res/cardsfolder/f/falter.txt | 2 +- res/cardsfolder/f/festival.txt | 2 +- res/cardsfolder/f/flame_fusillade.txt | 2 +- res/cardsfolder/f/flaring_pain.txt | 2 +- res/cardsfolder/f/forfend.txt | 2 +- res/cardsfolder/g/gorilla_war_cry.txt | 2 +- res/cardsfolder/g/guardian_angel.txt | 2 +- res/cardsfolder/h/harmless_assault.txt | 2 +- res/cardsfolder/h/havengul_lich.txt | 2 +- res/cardsfolder/h/heavy_fog.txt | 2 +- res/cardsfolder/h/hero_of_oxid_ridge.txt | 2 +- res/cardsfolder/i/interdict.txt | 2 +- res/cardsfolder/i/island_sanctuary.txt | 2 +- res/cardsfolder/k/koth_of_the_hammer.txt | 2 +- res/cardsfolder/l/liege_of_the_tangle.txt | 2 +- .../l/liliana_of_the_dark_realms.txt | 2 +- res/cardsfolder/l/luminesce.txt | 2 +- res/cardsfolder/m/maddening_imp.txt | 2 +- res/cardsfolder/m/moonhold.txt | 4 +- res/cardsfolder/m/moonmist.txt | 2 +- res/cardsfolder/o/orims_chant.txt | 4 +- res/cardsfolder/o/oriss_samite_guardian.txt | 4 +- res/cardsfolder/p/pardic_miner.txt | 2 +- res/cardsfolder/p/praetors_counsel.txt | 2 +- res/cardsfolder/p/predatory_focus.txt | 2 +- res/cardsfolder/p/predatory_rampage.txt | 2 +- res/cardsfolder/p/prismatic_strands.txt | 2 +- res/cardsfolder/p/psychic_trance.txt | 2 +- res/cardsfolder/q/quicken.txt | 2 +- res/cardsfolder/r/radiant_kavu.txt | 2 +- res/cardsfolder/r/rootborn_defenses.txt | 2 +- res/cardsfolder/r/ruthless_invasion.txt | 2 +- res/cardsfolder/s/safe_passage.txt | 2 +- res/cardsfolder/s/scarecrow.txt | 2 +- res/cardsfolder/s/scouts_warning.txt | 2 +- res/cardsfolder/s/silence.txt | 2 +- res/cardsfolder/s/sirens_call.txt | 2 +- res/cardsfolder/s/sivvis_ruse.txt | 2 +- res/cardsfolder/s/snag.txt | 2 +- res/cardsfolder/s/solfatara.txt | 2 +- res/cardsfolder/s/sorin_lord_of_innistrad.txt | 2 +- res/cardsfolder/s/stigma_lasher.txt | 2 +- res/cardsfolder/t/tamiyo_the_moon_sage.txt | 4 +- res/cardsfolder/t/tanglesap.txt | 2 +- res/cardsfolder/t/tectonic_rift.txt | 2 +- res/cardsfolder/t/terrifying_presence.txt | 2 +- res/cardsfolder/t/titanias_song.txt | 2 +- res/cardsfolder/t/turf_wound.txt | 2 +- res/cardsfolder/u/undergrowth.txt | 2 +- res/cardsfolder/u/unstable_footing.txt | 2 +- res/cardsfolder/v/veiling_oddity.txt | 2 +- res/cardsfolder/v/veilstone_amulet.txt | 2 +- res/cardsfolder/v/venser_the_sojourner.txt | 2 +- res/cardsfolder/w/winding_canyons.txt | 2 +- res/cardsfolder/x/xantid_swarm.txt | 2 +- res/cardsfolder/y/yawgmoths_will.txt | 2 +- res/layouts/home_default.xml | 1 + res/layouts/match_default.xml | 2 + src/main/java/forge/Card.java | 4 +- src/main/java/forge/GameAction.java | 7 +- src/main/java/forge/card/CardRules.java | 29 ++ src/main/java/forge/card/CardRulesReader.java | 6 + src/main/java/forge/card/CardType.java | 9 + .../abilityfactory/effects/EffectEffect.java | 3 +- .../card/spellability/AbilityActivated.java | 2 +- .../java/forge/card/spellability/Spell.java | 2 +- src/main/java/forge/deck/Deck.java | 80 +++++- src/main/java/forge/deck/DeckRecognizer.java | 12 + src/main/java/forge/game/GameNew.java | 26 +- src/main/java/forge/game/GameState.java | 1 + src/main/java/forge/game/GameType.java | 6 + .../java/forge/game/MatchStartHelper.java | 38 ++- .../forge/game/PlayerStartConditions.java | 42 ++- .../java/forge/game/phase/CombatUtil.java | 2 +- src/main/java/forge/game/player/Player.java | 4 +- .../game/zone/PlayerZoneBattlefield.java | 2 +- src/main/java/forge/game/zone/ZoneType.java | 2 +- .../controllers/CEditorConstructed.java | 2 +- src/main/java/forge/gui/framework/EDocID.java | 15 +- src/main/java/forge/gui/home/EMenuGroup.java | 2 +- src/main/java/forge/gui/home/VHomeUI.java | 5 +- .../gui/home/quest/SSubmenuQuestUtil.java | 4 +- .../CSubmenuArchenemy.java | 2 +- .../gui/home/variant/CSubmenuVanguard.java | 176 ++++++++++++ .../VSubmenuArchenemy.java | 4 +- .../gui/home/variant/VSubmenuVanguard.java | 250 ++++++++++++++++++ src/main/java/forge/gui/match/CMatchUI.java | 10 +- src/main/java/forge/gui/match/VMatchUI.java | 37 +++ src/main/java/forge/item/CardDb.java | 9 + src/main/java/forge/item/CardPrinted.java | 29 ++ .../forge/properties/ForgePreferences.java | 2 +- 124 files changed, 1009 insertions(+), 128 deletions(-) create mode 100644 res/cardsfolder/a/arcbound_overseer_avatar.txt create mode 100644 res/cardsfolder/a/ashling_the_pilgrim_avatar.txt create mode 100644 res/cardsfolder/a/ashnod.txt create mode 100644 res/cardsfolder/b/barrin.txt create mode 100644 res/cardsfolder/b/birds_of_paradise_avatar.txt create mode 100644 res/cardsfolder/c/chronatog_avatar.txt create mode 100644 res/cardsfolder/c/crovax.txt create mode 100644 res/cardsfolder/d/dauntless_escort_avatar.txt create mode 100644 res/cardsfolder/d/diamond_faerie_avatar.txt create mode 100644 res/cardsfolder/e/eladamri.txt create mode 100644 res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt rename src/main/java/forge/gui/home/{multiplayer => variant}/CSubmenuArchenemy.java (98%) create mode 100644 src/main/java/forge/gui/home/variant/CSubmenuVanguard.java rename src/main/java/forge/gui/home/{multiplayer => variant}/VSubmenuArchenemy.java (95%) create mode 100644 src/main/java/forge/gui/home/variant/VSubmenuVanguard.java diff --git a/.gitattributes b/.gitattributes index b71093373c9..0fa6fcf1cf5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -405,6 +405,7 @@ res/cardsfolder/a/arcbound_crusher.txt svneol=native#text/plain res/cardsfolder/a/arcbound_hybrid.txt svneol=native#text/plain res/cardsfolder/a/arcbound_lancer.txt svneol=native#text/plain res/cardsfolder/a/arcbound_overseer.txt svneol=native#text/plain +res/cardsfolder/a/arcbound_overseer_avatar.txt -text res/cardsfolder/a/arcbound_ravager.txt svneol=native#text/plain res/cardsfolder/a/arcbound_reclaimer.txt svneol=native#text/plain res/cardsfolder/a/arcbound_slith.txt svneol=native#text/plain @@ -512,8 +513,10 @@ res/cardsfolder/a/ashenmoor_liege.txt svneol=native#text/plain res/cardsfolder/a/ashes_of_the_fallen.txt svneol=native#text/plain res/cardsfolder/a/ashes_to_ashes.txt svneol=native#text/plain res/cardsfolder/a/ashling_the_extinguisher.txt -text +res/cardsfolder/a/ashling_the_pilgrim_avatar.txt -text res/cardsfolder/a/ashlings_prerogative.txt -text res/cardsfolder/a/ashmouth_hound.txt -text +res/cardsfolder/a/ashnod.txt -text res/cardsfolder/a/ashnods_altar.txt svneol=native#text/plain res/cardsfolder/a/ashnods_battle_gear.txt svneol=native#text/plain res/cardsfolder/a/ashnods_cylix.txt -text @@ -746,6 +749,7 @@ res/cardsfolder/b/barren_glory.txt svneol=native#text/plain res/cardsfolder/b/barren_moor.txt svneol=native#text/plain res/cardsfolder/b/barrenton_cragtreads.txt svneol=native#text/plain res/cardsfolder/b/barrenton_medic.txt svneol=native#text/plain +res/cardsfolder/b/barrin.txt -text res/cardsfolder/b/barrin_master_wizard.txt svneol=native#text/plain res/cardsfolder/b/barrins_codex.txt svneol=native#text/plain res/cardsfolder/b/barrins_unmaking.txt -text @@ -878,6 +882,7 @@ res/cardsfolder/b/biorhythm.txt svneol=native#text/plain res/cardsfolder/b/birchlore_rangers.txt svneol=native#text/plain res/cardsfolder/b/bird_maiden.txt svneol=native#text/plain res/cardsfolder/b/birds_of_paradise.txt svneol=native#text/plain +res/cardsfolder/b/birds_of_paradise_avatar.txt -text res/cardsfolder/b/birthing_pod.txt -text res/cardsfolder/b/biting_tether.txt svneol=native#text/plain res/cardsfolder/b/bitter_ordeal.txt svneol=native#text/plain @@ -1635,6 +1640,7 @@ res/cardsfolder/c/chrome_steed.txt svneol=native#text/plain res/cardsfolder/c/chromescale_drake.txt svneol=native#text/plain res/cardsfolder/c/chromium.txt svneol=native#text/plain res/cardsfolder/c/chronatog.txt svneol=native#text/plain +res/cardsfolder/c/chronatog_avatar.txt -text res/cardsfolder/c/chronatog_totem.txt svneol=native#text/plain res/cardsfolder/c/chronic_flooding.txt -text res/cardsfolder/c/chronomantic_escape.txt -text @@ -1999,6 +2005,7 @@ res/cardsfolder/c/crossbow_infantry.txt svneol=native#text/plain res/cardsfolder/c/crosstown_courier.txt -text res/cardsfolder/c/crossway_vampire.txt -text res/cardsfolder/c/crosswinds.txt svneol=native#text/plain +res/cardsfolder/c/crovax.txt -text res/cardsfolder/c/crovax_ascendant_hero.txt svneol=native#text/plain res/cardsfolder/c/crovax_the_cursed.txt -text svneol=unset#text/plain res/cardsfolder/c/crowd_favorites.txt svneol=native#text/plain @@ -2203,6 +2210,7 @@ res/cardsfolder/d/daru_warchief.txt svneol=native#text/plain res/cardsfolder/d/daunting_defender.txt svneol=native#text/plain res/cardsfolder/d/dauntless_dourbark.txt svneol=native#text/plain res/cardsfolder/d/dauntless_escort.txt svneol=native#text/plain +res/cardsfolder/d/dauntless_escort_avatar.txt -text res/cardsfolder/d/dauthi_cutthroat.txt svneol=native#text/plain res/cardsfolder/d/dauthi_embrace.txt svneol=native#text/plain res/cardsfolder/d/dauthi_ghoul.txt svneol=native#text/plain @@ -2456,6 +2464,7 @@ res/cardsfolder/d/diabolic_servitude.txt -text svneol=unset#text/plain res/cardsfolder/d/diabolic_tutor.txt svneol=native#text/plain res/cardsfolder/d/diabolic_vision.txt svneol=native#text/plain res/cardsfolder/d/diamond_faerie.txt svneol=native#text/plain +res/cardsfolder/d/diamond_faerie_avatar.txt -text res/cardsfolder/d/diamond_kaleidoscope.txt svneol=native#text/plain res/cardsfolder/d/diamond_valley.txt svneol=native#text/plain res/cardsfolder/d/didgeridoo.txt svneol=native#text/plain @@ -2852,7 +2861,9 @@ res/cardsfolder/e/eiganjo_free_riders.txt svneol=native#text/plain res/cardsfolder/e/eightfold_maze.txt svneol=native#text/plain res/cardsfolder/e/ekundu_griffin.txt svneol=native#text/plain res/cardsfolder/e/el_hajjaj.txt svneol=native#text/plain +res/cardsfolder/e/eladamri.txt -text res/cardsfolder/e/eladamri_lord_of_leaves.txt svneol=native#text/plain +res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt -text res/cardsfolder/e/eladamris_call.txt svneol=native#text/plain res/cardsfolder/e/eladamris_vineyard.txt svneol=native#text/plain res/cardsfolder/e/eland_umbra.txt svneol=native#text/plain @@ -13089,8 +13100,6 @@ src/main/java/forge/gui/home/gauntlet/VSubmenuGauntletBuild.java -text src/main/java/forge/gui/home/gauntlet/VSubmenuGauntletContests.java -text src/main/java/forge/gui/home/gauntlet/VSubmenuGauntletLoad.java -text src/main/java/forge/gui/home/gauntlet/VSubmenuGauntletQuick.java -text -src/main/java/forge/gui/home/multiplayer/CSubmenuArchenemy.java -text -src/main/java/forge/gui/home/multiplayer/VSubmenuArchenemy.java -text src/main/java/forge/gui/home/package-info.java svneol=native#text/plain src/main/java/forge/gui/home/quest/CSubmenuChallenges.java -text src/main/java/forge/gui/home/quest/CSubmenuDuels.java -text @@ -13123,6 +13132,10 @@ src/main/java/forge/gui/home/settings/VSubmenuAvatars.java -text src/main/java/forge/gui/home/settings/VSubmenuDownloaders.java -text src/main/java/forge/gui/home/settings/VSubmenuPreferences.java -text src/main/java/forge/gui/home/settings/package-info.java svneol=native#text/plain +src/main/java/forge/gui/home/variant/CSubmenuArchenemy.java -text +src/main/java/forge/gui/home/variant/CSubmenuVanguard.java -text +src/main/java/forge/gui/home/variant/VSubmenuArchenemy.java -text +src/main/java/forge/gui/home/variant/VSubmenuVanguard.java -text src/main/java/forge/gui/match/CMatchUI.java -text src/main/java/forge/gui/match/ControlWinLose.java -text src/main/java/forge/gui/match/GauntletWinLose.java -text diff --git a/res/cardsfolder/a/al_abaras_carpet.txt b/res/cardsfolder/a/al_abaras_carpet.txt index af1cecb2132..af8f3a28f12 100644 --- a/res/cardsfolder/a/al_abaras_carpet.txt +++ b/res/cardsfolder/a/al_abaras_carpet.txt @@ -3,7 +3,7 @@ ManaCost:5 Types:Artifact Text:no text A:AB$ Effect | Cost$ 5 T | Name$ Al-abara's Carpet Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that would be dealt to you this turn by attacking creatures without flying. -SVar:STPrevent:Mode$ PreventDamage | Target$ You | Source$ Creature.attacking+withoutFlying | Description$ Prevent all damage that would be dealt to you this turn by attacking creatures without flying. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ You | Source$ Creature.attacking+withoutFlying | Description$ Prevent all damage that would be dealt to you this turn by attacking creatures without flying. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/al_abaras_carpet.jpg diff --git a/res/cardsfolder/a/alchemists_refuge.txt b/res/cardsfolder/a/alchemists_refuge.txt index 1bbeb2d7659..0b51a824329 100644 --- a/res/cardsfolder/a/alchemists_refuge.txt +++ b/res/cardsfolder/a/alchemists_refuge.txt @@ -4,7 +4,7 @@ Types:Land Text:no text A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add 1 to your mana pool. A:AB$ Effect | Cost$ U G T | Name$ Refuge Effect | StaticAbilities$ QuickSpell | SpellDescription$ Until end of turn, you may cast nonland cards as though they had flash. -SVar:QuickSpell:Mode$ Continuous | Affected$ You | AddKeyword$ You may cast nonland cards as though they had flash. | Description$ You may cast nonland cards as though they had flash. +SVar:QuickSpell:Mode$ Continuous | EffectZone$ Command | Affected$ You | AddKeyword$ You may cast nonland cards as though they had flash. | Description$ You may cast nonland cards as though they had flash. SVar:PlayMain1:TRUE SVar:RemRandomDeck:True SVar:RemAIDeck:True diff --git a/res/cardsfolder/a/angels_grace.txt b/res/cardsfolder/a/angels_grace.txt index b13f0e49c3f..8879ae3a270 100644 --- a/res/cardsfolder/a/angels_grace.txt +++ b/res/cardsfolder/a/angels_grace.txt @@ -4,8 +4,8 @@ Types:Instant Text:no text K:Split second A:SP$ Effect | Cost$ W | Name$ Angel's Grace Effect | Keywords$ AliFromCairo | StaticAbilities$ STCantLose,STOppsCantWin | AILogic$ Fog | SpellDescription$ You can't lose the game this turn and your opponents can't win the game this turn. Until end of turn, damage that would reduce your life total to less than 1 reduces it to 1 instead. -SVar:STCantLose:Mode$ Continuous | Affected$ You | AddKeyword$ You can't lose the game. | Description$ You can't lose the game. -SVar:STOppsCantWin:Mode$ Continuous | Affected$ You | AddKeyword$ Your opponents can't win the game. | Description$ Your opponents can't win the game. +SVar:STCantLose:Mode$ Continuous | EffectZone$ Command | Affected$ You | AddKeyword$ You can't lose the game. | Description$ You can't lose the game. +SVar:STOppsCantWin:Mode$ Continuous | EffectZone$ Command | Affected$ You | AddKeyword$ Your opponents can't win the game. | Description$ Your opponents can't win the game. SVar:AliFromCairo:Damage that would reduce your life total to less than 1 reduces it to 1 instead. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/angels_grace.jpg diff --git a/res/cardsfolder/a/aquitects_will.txt b/res/cardsfolder/a/aquitects_will.txt index ba3dd0b8a9d..3375c47903b 100644 --- a/res/cardsfolder/a/aquitects_will.txt +++ b/res/cardsfolder/a/aquitects_will.txt @@ -5,7 +5,7 @@ Text:no text A:SP$ Effect | Cost$ U | Name$ Flood Effect | StaticAbilities$ STFlood | Unique$ True | Duration$ Permanent | SubAbility$ TrigPutCounter | SpellDescription$ Put a flood counter on target land. That land is an island in addition to its other types for as long as it has a flood counter on it. If you control a Merfolk, draw a card. SVar:TrigPutCounter:DB$ PutCounter | Cost$ 0 | ValidTgts$ Land | CounterType$ FLOOD | CounterNum$ 1 | TgtPrompt$ Select target land | SubAbility$ DBDraw SVar:DBDraw:DB$ Draw | Cost$ 0 | NumCards$ 1 | ConditionPresent$ Merfolk.YouCtrl | ConditionCompare$ GE1 | ConditionDescription$ If you control a Merfolk, -SVar:STFlood:Mode$ Continuous | Affected$ Land.counters_GE1_FLOOD | AddType$ Island +SVar:STFlood:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Land.counters_GE1_FLOOD | AddType$ Island SVar:RemRandomDeck:True SVar:RemAIDeck:True SVar:Rarity:Common diff --git a/res/cardsfolder/a/arcbound_overseer_avatar.txt b/res/cardsfolder/a/arcbound_overseer_avatar.txt new file mode 100644 index 00000000000..bc90fd46b3a --- /dev/null +++ b/res/cardsfolder/a/arcbound_overseer_avatar.txt @@ -0,0 +1,12 @@ +Name:Arcbound Overseer Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/+3 +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | Execute$ BuildCounter | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may put a +1/+1 counter on target creature you control. +SVar:BuildCounter:AB$ PutCounter | Cost$ 0 | CounterType$ P1P1 | CounterNum$ 1 | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | Execute$ ChargeCounter | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may put a charge counter on target permanent you control. +SVar:ChargeCounter:AB$ PutCounter | Cost$ 0 | CounterType$ CHARGE | CounterNum$ 1 | ValidTgts$ Permanent.YouCtrl | TgtPrompt$ Select target permanent you control +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182296&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/a/archangel_of_strife.txt b/res/cardsfolder/a/archangel_of_strife.txt index 5dd76df57ea..d72fd5c1d19 100644 --- a/res/cardsfolder/a/archangel_of_strife.txt +++ b/res/cardsfolder/a/archangel_of_strife.txt @@ -11,10 +11,10 @@ SVar:WarChoice:DB$ Effect | Name$ Archangel War Effect | ChoiceDescription$ War SVar:PeaceChoice:DB$ Effect | Name$ Archangel Peace Effect | ChoiceDescription$ Peace | Duration$ UntilHostLeavesPlay | RememberEffect$ True SVar:Attacking:DB$ Effect | Name$ Archangel War Effect | ChoiceDescription$ War | EffectOwner$ Opponent | Duration$ UntilHostLeavesPlay | RememberEffect$ True SVar:Defensive:DB$ Effect | Name$ Archangel Peace Effect | ChoiceDescription$ Peace | EffectOwner$ Opponent | Duration$ UntilHostLeavesPlay | RememberEffect$ True -S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddPower$ 3 | CheckSVar$ WarYou | SVarCompare$ GE1 | References$ WarYou -S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddToughness$ 3 | CheckSVar$ PeaceYou | SVarCompare$ GE1 | References$ PeaceYou -S:Mode$ Continuous | Affected$ Creature.YouDontCtrl | AddPower$ 3 | CheckSVar$ WarOpp | SVarCompare$ GE1 | References$ WarOpp -S:Mode$ Continuous | Affected$ Creature.YouDontCtrl | AddToughness$ 3 | CheckSVar$ PeaceOpp | SVarCompare$ GE1 | References$ PeaceOpp +S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddPower$ 3 | CheckSVar$ WarYou | SVarCompare$ GE1 | References$ WarYou +S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddToughness$ 3 | CheckSVar$ PeaceYou | SVarCompare$ GE1 | References$ PeaceYou +S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouDontCtrl | AddPower$ 3 | CheckSVar$ WarOpp | SVarCompare$ GE1 | References$ WarOpp +S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouDontCtrl | AddToughness$ 3 | CheckSVar$ PeaceOpp | SVarCompare$ GE1 | References$ PeaceOpp T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Self | Execute$ DBCleanup | Static$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:WarYou:Remembered$Valid Card.namedArchangel War Effect+YouCtrl diff --git a/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt b/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt new file mode 100644 index 00000000000..a7daaf8296c --- /dev/null +++ b/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt @@ -0,0 +1,9 @@ +Name:Ashling the Pilgrim Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+6 +A:AB$ DamageAll | ActivationZone$ Command | Cost$ 2 | NumDmg$ 1 | ValidCards$ Creature | ValidPlayers$ Each | ValidDescription$ each creature and each player. | SpellDescription$ CARDNAME deals 1 damage to each creature and each player. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182283&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/a/ashnod.txt b/res/cardsfolder/a/ashnod.txt new file mode 100644 index 00000000000..9cbb0c4f046 --- /dev/null +++ b/res/cardsfolder/a/ashnod.txt @@ -0,0 +1,10 @@ +Name:Ashnod +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/-8 +T:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ You | Execute$ TrigDestroy | TriggerZones$ Command | TriggerDescription$ Whenever a creature deals damage to you, destroy it. +SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredSource +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12329&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/a/aven_mimeomancer.txt b/res/cardsfolder/a/aven_mimeomancer.txt index b42c9bd1a02..09a2a072b0d 100644 --- a/res/cardsfolder/a/aven_mimeomancer.txt +++ b/res/cardsfolder/a/aven_mimeomancer.txt @@ -6,7 +6,7 @@ PT:3/1 K:Flying T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may put a feather counter on target creature. If you do, that creature is 3/1 and has flying for as long as it has a feather counter on it. SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ FEATHER | CounterNum$ 1 | SubAbility$ DBAnimate -SVar:DBAnimate:DB$ Animate | Defined$ Targeted | staticAbilities$ MimeomancerStatic | Permanent$ True +SVar:DBAnimate:DB$ Animate | Defined$ Targeted | StaticAbilities$ MimeomancerStatic | Permanent$ True SVar:MimeomancerStatic:Mode$ Continuous | Affected$ Card.Self+counters_GE1_FEATHER | SetPower$ 3 | SetToughness$ 1 | AddKeyword$ Flying | Description$ CARDNAME is 3/1 and has flying for as long as it has a feather counter on it. SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/b/barrin.txt b/res/cardsfolder/b/barrin.txt new file mode 100644 index 00000000000..2030580e4bd --- /dev/null +++ b/res/cardsfolder/b/barrin.txt @@ -0,0 +1,9 @@ +Name:Barrin +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/+6 +A:AB$ ChangeZone | ActivationZone$ Command | Cost$ Sac<1/Permanent> | ValidTgts$ Creature | TgtPrompt$ Select target Creature | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target creature to its owner's hand. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4957&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/b/birds_of_paradise_avatar.txt b/res/cardsfolder/b/birds_of_paradise_avatar.txt new file mode 100644 index 00000000000..c82c6b89912 --- /dev/null +++ b/res/cardsfolder/b/birds_of_paradise_avatar.txt @@ -0,0 +1,10 @@ +Name:Birds of Paradise Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/-3 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Land.YouCtrl | AddAbility$ AnyMana | Description$ Lands you control have "Tap: Add one mana of any color to your mana pool." +SVar:AnyMana:AB$ Mana | Cost$ T | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color to your mana pool. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182291&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/b/blinding_beam.txt b/res/cardsfolder/b/blinding_beam.txt index ecfd8b621fb..a5e5f3b0fb0 100644 --- a/res/cardsfolder/b/blinding_beam.txt +++ b/res/cardsfolder/b/blinding_beam.txt @@ -6,7 +6,7 @@ A:SP$ Tap | Cost$ 2 W | ValidTgts$ Creature | TargetMin$ 2 | TargetMax$ 2 | Tgt A:SP$ Effect | Cost$ 2 W | ValidTgts$ Player | TgtPrompt$ Select target player | IsCurse$ True | StaticAbilities$ DontUntap | Triggers$ RestoreSight | SVars$ ExileEffect | RememberObjects$ Targeted | Duration$ Permanent | SpellDescription$ or creatures don't untap during target player's next untap step. A:SP$ Effect | Cost$ 3 W | ValidTgts$ Player | TgtPrompt$ Select target player | IsCurse$ True | StaticAbilities$ DontUntap | Triggers$ RestoreSight | SVars$ ExileEffect | RememberObjects$ Targeted | AILogic$ BeginningOfOppTurn | Duration$ Permanent | SubAbility$ BlindTheFoe | PrecostDesc$ Entwine | CostDesc$ 1 | NonBasicSpell$ True | SpellDescription$ (Choose both if you pay the entwine cost.) SVar:BlindTheFoe:DB$ Tap | ValidTgts$ Creature | TargetMin$ 2 | TargetMax$ 2 | TgtPrompt$ Select two target creatures -SVar:DontUntap:Mode$ Continuous | Affected$ Creature.RememberedPlayerCtrl | AddHiddenKeyword$ HIDDEN This card doesn't untap during your next untap step. +SVar:DontUntap:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.RememberedPlayerCtrl | AddHiddenKeyword$ HIDDEN This card doesn't untap during your next untap step. SVar:RestoreSight:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player.IsRemembered | TriggerZones$ Battlefield | Execute$ ExileEffect | Static$ True SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile SVar:RemAIDeck:True diff --git a/res/cardsfolder/c/cease_fire.txt b/res/cardsfolder/c/cease_fire.txt index 1b0703bf2d3..f7a6f6d239c 100644 --- a/res/cardsfolder/c/cease_fire.txt +++ b/res/cardsfolder/c/cease_fire.txt @@ -3,7 +3,7 @@ ManaCost:2 W Types:Instant Text:no text A:SP$ Effect | Cost$ 2 W | ValidTgts$ Player | Name$ Cease-Fire Effect | StaticAbilities$ STCantBeCast | RememberObjects$ Targeted | AILogic$ BeginningOfOppTurn | SubAbility$ DBDraw | SpellDescription$ Target player can't cast creature spells this turn. -SVar:STCantBeCast:Mode$ CantBeCast | ValidCard$ Creature | Caster$ Player.IsRemembered | Description$ Target player can't cast creature spells this turn. +SVar:STCantBeCast:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Creature | Caster$ Player.IsRemembered | Description$ Target player can't cast creature spells this turn. SVar:DBDraw:DB$Draw | NumCards$ 1 | SpellDescription$ Draw a card. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/cease_fire.jpg diff --git a/res/cardsfolder/c/chameleon_blur.txt b/res/cardsfolder/c/chameleon_blur.txt index f3e4a7cf81b..40a182b9c09 100644 --- a/res/cardsfolder/c/chameleon_blur.txt +++ b/res/cardsfolder/c/chameleon_blur.txt @@ -3,7 +3,7 @@ ManaCost:3 G Types:Instant Text:no text A:SP$ Effect | Cost$ 3 G | Name$ Chameleon Blur Effect | StaticAbilities$ STPrevent | AILogic$ Fog | SpellDescription$ Prevent all damage that creatures would deal to players this turn. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature | Target$ Player | Description$ Prevent all damage that creatures would deal to players this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature | Target$ Player | Description$ Prevent all damage that creatures would deal to players this turn. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/chameleon_blur.jpg diff --git a/res/cardsfolder/c/channel.txt b/res/cardsfolder/c/channel.txt index a393c9ee0da..6d1361e796b 100644 --- a/res/cardsfolder/c/channel.txt +++ b/res/cardsfolder/c/channel.txt @@ -3,7 +3,7 @@ ManaCost:G G Types:Sorcery Text:no text A:SP$ Effect | Cost$ G G | Name$ Channel Effect | Abilities$ ABMana | SpellDescription$ Until end of turn, any time you could activate a mana ability, you may pay 1 life. If you do, add 1 to your mana pool. -SVar:ABMana:AB$Mana | Cost$ PayLife<1> | Produced$ 1 | Amount$ 1 | SpellDescription$ Add 1 to your mana pool. +SVar:ABMana:AB$Mana | Cost$ PayLife<1> | ActivationZone$ Command | Produced$ 1 | Amount$ 1 | SpellDescription$ Add 1 to your mana pool. SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/channel.jpg diff --git a/res/cardsfolder/c/chronatog_avatar.txt b/res/cardsfolder/c/chronatog_avatar.txt new file mode 100644 index 00000000000..2f335894cf6 --- /dev/null +++ b/res/cardsfolder/c/chronatog_avatar.txt @@ -0,0 +1,12 @@ +Name:Chronatog Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+1 +S:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. +A:AB$ Draw | ActivationZone$ Command | Cost$ 0 | NumCards$ 3 | Defined$ You | ActivationLimit$ 1 | SubAbility$ DBSkipTurn | SpellDescription$ Draw three cards. You skip your next turn. Activate this ability only once each turn. +SVar:DBSkipTurn:DB$ AddTurn | NumTurns$ 1 | Defined$ Opponent +SVar:RemAIDeck:True +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=201898&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/c/chronomantic_escape.txt b/res/cardsfolder/c/chronomantic_escape.txt index 6f23965cad0..47adb046be5 100644 --- a/res/cardsfolder/c/chronomantic_escape.txt +++ b/res/cardsfolder/c/chronomantic_escape.txt @@ -4,7 +4,7 @@ Types:Sorcery Text:no text K:Suspend:3:2 W A:SP$ Effect | Cost$ 4 W W | Name$ Chronomantic Escape Effect | StaticAbilities$ STCantAttack | Duration$ UntilYourNextTurn | SubAbility$ DBChange | SpellDescription$ Until your next turn, creatures can't attack you. Exile CARDNAME with three time counters on it. -SVar:STCantAttack:Mode$ CantAttack | ValidCard$ Creature | Target$ You | Description$ Creatures can't attack you. +SVar:STCantAttack:Mode$ CantAttack | EffectZone$ Command | ValidCard$ Creature | Target$ You | Description$ Creatures can't attack you. SVar:DBChange:DB$ ChangeZone | Origin$ Stack | Destination$ Exile | RememberChanged$ True | SubAbility$ DBPutCounter SVar:DBPutCounter:DB$ PutCounter | Defined$ Remembered | CounterType$ TIME | CounterNum$ 3 | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True diff --git a/res/cardsfolder/c/crovax.txt b/res/cardsfolder/c/crovax.txt new file mode 100644 index 00000000000..8bcb5509455 --- /dev/null +++ b/res/cardsfolder/c/crovax.txt @@ -0,0 +1,11 @@ +Name:Crovax +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+2/+0 +T:Mode$ DamageDone | ValidSource$ Creature+YouCtrl | ValidTarget$ Creature,Player | TriggerZones$ Command | Execute$ TrigGainLife | TriggerDescription$ Whenever a creature you control deals damage to a creature or player, you gain 1 life. +SVar:TrigGainLife:AB$ GainLife | Cost$ 0 | Defined$ You | LifeAmount$ 1 +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4958&type=card +Oracle:Hand +2, life +0\nWhenever a creature you control deals damage to a creature or player, you gain 1 life. +End \ No newline at end of file diff --git a/res/cardsfolder/d/dauntless_escort.txt b/res/cardsfolder/d/dauntless_escort.txt index 0bc1de7e6d5..ec1f85384a3 100644 --- a/res/cardsfolder/d/dauntless_escort.txt +++ b/res/cardsfolder/d/dauntless_escort.txt @@ -4,7 +4,7 @@ Types:Creature Rhino Soldier Text:no text PT:3/3 A:AB$ Effect | Cost$ Sac<1/CARDNAME> | Name$ Dauntless Escort Effect | StaticAbilities$ KWPump | SpellDescription$ Creatures you control are indestructible this turn. -SVar:KWPump:Mode$ Continuous | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN Indestructible | Description$ Creatures you control are indestructible this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN Indestructible | Description$ Creatures you control are indestructible this turn. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/dauntless_escort.jpg diff --git a/res/cardsfolder/d/dauntless_escort_avatar.txt b/res/cardsfolder/d/dauntless_escort_avatar.txt new file mode 100644 index 00000000000..8cc8300a6a4 --- /dev/null +++ b/res/cardsfolder/d/dauntless_escort_avatar.txt @@ -0,0 +1,9 @@ +Name:Dauntless Escort Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/+1 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Exalted | Description$ Creatures you control have exalted. (Whenever a creature you control attacks alone, it gets +1/+1 until end of turn for each instance of exalted among permanents you control.) +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=201898&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/d/deep_wood.txt b/res/cardsfolder/d/deep_wood.txt index 779ddf759de..96310b0b151 100644 --- a/res/cardsfolder/d/deep_wood.txt +++ b/res/cardsfolder/d/deep_wood.txt @@ -3,7 +3,7 @@ ManaCost:1 G Types:Instant Text:no text A:SP$ Effect | Cost$ 1 G | Name$ Deep Wood Effect | StaticAbilities$ STPrevent | AILogic$ Fog | OpponentTurn$ True | ActivationPhases$ Declare Attackers - Play Instants and Abilities | SpellDescription$ Cast CARDNAME only during the declare attackers step and only if you've been attacked this step. Prevent all damage that would be dealt to you this turn by attacking creatures. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature.attacking | Target$ You | Description$ Prevent all damage that would be dealt to you this turn by attacking creatures. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.attacking | Target$ You | Description$ Prevent all damage that would be dealt to you this turn by attacking creatures. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/deep_wood.jpg SetInfo:POR|Uncommon|http://magiccards.info/scans/en/po/86.jpg diff --git a/res/cardsfolder/d/demoralize.txt b/res/cardsfolder/d/demoralize.txt index d4a8bc3d672..2c9ba4e5de9 100644 --- a/res/cardsfolder/d/demoralize.txt +++ b/res/cardsfolder/d/demoralize.txt @@ -4,8 +4,8 @@ Types:Instant Text:no text A:SP$ Effect | Cost$ 2 R | Name$ Demoralize Effect | StaticAbilities$ KWPump | SubAbility$ DBEffect2 | SpellDescription$ Each creature can't be blocked this turn except by two or more creatures. SVar:DBEffect2:DB$ Effect | Name$ Demoralize Effect 2 | StaticAbilities$ KWPump2 | SpellDescription$ Threshold - If seven or more cards are in your graveyard, creatures can't block this turn. -SVar:KWPump:Mode$ Continuous | Affected$ Creature | AddKeyword$ CARDNAME can't be blocked except by two or more creatures. | Description$ Each creature can't be blocked this turn except by two or more creatures. -SVar:KWPump2:Mode$ Continuous | Affected$ Creature | AddKeyword$ CARDNAME can't block. | Threshold$ True | Description$ Threshold - If seven or more cards are in your graveyard, creatures can't block this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature | AddKeyword$ CARDNAME can't be blocked except by two or more creatures. | Description$ Each creature can't be blocked this turn except by two or more creatures. +SVar:KWPump2:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature | AddKeyword$ CARDNAME can't block. | Threshold$ True | Description$ Threshold - If seven or more cards are in your graveyard, creatures can't block this turn. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/demoralize.jpg diff --git a/res/cardsfolder/d/diamond_faerie_avatar.txt b/res/cardsfolder/d/diamond_faerie_avatar.txt new file mode 100644 index 00000000000..a96f2323fa2 --- /dev/null +++ b/res/cardsfolder/d/diamond_faerie_avatar.txt @@ -0,0 +1,9 @@ +Name:Diamond Faerie Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/+5 +A:AB$ Pump | ActivationZone$ Command | Cost$ S | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | NumAtt$ 1 | NumDef$ 1 | SpellDescription$ Target creature you control gets +1/+1 until end of turn. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182274&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/d/divine_light.txt b/res/cardsfolder/d/divine_light.txt index 6397407c7d4..2188e278a44 100644 --- a/res/cardsfolder/d/divine_light.txt +++ b/res/cardsfolder/d/divine_light.txt @@ -3,7 +3,7 @@ ManaCost:W Types:Instant Text:no text A:SP$ Effect | Cost$ W | Name$ Divine Light Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that would be dealt this turn to creatures you control. -SVar:STPrevent:Mode$ PreventDamage | Target$ Creature.YouCtrl | Description$ Prevent all damage that would be dealt this turn to creatures you control. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ Creature.YouCtrl | Description$ Prevent all damage that would be dealt this turn to creatures you control. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/divine_light.jpg diff --git a/res/cardsfolder/d/druids_deliverance.txt b/res/cardsfolder/d/druids_deliverance.txt index 7a0615c8b1f..23ae96c8b55 100644 --- a/res/cardsfolder/d/druids_deliverance.txt +++ b/res/cardsfolder/d/druids_deliverance.txt @@ -3,7 +3,7 @@ ManaCost:1 G Types:Instant Text:no text A:SP$ Effect | Cost$ 1 G | Name$ Druid's Deliverance Effect | StaticAbilities$ STPrevent | AILogic$ Fog | SubAbility$ DBChoose | SpellDescription$ Prevent all combat damage that would be dealt to you this turn. Populate. (Put a token onto the battlefield that's a copy of a creature token you control.) -SVar:STPrevent:Mode$ PreventDamage | CombatDamage$ True | Target$ You | Description$ Prevent all combat damage that would be dealt to you this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | CombatDamage$ True | Target$ You | Description$ Prevent all combat damage that would be dealt to you this turn. SVar:DBChoose:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.token+YouCtrl | SubAbility$ DBCopy | RememberChosen$ True SVar:DBCopy:DB$ CopyPermanent | Defined$ Remembered SVar:Rarity:Common diff --git a/res/cardsfolder/d/due_respect.txt b/res/cardsfolder/d/due_respect.txt index b28dd2e7835..d0db63f9eee 100644 --- a/res/cardsfolder/d/due_respect.txt +++ b/res/cardsfolder/d/due_respect.txt @@ -3,7 +3,7 @@ ManaCost:1 W Types:Instant Text:no text A:SP$ Effect | Cost$ 1 W | Name$ Due Respect Effect | StaticAbilities$ STETBTapped | SubAbility$ DBDraw | AILogic$ BeginningOfOppTurn | SpellDescription$ Permanents enter the battlefield tapped this turn. -SVar:STETBTapped:Mode$ ETBTapped | ValidCard$ Permanent | Description$ Permanents enter the battlefield tapped this turn. +SVar:STETBTapped:Mode$ ETBTapped | EffectZone$ Command | ValidCard$ Permanent | Description$ Permanents enter the battlefield tapped this turn. SVar:DBDraw:DB$Draw | NumCards$ 1 | SpellDescription$ Draw a card. SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/due_respect.jpg diff --git a/res/cardsfolder/e/eladamri.txt b/res/cardsfolder/e/eladamri.txt new file mode 100644 index 00000000000..01e02429ebb --- /dev/null +++ b/res/cardsfolder/e/eladamri.txt @@ -0,0 +1,20 @@ +Name:Eladamri +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+15 +A:AB$ Effect | ActivationZone$ Command | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature to redirect damage from | ReplacementEffects$ SelflessCombat,SelflessNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,RestDmgCombat,RestDmg,ExileEffect,X,Y | References$ SelflessCombat,SelflessNonCombat,OutOfSight,CombatDmg,NonCombatDmg,RestDmgCombat,RestDmg,ExileEffect,X,Y | RememberObjects$ Targeted | Duration$ Permanent | SpellDescription$ The next 1 damage that would be dealt to target creature you control is dealt to you instead. +SVar:SelflessCombat:Event$ DamageDone | ValidTarget$ Card.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to target creature you control is dealt to you instead. +SVar:SelflessNonCombat:Event$ DamageDone | ValidTarget$ Card.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to target creature you control is dealt to you instead. +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:RestDmgCombat:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:X:ReplaceCount$DamageAmount/Minus.1 +SVar:Y:ReplaceCount$DamageAmount +SVar:Rarity:Special +SVar:Picture:http://www.wizards.com/global/images/magic/general/eladamri.jpg +Oracle:Hand -1, life +15\n{0}: The next 1 damage that would be dealt to target creature you control is dealt to you instead. +End \ No newline at end of file diff --git a/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt b/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt new file mode 100644 index 00000000000..ffb044f9d83 --- /dev/null +++ b/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt @@ -0,0 +1,10 @@ +Name:Eladamri, Lord of Leaves Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+2 +T:Mode$ Phase | Phase$ Main1 | ValidPlayer$ Player | TriggerZones$ Command | Execute$ TrigAddMana | TriggerDescription$ At the beginning of each player's precombat main phase, that player adds {G}{G} to his or her mana pool. +SVar:TrigAddMana:AB$ Mana | Cost$ 0 | Produced$ G | Amount$ 2 | Defined$ TriggeredPlayer +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=195137&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/e/elspeth_knight_errant.txt b/res/cardsfolder/e/elspeth_knight_errant.txt index d475c962452..a7f2edba061 100644 --- a/res/cardsfolder/e/elspeth_knight_errant.txt +++ b/res/cardsfolder/e/elspeth_knight_errant.txt @@ -6,7 +6,7 @@ Loyalty:4 A:AB$ Token | Cost$ AddCounter<1/LOYALTY> | TokenAmount$ 1 | TokenName$ Soldier | TokenColors$ White | TokenTypes$ Creature,Soldier | TokenOwner$ You | TokenPower$ 1 | TokenToughness$ 1 | Planeswalker$ True | SpellDescription$ Put a 1/1 white Soldier creature token onto the battlefield. A:AB$ Pump | Cost$ AddCounter<1/LOYALTY> | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ 3 | NumDef$ 3 | KW$ Flying | Planeswalker$ True | SpellDescription$ Target creature gets +3/+3 and gains flying until end of turn. A:AB$ Effect | Cost$ SubCounter<8/LOYALTY> | Name$ Elspeth, Knight-Errant emblem | Image$ elspeth_knight_errant_emblem | StaticAbilities$ STIndestructible | Keywords$ Indestructible | Planeswalker$ True | Ultimate$ True | Stackable$ False | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "Artifacts, creatures, enchantments, and lands you control are indestructible." -SVar:STIndestructible:Mode$ Continuous | Affected$ Artifact.YouCtrl,Creature.YouCtrl,Enchantment.YouCtrl,Land.YouCtrl | AffectedZone$ Battlefield | AddKeyword$ Indestructible +SVar:STIndestructible:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.YouCtrl,Creature.YouCtrl,Enchantment.YouCtrl,Land.YouCtrl | AffectedZone$ Battlefield | AddKeyword$ Indestructible SVar:Indestructible:Artifacts, creatures, enchantments, and lands you control are indestructible. SVar:Rarity:Mythic SVar:Picture:http://www.wizards.com/global/images/magic/general/elspeth_knight_errant.jpg diff --git a/res/cardsfolder/e/endure.txt b/res/cardsfolder/e/endure.txt index 3dd54efd78d..6631306de97 100644 --- a/res/cardsfolder/e/endure.txt +++ b/res/cardsfolder/e/endure.txt @@ -3,7 +3,7 @@ ManaCost:3 W W Types:Instant Text:no text A:SP$ Effect | Cost$ 3 W W | Name$ Endure Effect | StaticAbilities$ STPrevent | AILogic$ Fog | SpellDescription$ Prevent all damage that would be dealt to you and permanents you control this turn. -SVar:STPrevent:Mode$ PreventDamage | Target$ You,Permanent.YouCtrl | Description$ Prevent all damage that would be dealt to you and permanents you control this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ You,Permanent.YouCtrl | Description$ Prevent all damage that would be dealt to you and permanents you control this turn. SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/endure.jpg diff --git a/res/cardsfolder/e/ethereal_haze.txt b/res/cardsfolder/e/ethereal_haze.txt index 3fd0b5b93f6..1f50757b0ab 100644 --- a/res/cardsfolder/e/ethereal_haze.txt +++ b/res/cardsfolder/e/ethereal_haze.txt @@ -3,7 +3,7 @@ ManaCost:W Types:Instant Text:no text A:SP$ Effect | Cost$ W | Name$ Ethereal Haze Effect | StaticAbilities$ STPrevent | AILogic$ Fog | SpellDescription$ Prevent all damage that would be dealt by creatures this turn. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature | Description$ Prevent all damage that would be dealt by creatures this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature | Description$ Prevent all damage that would be dealt by creatures this turn. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/ethereal_haze.jpg SetInfo:CHK|Common|http://magiccards.info/scans/en/chk/9.jpg diff --git a/res/cardsfolder/e/ethersworn_shieldmage.txt b/res/cardsfolder/e/ethersworn_shieldmage.txt index 4aa70f1943e..11aa5f1f3ac 100644 --- a/res/cardsfolder/e/ethersworn_shieldmage.txt +++ b/res/cardsfolder/e/ethersworn_shieldmage.txt @@ -6,7 +6,7 @@ PT:2/2 K:Flash T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ When CARDNAME enters the battlefield, prevent all damage that would be dealt to artifact creatures this turn. SVar:TrigEffect:DB$Effect | Name$ Ethersworn Shieldmage Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that would be dealt to artifact creatures this turn. -SVar:STPrevent:Mode$ PreventDamage | Target$ Creature.Artifact | Description$ Prevent all damage that would be dealt to artifact creatures this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ Creature.Artifact | Description$ Prevent all damage that would be dealt to artifact creatures this turn. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/ethersworn_shieldmage.jpg SetInfo:ARB|Common|http://magiccards.info/scans/en/arb/4.jpg diff --git a/res/cardsfolder/f/falter.txt b/res/cardsfolder/f/falter.txt index 5bc7ed1b8c9..cb21689c8dd 100644 --- a/res/cardsfolder/f/falter.txt +++ b/res/cardsfolder/f/falter.txt @@ -3,7 +3,7 @@ ManaCost:1 R Types:Instant Text:no text A:SP$ Effect | Cost$ 1 R | Name$ Falter Effect | StaticAbilities$ KWPump | AILogic$ Evasion | SpellDescription$ Creatures without flying can't block this turn. -SVar:KWPump:Mode$ Continuous | Affected$ Creature.withoutFlying | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | Description$ Creatures without flying can't block this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.withoutFlying | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | Description$ Creatures without flying can't block this turn. SVar:PlayMain1:TRUE SVar:RemAIDeck:True SVar:Rarity:Common diff --git a/res/cardsfolder/f/festival.txt b/res/cardsfolder/f/festival.txt index 8482deae37a..8a3f56c0c3e 100644 --- a/res/cardsfolder/f/festival.txt +++ b/res/cardsfolder/f/festival.txt @@ -3,7 +3,7 @@ ManaCost:W Types:Instant Text:Cast Festival only during an opponent's upkeep. A:SP$ Effect | Cost$ W | Name$ Festival Effect | StaticAbilities$ KWPump | OpponentTurn$ True | ActivationPhases$ Upkeep | SpellDescription$ Creatures can't attack this turn. -SVar:KWPump:Mode$ Continuous | Affected$ Creature | AddHiddenKeyword$ HIDDEN CARDNAME can't attack. | Description$ Creatures can't attack this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature | AddHiddenKeyword$ HIDDEN CARDNAME can't attack. | Description$ Creatures can't attack this turn. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/festival.jpg diff --git a/res/cardsfolder/f/flame_fusillade.txt b/res/cardsfolder/f/flame_fusillade.txt index 2ce66b30a15..c22bed3c845 100644 --- a/res/cardsfolder/f/flame_fusillade.txt +++ b/res/cardsfolder/f/flame_fusillade.txt @@ -3,7 +3,7 @@ ManaCost:3 R Types:Sorcery Text:no text A:SP$ Effect | Cost$ 3 R | Name$ Flame Fusillade Effect | StaticAbilities$ STDamage | SVars$ ABDamage | SpellDescription$ Until end of turn, permanents you control gain "Tap: This permanent deals 1 damage to target creature or player." -SVar:STDamage:Mode$ Continuous | Affected$ Permanent.YouCtrl | AddAbility$ ABDamage | Description$ Until end of turn, permanents you control gain "Tap: This permanent deals 1 damage to target creature or player." +SVar:STDamage:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Permanent.YouCtrl | AddAbility$ ABDamage | Description$ Until end of turn, permanents you control gain "Tap: This permanent deals 1 damage to target creature or player." SVar:ABDamage:AB$ DealDamage | Cost$ T | NumDmg$ 1 | Tgt$ TgtCP | SpellDescription$ CARDNAME deals 1 damage to target creature or player SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/f/flaring_pain.txt b/res/cardsfolder/f/flaring_pain.txt index 6c81c706db2..5a5f686387f 100644 --- a/res/cardsfolder/f/flaring_pain.txt +++ b/res/cardsfolder/f/flaring_pain.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text K:Flashback R A:SP$ Effect | Cost$ 1 R | Name$ Flaring Pain Effect | StaticAbilities$ STCantPrevent | SpellDescription$ Damage can't be prevented this turn. -SVar:STCantPrevent:Mode$ Continuous | GlobalRule$ Damage can't be prevented. | Description$ Damage can't be prevented. +SVar:STCantPrevent:Mode$ Continuous | EffectZone$ Command | GlobalRule$ Damage can't be prevented. | Description$ Damage can't be prevented. SVar:RemAIDeck:True SVar:RemRandomDeck:True SVar:Rarity:Common diff --git a/res/cardsfolder/f/forfend.txt b/res/cardsfolder/f/forfend.txt index f04de0b2110..dba5d21e62a 100644 --- a/res/cardsfolder/f/forfend.txt +++ b/res/cardsfolder/f/forfend.txt @@ -3,7 +3,7 @@ ManaCost:1 W Types:Instant Text:no text A:SP$ Effect | Cost$ 1 W | Name$ Forfend Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that would be dealt to creatures this turn. -SVar:STPrevent:Mode$ PreventDamage | Target$ Creature | Description$ Prevent all damage that would be dealt to creatures this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ Creature | Description$ Prevent all damage that would be dealt to creatures this turn. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/forfend.jpg diff --git a/res/cardsfolder/g/gorilla_war_cry.txt b/res/cardsfolder/g/gorilla_war_cry.txt index aba2270f622..ffd4f566f0c 100644 --- a/res/cardsfolder/g/gorilla_war_cry.txt +++ b/res/cardsfolder/g/gorilla_war_cry.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text A:SP$ Effect | Cost$ 1 R | Name$ Gorilla War Cry Effect | StaticAbilities$ Blocking | ActivationPhases$ BeginCombat->Declare Attackers - Play Instants and Abilities | AILogic$ Evasion | SubAbility$ DBDraw | SpellDescription$ Cast CARDNAME only during combat before blockers are declared. Creatures can't be blocked this turn except by two or more creatures. SVar:DBDraw:DB$Draw | NumCards$ 1 | NextUpkeep$ True | SpellDescription$ Draw a card at the beginning of the next upkeep. -SVar:Blocking:Mode$ Continuous | Affected$ Creature | AddHiddenKeyword$ HIDDEN CARDNAME can't be blocked except by two or more creatures. | Description$ Creatures can't be blocked this turn except by two or more creatures. +SVar:Blocking:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature | AddHiddenKeyword$ HIDDEN CARDNAME can't be blocked except by two or more creatures. | Description$ Creatures can't be blocked this turn except by two or more creatures. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/gorilla_war_cry.jpg SetInfo:ALL|Common|http://magiccards.info/scans/en/ai/108.jpg|2 diff --git a/res/cardsfolder/g/guardian_angel.txt b/res/cardsfolder/g/guardian_angel.txt index 9bb5f2dc4e0..e8cda2095f4 100644 --- a/res/cardsfolder/g/guardian_angel.txt +++ b/res/cardsfolder/g/guardian_angel.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text A:SP$ PreventDamage | Cost$ X W | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | Amount$ X | References$ X | SubAbility$ GuardianEffect | SpellDescription$ Prevent the next X damage that would be dealt to target creature or player this turn. Until end of turn, you may pay 1 any time you could cast an instant. If you do, prevent the next 1 damage that would be dealt to that creature or player this turn. SVar:GuardianEffect:DB$ Effect | Name$ Guardian Angel Effect | Abilities$ ABProtect | RememberObjects$ Targeted | Triggers$ OutOfSight | SVars$ ExileEffect -SVar:ABProtect:AB$ PreventDamage | Cost$ 1 | InstantSpeed$ True | Defined$ Remembered | Amount$ 1 | SpellDescription$ You may pay 1 any time you could cast an instant. If you do, prevent the next 1 damage that would be dealt to that creature or player this turn. +SVar:ABProtect:AB$ PreventDamage | ActivationZone$ Command | Cost$ 1 | InstantSpeed$ True | Defined$ Remembered | Amount$ 1 | SpellDescription$ You may pay 1 any time you could cast an instant. If you do, prevent the next 1 damage that would be dealt to that creature or player this turn. SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Remembered | Execute$ ExileEffect | Static$ True SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True SVar:RemAIDeck:True diff --git a/res/cardsfolder/h/harmless_assault.txt b/res/cardsfolder/h/harmless_assault.txt index 7608b03e9a9..40ad6316586 100644 --- a/res/cardsfolder/h/harmless_assault.txt +++ b/res/cardsfolder/h/harmless_assault.txt @@ -3,7 +3,7 @@ ManaCost:2 W W Types:Instant Text:no text A:SP$ Effect | Cost$ 2 W W | Name$ Harmless Assault Effect | StaticAbilities$ STPrevent | AILogic$ Fog | SpellDescription$ Prevent all combat damage that would be dealt this turn by attacking creatures. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature.attacking | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt this turn by attacking creatures. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.attacking | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt this turn by attacking creatures. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/harmless_assault.jpg SetInfo:ROE|Common|http://magiccards.info/scans/en/roe/24.jpg diff --git a/res/cardsfolder/h/havengul_lich.txt b/res/cardsfolder/h/havengul_lich.txt index ecff39664e3..4e0522b8a49 100644 --- a/res/cardsfolder/h/havengul_lich.txt +++ b/res/cardsfolder/h/havengul_lich.txt @@ -9,7 +9,7 @@ SVar:PumpTheir:DB$Pump | Defined$ Remembered | ConditionCheckSVar$ SelectKW | Co SVar:FXCast:DB$Effect | Name$ Havengul Lich Delayed Trigger | Triggers$ DTCast | SVars$ StealAbs,STSteal,CleanupDT | RememberObjects$ Targeted SVar:DTCast:Mode$ SpellCast | ValidCard$ Card.IsRemembered | Execute$ StealAbs | TriggerDescription$ When you cast that card this turn, Havengul Lich gains all activated abilities of that card until end of turn. SVar:StealAbs:DB$Effect | Name$ Havengul Lich effect | RememberObjects$ TriggeredCard | StaticAbilities$ STSteal | SubAbility$ CleanupDT -SVar:STSteal:Mode$ Continuous | Affected$ EffectSource | EffectZone$ Battlefield | GainsAbilitiesOf$ Creature.IsRemembered | GainsAbilitiesOfZones$ Library,Hand,Stack,Battlefield,Graveyard,Exile,Command +SVar:STSteal:Mode$ Continuous | Affected$ EffectSource | EffectZone$ Command | GainsAbilitiesOf$ Creature.IsRemembered | GainsAbilitiesOfZones$ Library,Hand,Stack,Battlefield,Graveyard,Exile,Command T:Mode$ Phase | Phase$ Cleanup | Static$ True | Execute$ Cleanup | Secondary$ True | TriggerDescription$ A little behind the scenes. SVar:Cleanup:DB$Cleanup | ClearRemembered$ True SVar:CleanupDT:DB$ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile diff --git a/res/cardsfolder/h/heavy_fog.txt b/res/cardsfolder/h/heavy_fog.txt index 833aacb4b13..9ae77a22105 100644 --- a/res/cardsfolder/h/heavy_fog.txt +++ b/res/cardsfolder/h/heavy_fog.txt @@ -3,7 +3,7 @@ ManaCost:1 G Types:Instant Text:no text A:SP$ Effect | Cost$ 1 G | Name$ Heavy Fog Effect | StaticAbilities$ STPrevent | AILogic$ Fog | OpponentTurn$ True | ActivationPhases$ Declare Attackers - Play Instants and Abilities | SpellDescription$ Cast CARDNAME only during the declare attackers step and only if you've been attacked this step. Prevent all damage that would be dealt to you this turn by attacking creatures. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature.attacking | Target$ You | Description$ Prevent all damage that would be dealt to you this turn by attacking creatures. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.attacking | Target$ You | Description$ Prevent all damage that would be dealt to you this turn by attacking creatures. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/heavy_fog.jpg SetInfo:PTK|Uncommon|http://magiccards.info/scans/en/p3k/136.jpg diff --git a/res/cardsfolder/h/hero_of_oxid_ridge.txt b/res/cardsfolder/h/hero_of_oxid_ridge.txt index 787711df210..8a480cf1079 100644 --- a/res/cardsfolder/h/hero_of_oxid_ridge.txt +++ b/res/cardsfolder/h/hero_of_oxid_ridge.txt @@ -8,7 +8,7 @@ T:Mode$ Attacks | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ Tr T:Mode$ Attacks | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigEffect | TriggerDescription$ When CARDNAME attacks, creatures with power 1 or less can't block this turn. SVar:TrigBattleCry:AB$PumpAll | Cost$ 0 | ValidCards$ Creature.attacking+Other | NumAtt$ 1 SVar:TrigEffect:AB$Effect | Cost$ 0 | Name$ Hero of Oxid Ridge Effect | StaticAbilities$ KWPump -SVar:KWPump:Mode$ Continuous | Affected$ Creature.powerLE1 | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | Description$ Creatures with power 1 or less can't block this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.powerLE1 | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | Description$ Creatures with power 1 or less can't block this turn. SVar:Rarity:Mythic SVar:Picture:http://www.wizards.com/global/images/magic/general/hero_of_oxid_ridge.jpg SetInfo:MBS|Mythic|http://magiccards.info/scans/en/mbs/66.jpg diff --git a/res/cardsfolder/i/interdict.txt b/res/cardsfolder/i/interdict.txt index f1fc3f00d9e..8f10336e1c2 100644 --- a/res/cardsfolder/i/interdict.txt +++ b/res/cardsfolder/i/interdict.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text A:SP$ Counter | Cost$ 1 U | TargetType$ Activated | TgtPrompt$ Select target activated ability from an artifact, creature, enchantment, or land. | RememberTargets$ True | ValidTgts$ Artifact,Creature,Enchantment,Land | SubAbility$ DBEffect | SpellDescription$ Counter target activated ability from an artifact, creature, enchantment, or land. That permanent's activated abilities can't be activated this turn. (Mana abilities can't be targeted.) SVar:DBEffect:DB$ Effect | Name$ Interdict Effect | StaticAbilities$ STCantBeActivated | RememberObjects$ Remembered | SubAbility$ DBDraw -SVar:STCantBeActivated:Mode$ CantBeActivated | ValidCard$ Permanent.IsRemembered +SVar:STCantBeActivated:Mode$ CantBeActivated | EffectZone$ Command | ValidCard$ Permanent.IsRemembered SVar:DBDraw:DB$ Draw | NumCards$ 1 | SpellDescription$ Draw a card. SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/interdict.jpg diff --git a/res/cardsfolder/i/island_sanctuary.txt b/res/cardsfolder/i/island_sanctuary.txt index 9d25aa6ed6c..0ad61ab78f2 100644 --- a/res/cardsfolder/i/island_sanctuary.txt +++ b/res/cardsfolder/i/island_sanctuary.txt @@ -4,7 +4,7 @@ Types:Enchantment Text:no text R:Event$ Draw | ActiveZones$ Battlefield | ActivePhases$ Draw | PlayerTurn$ True | ValidPlayer$ You | Optional$ True | ReplaceWith$ SanctuaryEffect | Description$ If you would draw a card during your draw step, instead you may skip that draw. If you do, until your next turn, you can't be attacked except by creatures with flying and/or islandwalk. SVar:SanctuaryEffect:AB$ Effect | Cost$ 0 | Name$ Sanctuary Effect | StaticAbilities$ IslandRetreat | Duration$ UntilYourNextTurn -SVar:IslandRetreat:Mode$ CantAttack | ValidCard$ Creature.withoutFlying+withoutIslandwalk | Target$ You | Description$ Creatures without flying can't attack you. +SVar:IslandRetreat:Mode$ CantAttack | EffectZone$ Command | ValidCard$ Creature.withoutFlying+withoutIslandwalk | Target$ You | Description$ Creatures without flying can't attack you. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/island_sanctuary.jpg diff --git a/res/cardsfolder/k/koth_of_the_hammer.txt b/res/cardsfolder/k/koth_of_the_hammer.txt index c98d40fbd48..f536b03719b 100644 --- a/res/cardsfolder/k/koth_of_the_hammer.txt +++ b/res/cardsfolder/k/koth_of_the_hammer.txt @@ -7,7 +7,7 @@ A:AB$ Untap | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | ValidTgts$ Moun SVar:DBAnimate:DB$ Animate | Defined$ Targeted | Power$ 4 | Toughness$ 4 | Types$ Creature,Elemental | Colors$ Red A:AB$ Mana | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | Produced$ R | Amount$ X | References$ X | SpellDescription$ Add R to your mana pool for each Mountain you control. A:AB$ Effect | Cost$ SubCounter<5/LOYALTY> | Planeswalker$ True | Ultimate$ True | Name$ Koth of the Hammer emblem | Image$ koth_of_the_hammer_emblem | StaticAbilities$ STDamage | SVars$ ABDealDamage | Stackable$ False | Keywords$ Damage | Duration$ Permanent | SpellDescription$ You get an emblem with "Mountains you control have '{T}: This land deals 1 damage to target creature or player." -SVar:STDamage:Mode$ Continuous | Affected$ Mountain.YouCtrl | AddAbility$ ABDealDamage | AffectedZone$ Battlefield +SVar:STDamage:Mode$ Continuous | EffectZone$ Command | Affected$ Mountain.YouCtrl | AddAbility$ ABDealDamage | AffectedZone$ Battlefield SVar:ABDealDamage:AB$ DealDamage | Cost$ T | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ Deal 1 damage to target creature or player SVar:Damage:Mountains you control have '{T}: This land deals 1 damage to target creature or player. SVar:X:Count$Valid Mountain.YouCtrl diff --git a/res/cardsfolder/l/liege_of_the_tangle.txt b/res/cardsfolder/l/liege_of_the_tangle.txt index fbec1607da3..a4fa96d1310 100644 --- a/res/cardsfolder/l/liege_of_the_tangle.txt +++ b/res/cardsfolder/l/liege_of_the_tangle.txt @@ -9,7 +9,7 @@ T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | ValidTgts$ Land.YouCtrl | OptionalDecider$ You | TargetMax$ X | TgtPrompt$ Select lands you control | CounterType$ AWAKENING | CounterNum$ 1 | SubAbility$ DBEffect | References$ X SVar:X:Count$Valid Land.YouCtrl SVar:DBEffect:DB$ Effect | Cost$ 0 | Name$ Awakening Effect | StaticAbilities$ KWAnimateAll | Unique$ True | Duration$ Permanent -SVar:KWAnimateAll:Mode$ Continuous | Affected$ Card.counters_GE1_AWAKENING | SetPower$ 8 | SetToughness$ 8 | AddType$ Creature & Elemental | SetColor$ Green | Description$ Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands. +SVar:KWAnimateAll:Mode$ Continuous | EffectZone$ Command | Affected$ Card.counters_GE1_AWAKENING | SetPower$ 8 | SetToughness$ 8 | AddType$ Creature & Elemental | SetColor$ Green | Description$ Each of those lands is an 8/8 green Elemental creature for as long as it has an awakening counter on it. They're still lands. SVar:MustBeBlocked:True SVar:Rarity:Mythic SVar:Picture:http://www.wizards.com/global/images/magic/general/liege_of_the_tangle.jpg diff --git a/res/cardsfolder/l/liliana_of_the_dark_realms.txt b/res/cardsfolder/l/liliana_of_the_dark_realms.txt index 23da5a3bbce..598f24ee7b0 100644 --- a/res/cardsfolder/l/liliana_of_the_dark_realms.txt +++ b/res/cardsfolder/l/liliana_of_the_dark_realms.txt @@ -10,7 +10,7 @@ SVar:X:Count$Valid Swamp.YouCtrl SVar:ABChoice:DB$ GenericChoice | Defined$ You | Cost$ 0 | Choices$ ABPump1,ABPump2 SVar:ABPump1:DB$ Pump | Cost$ 0 | Defined$ Targeted | NumAtt$ +X | NumDef$ +X | References$ X | ChoiceDescription$ +X/+X SVar:ABPump2:DB$ Pump | Cost$ 0 | Defined$ Targeted | NumAtt$ -X | NumDef$ -X | References$ X | ChoiceDescription$ -X/-X -SVar:SwampBoost:Mode$ Continuous | Affected$ Swamp.YouCtrl | AddAbility$ BlackTap | Description$ Swamps you control have 'T:Add BBBB to your mana pool.' +SVar:SwampBoost:Mode$ Continuous | EffectZone$ Command | Affected$ Swamp.YouCtrl | AffectedZone$ Battlefield | AddAbility$ BlackTap | Description$ Swamps you control have 'T:Add BBBB to your mana pool.' SVar:BlackTap:AB$ Mana | Cost$ T | Produced$ B | Amount$ 4 | SpellDescription$ Add B B B B to your mana pool. SVar:Rarity:Mythic SVar:Picture:http://www.wizards.com/global/images/magic/general/liliana_of_the_dark_realms.jpg diff --git a/res/cardsfolder/l/luminesce.txt b/res/cardsfolder/l/luminesce.txt index ed27952e4ec..83e5bcd13a9 100644 --- a/res/cardsfolder/l/luminesce.txt +++ b/res/cardsfolder/l/luminesce.txt @@ -3,7 +3,7 @@ ManaCost:W Types:Instant Text:no text A:SP$ Effect | Cost$ W | Name$ Luminesce Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that black sources and red sources would deal this turn. -SVar:STPrevent:Mode$ PreventDamage | Source$ Card.Black,Card.Red | Description$ Prevent all damage that black sources and red sources would deal this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Card.Black,Card.Red | Description$ Prevent all damage that black sources and red sources would deal this turn. SVar:RemAIDeck:True SVar:RemRandomDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/m/maddening_imp.txt b/res/cardsfolder/m/maddening_imp.txt index eafb9b4ff75..d1e93aec2b3 100644 --- a/res/cardsfolder/m/maddening_imp.txt +++ b/res/cardsfolder/m/maddening_imp.txt @@ -5,7 +5,7 @@ Text:no text PT:1/1 K:Flying A:AB$ Effect | Cost$ T | Name$ Maddening Imp Effect | StaticAbilities$ KWPump | ActivationPhases$ Upkeep->Main1 | OpponentTurn$ True | SpellDescription$ Non-Wall creatures the active player controls attack this turn if able. At the beginning of the next end step, destroy each of those creatures that didn't attack this turn. Activate this ability only during an opponent's turn and only before combat. | SubAbility$ DestroyPacifist -SVar:KWPump:Mode$ Continuous | Affected$ Creature.ActivePlayerCtrl+nonWall | AddHiddenKeyword$ CARDNAME attacks each turn if able. | Description$ Non-Wall creatures the active player controls attack this turn if able. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.ActivePlayerCtrl+nonWall | AffectedZone$ Battlefield | AddHiddenKeyword$ CARDNAME attacks each turn if able. | Description$ Non-Wall creatures the active player controls attack this turn if able. SVar:DestroyPacifist:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigDestroy | TriggerDescription$ At the beginning of the next end step, destroy each of those creatures that didn't attack this turn. SVar:TrigDestroy:DB$ DestroyAll | ValidCards$ Creature.ActivePlayerCtrl+notAttackedThisTurn+nonWall SVar:RemAIDeck:True diff --git a/res/cardsfolder/m/moonhold.txt b/res/cardsfolder/m/moonhold.txt index ed69efbff1a..2957c85f96c 100644 --- a/res/cardsfolder/m/moonhold.txt +++ b/res/cardsfolder/m/moonhold.txt @@ -4,8 +4,8 @@ Types:Instant Text:no text A:SP$ Effect | Cost$ 2 RW | ValidTgts$ Player | IsCurse$ True | Name$ Moonhold Land Effect | StaticAbilities$ STCantPlayLand | EffectOwner$ Targeted | AILogic$ BeginningOfOppTurn | ConditionManaSpent$ R | SubAbility$ WPaid | SpellDescription$ Target player can't play land cards this turn if R was spent to cast CARDNAME and can't play creature cards this turn if W was spent to cast it. (Do both if R W was spent.) SVar:WPaid:DB$ Effect | Name$ Moonhold Creature Effect | IsCurse$ True | StaticAbilities$ STCantPlayCreats | EffectOwner$ Targeted | AILogic$ BeginningOfOppTurn | ConditionManaSpent$ W -SVar:STCantPlayLand:Mode$ CantPlayLand | Player$ You | Description$ You can't play land cards this turn. -SVar:STCantPlayCreats:Mode$ CantBeCast | ValidCard$ Creature | Caster$ You | Description$ You can't play creature cards this turn. +SVar:STCantPlayLand:Mode$ CantPlayLand | EffectZone$ Command | Player$ You | Description$ You can't play land cards this turn. +SVar:STCantPlayCreats:Mode$ CantBeCast | ValidCard$ Creature | EffectZone$ Command | Caster$ You | Description$ You can't play creature cards this turn. SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/moonhold.jpg SetInfo:EVE|Uncommon|http://magiccards.info/scans/en/eve/143.jpg diff --git a/res/cardsfolder/m/moonmist.txt b/res/cardsfolder/m/moonmist.txt index d3c12125135..dd137151a29 100644 --- a/res/cardsfolder/m/moonmist.txt +++ b/res/cardsfolder/m/moonmist.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text A:SP$SetStateAll | Cost$ 1 G | ValidCards$ Creature.Human+DoubleFaced | Mode$ Transform | SubAbility$ DBCurseNonWolves | SpellDescription$ Transform all Humans. Prevent all combat damage that would be dealt this turn by creatures other than Werewolves and Wolves. (Only double-faced cards can be transformed.) SVar:DBCurseNonWolves:DB$Effect | Name$ Moonmist Effect. | StaticAbilities$ Curse -SVar:Curse:Mode$ PreventDamage | Source$ Creature.nonWerewolf+nonWolf | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt this turn by creatures other than Werewolves and Wolves. +SVar:Curse:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.nonWerewolf+nonWolf | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt this turn by creatures other than Werewolves and Wolves. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/moonmist.jpg diff --git a/res/cardsfolder/o/orims_chant.txt b/res/cardsfolder/o/orims_chant.txt index 40b7b32e28d..fc915cc734a 100644 --- a/res/cardsfolder/o/orims_chant.txt +++ b/res/cardsfolder/o/orims_chant.txt @@ -3,9 +3,9 @@ ManaCost:W Types:Instant Text:no text A:SP$ Effect | Cost$ W | Name$ Orim's Chant Effect | IsCurse$ True | StaticAbilities$ CantBeCast | ValidTgts$ Player | RememberObjects$ Targeted | AILogic$ BeginningOfOppTurn | SpellDescription$ Target player can't cast spells this turn. If CARDNAME was kicked, creatures can't attack this turn. -SVar:CantBeCast:Mode$ CantBeCast | ValidCard$ Card | Caster$ Player.IsRemembered | Description$ Target player can't cast spells this turn. +SVar:CantBeCast:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Card | Caster$ Player.IsRemembered | Description$ Target player can't cast spells this turn. A:SP$ Effect | Cost$ W W | SetAsKicked$ True | Name$ Orim's Chant Effect | IsCurse$ True | StaticAbilities$ CantBeCast,CantAttack | ValidTgts$ Player | RememberObjects$ Targeted | AILogic$ BeginningOfOppTurn | SpellDescription$ Kicker W W (You may pay an additional W W as you cast this spell.) -SVar:CantAttack:Mode$ Continuous | Affected$ Creature | AddHiddenKeyword$ HIDDEN CARDNAME can't attack. | Description$ Creatures can't attack this turn. +SVar:CantAttack:Mode$ Continuous | EffectZone$ Command | Affected$ Creature | AffectedZone$ Battlefield | AddHiddenKeyword$ HIDDEN CARDNAME can't attack. | Description$ Creatures can't attack this turn. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/orims_chant.jpg SetInfo:PLS|Rare|http://magiccards.info/scans/en/ps/11.jpg diff --git a/res/cardsfolder/o/oriss_samite_guardian.txt b/res/cardsfolder/o/oriss_samite_guardian.txt index 64aabf19e90..8316fb9675e 100644 --- a/res/cardsfolder/o/oriss_samite_guardian.txt +++ b/res/cardsfolder/o/oriss_samite_guardian.txt @@ -5,8 +5,8 @@ Text:no text PT:1/3 A:AB$ Pump | Cost$ T | KW$ HIDDEN Prevent all damage that would be dealt to CARDNAME. | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Prevent all damage that would be dealt to target creature this turn. A:AB$ Effect | Cost$ Discard<1/Card.namedOriss, Samite Guardian> | CostDesc$ Grandeur - Discard another card named CARDNAME:| Name$ Oriss Effect | IsCurse$ True | StaticAbilities$ CantBeCast,CantAttack | ValidTgts$ Player | RememberObjects$ Targeted | AILogic$ BeginningOfOppTurn | SpellDescription$ Target player can't cast spells this turn, and creatures that player controls can't attack this turn. -SVar:CantBeCast:Mode$ CantBeCast | ValidCard$ Card | Caster$ Player.IsRemembered | Description$ Targeted player can't cast spells this turn. -SVar:CantAttack:Mode$ Continuous | Affected$ Creature.RememberedPlayerCtrl | AddHiddenKeyword$ HIDDEN CARDNAME can't attack. | Description$ Creatures targeted player controls can't attack this turn. +SVar:CantBeCast:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Card | Caster$ Player.IsRemembered | Description$ Targeted player can't cast spells this turn. +SVar:CantAttack:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.RememberedPlayerCtrl | AddHiddenKeyword$ HIDDEN CARDNAME can't attack. | Description$ Creatures targeted player controls can't attack this turn. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/oriss_samite_guardian.jpg diff --git a/res/cardsfolder/p/pardic_miner.txt b/res/cardsfolder/p/pardic_miner.txt index 84042c792cc..fade3a7e8ab 100644 --- a/res/cardsfolder/p/pardic_miner.txt +++ b/res/cardsfolder/p/pardic_miner.txt @@ -4,7 +4,7 @@ Types:Creature Dwarf Text:no text PT:1/1 A:AB$ Effect | Cost$ Sac<1/CARDNAME> | ValidTgts$ Player | Name$ Pardic Miner Effect | StaticAbilities$ STCantPlayLand | RememberObjects$ Targeted | AILogic$ BeginningOfOppTurn | SpellDescription$ Target player can't play lands this turn. -SVar:STCantPlayLand:Mode$ CantPlayLand | Player$ Player.IsRemembered | Description$ Target player can't play land cards this turn. +SVar:STCantPlayLand:Mode$ CantPlayLand | EffectZone$ Command | Player$ Player.IsRemembered | Description$ Target player can't play land cards this turn. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/pardic_miner.jpg diff --git a/res/cardsfolder/p/praetors_counsel.txt b/res/cardsfolder/p/praetors_counsel.txt index ea0642cfa5b..db7392c51f2 100644 --- a/res/cardsfolder/p/praetors_counsel.txt +++ b/res/cardsfolder/p/praetors_counsel.txt @@ -5,7 +5,7 @@ Text:no text A:SP$ ChangeZoneAll | Cost$ 5 G G G | Origin$ Graveyard | Destination$ Hand | ChangeType$ Card.YouOwn | SubAbility$ DBChange | SpellDescription$ Return all cards from your graveyard to your hand. Exile CARDNAME. You have no maximum hand size for the rest of the game. SVar:DBChange:DB$ChangeZone | Origin$ Stack | Destination$ Exile | SubAbility$ DBEffect SVar:DBEffect:DB$ Effect | Name$ Praetor's Counsel Effect | StaticAbilities$ STHandSize | Duration$ Permanent -SVar:STHandSize:Mode$ Continuous | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. +SVar:STHandSize:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. SVar:Rarity:Mythic SVar:Picture:http://www.wizards.com/global/images/magic/general/praetors_counsel.jpg SetInfo:MBS|Mythic|http://magiccards.info/scans/en/mbs/88.jpg diff --git a/res/cardsfolder/p/predatory_focus.txt b/res/cardsfolder/p/predatory_focus.txt index 3f5b3956a5d..00d6b121b86 100644 --- a/res/cardsfolder/p/predatory_focus.txt +++ b/res/cardsfolder/p/predatory_focus.txt @@ -3,7 +3,7 @@ ManaCost:3 G G Types:Sorcery Text:no text A:SP$ Effect | Cost$ 3 G G | Name$ Predatory Focus Effect | StaticAbilities$ KWPump | AILogic$ Evasion | SpellDescription$ You may have creatures you control assign their combat damage this turn as though they weren't blocked. -SVar:KWPump:Mode$ Continuous | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN You may have CARDNAME assign its combat damage as though it weren't blocked. | Description$ You may have creatures you control assign their combat damage this turn as though they weren't blocked. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN You may have CARDNAME assign its combat damage as though it weren't blocked. | Description$ You may have creatures you control assign their combat damage this turn as though they weren't blocked. SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/predatory_focus.jpg SetInfo:GPT|Uncommon|http://magiccards.info/scans/en/gp/92.jpg diff --git a/res/cardsfolder/p/predatory_rampage.txt b/res/cardsfolder/p/predatory_rampage.txt index 092701b77c2..a01a3f77fb6 100644 --- a/res/cardsfolder/p/predatory_rampage.txt +++ b/res/cardsfolder/p/predatory_rampage.txt @@ -4,7 +4,7 @@ Types:Sorcery Text:no text A:SP$ PumpAll | Cost$ 3 G G | ValidCards$ Creature.YouCtrl | NumAtt$ +3 | NumDef$ +3 | SubAbility$ OppBlock | SpellDescription$ Creatures you control get +3/+3 until end of turn. Each creature your opponents control blocks this turn if able. SVar:OppBlock:DB$ Effect | Name$ Predatory Rampage Effect | StaticAbilities$ KWPump -SVar:KWPump:Mode$ Continuous | Affected$ Creature.OppCtrl | AddHiddenKeyword$ HIDDEN CARDNAME blocks each turn if able. | Description$ Each creature your opponents control blocks this turn if able. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.OppCtrl | AddHiddenKeyword$ HIDDEN CARDNAME blocks each turn if able. | Description$ Each creature your opponents control blocks this turn if able. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/predatory_rampage.jpg SetInfo:M13|Rare|http://magiccards.info/scans/en/m13/180.jpg diff --git a/res/cardsfolder/p/prismatic_strands.txt b/res/cardsfolder/p/prismatic_strands.txt index 732624f7ddf..aab6ff31e53 100644 --- a/res/cardsfolder/p/prismatic_strands.txt +++ b/res/cardsfolder/p/prismatic_strands.txt @@ -5,7 +5,7 @@ Text:no text K:Flashback tapXType<1/Creature.White/white creature> A:SP$ ChooseColor | Cost$ 2 W | Defined$ You | AILogic$ MostProminentInHumanDeck | SubAbility$ DBEffect SVar:DBEffect:DB$ Effect | Name$ Prismatic Strands Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that sources of the color of your choice would deal this turn. -SVar:STPrevent:Mode$ PreventDamage | Target$ Creature,Player | Source$ Card.ChosenColor | Description$ Prevent all damage that sources of the chosen color would deal this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ Creature,Player | Source$ Card.ChosenColor | Description$ Prevent all damage that sources of the chosen color would deal this turn. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/prismatic_strands.jpg diff --git a/res/cardsfolder/p/psychic_trance.txt b/res/cardsfolder/p/psychic_trance.txt index cbaa5d1eed2..ea47fe32167 100644 --- a/res/cardsfolder/p/psychic_trance.txt +++ b/res/cardsfolder/p/psychic_trance.txt @@ -3,7 +3,7 @@ ManaCost:2 U U Types:Instant Text:no text A:SP$ Effect | Cost$ 2 U U | Name$ Psychic Trance Effect | StaticAbilities$ Static | SVars$ Counter | SpellDescription$ Until end of turn, Wizards you control gain "Tap: Counter target spell." -SVar:Static:Mode$ Continuous | Affected$ Card.Wizard+YouCtrl | AddAbility$ Counter | Description$ All Wizards you control have Tap: Counter target spell. +SVar:Static:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Card.Wizard+YouCtrl | AddAbility$ Counter | Description$ All Wizards you control have Tap: Counter target spell. SVar:Counter:AB$ Counter | Cost$ T | TargetType$ Spell | ValidTgts$ Card | SpellDescription$ Counter target spell SVar:RemRandomDeck:True SVar:RemAIDeck:True diff --git a/res/cardsfolder/q/quicken.txt b/res/cardsfolder/q/quicken.txt index ba548cc49ef..afbd7807f40 100644 --- a/res/cardsfolder/q/quicken.txt +++ b/res/cardsfolder/q/quicken.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text A:SP$Effect | Cost$ U | Name$ Quicken effect | StaticAbilities$ QuickenStA | Triggers$ SpellCastTrig | SVars$ Quickened | SubAbility$ DBDraw | SpellDescription$ The next sorcery card you cast this turn can be cast as though it had flash. SVar:DBDraw:DB$Draw | NumCards$ 1 | SpellDescription$ Draw a card. -SVar:QuickenStA:Mode$ Continuous | Affected$ Sorcery.YouCtrl | AffectedZone$ Hand,Graveyard,Exile | AddHiddenKeyword$ HIDDEN Flash +SVar:QuickenStA:Mode$ Continuous | EffectZone$ Command | Affected$ Sorcery.YouCtrl | AffectedZone$ Hand,Graveyard,Exile | AddHiddenKeyword$ HIDDEN Flash SVar:SpellCastTrig:Mode$ SpellCast | ValidCard$ Sorcery | ValidActivatingPlayer$ You | Execute$ Quickened | Static$ True | TriggerDescription$ The next sorcery card you cast this turn can be cast as though it had flash. SVar:Quickened:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Graveyard SVar:RemAIDeck:True diff --git a/res/cardsfolder/r/radiant_kavu.txt b/res/cardsfolder/r/radiant_kavu.txt index 754a614246a..d35373a836a 100644 --- a/res/cardsfolder/r/radiant_kavu.txt +++ b/res/cardsfolder/r/radiant_kavu.txt @@ -4,7 +4,7 @@ Types:Creature Kavu Text:no text PT:3/3 A:AB$ Effect | Cost$ R G W | Name$ Radiant Kavu Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all combat damage blue creatures and black creatures would deal this turn. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature.Blue,Creature.Black | CombatDamage$ True | Description$ Prevent all combat damage blue creatures and black creatures would deal this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.Blue,Creature.Black | CombatDamage$ True | Description$ Prevent all combat damage blue creatures and black creatures would deal this turn. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/radiant_kavu.jpg diff --git a/res/cardsfolder/r/rootborn_defenses.txt b/res/cardsfolder/r/rootborn_defenses.txt index 2a0d6d048f4..8af6f41761f 100644 --- a/res/cardsfolder/r/rootborn_defenses.txt +++ b/res/cardsfolder/r/rootborn_defenses.txt @@ -6,7 +6,7 @@ A:SP$ ChooseCard | Cost$ 2 W | Defined$ You | Amount$ 1 | Choices$ Creature.toke SVar:DBCopy:DB$ CopyPermanent | Defined$ Remembered | NumCopies$ 1 | SubAbility$ DBPumpAll SVar:DBPumpAll:DB$ Effect | Name$ Rootborn Defenses Effect | StaticAbilities$ KWPump | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:KWPump:Mode$ Continuous | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN Indestructible | Description$ Creatures you control are indestructible this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN Indestructible | Description$ Creatures you control are indestructible this turn. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/rootborn_defenses.jpg SetInfo:RTR|Common|http://magiccards.info/scans/en/rtr/19.jpg diff --git a/res/cardsfolder/r/ruthless_invasion.txt b/res/cardsfolder/r/ruthless_invasion.txt index 1466c5aedc9..40f03a1f9c0 100644 --- a/res/cardsfolder/r/ruthless_invasion.txt +++ b/res/cardsfolder/r/ruthless_invasion.txt @@ -3,7 +3,7 @@ ManaCost:3 PR Types:Sorcery Text:no text A:SP$ Effect | Cost$ 3 PR | Name$ Ruthless Invasion Effect | StaticAbilities$ KWPump | AILogic$ Evasion | SpellDescription$ Nonartifact creatures can't block this turn. -SVar:KWPump:Mode$ Continuous | Affected$ Creature.nonArtifact | AddKeyword$ CARDNAME can't block. | Description$ Nonartifact creatures can't block this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.nonArtifact | AddKeyword$ CARDNAME can't block. | Description$ Nonartifact creatures can't block this turn. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/ruthless_invasion.jpg diff --git a/res/cardsfolder/s/safe_passage.txt b/res/cardsfolder/s/safe_passage.txt index ed9a0925bb2..ce297e8722d 100644 --- a/res/cardsfolder/s/safe_passage.txt +++ b/res/cardsfolder/s/safe_passage.txt @@ -3,7 +3,7 @@ ManaCost:2 W Types:Instant Text:no text A:SP$ Effect | Cost$ 2 W | Name$ Safe Passage Effect | StaticAbilities$ STPrevent | AILogic$ Fog | SpellDescription$ Prevent all damage that would be dealt to you and creatures you control this turn. -SVar:STPrevent:Mode$ PreventDamage | Target$ You,Creature.YouCtrl | Description$ Prevent all damage that would be dealt to you and creatures you control this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ You,Creature.YouCtrl | Description$ Prevent all damage that would be dealt to you and creatures you control this turn. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/safe_passage.jpg SetInfo:M11|Common|http://magiccards.info/scans/en/m11/26.jpg diff --git a/res/cardsfolder/s/scarecrow.txt b/res/cardsfolder/s/scarecrow.txt index 311b38f5a26..c4a0323fa24 100644 --- a/res/cardsfolder/s/scarecrow.txt +++ b/res/cardsfolder/s/scarecrow.txt @@ -4,7 +4,7 @@ Types:Artifact Creature Scarecrow Text:no text PT:2/2 A:AB$ Effect | Cost$ 6 T | Name$ Scarecrow Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that would be dealt to you this turn by creatures with flying. -SVar:STPrevent:Mode$ PreventDamage | Target$ You | Source$ Creature.withFlying | Description$ Prevent all damage that would be dealt to you this turn by creatures with flying. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ You | Source$ Creature.withFlying | Description$ Prevent all damage that would be dealt to you this turn by creatures with flying. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/scarecrow.jpg diff --git a/res/cardsfolder/s/scouts_warning.txt b/res/cardsfolder/s/scouts_warning.txt index 355e35858ca..0249efad034 100644 --- a/res/cardsfolder/s/scouts_warning.txt +++ b/res/cardsfolder/s/scouts_warning.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text A:SP$Effect | Cost$ W | Name$ Scout's Warning effect | StaticAbilities$ ScoutFlash | Triggers$ SpellCastTrig | SVars$ WarningGiven | SubAbility$ DBDraw | SpellDescription$ The next creature card you play this turn can be played as though it had flash. SVar:DBDraw:DB$Draw | NumCards$ 1 | SpellDescription$ Draw a card. -SVar:ScoutFlash:Mode$ Continuous | Affected$ Creature.YouCtrl | AffectedZone$ Hand,Graveyard,Exile | AddHiddenKeyword$ HIDDEN Flash +SVar:ScoutFlash:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AffectedZone$ Hand,Graveyard,Exile | AddHiddenKeyword$ HIDDEN Flash SVar:SpellCastTrig:Mode$ SpellCast | ValidCard$ Creature | ValidActivatingPlayer$ You | Execute$ WarningGiven | Static$ True | TriggerDescription$ The next creature card you play this turn can be played as though it had flash. SVar:WarningGiven:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Graveyard SVar:RemAIDeck:True diff --git a/res/cardsfolder/s/silence.txt b/res/cardsfolder/s/silence.txt index 62ee70ff879..34a6fc6378b 100644 --- a/res/cardsfolder/s/silence.txt +++ b/res/cardsfolder/s/silence.txt @@ -3,7 +3,7 @@ ManaCost:W Types:Instant Text:no text A:SP$ Effect | Cost$ W | Name$ Silence Effect | StaticAbilities$ STCantBeCast | AILogic$ BeginningOfOppTurn | SpellDescription$ Your opponents can't cast spells this turn. (Spells cast before this resolves are unaffected.) -SVar:STCantBeCast:Mode$ CantBeCast | ValidCard$ Card | Caster$ Opponent | Description$ Your opponents can't cast spells. +SVar:STCantBeCast:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Card | Caster$ Opponent | Description$ Your opponents can't cast spells. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/silence.jpg SetInfo:M11|Rare|http://magiccards.info/scans/en/m11/30.jpg diff --git a/res/cardsfolder/s/sirens_call.txt b/res/cardsfolder/s/sirens_call.txt index e77d5651c0b..63d0fafda18 100644 --- a/res/cardsfolder/s/sirens_call.txt +++ b/res/cardsfolder/s/sirens_call.txt @@ -3,7 +3,7 @@ ManaCost:U Types:Instant Text:no text A:SP$ Effect | Cost$ U | Name$ Siren's Call Effect | StaticAbilities$ KWPump | ActivationPhases$ Upkeep->BeginCombat | OpponentTurn$ True | SpellDescription$ Cast CARDNAME only during an opponent's turn, before attackers are declared. Creatures the active player controls attack this turn if able. At the beginning of the next end step, destroy all non-Wall creatures that player controls that didn't attack this turn. Ignore this effect for each creature the player didn't control continuously since the beginning of the turn. | SubAbility$ DestroyPacifist -SVar:KWPump:Mode$ Continuous | Affected$ Creature.ActivePlayerCtrl | AddHiddenKeyword$ CARDNAME attacks each turn if able. | Description$ Creatures the active player controls attack this turn if able. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.ActivePlayerCtrl | AddHiddenKeyword$ CARDNAME attacks each turn if able. | Description$ Creatures the active player controls attack this turn if able. SVar:DestroyPacifist:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigDestroy | TriggerDescription$ At the beginning of the next end step, destroy all non-Wall creatures that player controls that didn't attack this turn. SVar:TrigDestroy:DB$DestroyAll | ValidCards$ Creature.ActivePlayerCtrl+notAttackedThisTurn+nonWall+notFirstTurnControlled | SubAbility$ DBCleanup SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True diff --git a/res/cardsfolder/s/sivvis_ruse.txt b/res/cardsfolder/s/sivvis_ruse.txt index dc29e52c103..b828aff0477 100644 --- a/res/cardsfolder/s/sivvis_ruse.txt +++ b/res/cardsfolder/s/sivvis_ruse.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text S:Mode$ Continuous | Affected$ Card.Self | EffectZone$ All | AddHiddenKeyword$ HIDDEN Alternative Cost 0 | CheckSVar$ X | CheckSecondSVar$ Y | Description$ If an opponent controls a Mountain and you control a Plains, you may cast CARDNAME without paying its mana cost. A:SP$ Effect | Cost$ 2 W W | Name$ Sivvi's Ruse Effect | StaticAbilities$ STPrevent | SpellDescription$ Prevent all damage that would be dealt this turn to creatures you control. -SVar:STPrevent:Mode$ PreventDamage | Target$ Creature.YouCtrl | Description$ Prevent all damage that would be dealt this turn to creatures you control. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Target$ Creature.YouCtrl | Description$ Prevent all damage that would be dealt this turn to creatures you control. SVar:X:Count$Valid Mountain.OppCtrl SVar:Y:Count$Valid Plains.YouCtrl SVar:RemAIDeck:True diff --git a/res/cardsfolder/s/snag.txt b/res/cardsfolder/s/snag.txt index 54db8208c50..2ac6c9ea2c1 100644 --- a/res/cardsfolder/s/snag.txt +++ b/res/cardsfolder/s/snag.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text SVar:AltCost:Cost$ Discard<1/Forest> A:SP$ Effect | Cost$ 3 G | Name$ Snag Effect | StaticAbilities$ STPrevent | AILogic$ Fog | SpellDescription$ Prevent all combat damage that would be dealt by unblocked creatures this turn. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature.unblocked | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt by unblocked creatures this turn. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.unblocked | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt by unblocked creatures this turn. SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/snag.jpg SetInfo:PCY|Uncommon|http://magiccards.info/scans/en/pr/124.jpg diff --git a/res/cardsfolder/s/solfatara.txt b/res/cardsfolder/s/solfatara.txt index ce401b68950..c28035f5ced 100644 --- a/res/cardsfolder/s/solfatara.txt +++ b/res/cardsfolder/s/solfatara.txt @@ -3,7 +3,7 @@ ManaCost:2 R Types:Instant Text:no text A:SP$ Effect | Cost$ 2 R | ValidTgts$ Player | Name$ Solfatara Effect | StaticAbilities$ STCantPlayLand | RememberObjects$ Targeted | AILogic$ BeginningOfOppTurn | SubAbility$ DBDraw | SpellDescription$ Target player can't play land cards this turn. -SVar:STCantPlayLand:Mode$ CantPlayLand | Player$ Player.IsRemembered | Description$ Target player can't play land cards this turn. +SVar:STCantPlayLand:Mode$ CantPlayLand | EffectZone$ Command | Player$ Player.IsRemembered | Description$ Target player can't play land cards this turn. SVar:DBDraw:DB$Draw | NumCards$ 1 | NextUpkeep$ True | SpellDescription$ Draw a card at the beginning of the next upkeep. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/solfatara.jpg diff --git a/res/cardsfolder/s/sorin_lord_of_innistrad.txt b/res/cardsfolder/s/sorin_lord_of_innistrad.txt index ebaffdee094..d94f7eb92fb 100644 --- a/res/cardsfolder/s/sorin_lord_of_innistrad.txt +++ b/res/cardsfolder/s/sorin_lord_of_innistrad.txt @@ -5,7 +5,7 @@ Text:no text Loyalty:3 A:AB$ Token | Cost$ AddCounter<1/LOYALTY> | TokenAmount$ 1 | TokenImage$ b 1 1 vampire dka | TokenName$ Vampire | TokenColors$ Black | TokenTypes$ Creature,Vampire | TokenOwner$ You | TokenPower$ 1 | TokenToughness$ 1 | TokenKeywords$ Lifelink | Planeswalker$ True | SpellDescription$ Put a 1/1 black Vampire creature token with lifelink onto the battlefield. A:AB$ Effect | Cost$ SubCounter<2/LOYALTY> | Name$ Sorin, Lord of Innistrad emblem | Image$ sorin_lord_of_innistrad_emblem | StaticAbilities$ STPump | Planeswalker$ True | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "Creatures you control get +1/+0." -SVar:STPump:Mode$ Continuous | Affected$ Creature.YouCtrl | AffectedZone$ Battlefield | AddPower$ 1 +SVar:STPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddPower$ 1 A:AB$ Destroy | Cost$ SubCounter<6/LOYALTY> | Planeswalker$ True | Ultimate$ True | ValidTgts$ Creature,Planeswalker.Other | TargetMin$ 0 | TargetMax$ 3 | TgtPrompt$ Select target creatures or other planeswalkers | RememberTargets$ True | ForgetOtherTargets$ True | SubAbility$ DBChangeZoneAll | SpellDescription$ Destroy up to 3 target creatures and/or other planeswalkers. Return each card put into a graveyard this way to the battlefield under your control. SVar:DBChangeZoneAll:DB$ ChangeZoneAll | Cost$ 0 | ChangeType$ Card.IsRemembered | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | SubAbility$ DBCleanup SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True diff --git a/res/cardsfolder/s/stigma_lasher.txt b/res/cardsfolder/s/stigma_lasher.txt index b02d2ec4d30..8b048633efb 100644 --- a/res/cardsfolder/s/stigma_lasher.txt +++ b/res/cardsfolder/s/stigma_lasher.txt @@ -6,7 +6,7 @@ PT:2/2 K:Wither T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | Execute$ TrigEffect | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals damage to a player, that player can't gain life for the rest of the game. SVar:TrigEffect:AB$Effect | Cost$ 0 | Name$ Stigma Lasher Effect | StaticAbilities$ CantGainLife | Duration$ Permanent | RememberObjects$ TriggeredAffected -SVar:CantGainLife:Mode$ Continuous | Affected$ Player.isRemembered | AddKeyword$ You can't gain life. | Description$ The damaged player can't gain life for the rest of the game. +SVar:CantGainLife:Mode$ Continuous | EffectZone$ Command | Affected$ Player.isRemembered | AddKeyword$ You can't gain life. | Description$ The damaged player can't gain life for the rest of the game. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/stigma_lasher.jpg SetInfo:EVE|Rare|http://magiccards.info/scans/en/eve/62.jpg diff --git a/res/cardsfolder/t/tamiyo_the_moon_sage.txt b/res/cardsfolder/t/tamiyo_the_moon_sage.txt index 030e3a865eb..d24ce15c5a7 100644 --- a/res/cardsfolder/t/tamiyo_the_moon_sage.txt +++ b/res/cardsfolder/t/tamiyo_the_moon_sage.txt @@ -8,8 +8,8 @@ SVar:TamiyoPump:DB$Pump | Defined$ Targeted | Permanent$ True | KW$ HIDDEN This A:AB$ Draw | Cost$ SubCounter<2/LOYALTY> | ValidTgts$ Player | TgtPrompt$ Select target player | Defined$ You | NumCards$ X | References$ X | Planeswalker$ True | SpellDescription$ Draw a card for each tapped creature target player controls. SVar:X:Count$Valid Creature.tapped+TargetedPlayerCtrl A:AB$ Effect | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Ultimate$ True | Name$ Tamiyo, the Moon Sage emblem | Image$ tamiyo_the_moon_sage_emblem | StaticAbilities$ UnlimitedHand | Triggers$ TamiyoCardToGrave | SVars$ TamiyoReturn | Stackable$ False | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "You have no maximum hand size" and "Whenever a card is put into your graveyard from anywhere, you may return it to your hand." -SVar:UnlimitedHand:Mode$ Continuous | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. -SVar:TamiyoCardToGrave:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Card.nonToken+YouCtrl | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TamiyoReturn | TriggerDescription$ Whenever a card is put into your graveyard from anywhere, you may return it to your hand. +SVar:UnlimitedHand:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. +SVar:TamiyoCardToGrave:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Card.nonToken+YouCtrl | OptionalDecider$ You | Execute$ TamiyoReturn | TriggerDescription$ Whenever a card is put into your graveyard from anywhere, you may return it to your hand. SVar:TamiyoReturn:AB$ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Hand SVar:Rarity:Mythic SVar:Picture:http://www.wizards.com/global/images/magic/general/tamiyo_the_moon_sage.jpg diff --git a/res/cardsfolder/t/tanglesap.txt b/res/cardsfolder/t/tanglesap.txt index d4a18f5ea5f..c5704fbb4fd 100644 --- a/res/cardsfolder/t/tanglesap.txt +++ b/res/cardsfolder/t/tanglesap.txt @@ -3,7 +3,7 @@ ManaCost:1 G Types:Instant Text:no text A:SP$ Effect | Cost$ 1 G | Name$ Tanglesap Effect | StaticAbilities$ STPrevent | AILogic$ Fog | SpellDescription$ Prevent all combat damage that would be dealt this turn by creatures without trample. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature.withoutTrample | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt this turn by creatures without trample. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.withoutTrample | CombatDamage$ True | Description$ Prevent all combat damage that would be dealt this turn by creatures without trample. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/tanglesap.jpg SetInfo:ZEN|Common|http://magiccards.info/scans/en/zen/186.jpg diff --git a/res/cardsfolder/t/tectonic_rift.txt b/res/cardsfolder/t/tectonic_rift.txt index 337b4b2c0f5..3d9f2d57008 100644 --- a/res/cardsfolder/t/tectonic_rift.txt +++ b/res/cardsfolder/t/tectonic_rift.txt @@ -4,7 +4,7 @@ Types:Sorcery Text:no text A:SP$ Destroy | Cost$ 3 R | ValidTgts$ Land | TgtPrompt$ Select target land | SubAbility$ DBEffect | SpellDescription$ Destroy target land. Creatures without flying can't block this turn. SVar:DBEffect:DB$Effect | Name$ Tectonic Rift Effect | StaticAbilities$ KWPump -SVar:KWPump:Mode$ Continuous | Affected$ Creature.withoutFlying | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | Description$ Creatures without flying can't block this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.withoutFlying | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | Description$ Creatures without flying can't block this turn. SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/tectonic_rift.jpg SetInfo:M12|Uncommon|http://magiccards.info/scans/en/m12/157.jpg diff --git a/res/cardsfolder/t/terrifying_presence.txt b/res/cardsfolder/t/terrifying_presence.txt index f258c708f64..521a52d0d92 100644 --- a/res/cardsfolder/t/terrifying_presence.txt +++ b/res/cardsfolder/t/terrifying_presence.txt @@ -3,7 +3,7 @@ ManaCost:1 G Types:Instant Text:no text A:SP$ Effect | Cost$ 1 G | Name$ Terrifying Presence Effect | ValidTgts$ Creature | TgtPrompt$ Select target creature | StaticAbilities$ STPrevent | RememberObjects$ Targeted | SpellDescription$ Prevent all damage that would be dealt this turn by creatures other than target creature. -SVar:STPrevent:Mode$ PreventDamage | Source$ Creature.IsNotRemembered | CombatDamage$ True | Description$ Prevent all damage that would be dealt this turn by creatures other than target creature. +SVar:STPrevent:Mode$ PreventDamage | EffectZone$ Command | Source$ Creature.IsNotRemembered | CombatDamage$ True | Description$ Prevent all damage that would be dealt this turn by creatures other than target creature. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/terrifying_presence.jpg diff --git a/res/cardsfolder/t/titanias_song.txt b/res/cardsfolder/t/titanias_song.txt index f182f7b927b..37defe43903 100644 --- a/res/cardsfolder/t/titanias_song.txt +++ b/res/cardsfolder/t/titanias_song.txt @@ -5,7 +5,7 @@ Text:no text S:Mode$ Continuous | Affected$ Artifact.nonCreature | SetPower$ AffectedX | SetToughness$ AffectedX | AddType$ Creature | RemoveAllAbilities$ True | Description$ Each noncreature artifact is an artifact creature with power and toughness each equal to its converted mana cost. T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigEffect | Static$ True | TriggerDescription$ If CARDNAME leaves the battlefield, this effect continues until end of turn. SVar:TrigEffect:AB$ Effect | Cost$ 0 | Name$ Titania's Song Effect | StaticAbilities$ KWAnimateAll | SVars$ AffectedX | References$ AffectedX -SVar:KWAnimateAll:Mode$ Continuous | Affected$ Artifact.nonCreature | SetPower$ AffectedX | SetToughness$ AffectedX | AddType$ Creature | RemoveAllAbilities$ True | Description$ Each noncreature artifact is an artifact creature with power and toughness each equal to its converted mana cost. +SVar:KWAnimateAll:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Artifact.nonCreature | SetPower$ AffectedX | SetToughness$ AffectedX | AddType$ Creature | RemoveAllAbilities$ True | Description$ Each noncreature artifact is an artifact creature with power and toughness each equal to its converted mana cost. SVar:AffectedX:Count$CardManaCost SVar:PlayMain1:TRUE SVar:RemRandomDeck:True diff --git a/res/cardsfolder/t/turf_wound.txt b/res/cardsfolder/t/turf_wound.txt index 174d506b769..4b7a1ac9925 100644 --- a/res/cardsfolder/t/turf_wound.txt +++ b/res/cardsfolder/t/turf_wound.txt @@ -3,7 +3,7 @@ ManaCost:2 R Types:Instant Text:no text A:SP$ Effect | Cost$ 2 R | ValidTgts$ Player | Name$ Turf Wound Effect | StaticAbilities$ STCantPlayLand | RememberObjects$ Targeted | AILogic$ BeginningOfOppTurn | SubAbility$ DBDraw | SpellDescription$ Target player can't play land cards this turn. -SVar:STCantPlayLand:Mode$ CantPlayLand | Player$ Player.IsRemembered | Description$ Target player can't play land cards this turn. +SVar:STCantPlayLand:Mode$ CantPlayLand | EffectZone$ Command | Player$ Player.IsRemembered | Description$ Target player can't play land cards this turn. SVar:DBDraw:DB$Draw | NumCards$ 1 | SpellDescription$ Draw a card. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/turf_wound.jpg diff --git a/res/cardsfolder/u/undergrowth.txt b/res/cardsfolder/u/undergrowth.txt index 7141f60470a..bbcecf2b777 100644 --- a/res/cardsfolder/u/undergrowth.txt +++ b/res/cardsfolder/u/undergrowth.txt @@ -4,7 +4,7 @@ Types:Instant Text:As an additional cost to cast Undergrowth, you may pay 2 R. A:SP$ Fog | Cost$ G | SpellDescription$ Prevent all combat damage that would be dealt this turn. A:SP$ Effect | Cost$ 2 R G | Name$ Undergrowth Effect | StaticAbilities$ KWPump | SpellDescription$ If its additional cost was paid, CARDNAME doesn't affect combat damage that would be dealt by red creatures. -SVar:KWPump:Mode$ Continuous | Affected$ Creature.nonRed | AddHiddenKeyword$ HIDDEN Prevent all combat damage that would be dealt by CARDNAME. | Description$ Prevent all combat damage this turn except that from red creatures. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.nonRed | AddHiddenKeyword$ HIDDEN Prevent all combat damage that would be dealt by CARDNAME. | Description$ Prevent all combat damage this turn except that from red creatures. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/undergrowth.jpg diff --git a/res/cardsfolder/u/unstable_footing.txt b/res/cardsfolder/u/unstable_footing.txt index 758ca46b0c1..70cd04d1225 100644 --- a/res/cardsfolder/u/unstable_footing.txt +++ b/res/cardsfolder/u/unstable_footing.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text K:Kicker 3 R A:SP$ Effect | Cost$ R | Name$ Unstable Footing | StaticAbilities$ STCantPrevent | SubAbility$ DBDamage | SpellDescription$ Damage can't be prevented this turn. If CARDNAME was kicked, it deals 5 damage to target player. -SVar:STCantPrevent:Mode$ Continuous | GlobalRule$ Damage can't be prevented. | Description$ Damage can't be prevented. +SVar:STCantPrevent:Mode$ Continuous | EffectZone$ Command | GlobalRule$ Damage can't be prevented. | Description$ Damage can't be prevented. SVar:DBDamage:DB$ DealDamage | ValidTgts$ Player | TgtPrompt$ Select another target player | NumDmg$ 5 | NoPrevention$ True | Condition$ Kicked | ConditionDescription$ If it was kicked, SVar:RemAIDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/v/veiling_oddity.txt b/res/cardsfolder/v/veiling_oddity.txt index 48229c6ae5c..0ee20cb7d75 100644 --- a/res/cardsfolder/v/veiling_oddity.txt +++ b/res/cardsfolder/v/veiling_oddity.txt @@ -6,7 +6,7 @@ PT:2/3 K:Suspend:4:1 U T:Mode$ CounterRemoved | ValidCard$ Card.Self | TriggerZones$ Exile | CounterType$ TIME | Execute$ TrigEffect | IsPresent$ Card.Self+counters_GE1_TIME | PresentZone$ Exile | PresentCompare$ EQ0 | TriggerDescription$ When the last time counter is removed from CARDNAME while it's exiled, creatures are unblockable this turn. SVar:TrigEffect:AB$ Effect | Cost$ 0 | Name$ Veiling Oddity Effect | StaticAbilities$ KWPump -SVar:KWPump:Mode$ Continuous | Affected$ Creature | AddHiddenKeyword$ HIDDEN Unblockable | Description$ creatures are unblockable this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature | AddHiddenKeyword$ HIDDEN Unblockable | Description$ creatures are unblockable this turn. SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/veiling_oddity.jpg SetInfo:PLC|Common|http://magiccards.info/scans/en/pc/51.jpg diff --git a/res/cardsfolder/v/veilstone_amulet.txt b/res/cardsfolder/v/veilstone_amulet.txt index 6d80f5ec0f5..b3208a3897d 100644 --- a/res/cardsfolder/v/veilstone_amulet.txt +++ b/res/cardsfolder/v/veilstone_amulet.txt @@ -4,7 +4,7 @@ Types:Artifact Text:no text T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigEffect | TriggerDescription$ Whenever you cast a spell, creatures you control can't be the targets of spells or abilities your opponents control this turn. SVar:TrigEffect:AB$Effect | Cost$ 0 | Name$ Veilstone Amulet Effect | StaticAbilities$ CantTarget -SVar:CantTarget:Mode$ CantTarget | ValidCard$ Creature.YouCtrl | Activator$ Opponent | Description$ Creatures you control can't be the targets of spells or abilities your opponents control +SVar:CantTarget:Mode$ CantTarget | EffectZone$ Command | ValidCard$ Creature.YouCtrl | Activator$ Opponent | Description$ Creatures you control can't be the targets of spells or abilities your opponents control SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/veilstone_amulet.jpg diff --git a/res/cardsfolder/v/venser_the_sojourner.txt b/res/cardsfolder/v/venser_the_sojourner.txt index 835b7001960..10adf620bf6 100644 --- a/res/cardsfolder/v/venser_the_sojourner.txt +++ b/res/cardsfolder/v/venser_the_sojourner.txt @@ -8,7 +8,7 @@ SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ Tr SVar:TrigReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Battlefield | Defined$ Remembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True A:AB$ Effect | Cost$ SubCounter<1/LOYALTY> | Planeswalker$ True | Name$ Venser, the Sojourner Effect | Image$ venser_the_sojourner_emblem | StaticAbilities$ KWPump | SpellDescription$ Creatures are unblockable this turn. -SVar:KWPump:Mode$ Continuous | Affected$ Creature | AddHiddenKeyword$ HIDDEN Unblockable | Description$ creatures are unblockable this turn. +SVar:KWPump:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature | AddHiddenKeyword$ HIDDEN Unblockable | Description$ creatures are unblockable this turn. A:AB$ Effect | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Ultimate$ True | Name$ Venser, the Sojourner emblem | Triggers$ TrigSpellCast | SVars$ EffSpellCast | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "Whenever you cast a spell, exile target permanent." SVar:TrigSpellCast:Mode$ SpellCast | ValidActivatingPlayer$ You | Execute$ EffSpellCast | TriggerDescription$ Whenever you cast a spell, exile target permanent. SVar:EffSpellCast:AB$ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Permanent diff --git a/res/cardsfolder/w/winding_canyons.txt b/res/cardsfolder/w/winding_canyons.txt index b5e29e40191..4bc765a3f2e 100644 --- a/res/cardsfolder/w/winding_canyons.txt +++ b/res/cardsfolder/w/winding_canyons.txt @@ -4,7 +4,7 @@ Types:Land Text:no text A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add 1 to your mana pool. A:AB$ Effect | Cost$ 2 T | Name$ Winding Canyons Effect | StaticAbilities$ GiveFlash | SpellDescription$ Until end of turn, you may play creature cards as though they had flash. -SVar:GiveFlash:Mode$ Continuous | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN Flash | AffectedZone$ Exile,Graveyard,Hand,Library | Description$ Until end of turn, you may play creature cards as though they had flash. +SVar:GiveFlash:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddHiddenKeyword$ HIDDEN Flash | AffectedZone$ Exile,Graveyard,Hand,Library | Description$ Until end of turn, you may play creature cards as though they had flash. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/winding_canyons.jpg diff --git a/res/cardsfolder/x/xantid_swarm.txt b/res/cardsfolder/x/xantid_swarm.txt index b4bd793854d..7ecf4caea3e 100644 --- a/res/cardsfolder/x/xantid_swarm.txt +++ b/res/cardsfolder/x/xantid_swarm.txt @@ -6,7 +6,7 @@ PT:0/1 K:Flying T:Mode$ Attacks | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigEffect | TriggerDescription$ When CARDNAME attacks, defending player can't cast spells this turn. SVar:TrigEffect:AB$ Effect | Cost$ 0 | Name$ Xantid Swarm Effect | StaticAbilities$ CantBeCast -SVar:CantBeCast:Mode$ CantBeCast | ValidCard$ Card | Caster$ DefendingPlayer | Description$ Defending player can't cast spells. +SVar:CantBeCast:Mode$ CantBeCast | EffectZone$ Command | ValidCard$ Card | Caster$ DefendingPlayer | Description$ Defending player can't cast spells. SVar:RemRandomDeck:True SVar:HasAttackEffect:TRUE SVar:Rarity:Rare diff --git a/res/cardsfolder/y/yawgmoths_will.txt b/res/cardsfolder/y/yawgmoths_will.txt index 9f9e8cded79..f8b07ae6e08 100644 --- a/res/cardsfolder/y/yawgmoths_will.txt +++ b/res/cardsfolder/y/yawgmoths_will.txt @@ -3,7 +3,7 @@ ManaCost:2 B Types:Sorcery Text:no text A:SP$ Effect | Cost$ 2 B | Name$ Yawgmoth's Will Effect | StaticAbilities$ STPlay | Keywords$ Exile | SpellDescription$ Until end of turn, you may play cards from your graveyard. If a card would be put into your graveyard from anywhere this turn, exile that card instead. -SVar:STPlay:Mode$ Continuous | Affected$ Card.YouCtrl | AffectedZone$ Graveyard | AddHiddenKeyword$ HIDDEN May be played | Description$ You may play cards from your graveyard. +SVar:STPlay:Mode$ Continuous | EffectZone$ Command | Affected$ Card.YouCtrl | AffectedZone$ Graveyard | AddHiddenKeyword$ HIDDEN May be played | Description$ You may play cards from your graveyard. SVar:Exile:If a card would be put into your graveyard from anywhere, exile it instead. SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/layouts/home_default.xml b/res/layouts/home_default.xml index 2a661eed3dd..50c5ac0b7c6 100644 --- a/res/layouts/home_default.xml +++ b/res/layouts/home_default.xml @@ -21,5 +21,6 @@ HOME_CONSTRUCTED HOME_DRAFT HOME_SEALED + HOME_VANGUARD \ No newline at end of file diff --git a/res/layouts/match_default.xml b/res/layouts/match_default.xml index 95a9086682e..69ee7243866 100644 --- a/res/layouts/match_default.xml +++ b/res/layouts/match_default.xml @@ -14,6 +14,7 @@ FIELD_1 + COMMAND_1 HAND_0 @@ -23,6 +24,7 @@ FIELD_0 + COMMAND_0 CARD_PICTURE diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index a6c6168480a..015d4b2727d 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -8058,7 +8058,7 @@ public class Card extends GameEntity implements Comparable { } // Prevent Damage static abilities - for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)) { + for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { final ArrayList staticAbilities = ca.getStaticAbilities(); for (final StaticAbility stAb : staticAbilities) { restDamage = stAb.applyAbility("PreventDamage", source, this, restDamage, isCombat); @@ -8844,7 +8844,7 @@ public class Card extends GameEntity implements Comparable { } // CantTarget static abilities - for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)) { + for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { final ArrayList staticAbilities = ca.getStaticAbilities(); for (final StaticAbility stAb : staticAbilities) { if (stAb.applyAbility("CantTarget", this, sa)) { diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index 9b689a9d721..e20ca507f0f 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -212,7 +212,8 @@ public class GameAction { } // Tokens outside the battlefield disappear immediately. - if (copied.isToken() && !zoneTo.is(ZoneType.Battlefield)) { + if ((copied.isToken() && !zoneTo.is(ZoneType.Battlefield) + && !((copied.isType("Emblem") || copied.isType("Effect")) && zoneTo.is(ZoneType.Command)))) { zoneTo.remove(copied); } @@ -778,6 +779,9 @@ public class GameAction { } else if (name.equals(ZoneType.Ante)) { final PlayerZone ante = c.getOwner().getZone(ZoneType.Ante); return this.moveTo(ante, c); + } else if (name.equals(ZoneType.Command)) { + final PlayerZone command = c.getOwner().getZone(ZoneType.Command); + return this.moveTo(command, c); } else { return this.moveToStack(c); } @@ -1916,6 +1920,7 @@ public class GameAction { List cardsOnBattlefield = Lists.newArrayList(game.getCardsIn(ZoneType.Battlefield)); cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Stack)); + cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Command)); if (!cardsOnBattlefield.contains(originalCard)) { cardsOnBattlefield.add(originalCard); } diff --git a/src/main/java/forge/card/CardRules.java b/src/main/java/forge/card/CardRules.java index efbbfa7ed89..4218cf5fc6d 100644 --- a/src/main/java/forge/card/CardRules.java +++ b/src/main/java/forge/card/CardRules.java @@ -46,6 +46,10 @@ public final class CardRules { private String toughness = null; private String loyalty = null; + + //Vanguard avatar modifiers + private Integer life = null; + private Integer hand = null; Map setsPrinted = null; @@ -256,6 +260,15 @@ public final class CardRules { this.iToughness = StringUtils.isNumeric(this.toughness) ? Integer.parseInt(this.toughness) : 0; } else if (this.getType().isPlaneswalker()) { this.loyalty = this.characteristics.getPtLine(); + } else if (this.getType().isVanguard()) { + String pt = this.characteristics.getPtLine(); + final int slashPos = this.characteristics.getPtLine() == null ? -1 : this.characteristics.getPtLine() + .indexOf('/'); + if (slashPos == -1) { + throw new RuntimeException(String.format("Vanguard '%s' has bad hand/life stats", this.getName())); + } + this.hand = Integer.parseInt(pt.substring(0,pt.indexOf('/'))); + this.life = Integer.parseInt(pt.substring(pt.indexOf('/')+1)); } if (this.characteristics.getSetsData().isEmpty()) { @@ -386,6 +399,22 @@ public final class CardRules { public List getKeywords() { return characteristics.getKeywords(); } + + /** + * @return the hand + */ + public Integer getHand() { + return hand; + } + + /** + * @return the life + */ + public Integer getLife() { + return life; + } + + } diff --git a/src/main/java/forge/card/CardRulesReader.java b/src/main/java/forge/card/CardRulesReader.java index 798cfb92fce..a342c935f7d 100644 --- a/src/main/java/forge/card/CardRulesReader.java +++ b/src/main/java/forge/card/CardRulesReader.java @@ -111,6 +111,12 @@ public class CardRulesReader { this.characteristics[this.curCharacteristics].setDeckNeeds(CardRulesReader.getValueAfterKey(line, "DeckNeeds:")); } break; + + case 'H': + if(line.startsWith("HandLifeModifier:")) { + this.characteristics[this.curCharacteristics].setPtLine(CardRulesReader.getValueAfterKey(line, "HandLifeModifier:")); + } + break; case 'K': if (line.startsWith("K:")) { diff --git a/src/main/java/forge/card/CardType.java b/src/main/java/forge/card/CardType.java index 387c0650dde..561b0281049 100644 --- a/src/main/java/forge/card/CardType.java +++ b/src/main/java/forge/card/CardType.java @@ -203,6 +203,15 @@ public final class CardType implements Comparable { public boolean isSorcery() { return this.coreType.contains(CardCoreType.Sorcery); } + + /** + * Checks if is vanguard. + * + * @return true if vanguard + */ + public boolean isVanguard() { + return this.coreType.contains(CardCoreType.Vanguard); + } /** * Checks if is enchantment. diff --git a/src/main/java/forge/card/abilityfactory/effects/EffectEffect.java b/src/main/java/forge/card/abilityfactory/effects/EffectEffect.java index f4b075546a4..5443c46c914 100644 --- a/src/main/java/forge/card/abilityfactory/effects/EffectEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/EffectEffect.java @@ -14,6 +14,7 @@ import forge.card.trigger.Trigger; import forge.card.trigger.TriggerHandler; import forge.card.trigger.TriggerType; import forge.game.player.Player; +import forge.game.zone.ZoneType; public class EffectEffect extends SpellEffect { @@ -223,7 +224,7 @@ public class EffectEffect extends SpellEffect { // TODO: Add targeting to the effect so it knows who it's dealing with Singletons.getModel().getGame().getTriggerHandler().suppressMode(TriggerType.ChangesZone); - Singletons.getModel().getGame().getAction().moveToPlay(eff); + Singletons.getModel().getGame().getAction().moveTo(ZoneType.Command, eff); Singletons.getModel().getGame().getTriggerHandler().clearSuppression(TriggerType.ChangesZone); } diff --git a/src/main/java/forge/card/spellability/AbilityActivated.java b/src/main/java/forge/card/spellability/AbilityActivated.java index 3c2d16410a0..70ab2e7f7dd 100644 --- a/src/main/java/forge/card/spellability/AbilityActivated.java +++ b/src/main/java/forge/card/spellability/AbilityActivated.java @@ -93,7 +93,7 @@ public abstract class AbilityActivated extends SpellAbility implements java.io.S } // CantBeActivated static abilities - for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)) { + for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { final ArrayList staticAbilities = ca.getStaticAbilities(); for (final StaticAbility stAb : staticAbilities) { if (stAb.applyAbility("CantBeActivated", c, this)) { diff --git a/src/main/java/forge/card/spellability/Spell.java b/src/main/java/forge/card/spellability/Spell.java index 793b52983ce..d715ef174eb 100644 --- a/src/main/java/forge/card/spellability/Spell.java +++ b/src/main/java/forge/card/spellability/Spell.java @@ -119,7 +119,7 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable } // CantBeCast static abilities - final List allp = new ArrayList(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)); + final List allp = new ArrayList(Singletons.getModel().getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command"))); allp.add(card); for (final Card ca : allp) { final ArrayList staticAbilities = ca.getStaticAbilities(); diff --git a/src/main/java/forge/deck/Deck.java b/src/main/java/forge/deck/Deck.java index 5df67228afe..4db81fdf680 100644 --- a/src/main/java/forge/deck/Deck.java +++ b/src/main/java/forge/deck/Deck.java @@ -62,6 +62,9 @@ public class Deck extends DeckBase { private final DeckSection main; private final DeckSection sideboard; + private final DeckSection commander; + private final DeckSection planes; + private final DeckSection schemes; // gameType is from Constant.GameType, like GameType.Regular /** @@ -82,6 +85,9 @@ public class Deck extends DeckBase { super(name0); this.main = new DeckSection(); this.sideboard = new DeckSection(); + this.commander = new DeckSection(); + this.planes = new DeckSection(); + this.schemes = new DeckSection(); } /** @@ -197,7 +203,9 @@ public class Deck extends DeckBase { d.getMain().set(Deck.readCardList(sections.get("main"))); d.getSideboard().set(Deck.readCardList(sections.get("sideboard"))); - + d.getCommander().set(Deck.readCardList(sections.get("commander"))); + d.getPlanes().set(Deck.readCardList(sections.get("planes"))); + d.getSchemes().set(Deck.readCardList(sections.get("schemes"))); return d; } @@ -270,6 +278,15 @@ public class Deck extends DeckBase { out.add(String.format("%s", "[sideboard]")); out.addAll(Deck.writeCardPool(this.getSideboard())); + + out.add(String.format("%s", "[commander]")); + out.addAll(Deck.writeCardPool(this.getCommander())); + + out.add(String.format("%s", "[planes]")); + out.addAll(Deck.writeCardPool(this.getPlanes())); + + out.add(String.format("%s", "[schemes]")); + out.addAll(Deck.writeCardPool(this.getSchemes())); return out; } @@ -326,9 +343,70 @@ public class Deck extends DeckBase { return false; } + if(type == GameType.Commander) + {//Must contain exactly 1 legendary Commander and no sideboard. + //TODO:Enforce color identity + if(getCommander().countAll() != 1) + return false; + + if(!getCommander().toFlatList().get(0).getType().contains("Legendary")) + return false; + + //No sideboarding in Commander + if(getSideboard().countAll() > 0) + return false; + } + else if(type == GameType.Planechase) + {//Must contain at least 10 planes/phenomenons, but max 2 phenomenons. Singleton. + if(getPlanes().countAll() < 10) + return false; + int phenoms = 0; + for(CardPrinted cp : getPlanes().toFlatList()) + { + if(cp.getType().contains("Phenomenon")) + phenoms++; + if(getPlanes().count(cp) > 1) + return false; + } + if(phenoms > 2) + return false; + } + else if(type == GameType.Archenemy) + {//Must contain at least 20 schemes, max 2 of each. + if(getSchemes().countAll() < 20) + return false; + + for(CardPrinted cp : getSchemes().toFlatList()) + { + if(getSchemes().count(cp) > 2) + return false; + } + } + return true; } + /** + * @return the commander + */ + public DeckSection getCommander() { + return commander; + } + + /** + * @return the planes + */ + public DeckSection getPlanes() { + return planes; + } + + /** + * @return the schemes + */ + public DeckSection getSchemes() { + return schemes; + } + public static final Function FN_NAME_SELECTOR = new Function() { @Override public String apply(Deck arg1) { diff --git a/src/main/java/forge/deck/DeckRecognizer.java b/src/main/java/forge/deck/DeckRecognizer.java index 6b236800db7..29c86a68a5b 100644 --- a/src/main/java/forge/deck/DeckRecognizer.java +++ b/src/main/java/forge/deck/DeckRecognizer.java @@ -245,6 +245,18 @@ public class DeckRecognizer { if (line.toLowerCase().contains("main")) { return true; } + if (line.toLowerCase().contains("commander")) { + return true; + } + if (line.toLowerCase().contains("planes")) { + return true; + } + if (line.toLowerCase().contains("schemes")) { + return true; + } + if (line.toLowerCase().contains("vanguard")) { + return true; + } return false; } diff --git a/src/main/java/forge/game/GameNew.java b/src/main/java/forge/game/GameNew.java index 5b6f6fb4ad3..11f5cda3606 100644 --- a/src/main/java/forge/game/GameNew.java +++ b/src/main/java/forge/game/GameNew.java @@ -20,6 +20,7 @@ import forge.CardPredicates; import forge.CardUtil; import forge.GameAction; import forge.Singletons; +import forge.card.cardfactory.CardFactoryUtil; import forge.card.trigger.TriggerHandler; import forge.card.trigger.TriggerType; import forge.control.input.InputControl; @@ -32,6 +33,7 @@ import forge.game.player.Player; import forge.game.zone.PlayerZone; import forge.game.zone.ZoneType; import forge.gui.match.views.VAntes; +import forge.item.CardDb; import forge.item.CardPrinted; import forge.properties.ForgePreferences.FPref; import forge.sound.Sounds; @@ -121,12 +123,12 @@ public class GameNew { for( Entry p : playersConditions.entrySet() ) { final Player player = p.getKey(); player.setStartingLife(p.getValue().getStartingLife()); + player.setMaxHandSize(p.getValue().getStartingHand()); // what if I call it for AI player? PlayerZone bf = player.getZone(ZoneType.Battlefield); - Iterable onTable = p.getValue().getCardsOnTable(); + Iterable onTable = p.getValue().getCardsOnBattlefield(); if (onTable != null) { for (final Card c : onTable) { - c.addController(player); c.setOwner(player); bf.add(c, false); c.setSickness(true); @@ -135,10 +137,22 @@ public class GameNew { } } + PlayerZone com = player.getZone(ZoneType.Command); + Iterable inCommand = p.getValue().getCardsInCommand(); + if (inCommand != null) { + for (final Card c : inCommand) { + c.setOwner(player); + com.add(c, false); + c.refreshUniqueNumber(); + } + } + prepareSingleLibrary(player, p.getValue().getDeck(), removedAnteCards, rAICards, canRandomFoil); player.updateObservers(); bf.updateObservers(); player.getZone(ZoneType.Hand).updateObservers(); + player.getZone(ZoneType.Command).updateObservers(); + player.getZone(ZoneType.Battlefield).updateObservers(); } @@ -190,7 +204,7 @@ public class GameNew { player.setNumLandsPlayed(0); // what if I call it for AI player? PlayerZone bf = player.getZone(ZoneType.Battlefield); - Iterable onTable = p.getValue().getCardsOnTable(); + Iterable onTable = p.getValue().getCardsOnBattlefield(); if (onTable != null) { for (final Card c : onTable) { c.addController(player); @@ -237,6 +251,7 @@ public class GameNew { final String nl = System.getProperty("line.separator"); final StringBuilder msg = new StringBuilder(); for (final Player p : game.getPlayers()) { + final List lib = p.getCardsIn(ZoneType.Library); Predicate goodForAnte = Predicates.not(CardPredicates.Presets.BASIC_LANDS); Card ante = Aggregates.random(Iterables.filter(lib, goodForAnte)); @@ -262,10 +277,9 @@ public class GameNew { } } - // Draw 7 cards + // Draw cards for (final Player p : game.getPlayers()) { - // Should this be p.getMaxHandSize() for Vanguard compatibility? - p.drawCards(7); + p.drawCards(p.getMaxHandSize()); } game.getPhaseHandler().setPhaseState(PhaseType.MULLIGAN); diff --git a/src/main/java/forge/game/GameState.java b/src/main/java/forge/game/GameState.java index 72a14e2f02a..af64104ee82 100644 --- a/src/main/java/forge/game/GameState.java +++ b/src/main/java/forge/game/GameState.java @@ -426,6 +426,7 @@ public class GameState { all.addAll(player.getZone(ZoneType.Library).getCards()); all.addAll(player.getZone(ZoneType.Battlefield).getCards(false)); all.addAll(player.getZone(ZoneType.Exile).getCards()); + all.addAll(player.getZone(ZoneType.Command).getCards()); } all.addAll(getStackZone().getCards()); return all; diff --git a/src/main/java/forge/game/GameType.java b/src/main/java/forge/game/GameType.java index dcfa614ffef..946d10419b9 100644 --- a/src/main/java/forge/game/GameType.java +++ b/src/main/java/forge/game/GameType.java @@ -32,6 +32,12 @@ public enum GameType { Commander(false, 100, 100, true), /** The Quest. */ Quest(true, 40), + /** The Vanguard. */ + Vanguard(false, 60), + /** The Planechase. */ + Planechase(false, 60), + /** The Archenemy. */ + Archenemy(false, 60), /** */ Gauntlet(true, 40); diff --git a/src/main/java/forge/game/MatchStartHelper.java b/src/main/java/forge/game/MatchStartHelper.java index f9012900514..df4947ad72a 100644 --- a/src/main/java/forge/game/MatchStartHelper.java +++ b/src/main/java/forge/game/MatchStartHelper.java @@ -1,10 +1,17 @@ package forge.game; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; +import com.google.common.base.Supplier; + +import forge.Card; +import forge.card.CardRules; import forge.deck.Deck; import forge.game.player.LobbyPlayer; +import forge.item.CardPrinted; /** * TODO: Write javadoc for this type. @@ -12,13 +19,35 @@ import forge.game.player.LobbyPlayer; */ public class MatchStartHelper { private final Map players = new HashMap(); - - public void addPlayer(LobbyPlayer player, PlayerStartConditions c) { + + public void addPlayer(final LobbyPlayer player, final PlayerStartConditions c) { players.put(player,c); } - public void addPlayer(LobbyPlayer player, Deck deck) { - players.put(player, new PlayerStartConditions(deck)); + public void addPlayer(final LobbyPlayer player, final Deck deck) { + PlayerStartConditions start = new PlayerStartConditions(deck); + players.put(player, start); + } + + public void addVanguardPlayer(final LobbyPlayer player, final Deck deck, final CardPrinted avatar) + { + PlayerStartConditions start = new PlayerStartConditions(deck); + + start.setStartingLife(start.getStartingLife() + avatar.getCard().getLife()); + start.setStartingHand(start.getStartingHand() + avatar.getCard().getHand()); + + start.setCardsInCommand(new Supplier>() { + + @Override + public Iterable get() { + List res = new ArrayList(); + res.add(avatar.toForgeCard()); + return res; + } + + }); + + players.put(player, start); } public Map getPlayerMap() @@ -26,5 +55,4 @@ public class MatchStartHelper { return players; } - } diff --git a/src/main/java/forge/game/PlayerStartConditions.java b/src/main/java/forge/game/PlayerStartConditions.java index 3dac637c4d9..8f388a2352c 100644 --- a/src/main/java/forge/game/PlayerStartConditions.java +++ b/src/main/java/forge/game/PlayerStartConditions.java @@ -3,13 +3,17 @@ package forge.game; import com.google.common.base.Supplier; import forge.Card; +import forge.card.CardRules; import forge.deck.Deck; +import forge.item.CardPrinted; public class PlayerStartConditions { private final Deck deck; private int startingLife = 20; - private Supplier> cardsOnTable = null; + private int startingHand = 7; + private Supplier> cardsOnBattlefield = null; + private Supplier> cardsInCommand = null; public PlayerStartConditions( Deck deck0 ) { deck = deck0; @@ -21,16 +25,44 @@ public class PlayerStartConditions { public final int getStartingLife() { return startingLife; } - public final Iterable getCardsOnTable() { - return cardsOnTable == null ? null : cardsOnTable.get(); + public final Iterable getCardsOnBattlefield() { + return cardsOnBattlefield == null ? null : cardsOnBattlefield.get(); } public final void setStartingLife(int startingLife) { this.startingLife = startingLife; } - public final void setCardsOnTable(Supplier> cardsOnTable) { - this.cardsOnTable = cardsOnTable; + public final void setCardsOnBattlefield(Supplier> cardsOnTable) { + this.cardsOnBattlefield = cardsOnTable; + } + + /** + * @return the startingHand + */ + public int getStartingHand() { + return startingHand; + } + + /** + * @param startingHand0 the startingHand to set + */ + public void setStartingHand(int startingHand0) { + this.startingHand = startingHand0; + } + + /** + * @return the cardsInCommand + */ + public Iterable getCardsInCommand() { + return cardsInCommand == null ? null : cardsInCommand.get(); + } + + /** + * @param cardsInCommand0 the cardsInCommand to set + */ + public void setCardsInCommand(Supplier> cardsInCommand0) { + this.cardsInCommand = cardsInCommand0; } diff --git a/src/main/java/forge/game/phase/CombatUtil.java b/src/main/java/forge/game/phase/CombatUtil.java index f270ee68b25..652b10e59e6 100644 --- a/src/main/java/forge/game/phase/CombatUtil.java +++ b/src/main/java/forge/game/phase/CombatUtil.java @@ -952,7 +952,7 @@ public class CombatUtil { } // CantBeActivated static abilities - for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)) { + for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { final ArrayList staticAbilities = ca.getStaticAbilities(); for (final StaticAbility stAb : staticAbilities) { if (stAb.applyAbility("CantAttack", c, defender)) { diff --git a/src/main/java/forge/game/player/Player.java b/src/main/java/forge/game/player/Player.java index f6bc113b4c4..901dd0abcae 100644 --- a/src/main/java/forge/game/player/Player.java +++ b/src/main/java/forge/game/player/Player.java @@ -668,7 +668,7 @@ public abstract class Player extends GameEntity implements Comparable { } // Prevent Damage static abilities - for (final Card ca : game.getCardsIn(ZoneType.Battlefield)) { + for (final Card ca : game.getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { final ArrayList staticAbilities = ca.getStaticAbilities(); for (final StaticAbility stAb : staticAbilities) { restDamage = stAb.applyAbility("PreventDamage", source, this, restDamage, isCombat); @@ -1895,7 +1895,7 @@ public abstract class Player extends GameEntity implements Comparable { } // CantBeCast static abilities - for (final Card ca : game.getCardsIn(ZoneType.Battlefield)) { + for (final Card ca : game.getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { final ArrayList staticAbilities = ca.getStaticAbilities(); for (final StaticAbility stAb : staticAbilities) { if (stAb.applyAbility("CantPlayLand", null, this)) { diff --git a/src/main/java/forge/game/zone/PlayerZoneBattlefield.java b/src/main/java/forge/game/zone/PlayerZoneBattlefield.java index 980223942ac..a70208561b9 100644 --- a/src/main/java/forge/game/zone/PlayerZoneBattlefield.java +++ b/src/main/java/forge/game/zone/PlayerZoneBattlefield.java @@ -84,7 +84,7 @@ public class PlayerZoneBattlefield extends PlayerZone { c.setTapped(true); } else { // ETBTapped static abilities - for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)) { + for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { for (final StaticAbility stAb : ca.getStaticAbilities()) { if (stAb.applyAbility("ETBTapped", c)) { // it enters the battlefield this way, and should diff --git a/src/main/java/forge/game/zone/ZoneType.java b/src/main/java/forge/game/zone/ZoneType.java index d074768308a..143690851fc 100644 --- a/src/main/java/forge/game/zone/ZoneType.java +++ b/src/main/java/forge/game/zone/ZoneType.java @@ -34,7 +34,7 @@ public enum ZoneType { /** Ante. */ Ante(false); - public static final List STATIC_ABILITIES_SOURCE_ZONES = Arrays.asList(new ZoneType[]{Battlefield, Graveyard, Exile/*, Hand*/}); + public static final List STATIC_ABILITIES_SOURCE_ZONES = Arrays.asList(new ZoneType[]{Battlefield, Graveyard, Exile, Command/*, Hand*/}); private final boolean holdsHiddenInfo; private ZoneType(boolean holdsHidden) { diff --git a/src/main/java/forge/gui/deckeditor/controllers/CEditorConstructed.java b/src/main/java/forge/gui/deckeditor/controllers/CEditorConstructed.java index a3249903465..663fc34874a 100644 --- a/src/main/java/forge/gui/deckeditor/controllers/CEditorConstructed.java +++ b/src/main/java/forge/gui/deckeditor/controllers/CEditorConstructed.java @@ -121,7 +121,7 @@ public final class CEditorConstructed extends ACEditorBase { @Override public void resetTables() { // Constructed mode can use all cards, no limitations. - this.getTableCatalog().setDeck(ItemPool.createFrom(CardDb.instance().getAllCards(), CardPrinted.class)); + this.getTableCatalog().setDeck(ItemPool.createFrom(CardDb.instance().getTraditionalCards(), CardPrinted.class)); this.getTableDeck().setDeck(this.controller.getModel().getMain()); } diff --git a/src/main/java/forge/gui/framework/EDocID.java b/src/main/java/forge/gui/framework/EDocID.java index fbecafe3c2c..fe9e7c20851 100644 --- a/src/main/java/forge/gui/framework/EDocID.java +++ b/src/main/java/forge/gui/framework/EDocID.java @@ -15,7 +15,6 @@ import forge.gui.home.gauntlet.VSubmenuGauntletBuild; import forge.gui.home.gauntlet.VSubmenuGauntletContests; import forge.gui.home.gauntlet.VSubmenuGauntletLoad; import forge.gui.home.gauntlet.VSubmenuGauntletQuick; -import forge.gui.home.multiplayer.VSubmenuArchenemy; import forge.gui.home.quest.VSubmenuChallenges; import forge.gui.home.quest.VSubmenuDuels; import forge.gui.home.quest.VSubmenuQuestData; @@ -27,6 +26,8 @@ import forge.gui.home.sanctioned.VSubmenuSealed; import forge.gui.home.settings.VSubmenuAvatars; import forge.gui.home.settings.VSubmenuDownloaders; import forge.gui.home.settings.VSubmenuPreferences; +import forge.gui.home.variant.VSubmenuArchenemy; +import forge.gui.home.variant.VSubmenuVanguard; import forge.gui.match.views.VAntes; import forge.gui.match.views.VCombat; import forge.gui.match.views.VDetail; @@ -74,6 +75,7 @@ public enum EDocID { /** */ HOME_CONSTRUCTED (VSubmenuConstructed.SINGLETON_INSTANCE), /** */ HOME_DRAFT (VSubmenuDraft.SINGLETON_INSTANCE), /** */ HOME_SEALED (VSubmenuSealed.SINGLETON_INSTANCE), /** */ + HOME_VANGUARD (VSubmenuVanguard.SINGLETON_INSTANCE), /** */ REPORT_MESSAGE (VMessage.SINGLETON_INSTANCE), /** */ REPORT_STACK (VStack.SINGLETON_INSTANCE), /** */ @@ -98,7 +100,16 @@ public enum EDocID { /** */ HAND_0 (null), /** */ HAND_1 (null), /** */ HAND_2 (null), /** */ - HAND_3 (null); + HAND_3 (null), /** */ + + COMMAND_0 (null), /** */ + COMMAND_1 (null), /** */ + COMMAND_2 (null), /** */ + COMMAND_3 (null), /** */ + COMMAND_4 (null), /** */ + COMMAND_5 (null), /** */ + COMMAND_6 (null), /** */ + COMMAND_7 (null); /** */ // End enum declarations, start enum methods. private IVDoc vDoc; diff --git a/src/main/java/forge/gui/home/EMenuGroup.java b/src/main/java/forge/gui/home/EMenuGroup.java index d86f494e2a5..b705cb6b935 100644 --- a/src/main/java/forge/gui/home/EMenuGroup.java +++ b/src/main/java/forge/gui/home/EMenuGroup.java @@ -11,7 +11,7 @@ public enum EMenuGroup { /** */ SANCTIONED ("Sanctioned Formats"), /** */ QUEST ("Quest Mode"), /** */ GAUNTLET ("Gauntlets"), /** */ - MULTIPLAYER ("Multiplayer"), /** */ + VARIANT ("Variant"), /** */ SETTINGS ("Game Settings"); private final String strTitle; diff --git a/src/main/java/forge/gui/home/VHomeUI.java b/src/main/java/forge/gui/home/VHomeUI.java index 592e89237ac..f2913f807d4 100644 --- a/src/main/java/forge/gui/home/VHomeUI.java +++ b/src/main/java/forge/gui/home/VHomeUI.java @@ -43,7 +43,6 @@ import forge.gui.home.gauntlet.VSubmenuGauntletBuild; import forge.gui.home.gauntlet.VSubmenuGauntletContests; import forge.gui.home.gauntlet.VSubmenuGauntletLoad; import forge.gui.home.gauntlet.VSubmenuGauntletQuick; -import forge.gui.home.multiplayer.VSubmenuArchenemy; import forge.gui.home.quest.VSubmenuChallenges; import forge.gui.home.quest.VSubmenuDuels; import forge.gui.home.quest.VSubmenuQuestData; @@ -55,6 +54,8 @@ import forge.gui.home.sanctioned.VSubmenuSealed; import forge.gui.home.settings.VSubmenuAvatars; import forge.gui.home.settings.VSubmenuDownloaders; import forge.gui.home.settings.VSubmenuPreferences; +import forge.gui.home.variant.VSubmenuArchenemy; +import forge.gui.home.variant.VSubmenuVanguard; import forge.gui.toolbox.ExperimentalLabel; import forge.gui.toolbox.FLabel; import forge.gui.toolbox.FSkin; @@ -118,6 +119,8 @@ public enum VHomeUI implements IVTopLevelUI { //allSubmenus.add(VSubmenuExit.SINGLETON_INSTANCE); allSubmenus.add(VSubmenuArchenemy.SINGLETON_INSTANCE); + + allSubmenus.add(VSubmenuVanguard.SINGLETON_INSTANCE); // For each group: init its panel final SortedMap allGroupPanels = new TreeMap(); diff --git a/src/main/java/forge/gui/home/quest/SSubmenuQuestUtil.java b/src/main/java/forge/gui/home/quest/SSubmenuQuestUtil.java index acdbab2b8c3..f3e3b45b65a 100644 --- a/src/main/java/forge/gui/home/quest/SSubmenuQuestUtil.java +++ b/src/main/java/forge/gui/home/quest/SSubmenuQuestUtil.java @@ -312,9 +312,9 @@ public class SSubmenuQuestUtil { humanStart.setStartingLife(qData.getAssets().getLife(qData.getMode()) + extraLifeHuman); aiStart.setStartingLife(lifeAI); - humanStart.setCardsOnTable(new Supplier>() { + humanStart.setCardsOnBattlefield(new Supplier>() { @Override public Iterable get() { return QuestUtil.getHumanStartingCards(qData, event); } }); - aiStart.setCardsOnTable(new Supplier>() { + aiStart.setCardsOnBattlefield(new Supplier>() { @Override public Iterable get() { return QuestUtil.getComputerStartingCards(event); } }); } // End isFantasy diff --git a/src/main/java/forge/gui/home/multiplayer/CSubmenuArchenemy.java b/src/main/java/forge/gui/home/variant/CSubmenuArchenemy.java similarity index 98% rename from src/main/java/forge/gui/home/multiplayer/CSubmenuArchenemy.java rename to src/main/java/forge/gui/home/variant/CSubmenuArchenemy.java index 62f415a81e4..7064fc64fdd 100644 --- a/src/main/java/forge/gui/home/multiplayer/CSubmenuArchenemy.java +++ b/src/main/java/forge/gui/home/variant/CSubmenuArchenemy.java @@ -1,4 +1,4 @@ -package forge.gui.home.multiplayer; +package forge.gui.home.variant; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; diff --git a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java new file mode 100644 index 00000000000..e335984ea51 --- /dev/null +++ b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java @@ -0,0 +1,176 @@ +package forge.gui.home.variant; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Random; + +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; + +import com.google.common.collect.Iterables; + +import forge.Command; +import forge.Singletons; +import forge.control.Lobby; +import forge.deck.Deck; +import forge.game.GameType; +import forge.game.MatchController; +import forge.game.MatchStartHelper; +import forge.game.PlayerStartConditions; +import forge.game.player.LobbyPlayer; +import forge.game.player.PlayerType; +import forge.gui.SOverlayUtils; +import forge.gui.framework.ICDoc; +import forge.item.CardPrinted; +import forge.properties.ForgePreferences; +import forge.properties.ForgePreferences.FPref; + +/** + * Controls the constructed submenu in the home UI. + * + *

(C at beginning of class name denotes a control class.) + * + */ +public enum CSubmenuVanguard implements ICDoc { + /** */ + SINGLETON_INSTANCE; + private final VSubmenuVanguard view = VSubmenuVanguard.SINGLETON_INSTANCE; + + + /* (non-Javadoc) + * @see forge.gui.home.ICSubmenu#initialize() + */ + @Override + public void update() { + // Nothing to see here... + } + + /* (non-Javadoc) + * @see forge.gui.home.ICSubmenu#initialize() + */ + @Override + public void initialize() { + final ForgePreferences prefs = Singletons.getModel().getPreferences(); + view.getDcAi().initialize(); + view.getDcHuman().initialize(); + + // Checkbox event handling + view.getBtnStart().addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent arg0) { + startGame(); + } + }); + + // Checkbox event handling + view.getCbSingletons().addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent arg0) { + prefs.setPref(FPref.DECKGEN_SINGLETONS, + String.valueOf(view.getCbSingletons().isSelected())); + prefs.save(); + } + }); + + view.getCbArtifacts().addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent arg0) { + prefs.setPref( + FPref.DECKGEN_ARTIFACTS, String.valueOf(view.getCbArtifacts().isSelected())); + prefs.save(); + } + }); + + view.getCbRemoveSmall().addActionListener(new ActionListener() { + @Override + public void actionPerformed(final ActionEvent arg0) { + prefs.setPref( + FPref.DECKGEN_NOSMALL, String.valueOf(view.getCbRemoveSmall().isSelected())); + prefs.save(); + } + }); + + // Pre-select checkboxes + view.getCbSingletons().setSelected(prefs.getPrefBoolean(FPref.DECKGEN_SINGLETONS)); + view.getCbArtifacts().setSelected(prefs.getPrefBoolean(FPref.DECKGEN_ARTIFACTS)); + view.getCbRemoveSmall().setSelected(prefs.getPrefBoolean(FPref.DECKGEN_NOSMALL)); + } + + + + /** @param lists0   {@link java.util.List}<{@link javax.swing.JList}> */ + private void startGame() { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + SOverlayUtils.startGameOverlay(); + SOverlayUtils.showOverlay(); + } + }); + + final SwingWorker worker = new SwingWorker() { + @Override + public Object doInBackground() { + Deck humanDeck = VSubmenuVanguard.SINGLETON_INSTANCE.getDcHuman().getDeck(); + Deck aiDeck = VSubmenuVanguard.SINGLETON_INSTANCE.getDcAi().getDeck(); + Object selAiAv = VSubmenuVanguard.SINGLETON_INSTANCE.getAvAi().getSelectedValue(); + Object selHumanAv = VSubmenuVanguard.SINGLETON_INSTANCE.getAvHuman().getSelectedValue(); + + Lobby lobby = Singletons.getControl().getLobby(); + LobbyPlayer humanPlayer = lobby.findLocalPlayer(PlayerType.HUMAN); + LobbyPlayer aiPlayer = lobby.findLocalPlayer(PlayerType.COMPUTER); + + PlayerStartConditions aiCond = new PlayerStartConditions(aiDeck); + PlayerStartConditions humanCond = new PlayerStartConditions(humanDeck); + + MatchStartHelper helper = new MatchStartHelper(); + + final CardPrinted aiVanguard,humanVanguard; + Iterable all = VSubmenuVanguard.SINGLETON_INSTANCE.getAllAvatars(); + if(selAiAv instanceof String) + { + //Random is the only string in the list so grab a random avatar. + Random r = new Random(); + aiVanguard = Iterables.get(all,r.nextInt(Iterables.size(all))); + } + else + { + aiVanguard = (CardPrinted)selAiAv; + } + if(selHumanAv instanceof String) + { + //Random is the only string in the list so grab a random avatar. + Random r = new Random(); + humanVanguard = Iterables.get(all,r.nextInt(Iterables.size(all))); + } + else + { + humanVanguard = (CardPrinted)selHumanAv; + } + helper.addVanguardPlayer(humanPlayer, humanDeck, humanVanguard); + helper.addVanguardPlayer(aiPlayer, aiDeck, aiVanguard); + + MatchController mc = Singletons.getModel().getMatch(); + mc.initMatch(GameType.Vanguard, helper.getPlayerMap()); + mc.startRound(); + + return null; + } + + @Override + public void done() { + SOverlayUtils.hideOverlay(); + } + }; + worker.execute(); + } + + + /* (non-Javadoc) + * @see forge.gui.framework.ICDoc#getCommandOnSelect() + */ + @Override + public Command getCommandOnSelect() { + return null; + } +} diff --git a/src/main/java/forge/gui/home/multiplayer/VSubmenuArchenemy.java b/src/main/java/forge/gui/home/variant/VSubmenuArchenemy.java similarity index 95% rename from src/main/java/forge/gui/home/multiplayer/VSubmenuArchenemy.java rename to src/main/java/forge/gui/home/variant/VSubmenuArchenemy.java index ec3e8eb3f95..6a1edccfe85 100644 --- a/src/main/java/forge/gui/home/multiplayer/VSubmenuArchenemy.java +++ b/src/main/java/forge/gui/home/variant/VSubmenuArchenemy.java @@ -1,4 +1,4 @@ -package forge.gui.home.multiplayer; +package forge.gui.home.variant; import java.util.ArrayList; import java.util.List; @@ -103,7 +103,7 @@ public enum VSubmenuArchenemy implements IVSubmenu { */ @Override public EMenuGroup getGroupEnum() { - return EMenuGroup.MULTIPLAYER; + return EMenuGroup.VARIANT; } /* (non-Javadoc) diff --git a/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java new file mode 100644 index 00000000000..45cfe340117 --- /dev/null +++ b/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java @@ -0,0 +1,250 @@ +package forge.gui.home.variant; + +import java.util.Arrays; +import java.util.Vector; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingConstants; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; + +import net.miginfocom.swing.MigLayout; +import forge.card.CardCoreType; +import forge.card.CardRules; +import forge.card.CardRulesPredicates; +import forge.game.player.PlayerType; +import forge.gui.framework.DragCell; +import forge.gui.framework.DragTab; +import forge.gui.framework.EDocID; +import forge.gui.home.EMenuGroup; +import forge.gui.home.IVSubmenu; +import forge.gui.home.LblHeader; +import forge.gui.home.StartButton; +import forge.gui.home.VHomeUI; +import forge.gui.toolbox.FCheckBox; +import forge.gui.toolbox.FDeckChooser; +import forge.gui.toolbox.FLabel; +import forge.gui.toolbox.FList; +import forge.gui.toolbox.FSkin; +import forge.item.CardDb; +import forge.item.CardPrinted; + +/** + * Assembles Swing components of constructed submenu singleton. + * + *

(V at beginning of class name denotes a view class.) + * + */ +public enum VSubmenuVanguard implements IVSubmenu { + /** */ + SINGLETON_INSTANCE; + + // Fields used with interface IVDoc + private DragCell parentCell; + private final DragTab tab = new DragTab("Vanguard Mode"); + + /** */ + private final LblHeader lblTitle = new LblHeader("Variant: Vanguard"); + + private final JPanel pnlStart = new JPanel(new MigLayout("insets 0, gap 0, wrap 2")); + + private final StartButton btnStart = new StartButton(); + + private final JCheckBox cbSingletons = new FCheckBox("Singleton Mode"); + private final JCheckBox cbArtifacts = new FCheckBox("Remove Artifacts"); + private final JCheckBox cbRemoveSmall = new FCheckBox("Remove Small Creatures"); + + private final FDeckChooser dcHuman = new FDeckChooser("Select your deck:", PlayerType.HUMAN); + private final FDeckChooser dcAi = new FDeckChooser("Select AI deck:", PlayerType.COMPUTER); + + private final FList avHuman = new FList(); + private final FList avAi = new FList(); + private final JScrollPane scrHuman = new JScrollPane(avHuman, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + private final JScrollPane scrAi = new JScrollPane(avAi, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + + private final Predicate avatarTypePred = CardPrinted.Predicates.type("Vanguard"); + private final Iterable allAvatars = Iterables.filter(CardDb.instance().getAllCards(), avatarTypePred); + + private final FLabel lblAvatarHuman = new FLabel.Builder() + .text("Human avatar:") + .fontAlign(SwingConstants.CENTER) + .build(); + private final FLabel lblAvatarAi = new FLabel.Builder() + .text("AI Avatar:") + .fontAlign(SwingConstants.CENTER) + .build(); + + private VSubmenuVanguard() { + + lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2)); + + Predicate typePred = CardPrinted.Predicates.type("Vanguard"); + + Vector listData = new Vector(); + listData.add("Random"); + for(CardPrinted cp : Iterables.filter(CardDb.instance().getAllCards(), typePred)) + { + listData.add(cp); + } + + avHuman.setListData(listData); + avAi.setListData(listData); + avHuman.setSelectedIndex(0); + avAi.setSelectedIndex(0); + + final String strCheckboxConstraints = "w 200px!, h 30px!, gap 0 20px 0 0"; + pnlStart.setOpaque(false); + pnlStart.add(cbSingletons, strCheckboxConstraints); + pnlStart.add(btnStart, "span 1 3, growx, pushx, align center"); + pnlStart.add(cbArtifacts, strCheckboxConstraints); + pnlStart.add(cbRemoveSmall, strCheckboxConstraints); + } + + /* (non-Javadoc) + * @see forge.gui.home.IVSubmenu#getGroupEnum() + */ + @Override + public EMenuGroup getGroupEnum() { + return EMenuGroup.VARIANT; + } + + public final FDeckChooser getDcHuman() { + return dcHuman; + } + + public final FDeckChooser getDcAi() { + return dcAi; + } + + + /* (non-Javadoc) + * @see forge.gui.home.IVSubmenu#getMenuTitle() + */ + @Override + public String getMenuTitle() { + return "Vanguard"; + } + + /* (non-Javadoc) + * @see forge.gui.home.IVSubmenu#getItemEnum() + */ + @Override + public EDocID getItemEnum() { + return EDocID.HOME_VANGUARD; + } + + /* (non-Javadoc) + * @see forge.gui.home.IVSubmenu#populate() + */ + @Override + public void populate() { + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().removeAll(); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().setLayout(new MigLayout("insets 0, gap 0, wrap 2, ax right")); + + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblTitle, "w 80%!, h 40px!, gap 0 0 15px 15px, span 2, ax right"); + + dcAi.populate(); + dcHuman.populate(); + + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(dcAi, "w 44%!, gap 0 0 20px 20px, growy, pushy"); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(dcHuman, "w 44%!, gap 4% 4% 20px 20px, growy, pushy"); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblAvatarAi, "w 44%!, gap 0 0 0px 0px"); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblAvatarHuman, "w 44%!, gap 4% 4% 0px 0px"); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(scrAi, "w 44%!, gap 0 0 20px 20px, growy, pushy"); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(scrHuman, "w 44%!, gap 4% 4% 20px 20px, growy, pushy"); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(pnlStart, "span 2, gap 0 0 50px 50px, ax center"); + + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().revalidate(); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().repaintSelf(); + } + + + /** @return {@link javax.swing.JButton} */ + public JButton getBtnStart() { + return this.btnStart; + } + + + /** @return {@link javax.swing.JCheckBox} */ + public JCheckBox getCbSingletons() { + return cbSingletons; + } + + /** @return {@link javax.swing.JCheckBox} */ + public JCheckBox getCbArtifacts() { + return cbArtifacts; + } + + /** @return {@link javax.swing.JCheckBox} */ + public JCheckBox getCbRemoveSmall() { + return cbRemoveSmall; + } + + //========== Overridden from IVDoc + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#getDocumentID() + */ + @Override + public EDocID getDocumentID() { + return EDocID.HOME_VANGUARD; + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#getTabLabel() + */ + @Override + public DragTab getTabLabel() { + return tab; + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#getLayoutControl() + */ + @Override + public CSubmenuVanguard getLayoutControl() { + return CSubmenuVanguard.SINGLETON_INSTANCE; + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#setParentCell(forge.gui.framework.DragCell) + */ + @Override + public void setParentCell(DragCell cell0) { + this.parentCell = cell0; + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#getParentCell() + */ + @Override + public DragCell getParentCell() { + return parentCell; + } + + /** + * @return the avHuman + */ + public FList getAvHuman() { + return avHuman; + } + + /** + * @return the avAi + */ + public FList getAvAi() { + return avAi; + } + + /** + * @return the allAvatars + */ + public Iterable getAllAvatars() { + return allAvatars; + } +} diff --git a/src/main/java/forge/gui/match/CMatchUI.java b/src/main/java/forge/gui/match/CMatchUI.java index 347a22ef5b0..57476486767 100644 --- a/src/main/java/forge/gui/match/CMatchUI.java +++ b/src/main/java/forge/gui/match/CMatchUI.java @@ -35,6 +35,7 @@ import forge.gui.match.controllers.CDetail; import forge.gui.match.controllers.CMessage; import forge.gui.match.controllers.CPicture; import forge.gui.match.nonsingleton.CField; +import forge.gui.match.nonsingleton.VCommand; import forge.gui.match.nonsingleton.VField; import forge.gui.match.nonsingleton.VHand; import forge.gui.toolbox.FSkin; @@ -87,12 +88,15 @@ public enum CMatchUI implements CardContainer { // Instantiate all required field slots (user at 0) <-- that's not guaranteed final List fields = new ArrayList(); + final List commands = new ArrayList(); VField humanField = new VField(EDocID.valueOf("FIELD_0"), localPlayer); + VCommand humanCommand = new VCommand(EDocID.COMMAND_0, localPlayer); fields.add(0, humanField); + commands.add(0, humanCommand); setAvatar(humanField, FSkin.getAvatars().get(Integer.parseInt(indices[0]))); humanField.getLayoutControl().initialize(); - + humanCommand.getLayoutControl().initialize(); int i = 1; for (Player p : players) { @@ -103,6 +107,9 @@ public enum CMatchUI implements CardContainer { setAvatar(f, getPlayerAvatar(p, Integer.parseInt(indices[i%2]))); f.getLayoutControl().initialize(); fields.add(f); + VCommand c = new VCommand(EDocID.valueOf("COMMAND_" + i), p); + c.getLayoutControl().initialize(); + commands.add(c); i++; } @@ -121,6 +128,7 @@ public enum CMatchUI implements CardContainer { // } // Replace old instances + VMatchUI.SINGLETON_INSTANCE.setCommandViews(commands); VMatchUI.SINGLETON_INSTANCE.setFieldViews(fields); VMatchUI.SINGLETON_INSTANCE.setHandViews(hands); } diff --git a/src/main/java/forge/gui/match/VMatchUI.java b/src/main/java/forge/gui/match/VMatchUI.java index 62baffb0d3f..0eb183e5f8d 100644 --- a/src/main/java/forge/gui/match/VMatchUI.java +++ b/src/main/java/forge/gui/match/VMatchUI.java @@ -13,6 +13,7 @@ import forge.gui.framework.IVTopLevelUI; import forge.gui.framework.SLayoutIO; import forge.gui.framework.SRearrangingUtil; import forge.gui.framework.VEmptyDoc; +import forge.gui.match.nonsingleton.VCommand; import forge.gui.match.nonsingleton.VField; import forge.gui.match.nonsingleton.VHand; import forge.gui.match.views.VDev; @@ -31,6 +32,7 @@ public enum VMatchUI implements IVTopLevelUI { /** */ SINGLETON_INSTANCE; + private List lstCommands = new ArrayList(); private List lstFields = new ArrayList(); private List lstHands = new ArrayList(); @@ -43,6 +45,12 @@ public enum VMatchUI implements IVTopLevelUI { EDocID.valueOf("FIELD_" + i).setDoc( new VEmptyDoc(EDocID.valueOf("FIELD_" + i))); } + + // Create empty docs for all field slots + for (int i = 0; i < 8; i++) { + EDocID.valueOf("COMMAND_" + i).setDoc( + new VEmptyDoc(EDocID.valueOf("COMMAND_" + i))); + } // Create empty docs for all hand slots for (int i = 0; i < 4; i++) { @@ -95,6 +103,21 @@ public enum VMatchUI implements IVTopLevelUI { lstFields.get(1).getParentCell().addDoc(lstFields.get(i)); } } + + // Add extra players alternatively to existing user/AI field panels. + for (int i = 2; i < lstCommands.size(); i++) { + // If already in layout, no need to add again. + if (lstCommands.get(i).getParentCell() != null) { + continue; + } + + if (i % 2 == 0) { + lstCommands.get(0).getParentCell().addDoc(lstCommands.get(i)); + } + else { + lstCommands.get(1).getParentCell().addDoc(lstCommands.get(i)); + } + } // Add extra hands to existing hand panel. for (int i = 0; i < lstHands.size(); i++) { @@ -156,4 +179,18 @@ public enum VMatchUI implements IVTopLevelUI { public JButton getBtnOK() { return VMessage.SINGLETON_INSTANCE.getBtnOK(); } + + /** + * @return the lstCommands + */ + public List getCommandViews() { + return lstCommands; + } + + /** + * @param lstCommands0 the lstCommands to set + */ + public void setCommandViews(List lstCommands0) { + this.lstCommands = lstCommands0; + } } diff --git a/src/main/java/forge/item/CardDb.java b/src/main/java/forge/item/CardDb.java index 24e5bb5bd42..3422d69f542 100644 --- a/src/main/java/forge/item/CardDb.java +++ b/src/main/java/forge/item/CardDb.java @@ -363,6 +363,15 @@ public final class CardDb { public Iterable getAllCards() { return this.allCardsFlat; } + + /** + * Gets all "traditional" (non-scheme/vanguard/plane) cards + * + * @return the cards + */ + public Iterable getTraditionalCards() { + return Iterables.filter(getAllCards(), CardPrinted.Predicates.Presets.TRADITIONAL); + } /** * Gets the card. diff --git a/src/main/java/forge/item/CardPrinted.java b/src/main/java/forge/item/CardPrinted.java index 4cf96159e33..437fc39efe4 100644 --- a/src/main/java/forge/item/CardPrinted.java +++ b/src/main/java/forge/item/CardPrinted.java @@ -318,6 +318,16 @@ public final class CardPrinted implements Comparable, InventoryItem * Number of filters based on CardPrinted values. */ public abstract static class Predicates { + + /** + * Type. + * @param t + * the type to search for + * @return + */ + public static Predicate type(final String t) { + return new PredicateType(t); + } /** * Rarity. @@ -426,6 +436,21 @@ public final class CardPrinted implements Comparable, InventoryItem this.mustContain = shouldContain; } } + + private static class PredicateType implements Predicate { + private final String operand; + + @Override + public boolean apply(final CardPrinted card) { + return card.getType().contains(operand); + } + + + public PredicateType(final String op) { + operand = op; + } + + } private static class PredicateName extends PredicateString { private final String operand; @@ -489,6 +514,10 @@ public final class CardPrinted implements Comparable, InventoryItem /** The Constant exceptLands. */ public static final Predicate EXCEPT_LANDS = Predicates.rarity(false, CardRarity.BasicLand); + + public static final Predicate NONTRADITIONAL = com.google.common.base.Predicates.or(Predicates.type("Vanguard"),Predicates.type("Scheme"),Predicates.type("Plane")); + + public static final Predicate TRADITIONAL = com.google.common.base.Predicates.not(Presets.NONTRADITIONAL); } } } diff --git a/src/main/java/forge/properties/ForgePreferences.java b/src/main/java/forge/properties/ForgePreferences.java index 564985d0a46..1f89540f29b 100644 --- a/src/main/java/forge/properties/ForgePreferences.java +++ b/src/main/java/forge/properties/ForgePreferences.java @@ -76,7 +76,7 @@ public class ForgePreferences { SUBMENU_CURRENTMENU (EMenuItem.CONSTRUCTED.toString()), /** */ SUBMENU_SANCTIONED ("false"), /** */ SUBMENU_GAUNTLET ("false"), /** */ - SUBMENU_MULTIPLAYER ("false"), /** */ + SUBMENU_VARIANT ("false"), /** */ SUBMENU_QUEST ("false"), /** */ SUBMENU_SETTINGS ("false"), /** */ SUBMENU_UTILITIES ("false"), /** */ From cbe37245079e88b77324ac75f11308b003f54374 Mon Sep 17 00:00:00 2001 From: Hellfish Date: Mon, 19 Nov 2012 20:04:33 +0000 Subject: [PATCH 03/36] *Variants:2 files weren't added correctly. --- .gitattributes | 2 + .../gui/match/nonsingleton/CCommand.java | 132 +++++++++++++++ .../gui/match/nonsingleton/VCommand.java | 154 ++++++++++++++++++ 3 files changed, 288 insertions(+) create mode 100644 src/main/java/forge/gui/match/nonsingleton/CCommand.java create mode 100644 src/main/java/forge/gui/match/nonsingleton/VCommand.java diff --git a/.gitattributes b/.gitattributes index 0fa6fcf1cf5..c1eed0f000d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13157,9 +13157,11 @@ src/main/java/forge/gui/match/controllers/CPicture.java -text src/main/java/forge/gui/match/controllers/CPlayers.java -text src/main/java/forge/gui/match/controllers/CStack.java -text src/main/java/forge/gui/match/controllers/package-info.java svneol=native#text/plain +src/main/java/forge/gui/match/nonsingleton/CCommand.java -text src/main/java/forge/gui/match/nonsingleton/CEmptyDoc.java -text src/main/java/forge/gui/match/nonsingleton/CField.java -text src/main/java/forge/gui/match/nonsingleton/CHand.java -text +src/main/java/forge/gui/match/nonsingleton/VCommand.java -text src/main/java/forge/gui/match/nonsingleton/VField.java -text src/main/java/forge/gui/match/nonsingleton/VHand.java -text src/main/java/forge/gui/match/nonsingleton/package-info.java svneol=native#text/plain diff --git a/src/main/java/forge/gui/match/nonsingleton/CCommand.java b/src/main/java/forge/gui/match/nonsingleton/CCommand.java new file mode 100644 index 00000000000..8950652d1f1 --- /dev/null +++ b/src/main/java/forge/gui/match/nonsingleton/CCommand.java @@ -0,0 +1,132 @@ +/* + * Forge: Play Magic: the Gathering. + * Copyright (C) 2011 Forge Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package forge.gui.match.nonsingleton; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionAdapter; +import java.awt.event.MouseMotionListener; +import java.util.Observable; +import java.util.Observer; + +import forge.Card; + +import forge.Command; +import forge.game.player.Player; +import forge.game.zone.PlayerZone; +import forge.game.zone.ZoneType; +import forge.gui.GuiDisplayUtil; +import forge.gui.framework.ICDoc; +import forge.gui.match.CMatchUI; +import forge.gui.match.controllers.CMessage; +/** + * Controls Swing components of a player's field instance. + */ +public class CCommand implements ICDoc { + private final Player player; + private final VCommand view; + private boolean initializedAlready = false; + + private MouseMotionListener mmlCardOver = new MouseMotionAdapter() { @Override + public void mouseMoved(final MouseEvent e) { + cardoverAction(); } }; + + private final MouseListener madCardClick = new MouseAdapter() { @Override + public void mousePressed(final MouseEvent e) { + cardclickAction(e); } }; + + // Card play area, attached to battlefield zone. + private final Observer observerPlay = new Observer() { + @Override + public void update(final Observable a, final Object b) { + final PlayerZone pZone = (PlayerZone) a; + GuiDisplayUtil.setupPlayZone(CCommand.this.view.getTabletop(), pZone.getCards(false)); + } + }; + + /** + * Controls Swing components of a player's field instance. + * + * @param p0   {@link forge.game.player.Player} + * @param v0   {@link forge.gui.match.nonsingleton.VField} + */ + public CCommand(final Player p0, final VCommand v0) { + this.player = p0; + this.view = v0; + } + + @Override + public void initialize() { + if (initializedAlready) { return; } + initializedAlready = true; + + // Observers + CCommand.this.player.getZone(ZoneType.Command).addObserver(observerPlay); + + // Listeners + // Battlefield card clicks + this.view.getTabletop().addMouseListener(madCardClick); + + // Battlefield card mouseover + this.view.getTabletop().addMouseMotionListener(mmlCardOver); + } + + @Override + public void update() { + } + + /** @return {@link forge.game.player.Player} */ + public Player getPlayer() { + return this.player; + } + + /** @return {@link forge.gui.nonsingleton.VField} */ + public VCommand getView() { + return this.view; + } + + /** */ + private void cardoverAction() { + final Card c = CCommand.this.view.getTabletop().getCardFromMouseOverPanel(); + if (c != null) { + CMatchUI.SINGLETON_INSTANCE.setCard(c); + } + } + + /** */ + private void cardclickAction(final MouseEvent e) { + // original version: + // final Card c = t.getDetailController().getCurrentCard(); + // Roujin's bug fix version dated 2-12-2012 + final Card c = CCommand.this.view.getTabletop().getCardFromMouseOverPanel(); + + if (c != null && c.isInZone(ZoneType.Command)) { + //TODO: Cast commander/activate avatar/roll planar dice here. + CMessage.SINGLETON_INSTANCE.getInputControl().getInput().selectCard(c); + } + } + + /* (non-Javadoc) + * @see forge.gui.framework.ICDoc#getCommandOnSelect() + */ + @Override + public Command getCommandOnSelect() { + return null; + } +} // End class CCommand diff --git a/src/main/java/forge/gui/match/nonsingleton/VCommand.java b/src/main/java/forge/gui/match/nonsingleton/VCommand.java new file mode 100644 index 00000000000..1f592651305 --- /dev/null +++ b/src/main/java/forge/gui/match/nonsingleton/VCommand.java @@ -0,0 +1,154 @@ +/* + * Forge: Play Magic: the Gathering. + * Copyright (C) 2011 Forge Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package forge.gui.match.nonsingleton; + +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.border.MatteBorder; + +import net.miginfocom.swing.MigLayout; +import forge.game.player.Player; +import forge.gui.framework.DragCell; +import forge.gui.framework.DragTab; +import forge.gui.framework.EDocID; +import forge.gui.framework.IVDoc; +import forge.gui.toolbox.FSkin; +import forge.view.arcane.PlayArea; + +/** + * Assembles Swing components of a player field instance. + * + *

(V at beginning of class name denotes a view class.) + */ +public class VCommand implements IVDoc { + // Fields used with interface IVDoc + private final CCommand control; + private DragCell parentCell; + private final EDocID docID; + private final DragTab tab = new DragTab("Command"); + + // Other fields + private Player player = null; + + // Top-level containers + private final JScrollPane scroller = new JScrollPane(); + private final PlayArea tabletop; + + //========= Constructor + /** + * Assembles Swing components of a player field instance. + * + * @param player0   {@link forge.game.player.Player} + * @param id0   {@link forge.gui.framework.EDocID} + */ + public VCommand(final EDocID id0, final Player player0) { + this.docID = id0; + id0.setDoc(this); + + this.player = player0; + if (player0 != null) { tab.setText(player0.getName() + " Command"); } + else { tab.setText("NO PLAYER FOR " + docID.toString()); } + + // TODO player is hard-coded into tabletop...should be dynamic + // (haven't looked into it too deeply). Doublestrike 12-04-12 + tabletop = new PlayArea(scroller, id0 == EDocID.COMMAND_0 ); + + control = new CCommand(player, this); + + tabletop.setBorder(new MatteBorder(0, 1, 0, 0, + FSkin.getColor(FSkin.Colors.CLR_BORDERS))); + tabletop.setOpaque(false); + + scroller.setViewportView(this.tabletop); + scroller.setOpaque(false); + scroller.getViewport().setOpaque(false); + scroller.setBorder(null); + + } + + //========= Overridden methods + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#populate() + */ + @Override + public void populate() { + final JPanel pnl = parentCell.getBody(); + pnl.setLayout(new MigLayout("insets 0, gap 0")); + + pnl.add(scroller, "w 85%!, h 100%!, span 1 2, wrap"); + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#getDocumentID() + */ + @Override + public EDocID getDocumentID() { + return docID; + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#getTabLabel() + */ + @Override + public DragTab getTabLabel() { + return tab; + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#getLayoutControl() + */ + @Override + public CCommand getLayoutControl() { + return control; + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#setParentCell() + */ + @Override + public void setParentCell(final DragCell cell0) { + this.parentCell = cell0; + } + + /* (non-Javadoc) + * @see forge.gui.framework.IVDoc#getParentCell() + */ + @Override + public DragCell getParentCell() { + return this.parentCell; + } + + //========= Retrieval methods + /** + * Gets the player currently associated with this field. + * @return {@link forge.game.player.Player} + */ + public Player getPlayer() { + return this.player; + } + + /** + * Gets the tabletop. + * + * @return PlayArea where cards for this field are in play + */ + public PlayArea getTabletop() { + return this.tabletop; + } +} From f7a97d881e7b756ad7775f61f8aa7ff218a509bc Mon Sep 17 00:00:00 2001 From: moomarc Date: Tue, 20 Nov 2012 06:33:50 +0000 Subject: [PATCH 04/36] - Vanguard: added AffectedZone parameter to Birds of Paradise Avatar --- res/cardsfolder/b/birds_of_paradise_avatar.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/cardsfolder/b/birds_of_paradise_avatar.txt b/res/cardsfolder/b/birds_of_paradise_avatar.txt index c82c6b89912..47cbf054b0f 100644 --- a/res/cardsfolder/b/birds_of_paradise_avatar.txt +++ b/res/cardsfolder/b/birds_of_paradise_avatar.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Vanguard Text:no text HandLifeModifier:+0/-3 -S:Mode$ Continuous | EffectZone$ Command | Affected$ Land.YouCtrl | AddAbility$ AnyMana | Description$ Lands you control have "Tap: Add one mana of any color to your mana pool." +S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Land.YouCtrl | AddAbility$ AnyMana | Description$ Lands you control have "Tap: Add one mana of any color to your mana pool." SVar:AnyMana:AB$ Mana | Cost$ T | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color to your mana pool. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182291&type=card From d593009af5a3748d62834fb660b329ff34b1c467 Mon Sep 17 00:00:00 2001 From: moomarc Date: Tue, 20 Nov 2012 12:22:07 +0000 Subject: [PATCH 05/36] *Variants - Fixed Archangel of Strife *Variants - Changed ValidGrave count method to Valid eg:Count$ValidBattlefield,Graveyard Card.YouCtrl --- res/cardsfolder/a/archangel_of_strife.txt | 16 +++++------ res/cardsfolder/c/crypt_of_agadeem.txt | 2 +- res/cardsfolder/d/detritivore.txt | 2 +- res/cardsfolder/h/helm_of_obedience.txt | 4 +-- res/cardsfolder/n/nameless_race.txt | 2 +- res/cardsfolder/s/spoils_of_evil.txt | 2 +- res/cardsfolder/s/suffer_the_past.txt | 2 +- .../card/cardfactory/CardFactoryUtil.java | 27 ++++++++++--------- 8 files changed, 29 insertions(+), 28 deletions(-) diff --git a/res/cardsfolder/a/archangel_of_strife.txt b/res/cardsfolder/a/archangel_of_strife.txt index d72fd5c1d19..38f3a76f7f7 100644 --- a/res/cardsfolder/a/archangel_of_strife.txt +++ b/res/cardsfolder/a/archangel_of_strife.txt @@ -11,16 +11,16 @@ SVar:WarChoice:DB$ Effect | Name$ Archangel War Effect | ChoiceDescription$ War SVar:PeaceChoice:DB$ Effect | Name$ Archangel Peace Effect | ChoiceDescription$ Peace | Duration$ UntilHostLeavesPlay | RememberEffect$ True SVar:Attacking:DB$ Effect | Name$ Archangel War Effect | ChoiceDescription$ War | EffectOwner$ Opponent | Duration$ UntilHostLeavesPlay | RememberEffect$ True SVar:Defensive:DB$ Effect | Name$ Archangel Peace Effect | ChoiceDescription$ Peace | EffectOwner$ Opponent | Duration$ UntilHostLeavesPlay | RememberEffect$ True -S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddPower$ 3 | CheckSVar$ WarYou | SVarCompare$ GE1 | References$ WarYou -S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddToughness$ 3 | CheckSVar$ PeaceYou | SVarCompare$ GE1 | References$ PeaceYou -S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouDontCtrl | AddPower$ 3 | CheckSVar$ WarOpp | SVarCompare$ GE1 | References$ WarOpp -S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.YouDontCtrl | AddToughness$ 3 | CheckSVar$ PeaceOpp | SVarCompare$ GE1 | References$ PeaceOpp +S:Mode$ Continuous | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddPower$ 3 | CheckSVar$ WarYou | SVarCompare$ GE1 | References$ WarYou +S:Mode$ Continuous | AffectedZone$ Battlefield | Affected$ Creature.YouCtrl | AddToughness$ 3 | CheckSVar$ PeaceYou | SVarCompare$ GE1 | References$ PeaceYou +S:Mode$ Continuous | AffectedZone$ Battlefield | Affected$ Creature.YouDontCtrl | AddPower$ 3 | CheckSVar$ WarOpp | SVarCompare$ GE1 | References$ WarOpp +S:Mode$ Continuous | AffectedZone$ Battlefield | Affected$ Creature.YouDontCtrl | AddToughness$ 3 | CheckSVar$ PeaceOpp | SVarCompare$ GE1 | References$ PeaceOpp T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Self | Execute$ DBCleanup | Static$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:WarYou:Remembered$Valid Card.namedArchangel War Effect+YouCtrl -SVar:PeaceYou:Remembered$Valid Card.namedArchangel Peace Effect+YouCtrl -SVar:WarOpp:Remembered$Valid Card.namedArchangel War Effect+YouDontCtrl -SVar:PeaceOpp:Remembered$Valid Card.namedArchangel Peace Effect+YouDontCtrl +SVar:WarYou:Count$ValidCommand Card.namedArchangel War Effect+YouCtrl+IsRemembered +SVar:PeaceYou:Count$ValidCommand Card.namedArchangel Peace Effect+YouCtrl+IsRemembered +SVar:WarOpp:Count$ValidCommand Card.namedArchangel War Effect+YouDontCtrl+IsRemembered +SVar:PeaceOpp:Count$ValidCommand Card.namedArchangel Peace Effect+YouDontCtrl+IsRemembered SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/archangel_of_strife.jpg diff --git a/res/cardsfolder/c/crypt_of_agadeem.txt b/res/cardsfolder/c/crypt_of_agadeem.txt index 63b57349321..b7887b95b2a 100644 --- a/res/cardsfolder/c/crypt_of_agadeem.txt +++ b/res/cardsfolder/c/crypt_of_agadeem.txt @@ -5,7 +5,7 @@ Text:no text K:CARDNAME enters the battlefield tapped. A:AB$ Mana | Cost$ T | Produced$ B | SpellDescription$ Add B to your mana pool. A:AB$ Mana | Cost$ 2 T | Produced$ B | Amount$ X | References$ X | SpellDescription$ Add B to your mana pool for each black creature card in your graveyard. -SVar:X:Count$ValidGrave Creature.Black+YouCtrl +SVar:X:Count$ValidGraveyard Creature.Black+YouCtrl SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/crypt_of_agadeem.jpg diff --git a/res/cardsfolder/d/detritivore.txt b/res/cardsfolder/d/detritivore.txt index 52e1cebee52..d7124a85f6c 100644 --- a/res/cardsfolder/d/detritivore.txt +++ b/res/cardsfolder/d/detritivore.txt @@ -8,7 +8,7 @@ K:Suspend:X:XCantBe0 X 3 R T:Mode$ CounterRemoved | ValidCard$ Card.Self | TriggerZones$ Exile | CounterType$ TIME | Execute$ TrigDestroy | TriggerDescription$ Whenever a time counter is removed from CARDNAME while it's exiled, destroy target nonbasic land. SVar:TrigDestroy:DB$ Destroy | ValidTgts$ Land.nonBasic | TgtPrompt$ Select a nonbasic land. SVar:X:Count$xPaid -SVar:Y:Count$ValidGrave Land.nonBasic+YouDontCtrl +SVar:Y:Count$ValidGraveyard Land.nonBasic+YouDontCtrl SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/detritivore.jpg diff --git a/res/cardsfolder/h/helm_of_obedience.txt b/res/cardsfolder/h/helm_of_obedience.txt index ef412e3c80d..bf91c6afe3b 100644 --- a/res/cardsfolder/h/helm_of_obedience.txt +++ b/res/cardsfolder/h/helm_of_obedience.txt @@ -15,8 +15,8 @@ SVar:DBResetCounter:DB$ StoreSVar | SVar$ AccumlatedMilled | Type$ Number | Expr SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:TargetedLibrary:TargetedPlayer$CardsInLibrary SVar:MaxRepeats:TargetedPlayer$CardsInLibrary/Plus.2 -SVar:MilledCreature:Count$ValidGrave Creature.IsRemembered -SVar:MilledCard:Count$ValidGrave Card.IsRemembered +SVar:MilledCreature:Count$ValidGraveyard Creature.IsRemembered +SVar:MilledCard:Count$ValidGraveyard Card.IsRemembered SVar:AccumlatedMilled:Number$0 SVar:X:Count$xPaid SVar:RemAIDeck:True diff --git a/res/cardsfolder/n/nameless_race.txt b/res/cardsfolder/n/nameless_race.txt index c572d9c284b..dff6b3be015 100644 --- a/res/cardsfolder/n/nameless_race.txt +++ b/res/cardsfolder/n/nameless_race.txt @@ -10,7 +10,7 @@ S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ SVar:X:XChoice/LimitMax.Limit SVar:Limit:SVar$Active/Plus.Buried SVar:Active:Count$Valid Permanent.White+nonToken+OppCtrl -SVar:Buried:Count$ValidGrave Card.White+OppCtrl +SVar:Buried:Count$ValidGraveyard Card.White+OppCtrl SVar:LifePaidOnETB:Number$0 SVar:RemAIDeck:True SVar:RemRandomDeck:True diff --git a/res/cardsfolder/s/spoils_of_evil.txt b/res/cardsfolder/s/spoils_of_evil.txt index f2cd9a90a94..265e4c5663a 100644 --- a/res/cardsfolder/s/spoils_of_evil.txt +++ b/res/cardsfolder/s/spoils_of_evil.txt @@ -4,7 +4,7 @@ Types:Instant Text:no text A:SP$ GainLife | Cost$ 2 B | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | Defined$ You | LifeAmount$ X | References$ X | SubAbility$ DBMana | SpellDescription$ For each artifact or creature card in target opponent's graveyard, add {1} to your mana pool and you gain 1 life. SVar:DBMana:DB$ Mana | Produced$ 1 | Amount$ X | References$ X -SVar:X:Count$ValidGrave Creature.OppOwn,Artifact.OppOwn +SVar:X:Count$ValidGraveyard Creature.OppOwn,Artifact.OppOwn SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/spoils_of_evil.jpg diff --git a/res/cardsfolder/s/suffer_the_past.txt b/res/cardsfolder/s/suffer_the_past.txt index 68c0803b915..9d1b23790f2 100644 --- a/res/cardsfolder/s/suffer_the_past.txt +++ b/res/cardsfolder/s/suffer_the_past.txt @@ -9,7 +9,7 @@ SVar:DBSyphonLife:DB$ LoseLife | Defined$ Targeted | LifeAmount$ Y | SubAbility$ SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ Y | References$ Y | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:TargetedObjects$Amount/Minus.1 -SVar:MaxTgts:Targeted$ValidGrave Card.TargetedPlayerOwn +SVar:MaxTgts:Targeted$ValidGraveyard Card.TargetedPlayerOwn SVar:Y:Remembered$Amount SVar:RemAIDeck:True SVar:Rarity:Uncommon diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index 546b4f5330b..a993ae1439d 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -1977,20 +1977,8 @@ public class CardFactoryUtil { } } - // count valid cards in the garveyard - if (l[0].contains("ValidGrave")) { - String restrictions = l[0].replace("ValidGrave ", ""); - restrictions = restrictions.replace("Count$", ""); - final String[] rest = restrictions.split(","); - List cards = Singletons.getModel().getGame().getCardsIn(ZoneType.Graveyard); - cards = CardLists.getValidCards(cards, rest, cardController, c); - - n = cards.size(); - - return CardFactoryUtil.doXMath(n, m, c); - } // count valid cards on the battlefield - if (l[0].contains("Valid")) { + if (l[0].contains("Valid ")) { String restrictions = l[0].replace("Valid ", ""); restrictions = restrictions.replace("Count$", ""); final String[] rest = restrictions.split(","); @@ -2001,6 +1989,19 @@ public class CardFactoryUtil { return CardFactoryUtil.doXMath(n, m, c); } + // count valid cards in any specified zone/s + if (l[0].contains("Valid") && !l[0].contains("Valid ")) { + String[] lparts = l[0].split(" ", 2); + final List vZone = ZoneType.listValueOf(lparts[0].split("Valid")[1]); + String restrictions = l[0].replace(lparts[0] + " ", ""); + final String[] rest = restrictions.split(","); + List cards = Singletons.getModel().getGame().getCardsIn(vZone); + cards = CardLists.getValidCards(cards, rest, cardController, c); + + n = cards.size(); + + return CardFactoryUtil.doXMath(n, m, c); + } if (l[0].contains("ImprintedCardPower")) { if (c.getImprinted().size() > 0) { From b7128f28e91121b77811b9198eed6767bace50e4 Mon Sep 17 00:00:00 2001 From: Sloth Date: Tue, 20 Nov 2012 13:02:24 +0000 Subject: [PATCH 06/36] - Variants: Fixed CardRules parser choking on "+" characters. --- src/main/java/forge/card/CardRules.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/forge/card/CardRules.java b/src/main/java/forge/card/CardRules.java index 4218cf5fc6d..76825c622cf 100644 --- a/src/main/java/forge/card/CardRules.java +++ b/src/main/java/forge/card/CardRules.java @@ -267,8 +267,8 @@ public final class CardRules { if (slashPos == -1) { throw new RuntimeException(String.format("Vanguard '%s' has bad hand/life stats", this.getName())); } - this.hand = Integer.parseInt(pt.substring(0,pt.indexOf('/'))); - this.life = Integer.parseInt(pt.substring(pt.indexOf('/')+1)); + this.hand = Integer.parseInt(pt.substring(0,pt.indexOf('/')).replace("+", "")); + this.life = Integer.parseInt(pt.substring(pt.indexOf('/')+1).replace("+", "")); } if (this.characteristics.getSetsData().isEmpty()) { From 0c3a51374fcf36c9e00de3a1a5daf481c1193553 Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 11:28:41 +0000 Subject: [PATCH 07/36] *Variants - Added Ertai (vanguard avatar) --- .gitattributes | 1 + res/cardsfolder/e/ertai.txt | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 res/cardsfolder/e/ertai.txt diff --git a/.gitattributes b/.gitattributes index c1eed0f000d..3e026002346 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3066,6 +3066,7 @@ res/cardsfolder/e/errant_ephemeron.txt svneol=native#text/plain res/cardsfolder/e/errantry.txt -text res/cardsfolder/e/erratic_explosion.txt svneol=native#text/plain res/cardsfolder/e/erratic_portal.txt svneol=native#text/plain +res/cardsfolder/e/ertai.txt -text res/cardsfolder/e/ertai_the_corrupted.txt svneol=native#text/plain res/cardsfolder/e/ertai_wizard_adept.txt svneol=native#text/plain res/cardsfolder/e/ertais_trickery.txt svneol=native#text/plain diff --git a/res/cardsfolder/e/ertai.txt b/res/cardsfolder/e/ertai.txt new file mode 100644 index 00000000000..f883b1d1e44 --- /dev/null +++ b/res/cardsfolder/e/ertai.txt @@ -0,0 +1,9 @@ +Name:Ertai +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+4 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Hexproof | Description$ Creatures you control have hexproof. (They can't be the targets of spells or abilities your opponents control.) +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4959&type=card +End \ No newline at end of file From 7865ab3f391cde4d4a522d89329d8e0878c1a403 Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 12:39:56 +0000 Subject: [PATCH 08/36] *Variants - Added the following avatars: Gerrard, Gix and Greven il-Vec --- .gitattributes | 3 +++ res/cardsfolder/g/gerrard.txt | 10 ++++++++++ res/cardsfolder/g/gix.txt | 9 +++++++++ res/cardsfolder/g/greven_il_vec.txt | 10 ++++++++++ 4 files changed, 32 insertions(+) create mode 100644 res/cardsfolder/g/gerrard.txt create mode 100644 res/cardsfolder/g/gix.txt create mode 100644 res/cardsfolder/g/greven_il_vec.txt diff --git a/.gitattributes b/.gitattributes index 3e026002346..6c0165acfde 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3809,6 +3809,7 @@ res/cardsfolder/g/geosurge.txt -text res/cardsfolder/g/geothermal_crevice.txt svneol=native#text/plain res/cardsfolder/g/geralfs_messenger.txt -text res/cardsfolder/g/geralfs_mindcrusher.txt -text +res/cardsfolder/g/gerrard.txt -text res/cardsfolder/g/gerrard_capashen.txt -text res/cardsfolder/g/gerrards_battle_cry.txt svneol=native#text/plain res/cardsfolder/g/gerrards_command.txt svneol=native#text/plain @@ -3911,6 +3912,7 @@ res/cardsfolder/g/gilt_leaf_seer.txt svneol=native#text/plain res/cardsfolder/g/giltspire_avenger.txt svneol=native#text/plain res/cardsfolder/g/gisela_blade_of_goldnight.txt -text res/cardsfolder/g/gitaxian_probe.txt svneol=native#text/plain +res/cardsfolder/g/gix.txt -text res/cardsfolder/g/glacial_chasm.txt -text res/cardsfolder/g/glacial_crevasses.txt svneol=native#text/plain res/cardsfolder/g/glacial_fortress.txt svneol=native#text/plain @@ -4245,6 +4247,7 @@ res/cardsfolder/g/greenhilt_trainee.txt svneol=native#text/plain res/cardsfolder/g/greenseeker.txt svneol=native#text/plain res/cardsfolder/g/greenweaver_druid.txt svneol=native#text/plain res/cardsfolder/g/gremlin_mine.txt svneol=native#text/plain +res/cardsfolder/g/greven_il_vec.txt -text res/cardsfolder/g/grid_monitor.txt -text res/cardsfolder/g/grief_tyrant.txt -text svneol=unset#text/plain res/cardsfolder/g/griffin_canyon.txt svneol=native#text/plain diff --git a/res/cardsfolder/g/gerrard.txt b/res/cardsfolder/g/gerrard.txt new file mode 100644 index 00000000000..8e324d0a032 --- /dev/null +++ b/res/cardsfolder/g/gerrard.txt @@ -0,0 +1,10 @@ +Name:Gerrard +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-4/+0 +T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | TriggerZones$ Command | Execute$ TrigDraw | TriggerDescription$ At the beginning of your draw step, draw an additional card. +SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4960&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/g/gix.txt b/res/cardsfolder/g/gix.txt new file mode 100644 index 00000000000..f4ccb71626b --- /dev/null +++ b/res/cardsfolder/g/gix.txt @@ -0,0 +1,9 @@ +Name:Gix +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-2/+18 +A:AB$ ChangeZone | Cost$ 3 | ActivationZone$ Command | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Select target creature card in your graveyard | ValidTgts$ Creature.YouCtrl | SpellDescription$ Return target creature card from your graveyard to your hand. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12330&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/g/greven_il_vec.txt b/res/cardsfolder/g/greven_il_vec.txt new file mode 100644 index 00000000000..78d761c127f --- /dev/null +++ b/res/cardsfolder/g/greven_il_vec.txt @@ -0,0 +1,10 @@ +Name:Greven il-Vec +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+2 +T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Creature | TriggerZones$ Command | Execute$ TrigDestroy | TriggerDescription$ Whenever a creature you control deals damage to a creature, destroy the other creature. It can't be regenerated. +SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredTarget | NoRegen$ True +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4961&type=card +End \ No newline at end of file From 9a42d71501f4d4ee4e9a8e48201bf87ff1aafe13 Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 13:04:58 +0000 Subject: [PATCH 09/36] *Variants - Hand and life modifiers will now be displayed in the card info panel --- src/main/java/forge/Card.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 015d4b2727d..3b403787303 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -60,6 +60,7 @@ import forge.game.player.ComputerUtil; import forge.game.player.Player; import forge.game.zone.ZoneType; import forge.item.CardDb; +import forge.item.CardPrinted; import forge.sound.Sounds; import forge.util.Expressions; import forge.util.MyRandom; @@ -2105,6 +2106,16 @@ public class Card extends GameEntity implements Comparable { */ public String getText() { final StringBuilder sb = new StringBuilder(); + + // Vanguard Modifiers + if (this.isType("Vanguard")) { + final CardPrinted avatar = CardDb.instance().getCard(this); + sb.append("Hand Modifier: "); + sb.append(avatar.getCard().getHand()); + sb.append("\r\nLife Modifier: "); + sb.append(avatar.getCard().getLife()); + sb.append("\r\n\r\n"); + } sb.append(this.getAbilityText()); String nonAbilityText = this.getNonAbilityText(); From 5cab0e7c97ec595dd95ba8eb2b1fb9ef003466b3 Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 13:38:59 +0000 Subject: [PATCH 10/36] *Variants - Added the following avatars: Grinning Demon Avatar, Hanna and Karn --- .gitattributes | 3 +++ res/cardsfolder/g/grinning_demon_avatar.txt | 10 ++++++++++ res/cardsfolder/h/hanna.txt | 9 +++++++++ res/cardsfolder/k/karn.txt | 10 ++++++++++ 4 files changed, 32 insertions(+) create mode 100644 res/cardsfolder/g/grinning_demon_avatar.txt create mode 100644 res/cardsfolder/h/hanna.txt create mode 100644 res/cardsfolder/k/karn.txt diff --git a/.gitattributes b/.gitattributes index 6c0165acfde..c0b007385c8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4273,6 +4273,7 @@ res/cardsfolder/g/grindclock.txt svneol=native#text/plain res/cardsfolder/g/grinding_station.txt svneol=native#text/plain res/cardsfolder/g/grindstone.txt svneol=native#text/plain res/cardsfolder/g/grinning_demon.txt svneol=native#text/plain +res/cardsfolder/g/grinning_demon_avatar.txt -text res/cardsfolder/g/grinning_ignus.txt svneol=native#text/plain res/cardsfolder/g/grip_of_amnesia.txt -text res/cardsfolder/g/griptide.txt -text @@ -4406,6 +4407,7 @@ res/cardsfolder/h/hand_of_honor.txt svneol=native#text/plain res/cardsfolder/h/hand_of_justice.txt svneol=native#text/plain res/cardsfolder/h/hand_of_the_praetors.txt svneol=native#text/plain res/cardsfolder/h/hand_to_hand.txt -text +res/cardsfolder/h/hanna.txt -text res/cardsfolder/h/hanna_ships_navigator.txt svneol=native#text/plain res/cardsfolder/h/hannas_custody.txt svneol=native#text/plain res/cardsfolder/h/hanweir_lancer.txt -text @@ -5205,6 +5207,7 @@ res/cardsfolder/k/karakas.txt svneol=native#text/plain res/cardsfolder/k/kargan_dragonlord.txt svneol=native#text/plain res/cardsfolder/k/karma.txt svneol=native#text/plain res/cardsfolder/k/karmic_guide.txt svneol=native#text/plain +res/cardsfolder/k/karn.txt -text res/cardsfolder/k/karn_liberated.txt -text res/cardsfolder/k/karn_silver_golem.txt svneol=native#text/plain res/cardsfolder/k/karns_touch.txt svneol=native#text/plain diff --git a/res/cardsfolder/g/grinning_demon_avatar.txt b/res/cardsfolder/g/grinning_demon_avatar.txt new file mode 100644 index 00000000000..43c7933f76b --- /dev/null +++ b/res/cardsfolder/g/grinning_demon_avatar.txt @@ -0,0 +1,10 @@ +Name:Grinning Demon Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/-2 +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.YouCtrl+nonToken | TriggerZones$ Command | Execute$ GrinningDiscard | TriggerDescription$ Whenever a nontoken creature you control dies, target opponent discards a card. +SVar:GrinningDiscard:AB$ Discard | Cost$ 0 | ValidTgts$ Opponent | TgtPrompt$ Select an opponent to discard | NumCards$ 1 | Mode$ TgtChoose +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182304&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/h/hanna.txt b/res/cardsfolder/h/hanna.txt new file mode 100644 index 00000000000..eb08652d5a1 --- /dev/null +++ b/res/cardsfolder/h/hanna.txt @@ -0,0 +1,9 @@ +Name:Hanna +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/-5 +S:Mode$ ReduceCost | ValidCard$ Card | Type$ Spell | Activator$ You | Amount$ 1 | Description$ Spells you cast cost 1 less to cast. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4962&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/k/karn.txt b/res/cardsfolder/k/karn.txt new file mode 100644 index 00000000000..5d846d37166 --- /dev/null +++ b/res/cardsfolder/k/karn.txt @@ -0,0 +1,10 @@ +Name:Karn +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/+6 +S:Mode$ Continuous | Affected$ Artifact.nonCreature+YouCtrl | SetPower$ AffectedX | SetToughness$ AffectedX | References$ AffectedX | AddType$ Creature | Description$ Each noncreature artifact you control is an artifact creature with power and toughness each equal to its converted mana cost. +SVar:AffectedX:Count$CardManaCost +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4963&type=card +End \ No newline at end of file From bb62ffe499838c1194dff90247c9bb76ed90a9f7 Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 13:41:08 +0000 Subject: [PATCH 11/36] *Variants - Added the missing EffectZone param to Hanna and Karn --- res/cardsfolder/h/hanna.txt | 2 +- res/cardsfolder/k/karn.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/res/cardsfolder/h/hanna.txt b/res/cardsfolder/h/hanna.txt index eb08652d5a1..1642868252c 100644 --- a/res/cardsfolder/h/hanna.txt +++ b/res/cardsfolder/h/hanna.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Vanguard Text:no text HandLifeModifier:+1/-5 -S:Mode$ ReduceCost | ValidCard$ Card | Type$ Spell | Activator$ You | Amount$ 1 | Description$ Spells you cast cost 1 less to cast. +S:Mode$ ReduceCost | EffectZone$ Command | ValidCard$ Card | Type$ Spell | Activator$ You | Amount$ 1 | Description$ Spells you cast cost 1 less to cast. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4962&type=card End \ No newline at end of file diff --git a/res/cardsfolder/k/karn.txt b/res/cardsfolder/k/karn.txt index 5d846d37166..e99340aba8a 100644 --- a/res/cardsfolder/k/karn.txt +++ b/res/cardsfolder/k/karn.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Vanguard Text:no text HandLifeModifier:+1/+6 -S:Mode$ Continuous | Affected$ Artifact.nonCreature+YouCtrl | SetPower$ AffectedX | SetToughness$ AffectedX | References$ AffectedX | AddType$ Creature | Description$ Each noncreature artifact you control is an artifact creature with power and toughness each equal to its converted mana cost. +S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.nonCreature+YouCtrl | SetPower$ AffectedX | SetToughness$ AffectedX | References$ AffectedX | AddType$ Creature | Description$ Each noncreature artifact you control is an artifact creature with power and toughness each equal to its converted mana cost. SVar:AffectedX:Count$CardManaCost SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4963&type=card From 9e596ddac8c81bd9149bc562e91dea86b14b29b9 Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 14:22:06 +0000 Subject: [PATCH 12/36] *Variants - Added the following avatars: Lyna, Maraxus, Mishra, and Multani --- .gitattributes | 4 ++++ res/cardsfolder/l/lyna.txt | 9 +++++++++ res/cardsfolder/m/maraxus.txt | 9 +++++++++ res/cardsfolder/m/mishra.txt | 13 +++++++++++++ res/cardsfolder/m/multani.txt | 10 ++++++++++ 5 files changed, 45 insertions(+) create mode 100644 res/cardsfolder/l/lyna.txt create mode 100644 res/cardsfolder/m/maraxus.txt create mode 100644 res/cardsfolder/m/mishra.txt create mode 100644 res/cardsfolder/m/multani.txt diff --git a/.gitattributes b/.gitattributes index c0b007385c8..3bf3efa484f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5842,6 +5842,7 @@ res/cardsfolder/l/lust_for_war.txt svneol=native#text/plain res/cardsfolder/l/lux_cannon.txt svneol=native#text/plain res/cardsfolder/l/lyev_skyknight.txt -text res/cardsfolder/l/lymph_sliver.txt svneol=native#text/plain +res/cardsfolder/l/lyna.txt -text res/cardsfolder/l/lynx.txt svneol=native#text/plain res/cardsfolder/l/lys_alana_bowmaster.txt svneol=native#text/plain res/cardsfolder/l/lys_alana_huntmaster.txt svneol=native#text/plain @@ -5973,6 +5974,7 @@ res/cardsfolder/m/mantis_engine.txt svneol=native#text/plain res/cardsfolder/m/mantle_of_leadership.txt svneol=native#text/plain res/cardsfolder/m/maralen_of_the_mornsong.txt -text res/cardsfolder/m/marauding_knight.txt svneol=native#text/plain +res/cardsfolder/m/maraxus.txt -text res/cardsfolder/m/maraxus_of_keld.txt svneol=native#text/plain res/cardsfolder/m/marble_chalice.txt svneol=native#text/plain res/cardsfolder/m/marble_diamond.txt svneol=native#text/plain @@ -6278,6 +6280,7 @@ res/cardsfolder/m/misers_cage.txt svneol=native#text/plain res/cardsfolder/m/misery_charm.txt svneol=native#text/plain res/cardsfolder/m/misfortunes_gain.txt svneol=native#text/plain res/cardsfolder/m/misguided_rage.txt svneol=native#text/plain +res/cardsfolder/m/mishra.txt -text res/cardsfolder/m/mishra_artificer_prodigy.txt svneol=native#text/plain res/cardsfolder/m/mishras_bauble.txt -text res/cardsfolder/m/mishras_factory.txt svneol=native#text/plain @@ -6478,6 +6481,7 @@ res/cardsfolder/m/mudhole.txt -text res/cardsfolder/m/mul_daya_channelers.txt svneol=native#text/plain res/cardsfolder/m/mulch.txt svneol=native#text/plain res/cardsfolder/m/mulldrifter.txt svneol=native#text/plain +res/cardsfolder/m/multani.txt -text res/cardsfolder/m/multani_maro_sorcerer.txt svneol=native#text/plain res/cardsfolder/m/multanis_acolyte.txt svneol=native#text/plain res/cardsfolder/m/multanis_decree.txt svneol=native#text/plain diff --git a/res/cardsfolder/l/lyna.txt b/res/cardsfolder/l/lyna.txt new file mode 100644 index 00000000000..fc05a676ade --- /dev/null +++ b/res/cardsfolder/l/lyna.txt @@ -0,0 +1,9 @@ +Name:Lyna +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+2/-4 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Shadow | Description$ Creatures you control have shadow. (They can block and be blocked only by creatures with shadow.) +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12142&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/m/maraxus.txt b/res/cardsfolder/m/maraxus.txt new file mode 100644 index 00000000000..fa32ff5424b --- /dev/null +++ b/res/cardsfolder/m/maraxus.txt @@ -0,0 +1,9 @@ +Name:Maraxus +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/+2 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddPower$ 1 | Description$ Creatures you control get +1/+0. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4964&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/m/mishra.txt b/res/cardsfolder/m/mishra.txt new file mode 100644 index 00000000000..0d8b9eadba9 --- /dev/null +++ b/res/cardsfolder/m/mishra.txt @@ -0,0 +1,13 @@ +Name:Mishra +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/-3 +R:Event$ DamageDone | ActiveZones$ Command | ValidSource$ Creature.YouCtrl | ReplaceWith$ DmgTimes2 | IsCombat$ False | Description$ If a creature you control would deal damage, it deals double that damage instead. +R:Event$ DamageDone | ActiveZones$ Command | ValidSource$ Creature.YouCtrl | ReplaceWith$ DmgTimes2Combat | IsCombat$ True | Secondary$ True | Description$ If a creature you control would deal damage, it deals double that damage instead. +SVar:DmgTimes2:AB$ DealDamage | Cost$ 0 | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X +SVar:DmgTimes2Combat:AB$ DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ ReplacedTarget | DamageSource$ ReplacedSource | NumDmg$ X | References$ X +SVar:X:ReplaceCount$DamageAmount/Twice +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12327 +End \ No newline at end of file diff --git a/res/cardsfolder/m/multani.txt b/res/cardsfolder/m/multani.txt new file mode 100644 index 00000000000..651b14e4cf1 --- /dev/null +++ b/res/cardsfolder/m/multani.txt @@ -0,0 +1,10 @@ +Name:Multani +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-3/-2 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddPower$ X | References$ X | Description$ Creatures you control get +X/+0, where X is the number of cards in your hand. +SVar:X:Count$CardsInYourHand +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12146&type=card +End \ No newline at end of file From c592d860b1ca2edc5c5ad097bad7798c0a4e2f89 Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 14:48:23 +0000 Subject: [PATCH 13/36] *Variants - Added the following avatars: Oracle, Orim, Rofellos, Selenia, and Serra --- .gitattributes | 5 +++++ res/cardsfolder/o/oracle.txt | 11 +++++++++++ res/cardsfolder/o/orim.txt | 9 +++++++++ res/cardsfolder/r/rofellos.txt | 10 ++++++++++ res/cardsfolder/s/selenia.txt | 9 +++++++++ res/cardsfolder/s/serra.txt | 9 +++++++++ 6 files changed, 53 insertions(+) create mode 100644 res/cardsfolder/o/oracle.txt create mode 100644 res/cardsfolder/o/orim.txt create mode 100644 res/cardsfolder/r/rofellos.txt create mode 100644 res/cardsfolder/s/selenia.txt create mode 100644 res/cardsfolder/s/serra.txt diff --git a/.gitattributes b/.gitattributes index 3bf3efa484f..102b972d65c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6936,6 +6936,7 @@ res/cardsfolder/o/opposition.txt svneol=native#text/plain res/cardsfolder/o/oppression.txt svneol=native#text/plain res/cardsfolder/o/oppressive_will.txt svneol=native#text/plain res/cardsfolder/o/opt.txt svneol=native#text/plain +res/cardsfolder/o/oracle.txt -text res/cardsfolder/o/oracle_of_mul_daya.txt svneol=native#text/plain res/cardsfolder/o/oracle_of_nectars.txt svneol=native#text/plain res/cardsfolder/o/oracles_attendants.txt -text @@ -6979,6 +6980,7 @@ res/cardsfolder/o/ore_gorger.txt svneol=native#text/plain res/cardsfolder/o/organ_grinder.txt svneol=native#text/plain res/cardsfolder/o/orgg.txt svneol=native#text/plain res/cardsfolder/o/origin_spellbomb.txt svneol=native#text/plain +res/cardsfolder/o/orim.txt -text res/cardsfolder/o/orim_samite_healer.txt svneol=native#text/plain res/cardsfolder/o/orims_chant.txt -text svneol=unset#text/plain res/cardsfolder/o/orims_cure.txt -text @@ -8141,6 +8143,7 @@ res/cardsfolder/r/rockslide_ambush.txt svneol=native#text/plain res/cardsfolder/r/rockslide_elemental.txt svneol=native#text/plain res/cardsfolder/r/rocky_tar_pit.txt svneol=native#text/plain res/cardsfolder/r/rod_of_ruin.txt svneol=native#text/plain +res/cardsfolder/r/rofellos.txt -text res/cardsfolder/r/rofellos_llanowar_emissary.txt svneol=native#text/plain res/cardsfolder/r/rofelloss_gift.txt -text res/cardsfolder/r/rogue_elephant.txt -text @@ -8609,6 +8612,7 @@ res/cardsfolder/s/sejiri_steppe.txt svneol=native#text/plain res/cardsfolder/s/sekki_seasons_guide.txt -text svneol=unset#text/plain res/cardsfolder/s/sekkuar_deathkeeper.txt svneol=native#text/plain res/cardsfolder/s/selective_memory.txt -text +res/cardsfolder/s/selenia.txt -text res/cardsfolder/s/selenia_dark_angel.txt svneol=native#text/plain res/cardsfolder/s/selesnya_charm.txt -text res/cardsfolder/s/selesnya_evangel.txt svneol=native#text/plain @@ -8656,6 +8660,7 @@ res/cardsfolder/s/serpent_warrior.txt svneol=native#text/plain res/cardsfolder/s/serpentine_basilisk.txt svneol=native#text/plain res/cardsfolder/s/serpentine_kavu.txt svneol=native#text/plain res/cardsfolder/s/serpents_gift.txt -text +res/cardsfolder/s/serra.txt -text res/cardsfolder/s/serra_advocate.txt svneol=native#text/plain res/cardsfolder/s/serra_angel.txt svneol=native#text/plain res/cardsfolder/s/serra_ascendant.txt svneol=native#text/plain diff --git a/res/cardsfolder/o/oracle.txt b/res/cardsfolder/o/oracle.txt new file mode 100644 index 00000000000..c7354ab2514 --- /dev/null +++ b/res/cardsfolder/o/oracle.txt @@ -0,0 +1,11 @@ +Name:Oracle +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/+9 +A:AB$ Untap | ActivationZone$ Command | Cost$ 0 | ValidTgts$ Creature.attacking+youCtrl | TgtPrompt$ Select target attacking creature you control | SubAbility$ Reconsider | SpellDescription$ Untap target attacking creature you control and remove it from combat. +SVar:Reconsider:DB$ RemoveFromCombat | Defined$ Targeted +SVar:RemAIDeck:True +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12141&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/o/orim.txt b/res/cardsfolder/o/orim.txt new file mode 100644 index 00000000000..37843ca7324 --- /dev/null +++ b/res/cardsfolder/o/orim.txt @@ -0,0 +1,9 @@ +Name:Orim +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/+12 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Reach | Description$ Creatures you control have reach. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4966&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/r/rofellos.txt b/res/cardsfolder/r/rofellos.txt new file mode 100644 index 00000000000..dbf2937dab4 --- /dev/null +++ b/res/cardsfolder/r/rofellos.txt @@ -0,0 +1,10 @@ +Name:Rofellos +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-2/+4 +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.YouCtrl | Execute$ TrigDraw | TriggerController$ TriggeredCardController | TriggerDescription$ Whenever a creature you control dies, draw a card. +SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12145 +End \ No newline at end of file diff --git a/res/cardsfolder/s/selenia.txt b/res/cardsfolder/s/selenia.txt new file mode 100644 index 00000000000..b3f74c7ac26 --- /dev/null +++ b/res/cardsfolder/s/selenia.txt @@ -0,0 +1,9 @@ +Name:Selenia +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/+7 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Vigilance | Description$ Creatures you control have vigilance. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4967&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/s/serra.txt b/res/cardsfolder/s/serra.txt new file mode 100644 index 00000000000..09a59398d3b --- /dev/null +++ b/res/cardsfolder/s/serra.txt @@ -0,0 +1,9 @@ +Name:Serra +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/+1 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddToughness$ 2 | Description$ Creatures you control get +0/+2. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12332&type=card +End \ No newline at end of file From 5b47ae940017705ce79ff1702821bcd4c51b304b Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 14:50:18 +0000 Subject: [PATCH 14/36] *Variants - Fixed TriggerZones for Rofellos --- res/cardsfolder/r/rofellos.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/cardsfolder/r/rofellos.txt b/res/cardsfolder/r/rofellos.txt index dbf2937dab4..43da9f2b07f 100644 --- a/res/cardsfolder/r/rofellos.txt +++ b/res/cardsfolder/r/rofellos.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Vanguard Text:no text HandLifeModifier:-2/+4 -T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.YouCtrl | Execute$ TrigDraw | TriggerController$ TriggeredCardController | TriggerDescription$ Whenever a creature you control dies, draw a card. +T:Mode$ ChangesZone | TriggerZones$ Command | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.YouCtrl | Execute$ TrigDraw | TriggerController$ TriggeredCardController | TriggerDescription$ Whenever a creature you control dies, draw a card. SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12145 From 1e890e1823a47b3f466d61233db68db50b36a4fa Mon Sep 17 00:00:00 2001 From: moomarc Date: Thu, 22 Nov 2012 17:36:48 +0000 Subject: [PATCH 15/36] *Variants - Added the following avatars: Volrath and Xantcha --- .gitattributes | 2 ++ res/cardsfolder/v/volrath.txt | 10 ++++++++++ res/cardsfolder/x/xantcha.txt | 10 ++++++++++ 3 files changed, 22 insertions(+) create mode 100644 res/cardsfolder/v/volrath.txt create mode 100644 res/cardsfolder/x/xantcha.txt diff --git a/.gitattributes b/.gitattributes index 102b972d65c..9f7dd7bb72c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11026,6 +11026,7 @@ res/cardsfolder/v/volcanic_submersion.txt svneol=native#text/plain res/cardsfolder/v/volcano_imp.txt svneol=native#text/plain res/cardsfolder/v/volition_reins.txt svneol=native#text/plain res/cardsfolder/v/volley_of_boulders.txt -text +res/cardsfolder/v/volrath.txt -text res/cardsfolder/v/volrath_the_fallen.txt svneol=native#text/plain res/cardsfolder/v/volraths_dungeon.txt svneol=native#text/plain res/cardsfolder/v/volraths_gardens.txt svneol=native#text/plain @@ -11515,6 +11516,7 @@ res/cardsfolder/w/wurmskin_forger.txt svneol=native#text/plain res/cardsfolder/w/wurmweaver_coil.txt svneol=native#text/plain res/cardsfolder/w/wydwen_the_biting_gale.txt svneol=native#text/plain res/cardsfolder/w/wyluli_wolf.txt svneol=native#text/plain +res/cardsfolder/x/xantcha.txt -text res/cardsfolder/x/xanthic_statue.txt svneol=native#text/plain res/cardsfolder/x/xantid_swarm.txt -text res/cardsfolder/x/xathrid_demon.txt -text diff --git a/res/cardsfolder/v/volrath.txt b/res/cardsfolder/v/volrath.txt new file mode 100644 index 00000000000..3a4f6b96b16 --- /dev/null +++ b/res/cardsfolder/v/volrath.txt @@ -0,0 +1,10 @@ +Name:Volrath +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+2/-3 +T:Mode$ ChangesZone | TriggerZones$ Command | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.YouCtrl+YouOwn | OptionalDecider$ You | Execute$ GetUp | TriggerController$ TriggeredCardController | TriggerDescription$ Whenever a creature you control is put into your graveyard from the battlefield, you may put it on top of your library. +SVar:GetUp:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Library +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4972&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/x/xantcha.txt b/res/cardsfolder/x/xantcha.txt new file mode 100644 index 00000000000..a5ead968fca --- /dev/null +++ b/res/cardsfolder/x/xantcha.txt @@ -0,0 +1,10 @@ +Name:Xantcha +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/+3 +A:AB$ Regenerate | ActivationZone$ Command | Cost$ Sac<1/Permanent> | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Regenerate target creature. +SVar:RemAIDeck:True +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12331&type=card +End \ No newline at end of file From 5068de9c7389d221313647ab1e83388071ebfe2c Mon Sep 17 00:00:00 2001 From: Hellfish Date: Thu, 22 Nov 2012 19:21:34 +0000 Subject: [PATCH 16/36] *Variants: Removed avatars with RemAiDeck:True from AI's avatar list. *Variants: Made AI aware of the avatar. --- .../forge/game/player/ComputerAIGeneral.java | 1 + .../gui/home/variant/CSubmenuVanguard.java | 8 ++--- .../gui/home/variant/VSubmenuVanguard.java | 31 ++++++++++++++----- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/main/java/forge/game/player/ComputerAIGeneral.java b/src/main/java/forge/game/player/ComputerAIGeneral.java index e70fd4ac69c..6c87cf4a914 100644 --- a/src/main/java/forge/game/player/ComputerAIGeneral.java +++ b/src/main/java/forge/game/player/ComputerAIGeneral.java @@ -139,6 +139,7 @@ public class ComputerAIGeneral implements Computer { all.addAll(player.getCardsIn(ZoneType.Battlefield)); all.addAll(player.getCardsIn(ZoneType.Exile)); all.addAll(player.getCardsIn(ZoneType.Graveyard)); + all.addAll(player.getCardsIn(ZoneType.Command)); if (!player.getCardsIn(ZoneType.Library).isEmpty()) { all.add(player.getCardsIn(ZoneType.Library).get(0)); } diff --git a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java index e335984ea51..00ddc1ed597 100644 --- a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java +++ b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java @@ -119,19 +119,17 @@ public enum CSubmenuVanguard implements ICDoc { Lobby lobby = Singletons.getControl().getLobby(); LobbyPlayer humanPlayer = lobby.findLocalPlayer(PlayerType.HUMAN); LobbyPlayer aiPlayer = lobby.findLocalPlayer(PlayerType.COMPUTER); - - PlayerStartConditions aiCond = new PlayerStartConditions(aiDeck); - PlayerStartConditions humanCond = new PlayerStartConditions(humanDeck); - + MatchStartHelper helper = new MatchStartHelper(); final CardPrinted aiVanguard,humanVanguard; Iterable all = VSubmenuVanguard.SINGLETON_INSTANCE.getAllAvatars(); + Iterable aiAll = VSubmenuVanguard.SINGLETON_INSTANCE.getAllAiAvatars(); if(selAiAv instanceof String) { //Random is the only string in the list so grab a random avatar. Random r = new Random(); - aiVanguard = Iterables.get(all,r.nextInt(Iterables.size(all))); + aiVanguard = Iterables.get(aiAll,r.nextInt(Iterables.size(all))); } else { diff --git a/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java index 45cfe340117..021c212ff4e 100644 --- a/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java +++ b/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java @@ -1,6 +1,8 @@ package forge.gui.home.variant; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.Vector; import javax.swing.JButton; @@ -69,6 +71,7 @@ public enum VSubmenuVanguard implements IVSubmenu { private final Predicate avatarTypePred = CardPrinted.Predicates.type("Vanguard"); private final Iterable allAvatars = Iterables.filter(CardDb.instance().getAllCards(), avatarTypePred); + private final List allAiAvatars = new ArrayList(); private final FLabel lblAvatarHuman = new FLabel.Builder() .text("Human avatar:") @@ -83,17 +86,22 @@ public enum VSubmenuVanguard implements IVSubmenu { lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2)); - Predicate typePred = CardPrinted.Predicates.type("Vanguard"); - - Vector listData = new Vector(); - listData.add("Random"); - for(CardPrinted cp : Iterables.filter(CardDb.instance().getAllCards(), typePred)) + Vector humanListData = new Vector(); + Vector aiListData = new Vector(); + humanListData.add("Random"); + aiListData.add("Random"); + for(CardPrinted cp : allAvatars) { - listData.add(cp); + humanListData.add(cp); + if(!cp.getCard().getRemAIDecks()) + { + aiListData.add(cp); + allAiAvatars.add(cp); + } } - avHuman.setListData(listData); - avAi.setListData(listData); + avHuman.setListData(humanListData); + avAi.setListData(aiListData); avHuman.setSelectedIndex(0); avAi.setSelectedIndex(0); @@ -247,4 +255,11 @@ public enum VSubmenuVanguard implements IVSubmenu { public Iterable getAllAvatars() { return allAvatars; } + + /** + * @return the allAiAvatars + */ + public List getAllAiAvatars() { + return allAiAvatars; + } } From 354f609cd87140936c4676b856e4649f80aa95eb Mon Sep 17 00:00:00 2001 From: Hellfish Date: Thu, 22 Nov 2012 20:26:09 +0000 Subject: [PATCH 17/36] Merged changes from trunk to Variants: r18254-r18318 --- .gitattributes | 12 +- CHANGES.txt | 76 +++++- res/cardsfolder/a/acidic_dagger.txt | 2 +- res/cardsfolder/a/auriok_replica.txt | 2 +- res/cardsfolder/b/burrenton_forge_tender.txt | 2 +- res/cardsfolder/p/phyrexian_defiler.txt | 2 +- res/cardsfolder/s/starlit_sanctum.txt | 6 +- res/cardsfolder/z/zombie_mob.txt | 1 + src/main/java/forge/Card.java | 2 +- src/main/java/forge/CardUtil.java | 51 +--- src/main/java/forge/GameAction.java | 22 +- src/main/java/forge/GameActionUtil.java | 10 +- .../card/abilityfactory/AbilityFactory.java | 16 +- .../card/abilityfactory/ai/ChangeZoneAi.java | 28 +- .../effects/ChangeZoneAllEffect.java | 6 +- .../effects/ChangeZoneEffect.java | 246 ++++++++++-------- .../abilityfactory/effects/CharmEffect.java | 40 +-- .../effects/ChooseCardEffect.java | 4 +- .../effects/ChooseCardNameEffect.java | 6 +- .../effects/ChooseColorEffect.java | 6 +- .../effects/ChooseGenericEffect.java | 8 +- .../effects/ChooseNumberEffect.java | 25 +- .../effects/ChoosePlayerEffect.java | 20 +- .../effects/ChooseSourceEffect.java | 4 +- .../effects/ChooseTypeEffect.java | 15 +- .../abilityfactory/effects/ClashEffect.java | 6 +- .../abilityfactory/effects/CleanUpEffect.java | 12 +- .../abilityfactory/effects/CloneEffect.java | 6 +- .../effects/ControlExchangeEffect.java | 4 +- .../effects/ControlGainEffect.java | 76 +++--- .../effects/CopyPermanentEffect.java | 6 +- .../effects/CopySpellEffect.java | 6 +- .../abilityfactory/effects/CounterEffect.java | 44 ++-- .../effects/CountersMoveEffect.java | 12 +- .../effects/CountersProliferateEffect.java | 45 ++-- .../effects/CountersPutAllEffect.java | 10 +- .../effects/CountersPutEffect.java | 6 +- .../effects/CountersRemoveAllEffect.java | 8 +- .../effects/DamageAllEffect.java | 13 +- .../effects/DamageDealEffect.java | 10 +- .../effects/DamageEachEffect.java | 14 +- .../effects/DamagePreventAllEffect.java | 8 +- .../effects/DamagePreventEffect.java | 12 +- .../effects/DebuffAllEffect.java | 18 +- .../abilityfactory/effects/DebuffEffect.java | 12 +- .../effects/DelayedTriggerEffect.java | 6 +- .../effects/DestroyAllEffect.java | 10 +- .../abilityfactory/effects/DestroyEffect.java | 2 +- .../abilityfactory/effects/DigEffect.java | 7 +- .../effects/DigUntilEffect.java | 17 +- .../abilityfactory/effects/DiscardEffect.java | 71 +++-- .../effects/DrainManaEffect.java | 8 +- .../abilityfactory/effects/DrawEffect.java | 21 +- .../abilityfactory/effects/EffectEffect.java | 4 +- .../abilityfactory/effects/EndTurnEffect.java | 7 +- .../abilityfactory/effects/FightEffect.java | 4 +- .../effects/FlipCoinEffect.java | 4 +- .../abilityfactory/effects/FogEffect.java | 3 +- .../effects/GameLossEffect.java | 6 +- .../abilityfactory/effects/GameWinEffect.java | 3 +- .../effects/LifeExchangeEffect.java | 24 +- .../effects/LifeGainEffect.java | 25 +- .../effects/LifeLoseEffect.java | 13 +- .../abilityfactory/effects/LifeSetEffect.java | 14 +- .../abilityfactory/effects/ManaEffect.java | 43 ++- .../effects/ManaReflectedEffect.java | 19 +- .../abilityfactory/effects/MillEffect.java | 5 +- .../effects/MustAttackEffect.java | 15 +- .../effects/MustBlockEffect.java | 12 +- .../effects/PermanentCreatureEfect.java | 2 +- .../abilityfactory/effects/PhasesEffect.java | 4 +- .../abilityfactory/effects/PlayEffect.java | 11 +- .../abilityfactory/effects/PoisonEffect.java | 17 +- .../effects/ProtectAllEffect.java | 6 +- .../abilityfactory/effects/ProtectEffect.java | 6 +- .../abilityfactory/effects/PumpAllEffect.java | 36 +-- .../abilityfactory/effects/PumpEffect.java | 33 ++- .../effects/RearrangeTopOfLibraryEffect.java | 18 +- .../effects/RegenerateAllEffect.java | 3 +- .../effects/RegenerateEffect.java | 15 +- .../effects/RemoveFromCombatEffect.java | 10 +- .../abilityfactory/effects/RepeatEffect.java | 36 +-- .../effects/RestartGameEffect.java | 21 +- .../abilityfactory/effects/RevealEffect.java | 5 +- .../effects/RevealEffectBase.java | 2 +- .../effects/RevealHandEffect.java | 12 +- .../effects/SacrificeAllEffect.java | 10 +- .../effects/SacrificeEffect.java | 20 +- .../abilityfactory/effects/ScryEffect.java | 10 +- .../effects/SetStateAllEffect.java | 4 +- .../effects/SetStateEffect.java | 10 +- .../abilityfactory/effects/ShuffleEffect.java | 13 +- .../effects/StoreSVarEffect.java | 2 +- .../abilityfactory/effects/TapAllEffect.java | 17 +- .../abilityfactory/effects/TapEffect.java | 8 +- .../effects/TapOrUntapAllEffect.java | 6 +- .../effects/TapOrUntapEffect.java | 8 +- .../abilityfactory/effects/TokenEffect.java | 4 +- .../effects/TwoPilesEffect.java | 45 ++-- .../effects/UnattachAllEffect.java | 22 +- .../effects/UntapAllEffect.java | 19 +- .../abilityfactory/effects/UntapEffect.java | 20 +- .../cardfactory/CardFactoryCreatures.java | 4 +- .../card/cardfactory/CardFactoryLands.java | 5 +- .../card/cardfactory/CardFactoryUtil.java | 4 + .../java/forge/card/cost/CostDiscard.java | 6 +- src/main/java/forge/card/cost/CostExile.java | 6 +- src/main/java/forge/card/mana/ManaCost.java | 2 +- .../java/forge/card/mana/ManaCostShard.java | 10 +- src/main/java/forge/card/mana/ManaPool.java | 6 +- .../card/replacement/ReplacementEffect.java | 6 +- .../card/replacement/ReplacementHandler.java | 4 +- .../card/replacement/ReplacementLayer.java | 2 +- .../card/spellability/AbilityActivated.java | 4 +- .../card/spellability/AbilityManaPart.java | 20 +- .../card/spellability/AbilityTriggered.java | 2 +- .../card/spellability/ISpellAbility.java | 2 +- .../java/forge/card/spellability/Spell.java | 10 +- .../forge/card/spellability/SpellAbility.java | 56 ++-- .../spellability/SpellAbilityRestriction.java | 2 +- .../spellability/SpellAbilityVariables.java | 2 +- .../card/spellability/SpellPermanent.java | 28 +- .../java/forge/card/spellability/Target.java | 6 +- .../card/spellability/TargetChoices.java | 6 +- .../card/spellability/TargetSelection.java | 2 +- src/main/java/forge/control/FControl.java | 12 + .../forge/control/input/InputPayManaCost.java | 2 +- .../control/input/InputPayManaCost2.java | 2 +- .../input/InputPayManaCostAbility.java | 2 +- src/main/java/forge/game/GameNew.java | 8 +- src/main/java/forge/game/GameState.java | 14 + src/main/java/forge/game/event/Event.java | 5 + .../forge/game/event/LandPlayedEvent.java | 17 ++ .../forge/game/event/PoisonCounterEvent.java | 24 ++ .../forge/game/event/SpellResolvedEvent.java | 28 ++ .../java/forge/game/event/package-info.java | 3 + .../java/forge/game/limited/BoosterDraft.java | 10 + .../java/forge/game/phase/CombatUtil.java | 3 + .../java/forge/game/phase/PhaseHandler.java | 6 +- .../java/forge/game/player/ComputerUtil.java | 2 +- .../forge/game/player/ComputerUtilAttack.java | 6 +- src/main/java/forge/game/player/Player.java | 31 +-- src/main/java/forge/game/zone/MagicStack.java | 8 +- .../gui/home/quest/VSubmenuQuestData.java | 97 ++++--- .../java/forge/gui/match/VAssignDamage.java | 7 +- src/main/java/forge/sound/AudioClip.java | 103 ++++++++ .../java/forge/sound/EventVisualilzer.java | 142 ++++++++++ src/main/java/forge/sound/IAudioClip.java | 8 + src/main/java/forge/sound/NoSoundClip.java | 18 ++ .../java/forge/sound/SoundEffectType.java | 84 ++++++ src/main/java/forge/sound/SoundSystem.java | 139 +++++----- src/main/java/forge/sound/SoundUtils.java | 140 ---------- src/main/java/forge/sound/Sounds.java | 121 --------- src/main/java/forge/view/arcane/PlayArea.java | 9 +- 154 files changed, 1652 insertions(+), 1332 deletions(-) create mode 100644 src/main/java/forge/game/event/Event.java create mode 100644 src/main/java/forge/game/event/LandPlayedEvent.java create mode 100644 src/main/java/forge/game/event/PoisonCounterEvent.java create mode 100644 src/main/java/forge/game/event/SpellResolvedEvent.java create mode 100644 src/main/java/forge/game/event/package-info.java create mode 100644 src/main/java/forge/sound/AudioClip.java create mode 100644 src/main/java/forge/sound/EventVisualilzer.java create mode 100644 src/main/java/forge/sound/IAudioClip.java create mode 100644 src/main/java/forge/sound/NoSoundClip.java create mode 100644 src/main/java/forge/sound/SoundEffectType.java delete mode 100644 src/main/java/forge/sound/SoundUtils.java delete mode 100644 src/main/java/forge/sound/Sounds.java diff --git a/.gitattributes b/.gitattributes index 9f7dd7bb72c..d99677e9215 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12957,6 +12957,11 @@ src/main/java/forge/game/GlobalRuleChange.java -text src/main/java/forge/game/MatchController.java -text src/main/java/forge/game/MatchStartHelper.java -text src/main/java/forge/game/PlayerStartConditions.java -text +src/main/java/forge/game/event/Event.java -text +src/main/java/forge/game/event/LandPlayedEvent.java -text +src/main/java/forge/game/event/PoisonCounterEvent.java -text +src/main/java/forge/game/event/SpellResolvedEvent.java -text +src/main/java/forge/game/event/package-info.java -text src/main/java/forge/game/limited/BoosterDeck.java -text src/main/java/forge/game/limited/BoosterDraft.java svneol=native#text/plain src/main/java/forge/game/limited/BoosterDraftAI.java svneol=native#text/plain @@ -13279,9 +13284,12 @@ src/main/java/forge/quest/io/QuestDataIO.java svneol=native#text/plain src/main/java/forge/quest/io/ReadPriceList.java svneol=native#text/plain src/main/java/forge/quest/io/package-info.java svneol=native#text/plain src/main/java/forge/quest/package-info.java svneol=native#text/plain +src/main/java/forge/sound/AudioClip.java -text +src/main/java/forge/sound/EventVisualilzer.java -text +src/main/java/forge/sound/IAudioClip.java -text +src/main/java/forge/sound/NoSoundClip.java -text +src/main/java/forge/sound/SoundEffectType.java -text src/main/java/forge/sound/SoundSystem.java -text -src/main/java/forge/sound/SoundUtils.java -text -src/main/java/forge/sound/Sounds.java -text src/main/java/forge/util/Aggregates.java -text src/main/java/forge/util/Base64Coder.java svneol=native#text/plain src/main/java/forge/util/BinaryUtil.java -text diff --git a/CHANGES.txt b/CHANGES.txt index 22984b60d46..3f206a731e2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,7 +24,7 @@ A recent contribution to the code base should fix some of the bugs that people n We are now using a different system for our snapshot and beta releases. Unfortunately, this new system builds a jar file which does not accurately display the SVN revision number. -Forge may not be fully java 7 compatible at this time. We recommend that people downgrade to java 6. +Forge is likely to be compatible with Java 7 at this time. Some people have used forge with Java 7 and have not reported any problems that are related to Java 7. If you would like to upgrade to Java 7 and have held off because of Forge then you may upgrade as we do not think that it will cause an incompatibility type of problem at this time. We will continue to try to maintain compatibility with Java 6 for the foreseeable future. -- @@ -72,6 +72,60 @@ Fixes/Features: - ChangeZoneAll with destination Library will now let you choose the order. - Fixed spell description for Hypnotic Cloud - Added the recent commit logs to changes.txt. Preparing for the snapshot build release. +- CheckStyle +- CheckStyle +- small script tweaks +- Fixed Enlightened Tutor not shuffling the library. +- Added the global rule change: "Each creature assigns combat damage equal to its toughness rather than its power.". +- Converted Doran, the Siege Tower. +- Converted Shifting Sliver to script. +- Cleanup. +- Created Variants branch. +- Variants: Created command zone view. +- Variants: Moved effects and emblems to command zone. +- Variants: Added a bunch of Vanguard cards (Thanks, Marc!) +- Variants: Added a Vanguard home screen. +- Variants: Created command zone view. +- Variants:2 files weren't added correctly. +- You no longer have to choose the order of cards for Elixir of Immortality. +- Fixed payment of phyrexian mana. +- Fixed Shocklands not using canPayLife(2). +- The AI will now better react to Platinum Emperion. +- Added a Java 7 compatibility fluff piece to the changes.txt file. +- If lethal damage has already been assigned just treat is as 0 in VAssignDamage +- Minor text change +- CheckStyle. +- Vanguard: added AffectedZone parameter to Birds of Paradise Avatar +- Added Shell of the Last Kappa +- ChangeZone can now remember cards moved from the stack +- CheckStyle +- The AI can now use Icy Prison. +- Cleanup AF can now be used to clear individual defined cards from remembered lists +- Removed a println I left in my previous commit +- Variants - Fixed Archangel of Strife +- Variants - Changed ValidGrave count method to Valid eg:Count$ValidBattlefield,Graveyard Card.YouCtrl +- Added the recent commit logs to changes.txt. Preparing for the snapshot build release. +- Variants: Fixed CardRules parser choking on "+" characters. +- Fixed the wrong player gaining life when GainLife has a targetPlayer and a defined player. Defined player takes preference again as it used to. This fixes Divine Congregation, Gerrard Capashen and Spoils of Evil +- setinfo and oracle data for Chaotic Backlash +- Fixed Nomad Mythmaker targeting. +- CheckStyle. +- Another fix for Nomad Mythmaker. +- Fixed Exotic Curse. +- Reverted Nomad Mythmaker. +- Cleanup of getLKICopy functions. +- Fixed Starlit Sanctum. +- Hopefully the final fix for Nomad Mythmaker +- More fixing for Nomad Mythmaker. +- The AI will no longer choose non-Pump Auras with Nomad Mythmaker. +- The AI will no longer choose non-Pump Auras with Nomad Mythmaker. +- Added the recent commit logs to changes.txt. Preparing for the snapshot build release. +- CheckStyle. +- Added an AI SVar to Zombie Mob. +- Booster Draft: added four more choices to block booster draft set order selection (e.g. so that MRD/DST/5DN is possible in addition to only 5DN/DST/MRD, etc.) +- corrected static ability name in effect script for Ember Gale +- Variants - Added Ertai (vanguard avatar) +- Added the recent commit logs to changes.txt. Preparing for the snapshot build release. Many people helped with this version. A special thank you goes out to them. (Attempted to list names alphabetically): @@ -90,6 +144,26 @@ Equal Treatment Terastodon Demonfire Mirror of Fate +Vassal's Duty +Sivvi's Valor +Chromeshell Crab +Icy Prison +Kill Switch +Kaho, Minamo Historian +Nomad Mythmaker +Honorable Scout +Chaotic Backlash +Complicate +Circle of Solace +Pay No Heed +Prahv, Spires of Order +Rith's Charm +Cragganwick Cremator +Mischievous Quanar +Pilgrim of Justice +Pilgrim of Virtue +Ember Gale +Tower Above end diff --git a/res/cardsfolder/a/acidic_dagger.txt b/res/cardsfolder/a/acidic_dagger.txt index 8e89780163b..db02128ac45 100644 --- a/res/cardsfolder/a/acidic_dagger.txt +++ b/res/cardsfolder/a/acidic_dagger.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ Effect | Cost$ 4 T | Name$ Acidic Dagger Effect | ValidTgts$ Creature | TgtPrompt$ Select target creature | Triggers$ TrigDam,TrigLeave | SVars$ TrigDestroy,TrigSac,ExileEffect | RememberObjects$ Targeted | ImprintCards$ Self | ActivationPhases$ Upkeep->Declare Attackers - Play Instants and Abilities | SpellDescription$ Whenever target creature deals combat damage to a non-Wall creature this turn, destroy that non-Wall creature. When the targeted creature leaves the battlefield this turn, sacrifice CARDNAME. Activate this ability only before blockers are declared. SVar:TrigDam:Mode$ DamageDone | ValidSource$ Creature.IsRemembered | ValidTarget$ Creature.nonWall | CombatDamage$ True | TriggerZones$ Battlefield | Execute$ TrigDestroy | TriggerDescription$ Whenever targeted creature deals combat damage to a non-Wall creature this turn, destroy that non-Wall creature. SVar:TrigLeave:Mode$ ChangesZone | ValidCard$ Creature.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ TrigSac | TriggerDescription$ When the targeted creature leaves the battlefield this turn, sacrifice Acidic Dagger. -SVar:TrigDestroy:AB$Destroy | Cost$ 0 | Defined$ TriggeredTarget +SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredTarget SVar:TrigSac:DB$ SacrificeAll | Defined$ Imprinted | SubAbility$ ExileEffect SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True SVar:RemAIDeck:True diff --git a/res/cardsfolder/a/auriok_replica.txt b/res/cardsfolder/a/auriok_replica.txt index 00ccc4fa9a9..2d63c089842 100644 --- a/res/cardsfolder/a/auriok_replica.txt +++ b/res/cardsfolder/a/auriok_replica.txt @@ -5,7 +5,7 @@ Text:no text PT:2/2 A:AB$ ChooseSource | Cost$ W Sac<1/CARDNAME> | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ Prevent all damage a source of your choice would deal to you this turn. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 -SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | PreventionEffect$ True | Description$ Prevent all damage the chosen source would deal to you this turn. +SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | Prevent$ True | PreventionEffect$ True | Description$ Prevent all damage the chosen source would deal to you this turn. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/auriok_replica.jpg diff --git a/res/cardsfolder/b/burrenton_forge_tender.txt b/res/cardsfolder/b/burrenton_forge_tender.txt index c9e2c4046e6..82ce4840435 100644 --- a/res/cardsfolder/b/burrenton_forge_tender.txt +++ b/res/cardsfolder/b/burrenton_forge_tender.txt @@ -6,7 +6,7 @@ PT:1/1 K:Protection from red A:AB$ ChooseSource | Cost$ Sac<1/CARDNAME> | Choices$ Card.Red | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ Prevent all damage a red source of your choice would deal this turn. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 -SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | PreventionEffect$ True | Description$ Prevent all damage the chosen source would deal this turn. +SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | Prevent$ True | PreventionEffect$ True | Description$ Prevent all damage the chosen source would deal this turn. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/burrenton_forge_tender.jpg diff --git a/res/cardsfolder/p/phyrexian_defiler.txt b/res/cardsfolder/p/phyrexian_defiler.txt index c0df11e3a8c..84219210c87 100644 --- a/res/cardsfolder/p/phyrexian_defiler.txt +++ b/res/cardsfolder/p/phyrexian_defiler.txt @@ -4,7 +4,7 @@ Types:Creature Carrier Text:no text PT:3/3 A:AB$ Pump | Cost$ T Sac<1/CARDNAME> | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -3 | NumDef$ -3 | IsCurse$ True | SpellDescription$ Target creature gets -3/-3 until end of turn. -SVar:RemRandomDeck:True +SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_defiler.jpg SetInfo:ULG|Uncommon|http://magiccards.info/scans/en/ul/60.jpg diff --git a/res/cardsfolder/s/starlit_sanctum.txt b/res/cardsfolder/s/starlit_sanctum.txt index 033fad96a08..ccac2c01b18 100644 --- a/res/cardsfolder/s/starlit_sanctum.txt +++ b/res/cardsfolder/s/starlit_sanctum.txt @@ -2,10 +2,10 @@ Name:Starlit Sanctum ManaCost:no cost Types:Land A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add 1 to your mana pool. -A:AB$ GainLife | Cost$ W T Sac<1/Creature.cleric> | LifeAmount$ X | CostDesc$ W, T, Sacrifice a Cleric creature: | SpellDescription$ You gain life equal to the sacrificed creature's toughness. +A:AB$ GainLife | Cost$ W T Sac<1/Creature.Cleric/Cleric creature> | LifeAmount$ X | References$ X | SpellDescription$ You gain life equal to the sacrificed creature's toughness. SVar:X:Sacrificed$CardToughness -A:AB$ LoseLife | Cost$ B T Sac<1/Creature.cleric> | ValidTgts$ Player | LifeAmount$ X | TgtPrompt$ Select a player | CostDesc$ B, T, Sacrifice a Cleric creature: | SpellDescription$ Target player loses life equal to the sacrificed creature's power. -SVar:X:Sacrificed$CardPower +A:AB$ LoseLife | Cost$ B T Sac<1/Creature.Cleric/Cleric creature> | ValidTgts$ Player | LifeAmount$ Y | References$ Y | TgtPrompt$ Select a player | SpellDescription$ Target player loses life equal to the sacrificed creature's power. +SVar:Y:Sacrificed$CardPower SVar:RemRandomDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/starlit_sanctum.jpg diff --git a/res/cardsfolder/z/zombie_mob.txt b/res/cardsfolder/z/zombie_mob.txt index 1d4327c369a..57d2529de6a 100644 --- a/res/cardsfolder/z/zombie_mob.txt +++ b/res/cardsfolder/z/zombie_mob.txt @@ -7,6 +7,7 @@ K:etbCounter:P1P1:X:no Condition:CARDNAME enters the battlefield with a +1/+1 co T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigExileAll | TriggerDescription$ When CARDNAME enters the battlefield, exile all creature cards from your graveyard. SVar:TrigExileAll:AB$ChangeZoneAll | Cost$ 0 | ChangeType$ Creature.YouCtrl | Origin$ Graveyard | Destination$ Exile SVar:X:Count$TypeInYourYard.Creature +SVar:NeedsToPlayVar:X GE2 SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/zombie_mob.jpg SetInfo:MIR|Uncommon|http://magiccards.info/scans/en/mr/51.jpg diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 3b403787303..f4609160bcf 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -61,7 +61,7 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; import forge.item.CardDb; import forge.item.CardPrinted; -import forge.sound.Sounds; +import forge.sound.SoundEffectType; import forge.util.Expressions; import forge.util.MyRandom; diff --git a/src/main/java/forge/CardUtil.java b/src/main/java/forge/CardUtil.java index 7294beceb6c..53642e23290 100644 --- a/src/main/java/forge/CardUtil.java +++ b/src/main/java/forge/CardUtil.java @@ -680,48 +680,6 @@ public final class CardUtil { return res; } - /** - * getLKICopyOld. - * - * @param c - * a Card. - * @return a copy of C with LastKnownInfo stuff retained. - */ - public static Card getLKICopyOld(final Card c) { - if (c.isToken()) { - return c; - } - final CardCharacteristicName state = c.getCurState(); - if (c.isInAlternateState()) { - c.setState(CardCharacteristicName.Original); - } - final Card res = Singletons.getModel().getCardFactory().copyCard(c); - c.setState(state); - res.setState(state); - res.setControllerObjects(c.getControllerObjects()); - res.addTempAttackBoost(c.getTempAttackBoost()); - res.addSemiPermanentAttackBoost(c.getSemiPermanentAttackBoost()); - res.addTempDefenseBoost(c.getTempDefenseBoost()); - res.addSemiPermanentDefenseBoost(c.getSemiPermanentDefenseBoost()); - res.setCounters(c.getCounters()); - res.setExtrinsicKeyword(c.getExtrinsicKeyword()); - res.setColor(c.getColor()); - res.setChangedCardTypes(c.getChangedCardTypes()); - res.setNewPT(new ArrayList(c.getNewPT())); - res.setReceivedDamageFromThisTurn(c.getReceivedDamageFromThisTurn()); - res.getDamageHistory().setCreatureGotBlockedThisTurn(c.getDamageHistory().getCreatureGotBlockedThisTurn()); - res.setEnchanting(c.getEnchanting()); - res.setEnchantedBy(c.getEnchantedBy()); - res.setEquipping(c.getEquipping()); - res.setEquippedBy(c.getEquippedBy()); - res.setHaunting(c.getHaunting()); - for (final Card haunter : c.getHauntedBy()) { - res.addHauntedBy(haunter); - } - - return res; - } - /** * getLKICopy. * @@ -741,21 +699,18 @@ public final class CardUtil { newCopy.setFlipCard(in.isFlipCard()); newCopy.setDoubleFaced(in.isDoubleFaced()); newCopy.getCharacteristics().copy(in.getState(in.getCurState())); + newCopy.setBaseAttack(in.getNetAttack()); + newCopy.setBaseDefense(in.getNetDefense()); + newCopy.setType(new ArrayList(in.getType())); newCopy.setTriggers(in.getTriggers()); for (SpellAbility sa : in.getManaAbility()) { newCopy.addSpellAbility(sa); } newCopy.setControllerObjects(in.getControllerObjects()); - newCopy.addTempAttackBoost(in.getTempAttackBoost()); - newCopy.addSemiPermanentAttackBoost(in.getSemiPermanentAttackBoost()); - newCopy.addTempDefenseBoost(in.getTempDefenseBoost()); - newCopy.addSemiPermanentDefenseBoost(in.getSemiPermanentDefenseBoost()); newCopy.setCounters(in.getCounters()); newCopy.setExtrinsicKeyword(in.getExtrinsicKeyword()); newCopy.setColor(in.getColor()); - newCopy.setChangedCardTypes(in.getChangedCardTypes()); - newCopy.setNewPT(new ArrayList(in.getNewPT())); newCopy.setReceivedDamageFromThisTurn(in.getReceivedDamageFromThisTurn()); newCopy.getDamageHistory().setCreatureGotBlockedThisTurn(in.getDamageHistory().getCreatureGotBlockedThisTurn()); newCopy.setEnchanting(in.getEnchanting()); diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index e20ca507f0f..fe6754854d4 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -67,7 +67,7 @@ import forge.game.zone.Zone; import forge.game.zone.ZoneType; import forge.gui.GuiChoose; import forge.gui.match.ViewWinLose; -import forge.sound.Sounds; +import forge.sound.SoundEffectType; /** @@ -1057,9 +1057,9 @@ public class GameAction { } // Play the win/lose sound if (match.getLastGameOutcome().isWinner(Singletons.getControl().getPlayer().getLobbyPlayer())) { - Sounds.WinDuel.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.WinDuel); } else { - Sounds.LoseDuel.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.LoseDuel); } return; } @@ -1262,7 +1262,7 @@ public class GameAction { } // Play the Destroy sound - Sounds.Destroy.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.Destroy); final ArrayList types = c.getType(); for (final String type : types) { @@ -1308,7 +1308,7 @@ public class GameAction { } // Play the Destroy sound - Sounds.Destroy.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.Destroy); } } } // destroyLegendaryCreatures() @@ -1337,7 +1337,7 @@ public class GameAction { this.sacrificeDestroy(c); // Play the Sacrifice sound - Sounds.Sacrifice.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.Sacrifice); // Run triggers final HashMap runParams = new HashMap(); @@ -1391,7 +1391,7 @@ public class GameAction { card.setDamage(0); // Play the Destroy sound - Sounds.Destroy.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.Destroy); } }; @@ -1405,7 +1405,7 @@ public class GameAction { } // totem armor // Play the Destroy sound - Sounds.Destroy.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.Destroy); return this.sacrificeDestroy(c); } @@ -1554,7 +1554,7 @@ public class GameAction { game.getCombat().removeFromCombat(c); // Play the Regen sound - Sounds.Regen.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.Regen); return false; } @@ -1586,14 +1586,14 @@ public class GameAction { System.out.println("Totem armor destroyed instead of original card"); // Play the Destroy sound - Sounds.Destroy.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.Destroy); return false; } } // totem armor // Play the Destroy sound - Sounds.Destroy.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.Destroy); return this.sacrificeDestroy(c); } diff --git a/src/main/java/forge/GameActionUtil.java b/src/main/java/forge/GameActionUtil.java index 8d44175d224..5db08d54288 100644 --- a/src/main/java/forge/GameActionUtil.java +++ b/src/main/java/forge/GameActionUtil.java @@ -55,7 +55,7 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; import forge.gui.GuiChoose; import forge.gui.match.CMatchUI; -import forge.sound.Sounds; +import forge.sound.SoundEffectType; import forge.util.MyRandom; @@ -611,7 +611,7 @@ public final class GameActionUtil { final String winMsg = winFlip ? " wins flip." : " loses flip."; // Play the Flip A Coin sound - Sounds.FlipCoin.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.FlipCoin); JOptionPane.showMessageDialog(null, source.getName() + " - " + caller + winMsg, source.getName(), JOptionPane.PLAIN_MESSAGE); @@ -695,7 +695,7 @@ public final class GameActionUtil { } // Play the Damage sound - Sounds.Damage.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.Damage); } // this is for cards like Sengir Vampire @@ -793,7 +793,7 @@ public final class GameActionUtil { c.getDamageHistory().registerDamage(player); // Play the Life Loss sound - Sounds.LifeLoss.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.LifeLoss); } // restricted to combat damage, restricted to players @@ -864,7 +864,7 @@ public final class GameActionUtil { c.getDamageHistory().registerCombatDamage(player); // Play the Life Loss sound - Sounds.LifeLoss.playSync(); + Singletons.getControl().getSoundSystem().playSync(SoundEffectType.LifeLoss); } // executeCombatDamageToPlayerEffects /** diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactory.java b/src/main/java/forge/card/abilityfactory/AbilityFactory.java index 3b2ef4df1b6..b869d32e649 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactory.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactory.java @@ -1638,18 +1638,28 @@ public class AbilityFactory { boolean paid = false; for (Player payer : payers) { if (payer.isComputer()) { + if (sa.hasParam("UnlessAI")) { + if ("Never".equals(sa.getParam("UnlessAI"))) { + continue; + } else if ("OnlyOwn".equals(sa.getParam("UnlessAI"))) { + if (!sa.getActivatingPlayer().equals(payer)) { + continue; + } + } + } + // AI will only pay when it's not already payed and only opponents abilities - if (paid || (payers.size() > 1 && sa.getActivatingPlayer().equals(payer))) { + if (paid || (payers.size() > 1 + && (sa.getActivatingPlayer().equals(payer) && !"OnlyOwn".equals(sa.getParam("UnlessAI"))))) { continue; } - ability.setActivatingPlayer(payer); if (ComputerUtil.canPayCost(ability, payer) && CostUtil.checkLifeCost(payer, cost, source, 4, sa) && CostUtil.checkDamageCost(payer, cost, source, 4) && (!source.getName().equals("Tyrannize") || payer.getCardsIn(ZoneType.Hand).size() > 2) - && (!sa.hasParam("UnlessAI") || !sa.getParam("UnlessAI").equals("Never")) && (!source.getName().equals("Breaking Point") || payer.getCreaturesInPlay().size() > 1)) { // AI was crashing because the blank ability used to pay costs // Didn't have any of the data on the original SA to pay dependant costs + ability.setActivatingPlayer(payer); ability.setTarget(sa.getTarget()); ComputerUtil.playNoStack(payer, ability); // Unless cost was payed - no resolve paid = true; diff --git a/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java b/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java index cced3d05c3a..b4a0fbe77e4 100644 --- a/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java +++ b/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java @@ -766,9 +766,19 @@ public class ChangeZoneAi extends SpellAiLogic { if (destination.equals(ZoneType.Hand)) { // only retrieve cards from computer graveyard list = CardLists.filterControlledBy(list, ai); - System.out.println("changeZone:" + list); + } else if (sa.hasParam("AttachedTo")) { + list = CardLists.filter(list, new Predicate() { + @Override + public boolean apply(final Card c) { + for (SpellAbility attach : c.getSpellAbilities()) { + if ("Pump".equals(attach.getParam("AILogic"))) { + return true; //only use good auras + } + } + return false; + } + }); } - } // blink human targets only during combat @@ -1226,19 +1236,25 @@ public class ChangeZoneAi extends SpellAiLogic { } if (sa.hasParam("AttachedTo")) { - final ArrayList list = AbilityFactory.getDefinedCards(sa.getSourceCard(), + List list = AbilityFactory.getDefinedCards(sa.getSourceCard(), sa.getParam("AttachedTo"), sa); + if (list.isEmpty()) { + list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); + list = CardLists.getValidCards(list, sa.getParam("AttachedTo"), c.getController(), c); + } if (!list.isEmpty()) { - final Card attachedTo = list.get(0); + final Card attachedTo = CardFactoryUtil.getBestAI(list); if (c.isEnchanting()) { - // If this Card is already Enchanting something - // Need to unenchant it, then clear out the commands + // If this Card is already Enchanting something, need + // to unenchant it, then clear out the commands final GameEntity oldEnchanted = c.getEnchanting(); c.removeEnchanting(oldEnchanted); c.clearEnchantCommand(); c.clearUnEnchantCommand(); } c.enchantEntity(attachedTo); + } else { // When it should enter the battlefield attached to an illegal permanent it fails + continue; } } diff --git a/src/main/java/forge/card/abilityfactory/effects/ChangeZoneAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChangeZoneAllEffect.java index f3f445ef4b3..e7b22238aa4 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChangeZoneAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChangeZoneAllEffect.java @@ -64,11 +64,11 @@ public class ChangeZoneAllEffect extends SpellEffect { final String remember = sa.getParam("RememberChanged"); final int libraryPos = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0; - - if (sa.getActivatingPlayer().isHuman() && destination.equals(ZoneType.Library)) { + + if (sa.getActivatingPlayer().isHuman() && destination.equals(ZoneType.Library) && !sa.hasParam("Shuffle")) { cards = GuiChoose.getOrderChoices("Choose order of cards to put into the library", "Put first", 0, cards, null, null); } - + for (final Card c : cards) { if (destination.equals(ZoneType.Battlefield)) { // Auras without Candidates stay in their current location diff --git a/src/main/java/forge/card/abilityfactory/effects/ChangeZoneEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChangeZoneEffect.java index ae1cab3d961..d888bdc4a53 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChangeZoneEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChangeZoneEffect.java @@ -15,6 +15,7 @@ import forge.Singletons; import forge.card.abilityfactory.AbilityFactory; import forge.card.abilityfactory.SpellEffect; import forge.card.abilityfactory.ai.ChangeZoneAi; +import forge.card.cardfactory.CardFactoryUtil; import forge.card.spellability.AbilitySub; import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbilityStackInstance; @@ -32,13 +33,13 @@ public class ChangeZoneEffect extends SpellEffect { if (sa.hasParam("Origin")) { origin = sa.getParam("Origin"); } - + if (ZoneType.isHidden(origin, sa.hasParam("Hidden"))) { return changeHiddenOriginStackDescription(sa); } else if (ZoneType.isKnown(origin)) { return changeKnownOriginStackDescription(sa); } - + return ""; } @@ -56,16 +57,16 @@ public class ChangeZoneEffect extends SpellEffect { private static String changeHiddenOriginStackDescription(final SpellAbility sa) { // TODO build Stack Description will need expansion as more cards are // added - + final StringBuilder sb = new StringBuilder(); final Card host = sa.getSourceCard(); - + if (!(sa instanceof AbilitySub)) { sb.append(host.getName()).append(" -"); } - + sb.append(" "); - + if (sa.hasParam("StackDescription")) { String stackDesc = sa.getParam("StackDescription"); if (stackDesc.equals("None")) { @@ -81,11 +82,11 @@ public class ChangeZoneEffect extends SpellEffect { origin = sa.getParam("Origin"); } final String destination = sa.getParam("Destination"); - + final String type = sa.hasParam("ChangeType") ? sa.getParam("ChangeType") : "Card"; final int num = sa.hasParam("ChangeNum") ? AbilityFactory.calculateAmount(host, sa.getParam("ChangeNum"), sa) : 1; - + if (origin.equals("Library") && sa.hasParam("Defined")) { // for now, just handle the Exile from top of library case, but // this can be expanded... @@ -100,21 +101,21 @@ public class ChangeZoneEffect extends SpellEffect { sb.append("."); } else if (origin.equals("Library")) { sb.append("Search your library for ").append(num).append(" ").append(type).append(" and "); - + if (num == 1) { sb.append("put that card "); } else { sb.append("put those cards "); } - + if (destination.equals("Battlefield")) { sb.append("onto the battlefield"); if (sa.hasParam("Tapped")) { sb.append(" tapped"); } - + sb.append("."); - + } if (destination.equals("Hand")) { sb.append("into your hand."); @@ -122,24 +123,24 @@ public class ChangeZoneEffect extends SpellEffect { if (destination.equals("Graveyard")) { sb.append("into your graveyard."); } - + sb.append(" Then shuffle your library."); } else if (origin.equals("Hand")) { sb.append("Put ").append(num).append(" ").append(type).append(" card(s) from your hand "); - + if (destination.equals("Battlefield")) { sb.append("onto the battlefield."); } if (destination.equals("Library")) { final int libraryPos = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0; - + if (libraryPos == 0) { sb.append("on top"); } if (libraryPos == -1) { sb.append("on bottom"); } - + sb.append(" of your library."); } } else if (origin.equals("Battlefield")) { @@ -150,12 +151,12 @@ public class ChangeZoneEffect extends SpellEffect { sb.append(" to your ").append(destination); } } - + final AbilitySub abSub = sa.getSubAbility(); if (abSub != null) { sb.append(abSub.getStackDescription()); } - + return sb.toString(); } @@ -171,21 +172,21 @@ public class ChangeZoneEffect extends SpellEffect { * @return a {@link java.lang.String} object. */ private static String changeKnownOriginStackDescription(final SpellAbility sa) { - + final StringBuilder sb = new StringBuilder(); final Card host = sa.getSourceCard(); - + if (!(sa instanceof AbilitySub)) { sb.append(host.getName()).append(" -"); } - + sb.append(" "); - + final ZoneType destination = ZoneType.smartValueOf(sa.getParam("Destination")); final ZoneType origin = ZoneType.smartValueOf(sa.getParam("Origin")); - + final StringBuilder sbTargets = new StringBuilder(); - + ArrayList tgts; if (sa.getTarget() != null) { tgts = sa.getTarget().getTargetCards(); @@ -196,23 +197,23 @@ public class ChangeZoneEffect extends SpellEffect { tgts.add(c); } } - + for (final Card c : tgts) { sbTargets.append(" ").append(c); } - + final String targetname = sbTargets.toString(); - + final String pronoun = tgts.size() > 1 ? " their " : " its "; - + final String fromGraveyard = " from the graveyard"; - + if (destination.equals(ZoneType.Battlefield)) { sb.append("Put").append(targetname); if (origin.equals(ZoneType.Graveyard)) { sb.append(fromGraveyard); } - + sb.append(" onto the battlefield"); if (sa.hasParam("Tapped")) { sb.append(" tapped"); @@ -222,7 +223,7 @@ public class ChangeZoneEffect extends SpellEffect { } sb.append("."); } - + if (destination.equals(ZoneType.Hand)) { sb.append("Return").append(targetname); if (origin.equals(ZoneType.Graveyard)) { @@ -230,23 +231,23 @@ public class ChangeZoneEffect extends SpellEffect { } sb.append(" to").append(pronoun).append("owners hand."); } - + if (destination.equals(ZoneType.Library)) { if (sa.hasParam("Shuffle")) { // for things like Gaea's - // Blessing + // Blessing sb.append("Shuffle").append(targetname); - + sb.append(" into").append(pronoun).append("owner's library."); } else { sb.append("Put").append(targetname); if (origin.equals(ZoneType.Graveyard)) { sb.append(fromGraveyard); } - + // this needs to be zero indexed. Top = 0, Third = 2, -1 = // Bottom final int libraryPosition = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0; - + if (libraryPosition == -1) { sb.append(" on the bottom of").append(pronoun).append("owner's library."); } else if (libraryPosition == 0) { @@ -257,7 +258,7 @@ public class ChangeZoneEffect extends SpellEffect { } } } - + if (destination.equals(ZoneType.Exile)) { sb.append("Exile").append(targetname); if (origin.equals(ZoneType.Graveyard)) { @@ -265,23 +266,23 @@ public class ChangeZoneEffect extends SpellEffect { } sb.append("."); } - + if (destination.equals(ZoneType.Ante)) { sb.append("Ante").append(targetname); sb.append("."); } - + if (destination.equals(ZoneType.Graveyard)) { sb.append("Put").append(targetname); sb.append(" from ").append(origin); sb.append(" into").append(pronoun).append("owner's graveyard."); } - + final AbilitySub abSub = sa.getSubAbility(); if (abSub != null) { sb.append(abSub.getStackDescription()); } - + return sb.toString(); } @@ -294,14 +295,14 @@ public class ChangeZoneEffect extends SpellEffect { * @param af * a {@link forge.card.abilityfactory.AbilityFactory} object. */ - + @Override public void resolve(SpellAbility sa) { String origin = ""; if (sa.hasParam("Origin")) { origin = sa.getParam("Origin"); } - + if (ZoneType.isHidden(origin, sa.hasParam("Hidden")) && !sa.hasParam("Ninjutsu")) { changeHiddenOriginResolve(sa); } else { @@ -324,58 +325,58 @@ public class ChangeZoneEffect extends SpellEffect { private static void changeKnownOriginResolve(final SpellAbility sa) { ArrayList tgtCards; ArrayList sas; - + final Target tgt = sa.getTarget(); final Player player = sa.getActivatingPlayer(); final Card hostCard = sa.getSourceCard(); - + final ZoneType destination = ZoneType.smartValueOf(sa.getParam("Destination")); final List origin = ZoneType.listValueOf(sa.getParam("Origin")); - + if (tgt != null) { tgtCards = tgt.getTargetCards(); } else { tgtCards = new ArrayList(); - for(ZoneType o : origin) { + for (ZoneType o : origin) { for (final Card c : sa.knownDetermineDefined(sa.getParam("Defined"))) { tgtCards.add(c); } } } - + // changing zones for spells on the stack if (tgt != null) { sas = tgt.getTargetSAs(); } else { sas = AbilityFactory.getDefinedSpellAbilities(sa.getSourceCard(), sa.getParam("Defined"), sa); } - + for (final SpellAbility tgtSA : sas) { if (!tgtSA.isSpell()) { // Catch any abilities or triggers that slip through somehow continue; } - + final SpellAbilityStackInstance si = Singletons.getModel().getGame().getStack().getInstanceFromSpellAbility(tgtSA); if (si == null) { continue; } - + removeFromStack(tgtSA, sa, si); } // End of change from stack - + final String remember = sa.getParam("RememberChanged"); final String imprint = sa.getParam("Imprint"); - + if (sa.hasParam("Unimprint")) { hostCard.clearImprinted(); } - + if (sa.hasParam("ForgetOtherRemembered")) { hostCard.clearRemembered(); } - + boolean optional = sa.hasParam("Optional"); - + if (tgtCards.size() != 0) { for (final Card tgtC : tgtCards) { final StringBuilder sb = new StringBuilder(); @@ -385,21 +386,21 @@ public class ChangeZoneEffect extends SpellEffect { continue; } final Zone originZone = Singletons.getModel().getGame().getZoneOf(tgtC); - + // if Target isn't in the expected Zone, continue - + if (originZone == null || !origin.contains(originZone.getZoneType())) { continue; } - + Card movedCard = null; - + if (destination.equals(ZoneType.Library)) { // library position is zero indexed final int libraryPosition = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0; - + movedCard = Singletons.getModel().getGame().getAction().moveToLibrary(tgtC, libraryPosition); - + // for things like Gaea's Blessing if (sa.hasParam("Shuffle")) { tgtC.getOwner().shuffle(); @@ -413,21 +414,34 @@ public class ChangeZoneEffect extends SpellEffect { tgtC.addController(sa.getSourceCard()); } if (sa.hasParam("AttachedTo")) { - final ArrayList list = AbilityFactory.getDefinedCards(sa.getSourceCard(), + List list = AbilityFactory.getDefinedCards(sa.getSourceCard(), sa.getParam("AttachedTo"), sa); + if (list.isEmpty()) { + list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); + list = CardLists.getValidCards(list, sa.getParam("AttachedTo"), tgtC.getController(), tgtC); + } if (!list.isEmpty()) { - final Card attachedTo = list.get(0); + Card attachedTo = null; + if (player.isHuman()) { + if (list.size() > 1) { + attachedTo = GuiChoose.one(tgtC + " - Select a card to attach to.", list); + } else { + attachedTo = list.get(0); + } + } else { // AI player + attachedTo = CardFactoryUtil.getBestAI(list); + } if (tgtC.isEnchanting()) { - // If this Card is already Enchanting - // something - // Need to unenchant it, then clear out the - // commands + // If this Card is already Enchanting something, need + // to unenchant it, then clear out the commands final GameEntity oldEnchanted = tgtC.getEnchanting(); tgtC.removeEnchanting(oldEnchanted); tgtC.clearEnchantCommand(); tgtC.clearUnEnchantCommand(); } tgtC.enchantEntity(attachedTo); + } else { // When it should enter the battlefield attached to an illegal permanent it fails + continue; } } // Auras without Candidates stay in their current @@ -438,10 +452,10 @@ public class ChangeZoneEffect extends SpellEffect { continue; } } - + movedCard = Singletons.getModel().getGame().getAction() .moveTo(tgtC.getController().getZone(destination), tgtC); - + if (sa.hasParam("Ninjutsu") || sa.hasParam("Attacking")) { Singletons.getModel().getGame().getCombat().addAttacker(tgtC); Singletons.getModel().getGame().getCombat().addUnblockedAttacker(tgtC); @@ -488,18 +502,18 @@ public class ChangeZoneEffect extends SpellEffect { */ private static void changeHiddenOriginResolve(final SpellAbility sa) { ArrayList fetchers; - + if (sa.hasParam("DefinedPlayer")) { fetchers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), sa.getParam("DefinedPlayer"), sa); } else { fetchers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), sa.getParam("Defined"), sa); } - + // handle case when Defined is for a Card if (fetchers.isEmpty()) { fetchers.add(sa.getSourceCard().getController()); } - + Player chooser = null; if (sa.hasParam("Chooser")) { final String choose = sa.getParam("Chooser"); @@ -509,7 +523,7 @@ public class ChangeZoneEffect extends SpellEffect { chooser = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), choose, sa).get(0); } } - + for (final Player player : fetchers) { Player decider = chooser; if (decider == null) { @@ -539,7 +553,7 @@ public class ChangeZoneEffect extends SpellEffect { final Card card = sa.getSourceCard(); final List movedCards = new ArrayList(); final boolean defined = sa.hasParam("Defined"); - + final Target tgt = sa.getTarget(); if (tgt != null) { final ArrayList players = tgt.getTargetPlayers(); @@ -548,7 +562,7 @@ public class ChangeZoneEffect extends SpellEffect { return; } } - + List origin = new ArrayList(); if (sa.hasParam("Origin")) { origin = ZoneType.listValueOf(sa.getParam("Origin")); @@ -556,37 +570,37 @@ public class ChangeZoneEffect extends SpellEffect { ZoneType destination = ZoneType.smartValueOf(sa.getParam("Destination")); // this needs to be zero indexed. Top = 0, Third = 2 int libraryPos = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0; - + if (sa.hasParam("OriginChoice")) { // Currently only used for Mishra, but may be used by other things // Improve how this message reacts for other cards final List alt = ZoneType.listValueOf(sa.getParam("OriginAlternative")); List altFetchList = player.getCardsIn(alt); altFetchList = AbilityFactory.filterListByType(altFetchList, sa.getParam("ChangeType"), sa); - + final StringBuilder sb = new StringBuilder(); sb.append(sa.getParam("AlternativeMessage")).append(" "); sb.append(altFetchList.size()).append(" cards match your searching type in Alternate Zones."); - + if (!GameActionUtil.showYesNoDialog(card, sb.toString())) { origin = alt; } } - + if (sa.hasParam("DestinationAlternative")) { - + final StringBuilder sb = new StringBuilder(); sb.append(sa.getParam("AlternativeDestinationMessage")); - + if (!GameActionUtil.showYesNoDialog(card, sb.toString())) { destination = ZoneType.smartValueOf(sa.getParam("DestinationAlternative")); libraryPos = sa.hasParam("LibraryPositionAlternative") ? Integer.parseInt(sa.getParam("LibraryPositionAlternative")) : 0; } } - + int changeNum = sa.hasParam("ChangeNum") ? AbilityFactory.calculateAmount(card, sa.getParam("ChangeNum"), sa) : 1; - + List fetchList; if (defined) { fetchList = new ArrayList(AbilityFactory.getDefinedCards(card, sa.getParam("Defined"), sa)); @@ -599,14 +613,14 @@ public class ChangeZoneEffect extends SpellEffect { } else { fetchList = player.getCardsIn(origin); } - + if (!defined) { - if (origin.contains(ZoneType.Library) && !defined && !sa.hasParam("NoLooking")) { + if (origin.contains(ZoneType.Library) && !defined && !sa.hasParam("NoLooking")) { // Look at whole library before moving onto choosing a card GuiChoose.oneOrNone(sa.getSourceCard().getName() + " - Looking at Library", player.getCardsIn(ZoneType.Library)); } - + // Look at opponents hand before moving onto choosing a card if (origin.contains(ZoneType.Hand) && player.isComputer()) { GuiChoose.oneOrNone(sa.getSourceCard().getName() + " - Looking at Opponent's Hand", player @@ -614,16 +628,16 @@ public class ChangeZoneEffect extends SpellEffect { } fetchList = AbilityFactory.filterListByType(fetchList, sa.getParam("ChangeType"), sa); } - + final String remember = sa.getParam("RememberChanged"); final String forget = sa.getParam("ForgetChanged"); final String imprint = sa.getParam("Imprint"); final String selectPrompt = sa.hasParam("SelectPrompt") ? sa.getParam("SelectPrompt") : "Select a card"; - + if (sa.hasParam("Unimprint")) { card.clearImprinted(); } - + for (int i = 0; i < changeNum; i++) { if (sa.hasParam("DifferentNames")) { for (Card c : movedCards) { @@ -633,7 +647,7 @@ public class ChangeZoneEffect extends SpellEffect { if ((fetchList.size() == 0) || (destination == null)) { break; } - + Object o; if (sa.hasParam("AtRandom")) { o = CardUtil.getRandom(fetchList); @@ -644,12 +658,12 @@ public class ChangeZoneEffect extends SpellEffect { } else { o = GuiChoose.oneOrNone(selectPrompt, fetchList); } - + if (o != null) { final Card c = (Card) o; fetchList.remove(c); Card movedCard = null; - + if (destination.equals(ZoneType.Library)) { // do not shuffle the library once we have placed a fetched // card on top. @@ -664,30 +678,39 @@ public class ChangeZoneEffect extends SpellEffect { if (sa.hasParam("GainControl")) { c.addController(sa.getSourceCard()); } - + if (sa.hasParam("AttachedTo")) { - final ArrayList list = AbilityFactory.getDefinedCards(sa.getSourceCard(), + List list = AbilityFactory.getDefinedCards(sa.getSourceCard(), sa.getParam("AttachedTo"), sa); + if (list.isEmpty()) { + list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); + list = CardLists.getValidCards(list, sa.getParam("AttachedTo"), c.getController(), c); + } if (!list.isEmpty()) { - final Card attachedTo = list.get(0); + Card attachedTo = null; + if (list.size() > 1) { + attachedTo = GuiChoose.one(c + " - Select a card to attach to.", list); + } else { + attachedTo = list.get(0); + } if (c.isEnchanting()) { - // If this Card is already Enchanting something - // Need to unenchant it, then clear out the - // commands + // If this Card is already Enchanting something, need + // to unenchant it, then clear out the commands final GameEntity oldEnchanted = c.getEnchanting(); - oldEnchanted.removeEnchantedBy(c); c.removeEnchanting(oldEnchanted); c.clearEnchantCommand(); c.clearUnEnchantCommand(); } c.enchantEntity(attachedTo); + } else { // When it should enter the battlefield attached to an illegal permanent it fails + continue; } } - + if (sa.hasParam("Attacking")) { Singletons.getModel().getGame().getCombat().addAttacker(c); } - + movedCard = Singletons.getModel().getGame().getAction().moveTo(c.getController().getZone(destination), c); if (sa.hasParam("Tapped")) { movedCard.setTapped(true); @@ -701,7 +724,7 @@ public class ChangeZoneEffect extends SpellEffect { movedCard = Singletons.getModel().getGame().getAction().moveTo(destination, c); } movedCards.add(movedCard); - + if (remember != null) { card.addRemembered(movedCard); } @@ -712,12 +735,12 @@ public class ChangeZoneEffect extends SpellEffect { if (imprint != null) { card.addImprinted(movedCard); } - + } else { final StringBuilder sb = new StringBuilder(); final int num = Math.min(fetchList.size(), changeNum - i); sb.append("Cancel Search? Up to ").append(num).append(" more cards can change zones."); - + if (((i + 1) == changeNum) || GameActionUtil.showYesNoDialog(card, sb.toString())) { break; } @@ -726,7 +749,7 @@ public class ChangeZoneEffect extends SpellEffect { if (sa.hasParam("Reveal") && !movedCards.isEmpty()) { GuiChoose.one(card + " - Revealed card: ", movedCards.toArray()); } - + if ((origin.contains(ZoneType.Library) && !destination.equals(ZoneType.Library) && !defined) || (sa.hasParam("Shuffle") && "True".equals(sa.getParam("Shuffle")))) { player.shuffle(); @@ -748,8 +771,9 @@ public class ChangeZoneEffect extends SpellEffect { */ private static void removeFromStack(final SpellAbility tgtSA, final SpellAbility srcSA, final SpellAbilityStackInstance si) { Singletons.getModel().getGame().getStack().remove(si); - + if (srcSA.hasParam("Destination")) { + final boolean remember = srcSA.hasParam("RememberChanged"); if (tgtSA.isAbility()) { // Shouldn't be able to target Abilities but leaving this in for now } else if (tgtSA.isFlashBackAbility()) { @@ -771,11 +795,15 @@ public class ChangeZoneEffect extends SpellEffect { throw new IllegalArgumentException("AbilityFactory_ChangeZone: Invalid Destination argument for card " + srcSA.getSourceCard().getName()); } - + + if (remember) { + srcSA.getSourceCard().addRemembered(tgtSA.getSourceCard()); + } + if (!tgtSA.isAbility()) { System.out.println("Moving spell to " + srcSA.getParam("Destination")); } } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CharmEffect.java b/src/main/java/forge/card/abilityfactory/effects/CharmEffect.java index d3c6465ce38..bb7241f131c 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CharmEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CharmEffect.java @@ -12,16 +12,16 @@ import forge.game.player.Player; import forge.gui.GuiChoose; public class CharmEffect extends SpellEffect { - + public static List makePossibleOptions(final SpellAbility sa) { final Card source = sa.getSourceCard(); - + final String[] saChoices = sa.getParam("Choices").split(","); List choices = new ArrayList(); for (final String saChoice : saChoices) { final String ab = source.getSVar(saChoice); final AbilityFactory charmAF = new AbilityFactory(); - choices.add((AbilitySub)charmAF.getAbility(ab, source)); + choices.add((AbilitySub) charmAF.getAbility(ab, source)); } return choices; } @@ -37,23 +37,23 @@ public class CharmEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); // nothing stack specific for Charm - + return sb.toString(); } - + public static void makeChoices(SpellAbility sa) { //this resets all previous choices sa.setSubAbility(null); - + final int num = Integer.parseInt(sa.hasParam("CharmNum") ? sa.getParam("CharmNum") : "1"); final int min = sa.hasParam("MinCharmNum") ? Integer.parseInt(sa.getParam("MinCharmNum")) : num; final List choices = makePossibleOptions(sa); - + List chosen = null; - + Player activator = sa.getActivatingPlayer(); - if ( activator.isHuman() ) - { + if (activator.isHuman()) { + chosen = new ArrayList(); for (int i = 0; i < num; i++) { AbilitySub a; @@ -69,28 +69,28 @@ public class CharmEffect extends SpellEffect { choices.remove(a); chosen.add(a); } - } - else + } else { chosen = CharmAi.chooseOptionsAi(activator, true, choices, num, min); - + } + chainAbilities(sa, chosen); } private static void chainAbilities(SpellAbility sa, List chosen) { SpellAbility saDeepest = sa; - while( saDeepest.getSubAbility() != null) + while (saDeepest.getSubAbility() != null) { saDeepest = saDeepest.getSubAbility(); - - for(AbilitySub sub : chosen){ + } + + for (AbilitySub sub : chosen) { saDeepest.setSubAbility(sub); sub.setActivatingPlayer(saDeepest.getActivatingPlayer()); sub.setParent(saDeepest); - + // to chain the next one saDeepest = sub; } } - - -} \ No newline at end of file + +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ChooseCardEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChooseCardEffect.java index 6e5c8b5c338..7c98c21a863 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChooseCardEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChooseCardEffect.java @@ -25,7 +25,7 @@ public class ChooseCardEffect extends SpellEffect { sb.append(p).append(" "); } sb.append("chooses a card."); - + return sb.toString(); } @@ -110,4 +110,4 @@ public class ChooseCardEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ChooseCardNameEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChooseCardNameEffect.java index 36a8e4a3c9b..e14f6a98811 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChooseCardNameEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChooseCardNameEffect.java @@ -26,12 +26,12 @@ public class ChooseCardNameEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + for (final Player p : getTargetPlayers(sa)) { sb.append(p).append(" "); } sb.append("names a card."); - + return sb.toString(); } @@ -112,4 +112,4 @@ public class ChooseCardNameEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ChooseColorEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChooseColorEffect.java index 9323c3cdbf6..b64b6166bfc 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChooseColorEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChooseColorEffect.java @@ -17,11 +17,11 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class ChooseColorEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + for (final Player p : getTargetPlayers(sa)) { sb.append(p).append(" "); } @@ -111,4 +111,4 @@ public class ChooseColorEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ChooseGenericEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChooseGenericEffect.java index 42f8ca87052..dbfc3dff081 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChooseGenericEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChooseGenericEffect.java @@ -16,12 +16,12 @@ import forge.card.spellability.Target; import forge.game.player.Player; import forge.gui.GuiChoose; -public class ChooseGenericEffect extends SpellEffect { - +public class ChooseGenericEffect extends SpellEffect { + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + for (final Player p : getTargetPlayers(sa)) { sb.append(p).append(" "); } @@ -61,4 +61,4 @@ public class ChooseGenericEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ChooseNumberEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChooseNumberEffect.java index bf5d69460cb..3f9e6daf820 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChooseNumberEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChooseNumberEffect.java @@ -13,31 +13,30 @@ import forge.card.spellability.Target; import forge.game.player.Player; import forge.gui.GuiChoose; -public class ChooseNumberEffect extends SpellEffect -{ - +public class ChooseNumberEffect extends SpellEffect { + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + for (final Player p : getTargetPlayers(sa)) { sb.append(p).append(" "); } sb.append("chooses a number."); - + return sb.toString(); } - + @Override public void resolve(SpellAbility sa) { final Card card = sa.getSourceCard(); //final int min = sa.containsKey("Min") ? Integer.parseInt(sa.get("Min")) : 0; //final int max = sa.containsKey("Max") ? Integer.parseInt(sa.get("Max")) : 99; final boolean random = sa.hasParam("Random"); - + final int min; if (!sa.hasParam("Min")) { min = Integer.parseInt("0"); @@ -46,7 +45,7 @@ public class ChooseNumberEffect extends SpellEffect } else { min = CardFactoryUtil.xCount(card, card.getSVar(sa.getParam("Min"))); } // Allow variables for Min - + final int max; if (!sa.hasParam("Max")) { max = Integer.parseInt("99"); @@ -55,7 +54,7 @@ public class ChooseNumberEffect extends SpellEffect } else { max = CardFactoryUtil.xCount(card, card.getSVar(sa.getParam("Max"))); } // Allow variables for Max - + final String[] choices = new String[max + 1]; if (!random) { // initialize the array @@ -63,10 +62,10 @@ public class ChooseNumberEffect extends SpellEffect choices[i] = Integer.toString(i); } } - + final List tgtPlayers = getTargetPlayers(sa); final Target tgt = sa.getTarget(); - + for (final Player p : tgtPlayers) { if ((tgt == null) || p.canBeTargetedBy(sa)) { if (sa.getActivatingPlayer().isHuman()) { @@ -90,7 +89,7 @@ public class ChooseNumberEffect extends SpellEffect chosen = Integer.parseInt((String) o); } card.setChosenNumber(chosen); - + } else { // TODO - not implemented } @@ -98,4 +97,4 @@ public class ChooseNumberEffect extends SpellEffect } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ChoosePlayerEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChoosePlayerEffect.java index 2d377e2ec08..b581dba105a 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChoosePlayerEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChoosePlayerEffect.java @@ -13,7 +13,7 @@ import forge.game.player.Player; import forge.gui.GuiChoose; public class ChoosePlayerEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -22,23 +22,23 @@ public class ChoosePlayerEffect extends SpellEffect { sb.append(p).append(" "); } sb.append("chooses a player."); - + return sb.toString(); } - + @Override public void resolve(SpellAbility sa) { final Card card = sa.getSourceCard(); - + final List tgtPlayers = getTargetPlayers(sa); - + final Target tgt = sa.getTarget(); - + final ArrayList choices = sa.hasParam("Choices") ? AbilityFactory.getDefinedPlayers( sa.getSourceCard(), sa.getParam("Choices"), sa) : new ArrayList(Singletons.getModel().getGame().getPlayers()); - + final String choiceDesc = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") : "Choose a player"; - + for (final Player p : tgtPlayers) { if ((tgt == null) || p.canBeTargetedBy(sa)) { if (p.isHuman()) { @@ -51,7 +51,7 @@ public class ChoosePlayerEffect extends SpellEffect { } final Player chosen = (Player) o; card.setChosenPlayer(chosen); - + } else { if (sa.hasParam("AILogic")) { if (sa.getParam("AILogic").equals("Curse")) { @@ -66,4 +66,4 @@ public class ChoosePlayerEffect extends SpellEffect { } } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ChooseSourceEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChooseSourceEffect.java index 134b632dfac..f9c0d0b1c89 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChooseSourceEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChooseSourceEffect.java @@ -30,7 +30,7 @@ public class ChooseSourceEffect extends SpellEffect { sb.append(p).append(" "); } sb.append("chooses a source."); - + return sb.toString(); } @@ -149,7 +149,7 @@ public class ChooseSourceEffect extends SpellEffect { if (threatApi != ApiType.DealDamage && threatApi != ApiType.DamageAll) { break; } - + final Card source = topStack.getSourceCard(); ArrayList objects = new ArrayList(); final Target threatTgt = topStack.getTarget(); diff --git a/src/main/java/forge/card/abilityfactory/effects/ChooseTypeEffect.java b/src/main/java/forge/card/abilityfactory/effects/ChooseTypeEffect.java index 1142037272a..b5e4c6fa19b 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ChooseTypeEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ChooseTypeEffect.java @@ -18,8 +18,7 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class ChooseTypeEffect extends SpellEffect { - - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -28,10 +27,10 @@ public class ChooseTypeEffect extends SpellEffect { sb.append(p).append(" "); } sb.append("chooses a type."); - + return sb.toString(); } - + @Override public void resolve(SpellAbility sa) { final Card card = sa.getSourceCard(); @@ -40,7 +39,7 @@ public class ChooseTypeEffect extends SpellEffect { if (sa.hasParam("InvalidTypes")) { invalidTypes.addAll(Arrays.asList(sa.getParam("InvalidTypes").split(","))); } - + final ArrayList validTypes = new ArrayList(); if (sa.hasParam("ValidTypes")) { validTypes.addAll(Arrays.asList(sa.getParam("ValidTypes").split(","))); @@ -48,10 +47,10 @@ public class ChooseTypeEffect extends SpellEffect { final Target tgt = sa.getTarget(); final List tgtPlayers = getTargetPlayers(sa); - + for (final Player p : tgtPlayers) { if ((tgt == null) || p.canBeTargetedBy(sa)) { - + if (type.equals("Card")) { if (validTypes.isEmpty()) { validTypes.addAll(Constant.CardTypes.CARD_TYPES); @@ -170,4 +169,4 @@ public class ChooseTypeEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ClashEffect.java b/src/main/java/forge/card/abilityfactory/effects/ClashEffect.java index 2afd46738c3..41b9244ed60 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ClashEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ClashEffect.java @@ -10,7 +10,7 @@ import forge.card.spellability.SpellAbility; import forge.card.trigger.TriggerType; public class ClashEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -18,7 +18,7 @@ public class ClashEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { return sa.getSourceCard().getName() + " - Clash with an opponent."; } - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -56,4 +56,4 @@ public class ClashEffect extends SpellEffect { Singletons.getModel().getGame().getTriggerHandler().runTrigger(TriggerType.Clashed, runParams); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CleanUpEffect.java b/src/main/java/forge/card/abilityfactory/effects/CleanUpEffect.java index d0d83dfb705..457052aeee4 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CleanUpEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CleanUpEffect.java @@ -3,11 +3,12 @@ package forge.card.abilityfactory.effects; import forge.Card; import forge.Singletons; +import forge.card.abilityfactory.AbilityFactory; import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; -public class CleanUpEffect extends SpellEffect { - +public class CleanUpEffect extends SpellEffect { + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -19,6 +20,11 @@ public class CleanUpEffect extends SpellEffect { source.clearRemembered(); Singletons.getModel().getGame().getCardState(source).clearRemembered(); } + if (sa.hasParam("ForgetDefined")) { + for (final Card card : AbilityFactory.getDefinedCards(source, sa.getParam("ForgetDefined"), sa)) { + source.getRemembered().remove(card); + } + } if (sa.hasParam("ClearImprinted")) { source.clearImprinted(); } @@ -33,4 +39,4 @@ public class CleanUpEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CloneEffect.java b/src/main/java/forge/card/abilityfactory/effects/CloneEffect.java index d393ef10577..64cec42cb47 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CloneEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CloneEffect.java @@ -23,9 +23,9 @@ public class CloneEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final List tgts = getTargetCards(sa); - + sb.append(sa.getSourceCard()); sb.append(" becomes a copy of "); if (!tgts.isEmpty()) { @@ -278,4 +278,4 @@ public class CloneEffect extends SpellEffect { } - } \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ControlExchangeEffect.java b/src/main/java/forge/card/abilityfactory/effects/ControlExchangeEffect.java index e3926934dcb..ec243b1cf6a 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ControlExchangeEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ControlExchangeEffect.java @@ -11,7 +11,7 @@ import forge.game.player.Player; public class ControlExchangeEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -61,4 +61,4 @@ public class ControlExchangeEffect extends SpellEffect { object1.addController(player2); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ControlGainEffect.java b/src/main/java/forge/card/abilityfactory/effects/ControlGainEffect.java index b88961e0645..972bc1a0863 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ControlGainEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ControlGainEffect.java @@ -16,17 +16,17 @@ import forge.card.spellability.Target; import forge.game.player.Player; import forge.game.zone.ZoneType; -public class ControlGainEffect extends SpellEffect { +public class ControlGainEffect extends SpellEffect { /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final Target tgt = sa.getTarget(); - + ArrayList newController = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), sa.getParam("NewController"), sa); if ((tgt != null) && tgt.getTargetPlayers() != null && !tgt.getTargetPlayers().isEmpty()) { @@ -35,9 +35,9 @@ public class ControlGainEffect extends SpellEffect { if (newController.size() == 0) { newController.add(sa.getActivatingPlayer()); } - + sb.append(newController).append(" gains control of "); - + for (final Card c : getTargetCards(sa)) { sb.append(" "); if (c.isFaceDown()) { @@ -47,7 +47,7 @@ public class ControlGainEffect extends SpellEffect { } } sb.append("."); - + return sb.toString(); } @@ -60,11 +60,11 @@ public class ControlGainEffect extends SpellEffect { c.removeController(newController); // Singletons.getModel().getGameAction().changeController(new ArrayList(c), // c.getController(), originalController); - + if (tapOnLose) { c.tap(); } - + if (null != addedKeywords) { for (final String kw : addedKeywords) { c.removeExtrinsicKeyword(kw); @@ -79,32 +79,32 @@ public class ControlGainEffect extends SpellEffect { public void resolve(SpellAbility sa) { List tgtCards = new ArrayList(); Card source = sa.getSourceCard(); - - + final boolean bUntap = sa.hasParam("Untap"); final boolean bTapOnLose = sa.hasParam("TapOnLose"); final boolean bNoRegen = sa.hasParam("NoRegen"); final List destroyOn = sa.hasParam("DestroyTgt") ? Arrays.asList(sa.getParam("DestroyTgt").split(",")) : null; - final List kws = sa.hasParam("AddKWs") ? Arrays.asList(sa.getParam("AddKWs").split(" & ")) : null ; + final List kws = sa.hasParam("AddKWs") ? Arrays.asList(sa.getParam("AddKWs").split(" & ")) : null; final List lose = sa.hasParam("LoseControl") ? Arrays.asList(sa.getParam("LoseControl").split(",")) : null; final Target tgt = sa.getTarget(); if (sa.hasParam("AllValid")) { tgtCards = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); tgtCards = AbilityFactory.filterListByType(tgtCards, sa.getParam("AllValid"), sa); - } else + } else { tgtCards = getTargetCards(sa); - + } + ArrayList controllers = new ArrayList(); - + if (sa.hasParam("NewController")) { controllers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), sa.getParam("NewController"), sa); } else if ((tgt != null) && (tgt.getTargetPlayers() != null) && tgt.canTgtPlayer()) { controllers = tgt.getTargetPlayers(); } - + GameEntity newController; - + if (controllers.size() == 0) { if (sa.isSpell()) { newController = sa.getActivatingPlayer(); @@ -121,38 +121,38 @@ public class ControlGainEffect extends SpellEffect { if (lose != null && lose.contains("Untap") && !source.isTapped()) { return; } - + final int size = tgtCards.size(); for (int j = 0; j < size; j++) { final Card tgtC = tgtCards.get(j); final Player originalController = tgtC.getController(); - + if (!tgtC.equals(sa.getSourceCard()) && !sa.getSourceCard().getGainControlTargets().contains(tgtC)) { sa.getSourceCard().addGainControlTarget(tgtC); } - + if (tgtC.isInPlay()) { - + if (!tgtC.equals(newController)) { tgtC.addController(newController); } // Singletons.getModel().getGameAction().changeController(new ArrayList(tgtC), // tgtC.getController(), newController.get(0)); - + if (bUntap) { tgtC.untap(); } - + if (null != kws) { for (final String kw : kws) { tgtC.addExtrinsicKeyword(kw); } } } - + // end copied - - final Card hostCard = sa.getSourceCard(); + + final Card hostCard = sa.getSourceCard(); if (lose != null) { if (lose.contains("LeavesPlay")) { sa.getSourceCard().addLeavesPlayCommand(this.getLoseControlCommand(tgtC, originalController, newController, bTapOnLose, hostCard, kws)); @@ -167,7 +167,7 @@ public class ControlGainEffect extends SpellEffect { Singletons.getModel().getGame().getEndOfTurn().addAt(this.getLoseControlCommand(tgtC, originalController, newController, bTapOnLose, hostCard, kws)); } } - + if (destroyOn != null) { if (destroyOn.contains("LeavesPlay")) { sa.getSourceCard().addLeavesPlayCommand(this.getDestroyCommand(tgtC, hostCard, bNoRegen)); @@ -179,10 +179,10 @@ public class ControlGainEffect extends SpellEffect { sa.getSourceCard().addChangeControllerCommand(this.getDestroyCommand(tgtC, hostCard, bNoRegen)); } } - + sa.getSourceCard().clearGainControlReleaseCommands(); sa.getSourceCard().addGainControlReleaseCommand(this.getLoseControlCommand(tgtC, originalController, newController, bTapOnLose, hostCard, kws)); - + } // end foreach target } @@ -198,13 +198,13 @@ public class ControlGainEffect extends SpellEffect { private Command getDestroyCommand(final Card c, final Card hostCard, final boolean bNoRegen) { final Command destroy = new Command() { private static final long serialVersionUID = 878543373519872418L; - + @Override public void execute() { final Ability ability = new Ability(hostCard, "0") { @Override public void resolve() { - + if (bNoRegen) { Singletons.getModel().getGame().getAction().destroyNoRegeneration(c); } else { @@ -218,10 +218,10 @@ public class ControlGainEffect extends SpellEffect { sb.append(" It can't be regenerated."); } ability.setStackDescription(sb.toString()); - + Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(ability); } - + }; return destroy; } @@ -237,16 +237,16 @@ public class ControlGainEffect extends SpellEffect { * a {@link forge.game.player.Player} object. * @return a {@link forge.Command} object. */ - private Command getLoseControlCommand(final Card c, final Player originalController, final GameEntity newController, - final boolean bTapOnLose, final Card hostCard, final List kws ) { + private Command getLoseControlCommand(final Card c, final Player originalController, final GameEntity newController, + final boolean bTapOnLose, final Card hostCard, final List kws) { final Command loseControl = new Command() { private static final long serialVersionUID = 878543373519872418L; - + @Override public void execute() { doLoseControl(c, hostCard, bTapOnLose, kws, newController); } // execute() }; - + return loseControl; } - -} \ No newline at end of file + +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CopyPermanentEffect.java b/src/main/java/forge/card/abilityfactory/effects/CopyPermanentEffect.java index 5ced423fa70..b33085e3e5f 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CopyPermanentEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CopyPermanentEffect.java @@ -20,7 +20,7 @@ import forge.game.player.Player; import forge.item.CardDb; public class CopyPermanentEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -57,7 +57,7 @@ public class CopyPermanentEffect extends SpellEffect { if (controller == null) { controller = sa.getActivatingPlayer(); } - + hostCard.clearClones(); for (final Card c : tgtCards) { @@ -188,4 +188,4 @@ public class CopyPermanentEffect extends SpellEffect { } // end foreach Card } // end resolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CopySpellEffect.java b/src/main/java/forge/card/abilityfactory/effects/CopySpellEffect.java index cdcfa30efbf..4b1a684262d 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CopySpellEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CopySpellEffect.java @@ -13,7 +13,7 @@ import forge.game.player.Player; import forge.gui.GuiChoose; public class CopySpellEffect extends SpellEffect { - + // ************************************************************************* // ************************* CopySpell ************************************* // ************************************************************************* @@ -22,7 +22,7 @@ public class CopySpellEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final List tgtSpells = getTargetSpellAbilities(sa); - + sb.append("Copy "); // TODO Someone fix this Description when Copying Charms final Iterator it = tgtSpells.iterator(); @@ -120,4 +120,4 @@ public class CopySpellEffect extends SpellEffect { } } // end resolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CounterEffect.java b/src/main/java/forge/card/abilityfactory/effects/CounterEffect.java index ddfeb6c6bfd..a1baffe6597 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CounterEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CounterEffect.java @@ -13,13 +13,13 @@ import forge.card.spellability.SpellPermanent; public class CounterEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { - + final StringBuilder sb = new StringBuilder(); final List sas; - + if (sa.hasParam("AllType")) { sas = new ArrayList(); - for (int i=0; i < Singletons.getModel().getGame().getStack().size(); i++) { + for (int i = 0; i < Singletons.getModel().getGame().getStack().size(); i++) { SpellAbility spell = Singletons.getModel().getGame().getStack().peekAbility(i); if (sa.getParam("AllType").equals("Spell") && !spell.isSpell()) { continue; @@ -31,11 +31,12 @@ public class CounterEffect extends SpellEffect { } sas.add(spell); } - } else + } else { sas = getTargetSpellAbilities(sa); - + } + sb.append("countering"); - + boolean isAbility = false; for (final SpellAbility tgtSA : sas) { sb.append(" "); @@ -45,11 +46,11 @@ public class CounterEffect extends SpellEffect { sb.append("'s ability"); } } - + if (isAbility && sa.hasParam("DestroyPermanent")) { sb.append(" and destroy it"); } - + sb.append("."); return sb.toString(); } // end counterStackDescription @@ -59,10 +60,10 @@ public class CounterEffect extends SpellEffect { // TODO Before this resolves we should see if any of our targets are // still on the stack final List sas; - + if (sa.hasParam("AllType")) { sas = new ArrayList(); - for (int i=0; i < Singletons.getModel().getGame().getStack().size(); i++) { + for (int i = 0; i < Singletons.getModel().getGame().getStack().size(); i++) { SpellAbility spell = Singletons.getModel().getGame().getStack().peekAbility(i); if (sa.getParam("AllType").equals("Spell") && !spell.isSpell()) { continue; @@ -74,34 +75,35 @@ public class CounterEffect extends SpellEffect { } sas.add(spell); } - } else + } else { sas = getTargetSpellAbilities(sa); - + } + if (sa.hasParam("ForgetOtherTargets")) { if (sa.getParam("ForgetOtherTargets").equals("True")) { sa.getSourceCard().clearRemembered(); } } - + for (final SpellAbility tgtSA : sas) { final Card tgtSACard = tgtSA.getSourceCard(); - + if (tgtSA.isSpell() && !CardFactoryUtil.isCounterableBy(tgtSACard, sa)) { continue; } - + final SpellAbilityStackInstance si = Singletons.getModel().getGame().getStack().getInstanceFromSpellAbility(tgtSA); if (si == null) { continue; } - + this.removeFromStack(tgtSA, sa, si); - + // Destroy Permanent may be able to be turned into a SubAbility if (tgtSA.isAbility() && sa.hasParam("DestroyPermanent")) { Singletons.getModel().getGame().getAction().destroy(tgtSACard); } - + if (sa.hasParam("RememberTargets")) { if (sa.getParam("RememberTargets").equals("True")) { sa.getSourceCard().addRemembered(tgtSACard); @@ -122,11 +124,11 @@ public class CounterEffect extends SpellEffect { * @param si * a {@link forge.card.spellability.SpellAbilityStackInstance} * object. - * @param sa + * @param sa */ private void removeFromStack(final SpellAbility tgtSA, final SpellAbility srcSA, final SpellAbilityStackInstance si) { Singletons.getModel().getGame().getStack().remove(si); - + String destination = srcSA.hasParam("Destination") ? srcSA.getParam("Destination") : "Graveyard"; if (tgtSA.isAbility()) { @@ -167,4 +169,4 @@ public class CounterEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CountersMoveEffect.java b/src/main/java/forge/card/abilityfactory/effects/CountersMoveEffect.java index 626a9901572..996c2a52ed6 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CountersMoveEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CountersMoveEffect.java @@ -10,13 +10,13 @@ import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; import forge.card.spellability.Target; -public class CountersMoveEffect extends SpellEffect { +public class CountersMoveEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final Card host = sa.getSourceCard(); - + Card source = null; ArrayList srcCards; final Target tgt = sa.getTarget(); @@ -29,17 +29,17 @@ public class CountersMoveEffect extends SpellEffect { source = srcCards.get(0); } final List tgtCards = getTargetCards(sa); - + final Counters cType = Counters.valueOf(sa.getParam("CounterType")); final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("CounterNum"), sa); - + sb.append("Move ").append(amount).append(" ").append(cType.getName()).append(" counter"); if (amount != 1) { sb.append("s"); } sb.append(" from "); sb.append(source).append(" to ").append(tgtCards.get(0)); - + sb.append("."); return sb.toString(); } @@ -83,4 +83,4 @@ public class CountersMoveEffect extends SpellEffect { } } // moveCounterResolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CountersProliferateEffect.java b/src/main/java/forge/card/abilityfactory/effects/CountersProliferateEffect.java index 70338a539f3..4671ee544e0 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CountersProliferateEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CountersProliferateEffect.java @@ -35,12 +35,13 @@ public class CountersProliferateEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { Player controller = sa.getSourceCard().getController(); - if (controller.isHuman()) + if (controller.isHuman()) { resolveHuman(sa); - else + } else { resolveAI(controller, sa); + } } - + private static void resolveHuman(final SpellAbility sa) { final List unchosen = Lists.newArrayList(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)); final List players = new ArrayList(Singletons.getModel().getGame().getPlayers()); @@ -84,8 +85,8 @@ public class CountersProliferateEffect extends SpellEffect { @Override public void selectPlayer(final Player player) { - if (players.indexOf(player) >= 0) - { + if (players.indexOf(player) >= 0) { + players.remove(player); // no second selection if (player.getPoisonCounters() > 0) { player.addPoisonCounters(1, sa.getSourceCard()); @@ -94,9 +95,8 @@ public class CountersProliferateEffect extends SpellEffect { } }); } - - - + + private static void resolveAI(final Player ai, final SpellAbility sa) { final List allies = ai.getAllies(); allies.add(ai); @@ -105,10 +105,12 @@ public class CountersProliferateEffect extends SpellEffect { @Override public boolean apply(Card crd) { for (final Entry c1 : crd.getCounters().entrySet()) { - if ( CardFactoryUtil.isNegativeCounter(c1.getKey()) && enemies.contains(crd.getController())) + if (CardFactoryUtil.isNegativeCounter(c1.getKey()) && enemies.contains(crd.getController())) { return true; - if ( !CardFactoryUtil.isNegativeCounter(c1.getKey()) && allies.contains(crd.getController())) + } + if (!CardFactoryUtil.isNegativeCounter(c1.getKey()) && allies.contains(crd.getController())) { return true; + } } return false; } @@ -116,9 +118,10 @@ public class CountersProliferateEffect extends SpellEffect { List cardsToProliferate = CardLists.filter(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield), predProliferate); List playersToPoison = new ArrayList(); - for( Player e : enemies ) { - if ( e.getPoisonCounters() > 0 ) + for (Player e : enemies) { + if (e.getPoisonCounters() > 0) { playersToPoison.add(e); + } } final StringBuilder sb = new StringBuilder(); @@ -126,17 +129,17 @@ public class CountersProliferateEffect extends SpellEffect { if (cardsToProliferate.isEmpty() && playersToPoison.isEmpty()) { sb.append("nothing."); } else { - for( Card c : cardsToProliferate ) { + for (Card c : cardsToProliferate) { sb.append(c.getController().getName()); sb.append("'s "); sb.append(c.getName()); sb.append("
"); } - - if( !playersToPoison.isEmpty() ) { + + if (!playersToPoison.isEmpty()) { sb.append("
The following players:
"); } - for( Player p : playersToPoison ) { + for (Player p : playersToPoison) { sb.append(""); sb.append(p.getName()); sb.append("
"); @@ -148,22 +151,22 @@ public class CountersProliferateEffect extends SpellEffect { // computer for (final Card c : cardsToProliferate) { for (final Entry c1 : c.getCounters().entrySet()) { - if ( CardFactoryUtil.isNegativeCounter(c1.getKey()) && enemies.contains(c.getController())) + if (CardFactoryUtil.isNegativeCounter(c1.getKey()) && enemies.contains(c.getController())) { c.addCounter(c1.getKey(), 1); break; } - if ( !CardFactoryUtil.isNegativeCounter(c1.getKey()) && allies.contains(c.getController())) + if (!CardFactoryUtil.isNegativeCounter(c1.getKey()) && allies.contains(c.getController())) { c.addCounter(c1.getKey(), 1); break; } } } - - for(final Player p : playersToPoison ) { + + for (final Player p : playersToPoison) { p.addPoisonCounters(1, sa.getSourceCard()); } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CountersPutAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/CountersPutAllEffect.java index 12bb0119647..7360970b957 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CountersPutAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CountersPutAllEffect.java @@ -13,16 +13,16 @@ import forge.card.spellability.Target; import forge.game.player.Player; import forge.game.zone.ZoneType; -public class CountersPutAllEffect extends SpellEffect { +public class CountersPutAllEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final Counters cType = Counters.valueOf(sa.getParam("CounterType")); final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("CounterNum"), sa); final String zone = sa.hasParam("ValidZone") ? sa.getParam("ValidZone") : "Battlefield"; - + sb.append("Put ").append(amount).append(" ").append(cType.getName()).append(" counter"); if (amount != 1) { sb.append("s"); @@ -33,7 +33,7 @@ public class CountersPutAllEffect extends SpellEffect { } else { sb.append("card in ").append(zone).append("."); } - + return sb.toString(); } @@ -63,4 +63,4 @@ public class CountersPutAllEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CountersPutEffect.java b/src/main/java/forge/card/abilityfactory/effects/CountersPutEffect.java index fff91e22259..ebc042fcdc6 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CountersPutEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CountersPutEffect.java @@ -20,7 +20,7 @@ public class CountersPutEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final Card card = sa.getSourceCard(); - + final Counters cType = Counters.valueOf(sa.getParam("CounterType")); final int amount = AbilityFactory.calculateAmount(card, sa.getParam("CounterNum"), sa); @@ -50,7 +50,7 @@ public class CountersPutEffect extends SpellEffect { } } sb.append("."); - + return sb.toString(); } @@ -101,4 +101,4 @@ public class CountersPutEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/CountersRemoveAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/CountersRemoveAllEffect.java index 0cf912957d6..c94192ab1a8 100644 --- a/src/main/java/forge/card/abilityfactory/effects/CountersRemoveAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/CountersRemoveAllEffect.java @@ -13,7 +13,7 @@ import forge.card.spellability.Target; import forge.game.player.Player; import forge.game.zone.ZoneType; -public class CountersRemoveAllEffect extends SpellEffect { +public class CountersRemoveAllEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -22,11 +22,11 @@ public class CountersRemoveAllEffect extends SpellEffect { final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("CounterNum"), sa); final String zone = sa.hasParam("ValidZone") ? sa.getParam("ValidZone") : "Battlefield"; String amountString = Integer.toString(amount); - + if (sa.hasParam("AllCounters")) { amountString = "all"; } - + sb.append("Remove ").append(amount).append(" ").append(cType.getName()).append(" counter"); if (!amountString.equals("1")) { sb.append("s"); @@ -65,4 +65,4 @@ public class CountersRemoveAllEffect extends SpellEffect { tgtCard.subtractCounter(Counters.valueOf(type), counterAmount); } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DamageAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/DamageAllEffect.java index 52667d1dac1..ace3faefe78 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DamageAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DamageAllEffect.java @@ -22,12 +22,11 @@ public class DamageAllEffect extends SpellEffect { if (sa.hasParam("ValidDescription")) { desc = sa.getParam("ValidDescription"); } - - final String damage = sa.getParam("NumDmg"); - final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); - - + final String damage = sa.getParam("NumDmg"); + final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); + + final ArrayList definedSources = AbilityFactory.getDefinedCards(sa.getSourceCard(), sa.getParam("DamageSource"), sa); final Card source = definedSources.get(0); @@ -50,7 +49,7 @@ public class DamageAllEffect extends SpellEffect { final Card source = sa.getSourceCard(); final String damage = sa.getParam("NumDmg"); - final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); + final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); final Target tgt = sa.getTarget(); Player targetPlayer = null; @@ -90,4 +89,4 @@ public class DamageAllEffect extends SpellEffect { } } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DamageDealEffect.java b/src/main/java/forge/card/abilityfactory/effects/DamageDealEffect.java index 52ceff0502f..4593c70f28d 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DamageDealEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DamageDealEffect.java @@ -21,7 +21,7 @@ public class DamageDealEffect extends SpellEffect { // when damageStackDescription is called, just build exactly what is happening final StringBuilder sb = new StringBuilder(); final String damage = sa.getParam("NumDmg"); - final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); + final int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); List tgts = getTargetObjects(sa); @@ -42,11 +42,11 @@ public class DamageDealEffect extends SpellEffect { } sb.append(" ").append(dmg).append(" damage "); - + if (sa.hasParam("DivideEvenly")) { sb.append("divided evenly (rounded down) "); } - + sb.append("to"); for (int i = 0; i < tgts.size(); i++) { @@ -78,7 +78,7 @@ public class DamageDealEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { final String damage = sa.getParam("NumDmg"); - int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); + int dmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); final boolean noPrevention = sa.hasParam("NoPrevention"); final boolean combatDmg = sa.hasParam("CombatDamage"); @@ -154,4 +154,4 @@ public class DamageDealEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DamageEachEffect.java b/src/main/java/forge/card/abilityfactory/effects/DamageEachEffect.java index 2424e0ec3f9..d731fdc2b49 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DamageEachEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DamageEachEffect.java @@ -14,7 +14,7 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; public class DamageEachEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -22,20 +22,20 @@ public class DamageEachEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final String damage = sa.getParam("NumDmg"); - final int iDmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); - + final int iDmg = AbilityFactory.calculateAmount(sa.getSourceCard(), damage, sa); + String desc = sa.getParam("ValidCards"); if (sa.hasParam("ValidDescription")) { desc = sa.getParam("ValidDescription"); } - + String dmg = ""; if (sa.hasParam("DamageDesc")) { dmg = sa.getParam("DamageDesc"); } else { dmg += iDmg + " damage"; } - + if (sa.hasParam("StackDescription")) { sb.append(sa.getParam("StackDescription")); } else { @@ -53,7 +53,7 @@ public class DamageEachEffect extends SpellEffect { return sb.toString(); } - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -117,4 +117,4 @@ public class DamageEachEffect extends SpellEffect { } } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DamagePreventAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/DamagePreventAllEffect.java index 7560c520e21..8bac37863d7 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DamagePreventAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DamagePreventAllEffect.java @@ -12,7 +12,7 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; public class DamagePreventAllEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -52,13 +52,13 @@ public class DamagePreventAllEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); String desc = sa.getDescription(); - + if (desc.contains(":")) { desc = desc.split(":")[1]; } sb.append(desc); - + return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DamagePreventEffect.java b/src/main/java/forge/card/abilityfactory/effects/DamagePreventEffect.java index bbc1dc24fe0..28732db4a71 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DamagePreventEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DamagePreventEffect.java @@ -10,12 +10,12 @@ import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; import forge.game.player.Player; -public class DamagePreventEffect extends SpellEffect -{ +public class DamagePreventEffect extends SpellEffect { + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final List tgts = getTargetObjects(sa); sb.append("Prevent the next "); @@ -25,7 +25,7 @@ public class DamagePreventEffect extends SpellEffect if (i != 0) { sb.append(" "); } - + final Object o = tgts.get(i); if (o instanceof Card) { final Card tgtC = (Card) o; @@ -38,7 +38,7 @@ public class DamagePreventEffect extends SpellEffect sb.append(o.toString()); } } - + if (sa.hasParam("Radiance") && (sa.getTarget() != null)) { sb.append(" and each other ").append(sa.getParam("ValidTgts")) .append(" that shares a color with "); @@ -107,4 +107,4 @@ public class DamagePreventEffect extends SpellEffect } } } // preventDamageResolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DebuffAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/DebuffAllEffect.java index 4982613a514..57eeff4c6e9 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DebuffAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DebuffAllEffect.java @@ -13,7 +13,7 @@ import forge.card.spellability.SpellAbility; import forge.game.zone.ZoneType; public class DebuffAllEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -35,21 +35,21 @@ public class DebuffAllEffect extends SpellEffect { * @param af * a {@link forge.card.abilityfactory.AbilityFactory} object. */ - + @Override - public void resolve(SpellAbility sa) { + public void resolve(SpellAbility sa) { final Card hostCard = sa.getSourceCard(); final List kws = sa.hasParam("Keywords") ? Arrays.asList(sa.getParam("Keywords").split(" & ")) : new ArrayList(); - + String valid = ""; - + if (sa.hasParam("ValidCards")) { valid = sa.getParam("ValidCards"); } - + List list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); list = CardLists.getValidCards(list, valid.split(","), hostCard.getController(), hostCard); - + for (final Card tgtC : list) { final ArrayList hadIntrinsic = new ArrayList(); if (tgtC.isInPlay() && tgtC.canBeTargetedBy(sa)) { @@ -64,7 +64,7 @@ public class DebuffAllEffect extends SpellEffect { if (!sa.hasParam("Permanent")) { Singletons.getModel().getGame().getEndOfTurn().addUntil(new Command() { private static final long serialVersionUID = 7486231071095628674L; - + @Override public void execute() { if (tgtC.isInPlay()) { @@ -78,4 +78,4 @@ public class DebuffAllEffect extends SpellEffect { } } // debuffAllResolve() -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DebuffEffect.java b/src/main/java/forge/card/abilityfactory/effects/DebuffEffect.java index 4e7a064b5a1..3f58a4017d0 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DebuffEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DebuffEffect.java @@ -12,18 +12,18 @@ import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; public class DebuffEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final List kws = sa.hasParam("Keywords") ? Arrays.asList(sa.getParam("Keywords").split(" & ")) : new ArrayList(); final StringBuilder sb = new StringBuilder(); - + final List tgtCards = getTargetCards(sa); - + if (tgtCards.size() > 0) { - + final Iterator it = tgtCards.iterator(); while (it.hasNext()) { final Card tgtC = it.next(); @@ -32,7 +32,7 @@ public class DebuffEffect extends SpellEffect { } else { sb.append(tgtC); } - + if (it.hasNext()) { sb.append(" "); } @@ -86,4 +86,4 @@ public class DebuffEffect extends SpellEffect { } // debuffResolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DelayedTriggerEffect.java b/src/main/java/forge/card/abilityfactory/effects/DelayedTriggerEffect.java index 9e6f4f91c2a..186a5b8c583 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DelayedTriggerEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DelayedTriggerEffect.java @@ -10,7 +10,7 @@ import forge.card.trigger.Trigger; import forge.card.trigger.TriggerHandler; public class DelayedTriggerEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -27,7 +27,7 @@ public class DelayedTriggerEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { - Map mapParams = new HashMap(); + Map mapParams = new HashMap(); sa.copyParamsToMap(mapParams); if (mapParams.containsKey("Cost")) { mapParams.remove("Cost"); @@ -42,4 +42,4 @@ public class DelayedTriggerEffect extends SpellEffect { Singletons.getModel().getGame().getTriggerHandler().registerDelayedTrigger(delTrig); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DestroyAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/DestroyAllEffect.java index 5391cc84bfa..64b9012d9e8 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DestroyAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DestroyAllEffect.java @@ -14,13 +14,13 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; public class DestroyAllEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { - + final StringBuilder sb = new StringBuilder(); final boolean noRegen = sa.hasParam("NoRegen"); - + final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { @@ -51,7 +51,7 @@ public class DestroyAllEffect extends SpellEffect { */ @Override public void resolve(SpellAbility sa) { - + final boolean noRegen = sa.hasParam("NoRegen"); final Card card = sa.getSourceCard(); @@ -106,4 +106,4 @@ public class DestroyAllEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DestroyEffect.java b/src/main/java/forge/card/abilityfactory/effects/DestroyEffect.java index ea452afb916..89ab02438f4 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DestroyEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DestroyEffect.java @@ -132,4 +132,4 @@ public class DestroyEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DigEffect.java b/src/main/java/forge/card/abilityfactory/effects/DigEffect.java index a7e5e9b67d6..f451ab468cc 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DigEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DigEffect.java @@ -21,15 +21,14 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class DigEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final Card host = sa.getSourceCard(); final StringBuilder sb = new StringBuilder(); final int numToDig = AbilityFactory.calculateAmount(host, sa.getParam("DigNum"), sa); final List tgtPlayers = getTargetPlayers(sa); - - + sb.append(host.getController()).append(" looks at the top ").append(numToDig); sb.append(" card"); if (numToDig != 1) { @@ -355,4 +354,4 @@ public class DigEffect extends SpellEffect { return toReturn; } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DigUntilEffect.java b/src/main/java/forge/card/abilityfactory/effects/DigUntilEffect.java index cba948cb0f3..85b83dea19f 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DigUntilEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DigUntilEffect.java @@ -16,7 +16,6 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class DigUntilEffect extends SpellEffect { - /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) @@ -24,12 +23,12 @@ public class DigUntilEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + String desc = "Card"; if (sa.hasParam("ValidDescription")) { desc = sa.getParam("ValidDescription"); } - + int untilAmount = 1; if (sa.hasParam("Amount")) { untilAmount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("Amount"), sa); @@ -38,25 +37,25 @@ public class DigUntilEffect extends SpellEffect { for (final Player pl : getTargetPlayers(sa)) { sb.append(pl).append(" "); } - + sb.append("reveals cards from his or her library until revealing "); sb.append(untilAmount).append(" ").append(desc).append(" card"); if (untilAmount != 1) { sb.append("s"); } sb.append(". Put "); - + final ZoneType found = ZoneType.smartValueOf(sa.getParam("FoundDestination")); final ZoneType revealed = ZoneType.smartValueOf(sa.getParam("RevealedDestination")); if (found != null) { - + sb.append(untilAmount > 1 ? "those cards" : "that card"); sb.append(" "); - + if (found.equals(ZoneType.Hand)) { sb.append("into his or her hand "); } - + if (revealed.equals(ZoneType.Graveyard)) { sb.append("and all other cards into his or her graveyard."); } @@ -160,4 +159,4 @@ public class DigUntilEffect extends SpellEffect { } } // end resolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DiscardEffect.java b/src/main/java/forge/card/abilityfactory/effects/DiscardEffect.java index 6677f9e5391..3fcffbb5b4c 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DiscardEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DiscardEffect.java @@ -24,21 +24,20 @@ public class DiscardEffect extends RevealEffectBase { protected String getStackDescription(SpellAbility sa) { final String mode = sa.getParam("Mode"); final StringBuilder sb = new StringBuilder(); - + final List tgtPlayers = getTargetPlayers(sa); - - + final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - + if (tgtPlayers.size() > 0) { - + for (final Player p : tgtPlayers) { sb.append(p.toString()).append(" "); } - + if (mode.equals("RevealYouChoose")) { sb.append("reveals his or her hand.").append(" You choose ("); } else if (mode.equals("RevealDiscardAll")) { @@ -46,12 +45,12 @@ public class DiscardEffect extends RevealEffectBase { } else { sb.append("discards ("); } - + int numCards = 1; if (sa.hasParam("NumCards")) { numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa); } - + if (mode.equals("Hand")) { sb.append("his or her hand"); } else if (mode.equals("RevealDiscardAll")) { @@ -59,9 +58,9 @@ public class DiscardEffect extends RevealEffectBase { } else { sb.append(numCards); } - + sb.append(")"); - + if (mode.equals("RevealYouChoose")) { sb.append(" to discard"); } else if (mode.equals("RevealDiscardAll")) { @@ -71,11 +70,11 @@ public class DiscardEffect extends RevealEffectBase { } sb.append(" of type: ").append(valid); } - + if (mode.equals("Defined")) { sb.append(" defined cards"); } - + if (mode.equals("Random")) { sb.append(" at random."); } else { @@ -89,11 +88,11 @@ public class DiscardEffect extends RevealEffectBase { public void resolve(SpellAbility sa) { final Card source = sa.getSourceCard(); final String mode = sa.getParam("Mode"); - + final Target tgt = sa.getTarget(); - + final List discarded = new ArrayList(); - + for (final Player p : getTargetPlayers(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) { if (mode.equals("Defined")) { @@ -109,7 +108,7 @@ public class DiscardEffect extends RevealEffectBase { } continue; } - + if (mode.equals("Hand")) { final List list = p.discardHand(sa); if (sa.hasParam("RememberDiscarded")) { @@ -119,16 +118,16 @@ public class DiscardEffect extends RevealEffectBase { } continue; } - + if (mode.equals("NotRemembered")) { - final List dPHand = + final List dPHand = CardLists.getValidCards(p.getCardsIn(ZoneType.Hand), "Card.IsNotRemembered", source.getController(), source); for (final Card c : dPHand) { p.discard(c, sa); discarded.add(c); } } - + int numCards = 1; if (sa.hasParam("NumCards")) { numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa); @@ -138,7 +137,7 @@ public class DiscardEffect extends RevealEffectBase { numCards = p.getCardsIn(ZoneType.Hand).size(); } } - + if (mode.equals("Random")) { boolean runDiscard = true; if (sa.hasParam("Optional")) { @@ -153,7 +152,7 @@ public class DiscardEffect extends RevealEffectBase { // Balduvian Horde and similar cards } } - + if (runDiscard) { final String valid = sa.hasParam("DiscardValid") ? sa.getParam("DiscardValid") : "Card"; discarded.addAll(p.discardRandom(numCards, sa, valid)); @@ -163,22 +162,22 @@ public class DiscardEffect extends RevealEffectBase { } else if (mode.equals("RevealDiscardAll")) { // Reveal final List dPHand = p.getCardsIn(ZoneType.Hand); - + if (p.isHuman()) { // "reveal to computer" for information gathering } else { GuiChoose.oneOrNone("Revealed computer hand", dPHand); } - + String valid = sa.getParam("DiscardValid"); if (valid == null) { valid = "Card"; } - + if (valid.contains("X")) { valid = valid.replace("X", Integer.toString(AbilityFactory.calculateAmount(source, "X", sa))); } - + final List dPChHand = CardLists.getValidCards(dPHand, valid.split(","), source.getController(), source); // Reveal cards that will be discarded? for (final Card c : dPChHand) { @@ -208,7 +207,7 @@ public class DiscardEffect extends RevealEffectBase { } else if (mode.equals("RevealOppChoose")) { chooser = source.getController().getOpponent(); } - + if (chooser.isComputer()) { // AI if (p.isComputer()) { // discard AI cards @@ -230,8 +229,8 @@ public class DiscardEffect extends RevealEffectBase { List goodChoices = CardLists.filter(dPChHand, new Predicate() { @Override public boolean apply(final Card c) { - if (c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME," + - " put it onto the battlefield instead of putting it into your graveyard.") + if (c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME," + + " put it onto the battlefield instead of putting it into your graveyard.") || !c.getSVar("DiscardMe").equals("")) { return false; } @@ -251,15 +250,15 @@ public class DiscardEffect extends RevealEffectBase { } } } - + Collections.sort(goodChoices, CardLists.TextLenReverseComparator); - + CardLists.sortCMC(goodChoices); dChoices.add(goodChoices.get(0)); - + final Card dC = goodChoices.get(CardUtil.getRandomIndex(goodChoices)); dPChHand.remove(dC); - + if (mode.startsWith("Reveal")) { final List dCs = new ArrayList(); dCs.add(dC); @@ -274,7 +273,7 @@ public class DiscardEffect extends RevealEffectBase { if (mode.startsWith("Reveal")) { GuiChoose.oneOrNone("Revealed " + p + " hand", dPHand); } - + for (int i = 0; i < numCards; i++) { if (dPChHand.size() > 0) { Card dC = null; @@ -294,13 +293,13 @@ public class DiscardEffect extends RevealEffectBase { } } } - + if (sa.hasParam("RememberDiscarded")) { for (final Card c : discarded) { source.addRemembered(c); } } - + } // discardResolve() -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DrainManaEffect.java b/src/main/java/forge/card/abilityfactory/effects/DrainManaEffect.java index 400cdc1a572..ce1bb6b60af 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DrainManaEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DrainManaEffect.java @@ -13,19 +13,19 @@ public class DrainManaEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final List tgtPlayers = getTargetPlayers(sa); sb.append(StringUtils.join(tgtPlayers, ", ")); sb.append(" empties his or her mana pool."); - + return sb.toString(); } @Override public void resolve(SpellAbility sa) { final Target tgt = sa.getTarget(); - + for (final Player p : getTargetPlayers(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) { p.getManaPool().clearPool(false); @@ -33,4 +33,4 @@ public class DrainManaEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/DrawEffect.java b/src/main/java/forge/card/abilityfactory/effects/DrawEffect.java index 9ac7cbaa153..3ffa9357f5a 100644 --- a/src/main/java/forge/card/abilityfactory/effects/DrawEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/DrawEffect.java @@ -18,24 +18,23 @@ public class DrawEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - + final List tgtPlayers = getDefinedPlayersBeforeTargetOnes(sa); - - + if (!tgtPlayers.isEmpty()) { - + sb.append(StringUtils.join(tgtPlayers, " and ")); - + int numCards = 1; if (sa.hasParam("NumCards")) { numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa); } - + if (tgtPlayers.size() > 1) { sb.append(" each"); } @@ -44,14 +43,14 @@ public class DrawEffect extends SpellEffect { sb.append("s"); } sb.append(" (").append(numCards).append(")"); - + if (sa.hasParam("NextUpkeep")) { sb.append(" at the beginning of the next upkeep"); } - + sb.append("."); } - + return sb.toString(); } @@ -112,4 +111,4 @@ public class DrawEffect extends SpellEffect { } } } // drawResolve() -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/EffectEffect.java b/src/main/java/forge/card/abilityfactory/effects/EffectEffect.java index 5443c46c914..e60d3dbf76b 100644 --- a/src/main/java/forge/card/abilityfactory/effects/EffectEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/EffectEffect.java @@ -32,7 +32,7 @@ public class EffectEffect extends SpellEffect { * @param af * a {@link forge.card.abilityfactory.AbilityFactory} object. */ - + @Override public void resolve(SpellAbility sa) { final Card hostCard = sa.getSourceCard(); @@ -228,4 +228,4 @@ public class EffectEffect extends SpellEffect { Singletons.getModel().getGame().getTriggerHandler().clearSuppression(TriggerType.ChangesZone); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/EndTurnEffect.java b/src/main/java/forge/card/abilityfactory/effects/EndTurnEffect.java index 07a466b74e3..5b2a6a14aae 100644 --- a/src/main/java/forge/card/abilityfactory/effects/EndTurnEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/EndTurnEffect.java @@ -20,7 +20,7 @@ public class EndTurnEffect extends SpellEffect { */ @Override public void resolve(SpellAbility sa) { - + GameState game = Singletons.getModel().getGame(); // Steps taken from gatherer's rulings on Time Stop. // 1) All spells and abilities on the stack are exiled. This includes @@ -51,14 +51,13 @@ public class EndTurnEffect extends SpellEffect { } - /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ - + @Override protected String getStackDescription(SpellAbility sa) { return "End the turn."; } -} +} diff --git a/src/main/java/forge/card/abilityfactory/effects/FightEffect.java b/src/main/java/forge/card/abilityfactory/effects/FightEffect.java index 34ab28d9404..2c7e55de287 100644 --- a/src/main/java/forge/card/abilityfactory/effects/FightEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/FightEffect.java @@ -10,7 +10,7 @@ import forge.card.spellability.SpellAbility; import forge.card.spellability.Target; public class FightEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -88,4 +88,4 @@ public class FightEffect extends SpellEffect { fighter1.addDamage(dmg2, fighter2); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/FlipCoinEffect.java b/src/main/java/forge/card/abilityfactory/effects/FlipCoinEffect.java index f192df74d0e..8d757b0427b 100644 --- a/src/main/java/forge/card/abilityfactory/effects/FlipCoinEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/FlipCoinEffect.java @@ -11,7 +11,7 @@ import forge.card.spellability.SpellAbility; import forge.game.player.Player; public class FlipCoinEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -76,4 +76,4 @@ public class FlipCoinEffect extends SpellEffect { // AllZone.getTriggerHandler().runTrigger("FlipsACoin",runParams); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/FogEffect.java b/src/main/java/forge/card/abilityfactory/effects/FogEffect.java index fcffeae469a..99b81dd18f3 100644 --- a/src/main/java/forge/card/abilityfactory/effects/FogEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/FogEffect.java @@ -5,7 +5,6 @@ import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; public class FogEffect extends SpellEffect { - @Override protected String getStackDescription(SpellAbility sa) { @@ -18,4 +17,4 @@ public class FogEffect extends SpellEffect { // Expand Fog keyword here depending on what we need out of it. Singletons.getModel().getGame().getPhaseHandler().setPreventCombatDamageThisTurn(true); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/GameLossEffect.java b/src/main/java/forge/card/abilityfactory/effects/GameLossEffect.java index 27e124cee9f..4e772061bf6 100644 --- a/src/main/java/forge/card/abilityfactory/effects/GameLossEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/GameLossEffect.java @@ -9,7 +9,7 @@ import forge.game.GameLossReason; import forge.game.player.Player; public class GameLossEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -21,7 +21,7 @@ public class GameLossEffect extends SpellEffect { for (final Player p : tgtPlayers) { sb.append(p.getName()).append(" "); } - + sb.append("loses the game."); return sb.toString(); } @@ -35,4 +35,4 @@ public class GameLossEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/GameWinEffect.java b/src/main/java/forge/card/abilityfactory/effects/GameWinEffect.java index 9b85f28aae2..2c1fbe2f4bc 100644 --- a/src/main/java/forge/card/abilityfactory/effects/GameWinEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/GameWinEffect.java @@ -7,7 +7,6 @@ import forge.card.spellability.SpellAbility; import forge.game.player.Player; public class GameWinEffect extends SpellEffect { - /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) @@ -21,4 +20,4 @@ public class GameWinEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/LifeExchangeEffect.java b/src/main/java/forge/card/abilityfactory/effects/LifeExchangeEffect.java index 49a89240660..81ec6f22090 100644 --- a/src/main/java/forge/card/abilityfactory/effects/LifeExchangeEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/LifeExchangeEffect.java @@ -12,13 +12,13 @@ public class LifeExchangeEffect extends SpellEffect { // ************************************************************************* // ************************ EXCHANGE LIFE ********************************** // ************************************************************************* - - - + + + // ************************************************************************* // ************************* LOSE LIFE ************************************* // ************************************************************************* - + /* (non-Javadoc) * @see forge.card.abilityfactory.AbilityFactoryAlterLife.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -28,7 +28,7 @@ public class LifeExchangeEffect extends SpellEffect { final Player activatingPlayer = sa.getActivatingPlayer(); final List tgtPlayers = getTargetPlayers(sa); - + if (tgtPlayers.size() == 1) { sb.append(activatingPlayer).append(" exchanges life totals with "); sb.append(tgtPlayers.get(0)); @@ -48,9 +48,9 @@ public class LifeExchangeEffect extends SpellEffect { final Card source = sa.getSourceCard(); Player p1; Player p2; - + final List tgtPlayers = getTargetPlayers(sa); - + if (tgtPlayers.size() == 1) { p1 = sa.getActivatingPlayer(); p2 = tgtPlayers.get(0); @@ -58,10 +58,10 @@ public class LifeExchangeEffect extends SpellEffect { p1 = tgtPlayers.get(0); p2 = tgtPlayers.get(1); } - + final int life1 = p1.getLife(); final int life2 = p2.getLife(); - + if ((life1 > life2) && p1.canLoseLife()) { final int diff = life1 - life2; p1.loseLife(diff); @@ -73,7 +73,7 @@ public class LifeExchangeEffect extends SpellEffect { } else { // they are equal, so nothing to do } - + } - -} \ No newline at end of file + +} diff --git a/src/main/java/forge/card/abilityfactory/effects/LifeGainEffect.java b/src/main/java/forge/card/abilityfactory/effects/LifeGainEffect.java index 0b354d75f87..db9c5e5b018 100644 --- a/src/main/java/forge/card/abilityfactory/effects/LifeGainEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/LifeGainEffect.java @@ -1,6 +1,8 @@ package forge.card.abilityfactory.effects; +import java.util.ArrayList; + import forge.card.abilityfactory.AbilityFactory; import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; @@ -16,7 +18,7 @@ public class LifeGainEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("LifeAmount"), sa); - + final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); @@ -27,7 +29,7 @@ public class LifeGainEffect extends SpellEffect { } sb.append("gains ").append(amount).append(" life."); - + return sb.toString(); } @@ -37,14 +39,23 @@ public class LifeGainEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { final int lifeAmount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("LifeAmount"), sa); - + final Target tgt = sa.getTarget(); - - for (final Player p : getTargetPlayers(sa)) { + ArrayList tgtPlayers = new ArrayList(); + + if (sa.hasParam("Defined")) { + tgtPlayers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), sa.getParam("Defined"), sa); + } else if (tgt != null) { + tgtPlayers = tgt.getTargetPlayers(); + } else { + tgtPlayers.add(sa.getActivatingPlayer()); + } + + for (final Player p : tgtPlayers) { if ((tgt == null) || p.canBeTargetedBy(sa)) { p.gainLife(lifeAmount, sa.getSourceCard()); } } } - -} \ No newline at end of file + +} diff --git a/src/main/java/forge/card/abilityfactory/effects/LifeLoseEffect.java b/src/main/java/forge/card/abilityfactory/effects/LifeLoseEffect.java index 032d60c12bc..123edc34daa 100644 --- a/src/main/java/forge/card/abilityfactory/effects/LifeLoseEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/LifeLoseEffect.java @@ -18,18 +18,17 @@ public class LifeLoseEffect extends SpellEffect { final StringBuilder sb = new StringBuilder(); final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("LifeAmount"), sa); - final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - + for (final Player player : getTargetPlayers(sa)) { sb.append(player).append(" "); } - + sb.append("loses ").append(amount).append(" life."); - + return sb.toString(); } @@ -40,7 +39,7 @@ public class LifeLoseEffect extends SpellEffect { public void resolve(SpellAbility sa) { int lifeLost = 0; - + final int lifeAmount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("LifeAmount"), sa); final Target tgt = sa.getTarget(); @@ -51,5 +50,5 @@ public class LifeLoseEffect extends SpellEffect { } sa.getSourceCard().setSVar("AFLifeLost", "Number$" + Integer.toString(lifeLost)); } - -} \ No newline at end of file + +} diff --git a/src/main/java/forge/card/abilityfactory/effects/LifeSetEffect.java b/src/main/java/forge/card/abilityfactory/effects/LifeSetEffect.java index 52251027bbc..43913ae6e5d 100644 --- a/src/main/java/forge/card/abilityfactory/effects/LifeSetEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/LifeSetEffect.java @@ -17,7 +17,7 @@ public class LifeSetEffect extends SpellEffect { public void resolve(SpellAbility sa) { final int lifeAmount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("LifeAmount"), sa); final Target tgt = sa.getTarget(); - + for (final Player p : getTargetPlayers(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) { p.setLife(lifeAmount, sa.getSourceCard()); @@ -32,23 +32,21 @@ public class LifeSetEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("LifeAmount"), sa); - - final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - + List tgtPlayers = getTargetPlayers(sa); - + for (final Player player : tgtPlayers) { sb.append(player).append(" "); } - + sb.append("life total becomes ").append(amount).append("."); - + return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ManaEffect.java b/src/main/java/forge/card/abilityfactory/effects/ManaEffect.java index 191de57f141..07560d1ec8a 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ManaEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ManaEffect.java @@ -20,7 +20,7 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class ManaEffect extends SpellEffect { - + /** *

* hasUrzaLands. @@ -32,9 +32,9 @@ public class ManaEffect extends SpellEffect { */ private static boolean hasUrzaLands(final Player p) { final List landsControlled = p.getCardsIn(ZoneType.Battlefield); - return Iterables.any(landsControlled, CardPredicates.nameEquals("Urza's Mine")) && - Iterables.any(landsControlled, CardPredicates.nameEquals("Urza's Tower")) && - Iterables.any(landsControlled, CardPredicates.nameEquals("Urza's Power Plant")); + return Iterables.any(landsControlled, CardPredicates.nameEquals("Urza's Mine")) + && Iterables.any(landsControlled, CardPredicates.nameEquals("Urza's Tower")) + && Iterables.any(landsControlled, CardPredicates.nameEquals("Urza's Power Plant")); } @@ -49,19 +49,18 @@ public class ManaEffect extends SpellEffect { resolveDrawback(sa); return; } - + // Spells are not undoable sa.setUndoable(sa.isAbility() && sa.isUndoable()); - - + final List tgtPlayers = getTargetPlayers(sa); final Target tgt = sa.getTarget(); - + if (abMana.isComboMana()) { for (Player p : tgtPlayers) { int amount = sa.hasParam("Amount") ? AbilityFactory.calculateAmount(card, sa.getParam("Amount"), sa) : 1; if (tgt == null || p.canBeTargetedBy(sa)) { - Player activator = sa.getActivatingPlayer(); + Player activator = sa.getActivatingPlayer(); // AI color choice is set in ComputerUtils so only human players need to make a choice if (activator.isHuman()) { //String colorsNeeded = abMana.getExpressChoice(); @@ -124,7 +123,7 @@ public class ManaEffect extends SpellEffect { else if (abMana.isAnyMana()) { for (Player p : tgtPlayers) { if (tgt == null || p.canBeTargetedBy(sa)) { - Player act = sa.getActivatingPlayer(); + Player act = sa.getActivatingPlayer(); // AI color choice is set in ComputerUtils so only human players need to make a choice if (act.isHuman()) { String colorsNeeded = abMana.getExpressChoice(); @@ -176,20 +175,20 @@ public class ManaEffect extends SpellEffect { } } } - + for (final Player player : tgtPlayers) { abMana.produceMana(generatedMana(sa), player, sa); } - + // Only clear express choice after mana has been produced abMana.clearExpressChoice(); - + // convert these to SubAbilities when appropriate if (sa.hasParam("Stuck")) { sa.setUndoable(false); card.addExtrinsicKeyword("This card doesn't untap during your next untap step."); } - + final String deplete = sa.getParam("Deplete"); if (deplete != null) { final int num = card.getCounters(Counters.getType(deplete)); @@ -198,7 +197,7 @@ public class ManaEffect extends SpellEffect { Singletons.getModel().getGame().getAction().sacrifice(card, null); } } - + resolveDrawback(sa); } @@ -221,7 +220,7 @@ public class ManaEffect extends SpellEffect { // Calculate generated mana here for stack description and resolving int amount = sa.hasParam("Amount") ? AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("Amount"), sa) : 1; - + AbilityManaPart abMana = sa.getManaPart(); String baseMana; if (abMana.isComboMana()) { @@ -239,7 +238,7 @@ public class ManaEffect extends SpellEffect { else { baseMana = abMana.mana(); } - + if (sa.hasParam("Bonus")) { // For mana abilities that get a bonus // Bonus currently MULTIPLIES the base amount. Base Amounts should @@ -250,10 +249,10 @@ public class ManaEffect extends SpellEffect { bonus = Integer.parseInt(sa.getParam("BonusProduced")); } } - + amount += bonus; } - + try { if ((sa.getParam("Amount") != null) && (amount != Integer.parseInt(sa.getParam("Amount")))) { sa.setUndoable(false); @@ -261,7 +260,7 @@ public class ManaEffect extends SpellEffect { } catch (final NumberFormatException n) { sa.setUndoable(false); } - + final StringBuilder sb = new StringBuilder(); if (amount == 0) { sb.append("0"); @@ -302,11 +301,11 @@ public class ManaEffect extends SpellEffect { * * @return a {@link java.lang.String} object. */ - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); sb.append("Add ").append(generatedMana(sa)).append(" to your mana pool."); return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ManaReflectedEffect.java b/src/main/java/forge/card/abilityfactory/effects/ManaReflectedEffect.java index 19cb9d23de8..6ec3401bdd2 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ManaReflectedEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ManaReflectedEffect.java @@ -13,7 +13,6 @@ import forge.game.player.Player; import forge.gui.GuiChoose; public class ManaReflectedEffect extends SpellEffect { - /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) @@ -24,10 +23,10 @@ public class ManaReflectedEffect extends SpellEffect { // Spells are not undoable AbilityManaPart ma = sa.getManaPart(); sa.setUndoable(sa.isAbility() && sa.isUndoable()); - + final List colors = CardUtil.getReflectableManaColors(sa, sa, new ArrayList(), new ArrayList()); - + final List tgtPlayers = getTargetPlayers(sa); for (final Player player : tgtPlayers) { final String generated = generatedReflectedMana(sa, colors, player); @@ -36,16 +35,16 @@ public class ManaReflectedEffect extends SpellEffect { ma.setCanceled(false); return; } - + ma.produceMana(generated, player, sa); } - + resolveDrawback(sa); } // *************** Utility Functions ********************** - + /** *

* generatedReflectedMana. @@ -64,9 +63,9 @@ public class ManaReflectedEffect extends SpellEffect { private static String generatedReflectedMana(final SpellAbility sa, final List colors, final Player player) { // Calculate generated mana here for stack description and resolving final int amount = sa.hasParam("Amount") ? AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("Amount"), sa) : 1; - + String baseMana = ""; - + if (colors.size() == 0) { return "0"; } else if (colors.size() == 1) { @@ -86,7 +85,7 @@ public class ManaReflectedEffect extends SpellEffect { baseMana = InputPayManaCostUtil.getShortColorString(colors.get(0)); } } - + final StringBuilder sb = new StringBuilder(); if (amount == 0) { sb.append("0"); @@ -107,4 +106,4 @@ public class ManaReflectedEffect extends SpellEffect { } return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/MillEffect.java b/src/main/java/forge/card/abilityfactory/effects/MillEffect.java index 8a265e61961..3c051951131 100644 --- a/src/main/java/forge/card/abilityfactory/effects/MillEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/MillEffect.java @@ -50,13 +50,12 @@ public class MillEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final int numCards = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumCards"), sa); - + final List tgtPlayers = getTargetPlayers(sa); final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - for (final Player p : tgtPlayers) { sb.append(p.toString()).append(" "); @@ -81,4 +80,4 @@ public class MillEffect extends SpellEffect { return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/MustAttackEffect.java b/src/main/java/forge/card/abilityfactory/effects/MustAttackEffect.java index 1cc7b483297..dffe3d2c9f0 100644 --- a/src/main/java/forge/card/abilityfactory/effects/MustAttackEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/MustAttackEffect.java @@ -9,8 +9,8 @@ import forge.card.spellability.SpellAbility; import forge.card.spellability.Target; import forge.game.player.Player; -public class MustAttackEffect extends SpellEffect { - +public class MustAttackEffect extends SpellEffect { + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -19,19 +19,18 @@ public class MustAttackEffect extends SpellEffect { final Card host = sa.getSourceCard(); final StringBuilder sb = new StringBuilder(); - + // end standard pre- - + final List tgtPlayers = getTargetPlayers(sa); - - + String defender = null; if (sa.getParam("Defender").equals("Self")) { defender = host.toString(); } else { // TODO - if more needs arise in the future } - + for (final Player player : tgtPlayers) { sb.append("Creatures ").append(player).append(" controls attack "); sb.append(defender).append(" during his or her next turn."); @@ -60,4 +59,4 @@ public class MustAttackEffect extends SpellEffect { } // mustAttackResolve() -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/MustBlockEffect.java b/src/main/java/forge/card/abilityfactory/effects/MustBlockEffect.java index ebdc9f622e4..a8ce9dbe179 100644 --- a/src/main/java/forge/card/abilityfactory/effects/MustBlockEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/MustBlockEffect.java @@ -46,11 +46,11 @@ public class MustBlockEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { final Card host = sa.getSourceCard(); final StringBuilder sb = new StringBuilder(); - + // end standard pre- - + final List tgtCards = getTargetCards(sa); - + String attacker = null; if (sa.hasParam("DefinedAttacker")) { final ArrayList cards = AbilityFactory.getDefinedCards(sa.getSourceCard(), @@ -59,12 +59,12 @@ public class MustBlockEffect extends SpellEffect { } else { attacker = host.toString(); } - + for (final Card c : tgtCards) { sb.append(c).append(" must block ").append(attacker).append(" if able."); } - + return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/PermanentCreatureEfect.java b/src/main/java/forge/card/abilityfactory/effects/PermanentCreatureEfect.java index c7efd786825..240d4a2da33 100644 --- a/src/main/java/forge/card/abilityfactory/effects/PermanentCreatureEfect.java +++ b/src/main/java/forge/card/abilityfactory/effects/PermanentCreatureEfect.java @@ -21,7 +21,7 @@ public class PermanentCreatureEfect extends SpellEffect { final Card c = Singletons.getModel().getGame().getAction().moveTo(sa.getActivatingPlayer().getZone(ZoneType.Battlefield), sa.getSourceCard()); sa.setSourceCard(c); } - + @Override public String getStackDescription(final SpellAbility sa) { final Card sourceCard = sa.getSourceCard(); diff --git a/src/main/java/forge/card/abilityfactory/effects/PhasesEffect.java b/src/main/java/forge/card/abilityfactory/effects/PhasesEffect.java index 1669d752184..ba158faf145 100644 --- a/src/main/java/forge/card/abilityfactory/effects/PhasesEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/PhasesEffect.java @@ -9,7 +9,7 @@ import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; public class PhasesEffect extends SpellEffect { - + // ****************************************** // ************** Phases ******************** // ****************************************** @@ -48,4 +48,4 @@ public class PhasesEffect extends SpellEffect { } } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/PlayEffect.java b/src/main/java/forge/card/abilityfactory/effects/PlayEffect.java index 851f8b013b9..0d0ebb9e439 100644 --- a/src/main/java/forge/card/abilityfactory/effects/PlayEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/PlayEffect.java @@ -27,14 +27,14 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; import forge.item.CardDb; -public class PlayEffect extends SpellEffect { +public class PlayEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); sb.append("Play "); - final List tgtCards = getTargetCards(sa); - + final List tgtCards = getTargetCards(sa); + if (sa.hasParam("Valid")) { sb.append("cards"); } else { @@ -73,8 +73,9 @@ public class PlayEffect extends SpellEffect { } tgtCards = Singletons.getModel().getGame().getCardsIn(zone); tgtCards = AbilityFactory.filterListByType(tgtCards, sa.getParam("Valid"), sa); - } else + } else { tgtCards = getTargetCards(sa); + } if (tgtCards.isEmpty()) { return; @@ -239,4 +240,4 @@ public class PlayEffect extends SpellEffect { } } // end resolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/PoisonEffect.java b/src/main/java/forge/card/abilityfactory/effects/PoisonEffect.java index 3f60eb8f351..15caac4d3a2 100644 --- a/src/main/java/forge/card/abilityfactory/effects/PoisonEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/PoisonEffect.java @@ -23,7 +23,7 @@ import forge.game.player.Player; @Override public void resolve(SpellAbility sa) { final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("Num"), sa); - + final Target tgt = sa.getTarget(); for (final Player p : getTargetPlayers(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) { @@ -39,18 +39,17 @@ import forge.game.player.Player; protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("Num"), sa); - - + final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - + final List tgtPlayers = getTargetPlayers(sa); - + sb.append(StringUtils.join(tgtPlayers, ", ")); sb.append(" "); - + sb.append("get"); if (tgtPlayers.size() < 2) { sb.append("s"); @@ -61,9 +60,9 @@ import forge.game.player.Player; } else { sb.append("."); } - + return sb.toString(); - } - + } + } diff --git a/src/main/java/forge/card/abilityfactory/effects/ProtectAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/ProtectAllEffect.java index 4bd5ca31e5f..ec47431cbfd 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ProtectAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ProtectAllEffect.java @@ -16,8 +16,8 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; import forge.gui.GuiChoose; -public class ProtectAllEffect extends SpellEffect { - +public class ProtectAllEffect extends SpellEffect { + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -139,4 +139,4 @@ public class ProtectAllEffect extends SpellEffect { } // protectAllResolve() -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ProtectEffect.java b/src/main/java/forge/card/abilityfactory/effects/ProtectEffect.java index 641a670836c..9a3576c43e0 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ProtectEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ProtectEffect.java @@ -21,7 +21,7 @@ import forge.gui.GuiChoose; public class ProtectEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -103,7 +103,7 @@ public class ProtectEffect extends SpellEffect { final ArrayList choices = AbilityFactory.getProtectionList(sa); final ArrayList gains = new ArrayList(); if (isChoice) { - + if (sa.getActivatingPlayer().isHuman()) { final String choice = GuiChoose.one("Choose a protection", choices); if (null == choice) { @@ -219,4 +219,4 @@ public class ProtectEffect extends SpellEffect { } } } // protectResolve() -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/PumpAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/PumpAllEffect.java index deed13d8226..59177ddb469 100644 --- a/src/main/java/forge/card/abilityfactory/effects/PumpAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/PumpAllEffect.java @@ -40,8 +40,7 @@ public class PumpAllEffect extends SpellEffect { List list; final List tgtPlayers = getTargetPlayersEmptyAsDefault(sa); final ArrayList affectedZones = new ArrayList(); - - + if (sa.hasParam("PumpZone")) { for (final String zone : sa.getParam("PumpZone").split(",")) { affectedZones.add(ZoneType.valueOf(zone)); @@ -49,33 +48,34 @@ public class PumpAllEffect extends SpellEffect { } else { affectedZones.add(ZoneType.Battlefield); } - + list = new ArrayList(); if (tgtPlayers.isEmpty()) { for (final ZoneType zone : affectedZones) { list.addAll(Singletons.getModel().getGame().getCardsIn(zone)); } - + } else { for (final ZoneType zone : affectedZones) { - for( final Player p : tgtPlayers ) + for (final Player p : tgtPlayers) { list.addAll(p.getCardsIn(zone)); + } } } - + String valid = ""; if (sa.hasParam("ValidCards")) { valid = sa.getParam("ValidCards"); } - + list = AbilityFactory.filterListByType(list, valid, sa); - + final List keywords = sa.hasParam("KW") ? Arrays.asList(sa.getParam("KW").split(" & ")) : new ArrayList(); - final int a = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumAtt"), sa); - final int d = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumDef"), sa); - + final int a = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumAtt"), sa); + final int d = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumDef"), sa); + for (final Card tgtC : list) { - + // only pump things in the affected zones. boolean found = false; for (final ZoneType z : affectedZones) { @@ -87,24 +87,24 @@ public class PumpAllEffect extends SpellEffect { if (!found) { continue; } - + tgtC.addTempAttackBoost(a); tgtC.addTempDefenseBoost(d); - + for (int i = 0; i < keywords.size(); i++) { tgtC.addExtrinsicKeyword(keywords.get(i)); } - + if (!sa.hasParam("Permanent")) { // If not Permanent, remove Pumped at EOT final Command untilEOT = new Command() { private static final long serialVersionUID = 5415795460189457660L; - + @Override public void execute() { tgtC.addTempAttackBoost(-1 * a); tgtC.addTempDefenseBoost(-1 * d); - + if (keywords.size() > 0) { for (int i = 0; i < keywords.size(); i++) { tgtC.removeExtrinsicKeyword(keywords.get(i)); @@ -121,4 +121,4 @@ public class PumpAllEffect extends SpellEffect { } } // pumpAllResolve() -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/PumpEffect.java b/src/main/java/forge/card/abilityfactory/effects/PumpEffect.java index 201edf774f7..a299d3b8901 100644 --- a/src/main/java/forge/card/abilityfactory/effects/PumpEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/PumpEffect.java @@ -17,34 +17,34 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; public class PumpEffect extends SpellEffect { - + private void applyPump(final SpellAbility sa, final Card applyTo, final int a, final int d, final List keywords) { //if host is not on the battlefield don't apply if (sa.hasParam("UntilLoseControlOfHost") && !sa.getSourceCard().isInPlay()) { return; } - + applyTo.addTempAttackBoost(a); applyTo.addTempDefenseBoost(d); - + for (int i = 0; i < keywords.size(); i++) { applyTo.addExtrinsicKeyword(keywords.get(i)); if (keywords.get(i).equals("Suspend")) { applyTo.setSuspend(true); } } - + if (!sa.hasParam("Permanent")) { // If not Permanent, remove Pumped at EOT final Command untilEOT = new Command() { private static final long serialVersionUID = -42244224L; - + @Override public void execute() { applyTo.addTempAttackBoost(-1 * a); applyTo.addTempDefenseBoost(-1 * d); - + if (keywords.size() > 0) { for (int i = 0; i < keywords.size(); i++) { applyTo.removeExtrinsicKeyword(keywords.get(i)); @@ -72,19 +72,19 @@ public class PumpEffect extends SpellEffect { } private void applyPump(final SpellAbility sa, final Player p, final List keywords) { - + for (int i = 0; i < keywords.size(); i++) { p.addKeyword(keywords.get(i)); } - + if (!sa.hasParam("Permanent")) { // If not Permanent, remove Pumped at EOT final Command untilEOT = new Command() { private static final long serialVersionUID = -32453460L; - + @Override public void execute() { - + if (keywords.size() > 0) { for (int i = 0; i < keywords.size(); i++) { p.removeKeyword(keywords.get(i)); @@ -138,8 +138,8 @@ public class PumpEffect extends SpellEffect { } final List keywords = sa.hasParam("KW") ? Arrays.asList(sa.getParam("KW").split(" & ")) : new ArrayList(); - final int atk = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumAtt"), sa); - final int def = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumDef"), sa); + final int atk = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumAtt"), sa); + final int def = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumDef"), sa); sb.append("gains "); if ((atk != 0) || (def != 0)) { @@ -177,10 +177,9 @@ public class PumpEffect extends SpellEffect { String pumpRemembered = null; final List keywords = sa.hasParam("KW") ? Arrays.asList(sa.getParam("KW").split(" & ")) : new ArrayList(); - final int a = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumAtt"), sa); - final int d = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumDef"), sa); - - + final int a = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumAtt"), sa); + final int d = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("NumDef"), sa); + if (tgt != null) { tgtCards = tgt.getTargetCards(); tgtPlayers = tgt.getTargetPlayers(); @@ -271,4 +270,4 @@ public class PumpEffect extends SpellEffect { this.applyPump(sa, p, keywords); } } // pumpResolve() -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/RearrangeTopOfLibraryEffect.java b/src/main/java/forge/card/abilityfactory/effects/RearrangeTopOfLibraryEffect.java index 4de7f46eb0d..45425534343 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RearrangeTopOfLibraryEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/RearrangeTopOfLibraryEffect.java @@ -16,7 +16,7 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class RearrangeTopOfLibraryEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -27,10 +27,10 @@ public class RearrangeTopOfLibraryEffect extends SpellEffect { final List tgtPlayers = getTargetPlayers(sa); boolean shuffle = false; Card host = sa.getSourceCard(); - + numCards = AbilityFactory.calculateAmount(host, sa.getParam("NumCards"), sa); shuffle = sa.hasParam("MayShuffle"); - + final StringBuilder ret = new StringBuilder(); ret.append("Look at the top "); ret.append(numCards); @@ -41,9 +41,9 @@ public class RearrangeTopOfLibraryEffect extends SpellEffect { ret.append(" & "); } ret.delete(ret.length() - 3, ret.length()); - + ret.append(" library. Then put them back in any order."); - + if (shuffle) { ret.append("You may have "); if (tgtPlayers.size() > 1) { @@ -51,10 +51,10 @@ public class RearrangeTopOfLibraryEffect extends SpellEffect { } else { ret.append("that"); } - + ret.append(" player shuffle his or her library."); } - + return ret.toString(); } @@ -67,7 +67,7 @@ public class RearrangeTopOfLibraryEffect extends SpellEffect { * @param af * a {@link forge.card.abilityfactory.AbilityFactory} object. */ - + @Override public void resolve(SpellAbility sa) { int numCards = 0; @@ -128,4 +128,4 @@ public class RearrangeTopOfLibraryEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/RegenerateAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/RegenerateAllEffect.java index b0484506d8b..98692ed1de4 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RegenerateAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/RegenerateAllEffect.java @@ -11,6 +11,7 @@ import forge.card.spellability.SpellAbility; import forge.game.zone.ZoneType; public class RegenerateAllEffect extends SpellEffect { + @Override protected String getStackDescription(SpellAbility sa) { return "Regenerate all valid cards."; @@ -45,4 +46,4 @@ public class RegenerateAllEffect extends SpellEffect { } } // regenerateAllResolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/RegenerateEffect.java b/src/main/java/forge/card/abilityfactory/effects/RegenerateEffect.java index 4b3c1bb6e69..0b542377037 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RegenerateEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/RegenerateEffect.java @@ -10,9 +10,8 @@ import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; import forge.card.spellability.Target; -public class RegenerateEffect extends SpellEffect -{ - +public class RegenerateEffect extends SpellEffect { + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -20,10 +19,10 @@ public class RegenerateEffect extends SpellEffect protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); final List tgtCards = getTargetCards(sa); - + if (tgtCards.size() > 0) { sb.append("Regenerate "); - + final Iterator it = tgtCards.iterator(); while (it.hasNext()) { final Card tgtC = it.next(); @@ -32,14 +31,14 @@ public class RegenerateEffect extends SpellEffect } else { sb.append(tgtC); } - + if (it.hasNext()) { sb.append(", "); } } } sb.append("."); - + return sb.toString(); } @@ -64,4 +63,4 @@ public class RegenerateEffect extends SpellEffect } } // regenerateResolve -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/RemoveFromCombatEffect.java b/src/main/java/forge/card/abilityfactory/effects/RemoveFromCombatEffect.java index 91a5ca16002..14e13d9f768 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RemoveFromCombatEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/RemoveFromCombatEffect.java @@ -15,13 +15,13 @@ public class RemoveFromCombatEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final List tgtCards = getTargetCards(sa); - + sb.append("Remove "); sb.append(StringUtils.join(tgtCards, ", ")); sb.append(" from combat."); - + return sb.toString(); } @@ -35,5 +35,5 @@ public class RemoveFromCombatEffect extends SpellEffect { } } - } -} \ No newline at end of file + } +} diff --git a/src/main/java/forge/card/abilityfactory/effects/RepeatEffect.java b/src/main/java/forge/card/abilityfactory/effects/RepeatEffect.java index 243624ad313..80f805449ef 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RepeatEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/RepeatEffect.java @@ -15,7 +15,7 @@ import forge.game.zone.ZoneType; import forge.util.Expressions; public class RepeatEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { return "Repeat something. Somebody should really write a better StackDescription!"; @@ -25,17 +25,17 @@ public class RepeatEffect extends SpellEffect { public void resolve(SpellAbility sa) { final AbilityFactory afRepeat = new AbilityFactory(); Card source = sa.getSourceCard(); - + // setup subability to repeat final SpellAbility repeat = afRepeat.getAbility(sa.getSourceCard().getSVar(sa.getParam("RepeatSubAbility")), source); repeat.setActivatingPlayer(sa.getActivatingPlayer()); ((AbilitySub) repeat).setParent(sa); - + Integer maxRepeat = null; if (sa.hasParam("MaxRepeat")) { maxRepeat = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("MaxRepeat"), sa); } - + //execute repeat ability at least once int count = 0; do { @@ -52,10 +52,10 @@ public class RepeatEffect extends SpellEffect { break; } } while (checkRepeatConditions(sa)); - + } // end class AbilityFactory_Repeat - + /** *

* checkRepeatConditions. @@ -68,24 +68,24 @@ public class RepeatEffect extends SpellEffect { */ private boolean checkRepeatConditions(final SpellAbility sa) { //boolean doAgain = false; - + if (sa.hasParam("RepeatPresent")) { final String repeatPresent = sa.getParam("RepeatPresent"); List list = new ArrayList(); - + String repeatCompare = "GE1"; if (sa.hasParam("RepeatCompare")) { repeatCompare = sa.getParam("RepeatCompare"); } - + if (sa.hasParam("RepeatDefined")) { list.addAll(AbilityFactory.getDefinedCards(sa.getSourceCard(), sa.getParam("RepeatDefined"), sa)); } else { list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); } - + list = CardLists.getValidCards(list, repeatPresent.split(","), sa.getActivatingPlayer(), sa.getSourceCard()); - + int right; final String rightString = repeatCompare.substring(2); try { // If this is an Integer, just parse it @@ -95,14 +95,14 @@ public class RepeatEffect extends SpellEffect { // SVar right = CardFactoryUtil.xCount(sa.getSourceCard(), sa.getSourceCard().getSVar(rightString)); } - + final int left = list.size(); - + if (!Expressions.compare(left, repeatCompare, right)) { return false; } } - + if (sa.hasParam("RepeatCheckSVar")) { String sVarOperator = "GE"; String sVarOperand = "1"; @@ -112,12 +112,12 @@ public class RepeatEffect extends SpellEffect { } final int svarValue = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("RepeatCheckSVar"), sa); final int operandValue = AbilityFactory.calculateAmount(sa.getSourceCard(), sVarOperand, sa); - + if (!Expressions.compare(svarValue, sVarOperator, operandValue)) { return false; } } - + if (sa.hasParam("RepeatOptional")) { if (sa.getActivatingPlayer().isComputer()) { //TODO add logic to have computer make better choice (ArsenalNut) @@ -130,7 +130,7 @@ public class RepeatEffect extends SpellEffect { } } } - + return true; } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/RestartGameEffect.java b/src/main/java/forge/card/abilityfactory/effects/RestartGameEffect.java index b951ffb3a46..389d394633a 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RestartGameEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/RestartGameEffect.java @@ -27,27 +27,27 @@ public class RestartGameEffect extends SpellEffect { GameState game = Singletons.getModel().getGame(); List players = game.getPlayers(); Map> playerLibraries = new HashMap>(); - + // Don't grab Ante Zones List restartZones = new ArrayList(Arrays.asList(ZoneType.Battlefield, ZoneType.Library, ZoneType.Graveyard, ZoneType.Hand, ZoneType.Exile, ZoneType.Command)); - + ZoneType leaveZone = ZoneType.smartValueOf(sa.hasParam("RestrictFromZone") ? sa.getParam("RestrictFromZone") : null); restartZones.remove(leaveZone); String leaveRestriction = sa.hasParam("RestrictFromValid") ? sa.getParam("RestrictFromValid") : "Card"; - - for(Player p : players) { + + for (Player p : players) { List newLibrary = new ArrayList(p.getCardsIn(restartZones)); List filteredCards = null; if (leaveZone != null) { - filteredCards = CardLists.filter(p.getCardsIn(leaveZone), + filteredCards = CardLists.filter(p.getCardsIn(leaveZone), CardPredicates.restriction(leaveRestriction.split(","), p, sa.getSourceCard())); } - + newLibrary.addAll(filteredCards); playerLibraries.put(p, newLibrary); } - + GameNew.restartGame(game, sa.getActivatingPlayer(), playerLibraries); } @@ -57,11 +57,12 @@ public class RestartGameEffect extends SpellEffect { @Override public String getStackDescription(SpellAbility sa) { String desc = sa.getParam("SpellDescription"); - + if (desc == null) { desc = "Restart the game."; } - + return desc.replace("CARDNAME", sa.getSourceCard().getName()); - } + } } + diff --git a/src/main/java/forge/card/abilityfactory/effects/RevealEffect.java b/src/main/java/forge/card/abilityfactory/effects/RevealEffect.java index e12bf480e55..0b23cd2e900 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RevealEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/RevealEffect.java @@ -13,6 +13,7 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class RevealEffect extends RevealEffectBase { + @Override public void resolve(SpellAbility sa) { final Card host = sa.getSourceCard(); @@ -74,8 +75,8 @@ public class RevealEffect extends RevealEffectBase { } else { sb.append("Error - no target players for RevealHand. "); } - + return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/RevealEffectBase.java b/src/main/java/forge/card/abilityfactory/effects/RevealEffectBase.java index 040541e0996..291d6287295 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RevealEffectBase.java +++ b/src/main/java/forge/card/abilityfactory/effects/RevealEffectBase.java @@ -54,7 +54,7 @@ public abstract class RevealEffectBase extends SpellEffect { public static List getRevealedList(final Player player, final List valid, final int max, boolean anyNumber) { final List chosen = new ArrayList(); final int validamount = Math.min(valid.size(), max); - + if (anyNumber && player.isHuman() && validamount > 0) { final List selection = GuiChoose.getOrderChoices("Choose Which Cards to Reveal", "Revealed", -1, valid, null, null); for (final Object o : selection) { diff --git a/src/main/java/forge/card/abilityfactory/effects/RevealHandEffect.java b/src/main/java/forge/card/abilityfactory/effects/RevealHandEffect.java index 8a2aeaaf426..f81066a10f4 100644 --- a/src/main/java/forge/card/abilityfactory/effects/RevealHandEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/RevealHandEffect.java @@ -13,17 +13,15 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class RevealHandEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - final List tgtPlayers = getTargetPlayers(sa); - sb.append(sa.getActivatingPlayer()).append(" looks at "); - + if (tgtPlayers.size() > 0) { for (final Player p : tgtPlayers) { sb.append(p.toString()).append("'s "); @@ -32,14 +30,14 @@ public class RevealHandEffect extends SpellEffect { sb.append("Error - no target players for RevealHand. "); } sb.append("hand."); - + return sb.toString(); } @Override public void resolve(SpellAbility sa) { final Card host = sa.getSourceCard(); - + final Target tgt = sa.getTarget(); for (final Player p : getTargetPlayers(sa)) { @@ -66,4 +64,4 @@ public class RevealHandEffect extends SpellEffect { } } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/SacrificeAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/SacrificeAllEffect.java index 251172493ca..844d7537101 100644 --- a/src/main/java/forge/card/abilityfactory/effects/SacrificeAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/SacrificeAllEffect.java @@ -11,18 +11,18 @@ import forge.card.spellability.SpellAbility; import forge.game.zone.ZoneType; public class SacrificeAllEffect extends SpellEffect { + @Override protected String getStackDescription(SpellAbility sa) { // when getStackDesc is called, just build exactly what is happening - + final StringBuilder sb = new StringBuilder(); - final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - + /* * This is not currently targeted ArrayList tgtPlayers; * @@ -31,7 +31,7 @@ public class SacrificeAllEffect extends SpellEffect { * AbilityFactory.getDefinedPlayers(sa.getSourceCard(), * sa.get("Defined"), sa); */ - + sb.append("Sacrifice permanents."); return sb.toString(); } @@ -75,4 +75,4 @@ public class SacrificeAllEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/SacrificeEffect.java b/src/main/java/forge/card/abilityfactory/effects/SacrificeEffect.java index 9ba4d9b4c3e..8a66435fcd4 100644 --- a/src/main/java/forge/card/abilityfactory/effects/SacrificeEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/SacrificeEffect.java @@ -15,7 +15,7 @@ import forge.game.zone.ZoneType; import forge.gui.GuiChoose; public class SacrificeEffect extends SpellEffect { - + @Override public void resolve(SpellAbility sa) { final Card card = sa.getSourceCard(); @@ -74,23 +74,23 @@ public class SacrificeEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - + final List tgts = getTargetPlayers(sa); - + String valid = sa.getParam("SacValid"); if (valid == null) { valid = "Self"; } - + String num = sa.getParam("Amount"); num = (num == null) ? "1" : num; final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), num, sa); - + if (valid.equals("Self")) { sb.append("Sacrifice ").append(sa.getSourceCard().toString()); } else if (valid.equals("Card.AttachedBy")) { @@ -100,12 +100,12 @@ public class SacrificeEffect extends SpellEffect { for (final Player p : tgts) { sb.append(p.getName()).append(" "); } - + String msg = sa.getParam("SacMessage"); if (msg == null) { msg = valid; } - + if (sa.hasParam("Destroy")) { sb.append("Destroys "); } else { @@ -113,7 +113,7 @@ public class SacrificeEffect extends SpellEffect { } sb.append(amount).append(" ").append(msg).append("."); } - + return sb.toString(); } @@ -229,4 +229,4 @@ public class SacrificeEffect extends SpellEffect { return sacList; } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ScryEffect.java b/src/main/java/forge/card/abilityfactory/effects/ScryEffect.java index f1318326d1f..7640e96524e 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ScryEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ScryEffect.java @@ -9,7 +9,7 @@ import forge.card.spellability.Target; import forge.game.player.Player; public class ScryEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -31,15 +31,15 @@ public class ScryEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { - + int num = 1; if (sa.hasParam("ScryNum")) { num = AbilityFactory.calculateAmount(sa.getSourceCard(), sa.getParam("ScryNum"), sa); } - + final Target tgt = sa.getTarget(); final List tgtPlayers = getTargetPlayers(sa); - + for (final Player p : tgtPlayers) { if ((tgt == null) || p.canBeTargetedBy(sa)) { p.scry(num); @@ -47,4 +47,4 @@ public class ScryEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/SetStateAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/SetStateAllEffect.java index 2a76d6d7212..f7512f22a19 100644 --- a/src/main/java/forge/card/abilityfactory/effects/SetStateAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/SetStateAllEffect.java @@ -13,7 +13,7 @@ import forge.card.spellability.Target; import forge.game.player.Player; import forge.game.zone.ZoneType; -public class SetStateAllEffect extends SpellEffect { +public class SetStateAllEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { @@ -122,4 +122,4 @@ public class SetStateAllEffect extends SpellEffect { sb.append(" permanents."); return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/SetStateEffect.java b/src/main/java/forge/card/abilityfactory/effects/SetStateEffect.java index 46fd945cc1d..518436d1e59 100644 --- a/src/main/java/forge/card/abilityfactory/effects/SetStateEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/SetStateEffect.java @@ -9,7 +9,7 @@ import forge.card.abilityfactory.SpellEffect; import forge.card.spellability.SpellAbility; public class SetStateEffect extends SpellEffect { - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -19,7 +19,7 @@ public class SetStateEffect extends SpellEffect { sb.append(conditionDesc).append(" "); } - final List tgtCards = getTargetCards(sa); + final List tgtCards = getTargetCards(sa); if (sa.hasParam("Flip")) { sb.append("Flip"); @@ -47,8 +47,8 @@ public class SetStateEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { - final Card host = sa.getSourceCard(); - final List tgtCards = getTargetCards(sa); + final Card host = sa.getSourceCard(); + final List tgtCards = getTargetCards(sa); final boolean remChanged = sa.hasParam("RememberChanged"); @@ -120,4 +120,4 @@ public class SetStateEffect extends SpellEffect { } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/ShuffleEffect.java b/src/main/java/forge/card/abilityfactory/effects/ShuffleEffect.java index 8922bd30cdf..dbcbea729b2 100644 --- a/src/main/java/forge/card/abilityfactory/effects/ShuffleEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/ShuffleEffect.java @@ -11,12 +11,13 @@ import forge.card.spellability.Target; import forge.game.player.Player; public class ShuffleEffect extends SpellEffect { + @Override public void resolve(SpellAbility sa) { final Card host = sa.getSourceCard(); final boolean optional = sa.hasParam("Optional"); - final List tgtPlayers = getTargetPlayers(sa); + final List tgtPlayers = getTargetPlayers(sa); final Target tgt = sa.getTarget(); @@ -34,15 +35,15 @@ public class ShuffleEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final String conditionDesc = sa.getParam("ConditionDescription"); if (conditionDesc != null) { sb.append(conditionDesc).append(" "); } - + final List tgtPlayers = getTargetPlayers(sa); - + if (tgtPlayers.size() > 0) { final Iterator it = tgtPlayers.iterator(); while (it.hasNext()) { @@ -61,8 +62,8 @@ public class ShuffleEffect extends SpellEffect { sb.append("s his or her library"); } sb.append("."); - + return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/StoreSVarEffect.java b/src/main/java/forge/card/abilityfactory/effects/StoreSVarEffect.java index 1b4d43cf236..25dcc0e492d 100644 --- a/src/main/java/forge/card/abilityfactory/effects/StoreSVarEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/StoreSVarEffect.java @@ -99,4 +99,4 @@ public class StoreSVarEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/TapAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/TapAllEffect.java index af459c3e42a..a062af0e67a 100644 --- a/src/main/java/forge/card/abilityfactory/effects/TapAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/TapAllEffect.java @@ -13,7 +13,7 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; public class TapAllEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -33,21 +33,22 @@ public class TapAllEffect extends SpellEffect { if (remTapped) { card.clearRemembered(); } - + List cards = null; - + final List tgtPlayers = getTargetPlayersEmptyAsDefault(sa); - + if ((tgtPlayers == null) || tgtPlayers.isEmpty()) { cards = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); } else { cards = new ArrayList(); - for( final Player p : tgtPlayers ) + for (final Player p : tgtPlayers) { cards.addAll(p.getCardsIn(ZoneType.Battlefield)); + } } - + cards = AbilityFactory.filterListByType(cards, sa.getParam("ValidCards"), sa); - + for (final Card c : cards) { if (remTapped) { card.addRemembered(c); @@ -56,4 +57,4 @@ public class TapAllEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/TapEffect.java b/src/main/java/forge/card/abilityfactory/effects/TapEffect.java index 46b861857bc..974b92c743d 100644 --- a/src/main/java/forge/card/abilityfactory/effects/TapEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/TapEffect.java @@ -10,7 +10,7 @@ import forge.card.spellability.SpellAbility; import forge.card.spellability.Target; public class TapEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#resolve(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -29,7 +29,7 @@ public class TapEffect extends SpellEffect { if (tgt != null && !tgtC.canBeTargetedBy(sa)) { continue; } - + if (sa.hasParam("ETB") || tgtC.isInPlay()) { if (tgtC.isUntapped() && (remTapped)) { card.addRemembered(tgtC); @@ -42,7 +42,7 @@ public class TapEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + sb.append("Tap "); final List tgtCards = getTargetCards(sa); sb.append(StringUtils.join(tgtCards, ", ")); @@ -50,4 +50,4 @@ public class TapEffect extends SpellEffect { return sb.toString(); } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/TapOrUntapAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/TapOrUntapAllEffect.java index 1aaa5080095..dd440e951a7 100644 --- a/src/main/java/forge/card/abilityfactory/effects/TapOrUntapAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/TapOrUntapAllEffect.java @@ -17,7 +17,7 @@ import forge.gui.GuiChoose; * */ public class TapOrUntapAllEffect extends SpellEffect { - + private enum TapOrUntap { TAP, UNTAP } @@ -54,11 +54,11 @@ public class TapOrUntapAllEffect extends SpellEffect { StringBuilder sb = new StringBuilder("Tap or Untap "); if (sa.hasParam("ValidMessage")) { sb.append(sa.getParam("ValidMessage")); - } else{ + } else { sb.append("Permanents"); } sb.append("?"); - + final String[] tapOrUntap = new String[] { "Tap", "Untap" }; final Object z = GuiChoose.one(sb.toString(), tapOrUntap); toTap = (z.equals("Tap")) ? TapOrUntap.TAP : TapOrUntap.UNTAP; diff --git a/src/main/java/forge/card/abilityfactory/effects/TapOrUntapEffect.java b/src/main/java/forge/card/abilityfactory/effects/TapOrUntapEffect.java index 8df5ce8463b..306820d5f90 100644 --- a/src/main/java/forge/card/abilityfactory/effects/TapOrUntapEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/TapOrUntapEffect.java @@ -11,7 +11,7 @@ import forge.card.spellability.Target; import forge.gui.GuiChoose; public class TapOrUntapEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -20,9 +20,9 @@ public class TapOrUntapEffect extends SpellEffect { // when getStackDesc is called, just build exactly what is happening final StringBuilder sb = new StringBuilder(); - + sb.append("Tap or untap "); - + final List tgtCards = getTargetCards(sa); sb.append(StringUtils.join(tgtCards, ", ")); sb.append("."); @@ -58,4 +58,4 @@ public class TapOrUntapEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/TokenEffect.java b/src/main/java/forge/card/abilityfactory/effects/TokenEffect.java index e8d0e108928..c63315081e1 100644 --- a/src/main/java/forge/card/abilityfactory/effects/TokenEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/TokenEffect.java @@ -103,7 +103,7 @@ public class TokenEffect extends SpellEffect { this.tokenOwner = "You"; } } - + @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); @@ -137,7 +137,7 @@ public class TokenEffect extends SpellEffect { public void resolve(SpellAbility sa) { final Card host = sa.getSourceCard(); readParameters(sa); - + String imageName = ""; Player controller; String cost = ""; diff --git a/src/main/java/forge/card/abilityfactory/effects/TwoPilesEffect.java b/src/main/java/forge/card/abilityfactory/effects/TwoPilesEffect.java index f03eb7d546f..c5a658d3513 100644 --- a/src/main/java/forge/card/abilityfactory/effects/TwoPilesEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/TwoPilesEffect.java @@ -28,16 +28,16 @@ public class TwoPilesEffect extends SpellEffect { @Override protected String getStackDescription(SpellAbility sa) { final StringBuilder sb = new StringBuilder(); - + final List tgtPlayers = getTargetPlayers(sa); - + String valid = ""; if (sa.hasParam("ValidCards")) { valid = sa.getParam("ValidCards"); } - + sb.append("Separate all ").append(valid).append(" cards "); - + for (final Player p : tgtPlayers) { sb.append(p).append(" "); } @@ -93,9 +93,9 @@ public class TwoPilesEffect extends SpellEffect { if (separator.isHuman()) { final List firstPile = GuiChoose.getOrderChoices("Place into two piles", "Pile 1", -1, pool, null, card); for (final Object o : firstPile) { - pile1.add((Card)o); + pile1.add((Card) o); } - + for (final Card c : pool) { if (!pile1.contains(c)) { pile2.add(c); @@ -133,7 +133,7 @@ public class TwoPilesEffect extends SpellEffect { card.clearRemembered(); pile1WasChosen = selectPiles(sa, pile1, pile2, chooser, card, pool); - + // take action on the chosen pile if (sa.hasParam("ChosenPile")) { final AbilityFactory afPile = new AbilityFactory(); @@ -168,25 +168,25 @@ public class TwoPilesEffect extends SpellEffect { } } // end twoPiles resolve - private boolean selectPiles(final SpellAbility sa, ArrayList pile1, ArrayList pile2, + private boolean selectPiles(final SpellAbility sa, ArrayList pile1, ArrayList pile2, Player chooser, Card card, List pool) { boolean pile1WasChosen = true; // then, the chooser picks a pile - + if (sa.hasParam("FaceDown")) { // Used for Phyrexian Portal, FaceDown Pile choosing if (chooser.isHuman()) { final String p1Str = String.format("Pile 1 (%s cards)", pile1.size()); final String p2Str = String.format("Pile 2 (%s cards)", pile2.size()); - + final String message = String.format("Choose a pile\n%s or %s", p1Str, p2Str); - + final Object[] possibleValues = { p1Str , p2Str }; - - final Object playDraw = JOptionPane.showOptionDialog(null, message, "Choose a Pile", - JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, + + final Object playDraw = JOptionPane.showOptionDialog(null, message, "Choose a Pile", + JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, possibleValues, possibleValues[0]); - + pile1WasChosen = playDraw.equals(0); } else { @@ -194,8 +194,7 @@ public class TwoPilesEffect extends SpellEffect { // TODO Improve this to be slightly more random to not be so predictable pile1WasChosen = pile1.size() >= pile2.size(); } - } - else { + } else { if (chooser.isHuman()) { final Card[] disp = new Card[pile1.size() + pile2.size() + 2]; disp[0] = new Card(); @@ -214,13 +213,13 @@ public class TwoPilesEffect extends SpellEffect { final Object o = GuiChoose.one("Choose a pile", disp); final Card c = (Card) o; String name = c.getName(); - + if (!(name.equals("Pile 1") || name.equals("Pile 2"))) { continue; } - + pile1WasChosen = name.equals("Pile 1"); - break; + break; } } else { int cmc1 = CardFactoryUtil.evaluatePermanentList(new ArrayList(pile1)); @@ -244,7 +243,7 @@ public class TwoPilesEffect extends SpellEffect { } } } - + if (pile1WasChosen) { for (final Card z : pile1) { card.addRemembered(z); @@ -254,7 +253,7 @@ public class TwoPilesEffect extends SpellEffect { card.addRemembered(z); } } - + return pile1WasChosen; } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/UnattachAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/UnattachAllEffect.java index 4310bddc46e..8645d744143 100644 --- a/src/main/java/forge/card/abilityfactory/effects/UnattachAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/UnattachAllEffect.java @@ -14,9 +14,9 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; public class UnattachAllEffect extends SpellEffect { - + private void handleUnattachment(final GameEntity o, final Card cardToUnattach) { - + if (o instanceof Card) { final Card c = (Card) o; if (cardToUnattach.isAura()) { @@ -130,8 +130,8 @@ public class UnattachAllEffect extends SpellEffect { card.addLeavesPlayCommand(onLeavesPlay); card.enchantEntity(tgt); } - */ - + */ + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -140,7 +140,7 @@ public class UnattachAllEffect extends SpellEffect { final StringBuilder sb = new StringBuilder(); sb.append("Unattach all valid Equipment and Auras from "); final List targets = getTargetObjects(sa); - sb.append(StringUtils.join(targets, " ")); + sb.append(StringUtils.join(targets, " ")); return sb.toString(); } @@ -151,17 +151,19 @@ public class UnattachAllEffect extends SpellEffect { public void resolve(SpellAbility sa) { Card source = sa.getSourceCard(); final List targets = getTargetObjects(sa); - + // If Cast Targets will be checked on the Stack for (final Object o : targets) { - if (!( o instanceof GameEntity )) continue; - + if (!(o instanceof GameEntity)) { + continue; + } + String valid = sa.getParam("UnattachValid"); List unattachList = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); unattachList = CardLists.getValidCards(unattachList, valid.split(","), source.getController(), source); for (final Card c : unattachList) { - handleUnattachment((GameEntity)o, c); + handleUnattachment((GameEntity) o, c); } } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/UntapAllEffect.java b/src/main/java/forge/card/abilityfactory/effects/UntapAllEffect.java index 43ef4b6da31..a0958055b30 100644 --- a/src/main/java/forge/card/abilityfactory/effects/UntapAllEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/UntapAllEffect.java @@ -13,7 +13,7 @@ import forge.game.player.Player; import forge.game.zone.ZoneType; public class UntapAllEffect extends SpellEffect { - + /* (non-Javadoc) * @see forge.card.abilityfactory.SpellEffect#getStackDescription(java.util.Map, forge.card.spellability.SpellAbility) */ @@ -29,27 +29,28 @@ public class UntapAllEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { final Card card = sa.getSourceCard(); - + String valid = ""; List list = null; - + List tgtPlayers = getTargetPlayersEmptyAsDefault(sa); - + if (sa.hasParam("ValidCards")) { valid = sa.getParam("ValidCards"); } - + if (tgtPlayers.isEmpty()) { list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield); } else { list = new ArrayList(); - for( final Player p : tgtPlayers ) + for (final Player p : tgtPlayers) { list.addAll(p.getCardsIn(ZoneType.Battlefield)); + } } list = CardLists.getValidCards(list, valid.split(","), card.getController(), card); - + boolean remember = sa.hasParam("RememberUntapped"); - for(Card c : list) { + for (Card c : list) { c.untap(); if (remember) { card.addRemembered(c); @@ -57,4 +58,4 @@ public class UntapAllEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/abilityfactory/effects/UntapEffect.java b/src/main/java/forge/card/abilityfactory/effects/UntapEffect.java index f05160e2452..0d2aff24e58 100644 --- a/src/main/java/forge/card/abilityfactory/effects/UntapEffect.java +++ b/src/main/java/forge/card/abilityfactory/effects/UntapEffect.java @@ -25,9 +25,9 @@ public class UntapEffect extends SpellEffect { protected String getStackDescription(SpellAbility sa) { // when getStackDesc is called, just build exactly what is happening final StringBuilder sb = new StringBuilder(); - + sb.append("Untap "); - + if (sa.hasParam("UntapUpTo")) { sb.append("up to ").append(sa.getParam("Amount")).append(" "); sb.append(sa.getParam("UntapType")).append("s"); @@ -42,13 +42,13 @@ public class UntapEffect extends SpellEffect { @Override public void resolve(SpellAbility sa) { final Target tgt = sa.getTarget(); - + if (sa.hasParam("UntapUpTo")) { untapChooseUpTo(sa); } else { - + final List tgtCards = getTargetCards(sa); - + for (final Card tgtC : tgtCards) { if (tgtC.isInPlay() && ((tgt == null) || tgtC.canBeTargetedBy(sa))) { tgtC.untap(); @@ -72,10 +72,10 @@ public class UntapEffect extends SpellEffect { private void untapChooseUpTo(final SpellAbility sa) { final int num = Integer.parseInt(sa.getParam("Amount")); final String valid = sa.getParam("UntapType"); - + final ArrayList definedPlayers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), sa.getParam("Defined"), sa); - + for (final Player p : definedPlayers) { if (p.isHuman()) { Singletons.getModel().getMatch().getInput().setInput(CardFactoryUtil.inputUntapUpToNType(num, valid)); @@ -83,11 +83,11 @@ public class UntapEffect extends SpellEffect { List list = p.getCardsIn(ZoneType.Battlefield); list = CardLists.getType(list, valid); list = CardLists.filter(list, Presets.TAPPED); - + int count = 0; while ((list.size() != 0) && (count < num)) { for (int i = 0; (i < list.size()) && (count < num); i++) { - + final Card c = CardFactoryUtil.getBestLandAI(list); c.untap(); list.remove(c); @@ -98,4 +98,4 @@ public class UntapEffect extends SpellEffect { } } -} \ No newline at end of file +} diff --git a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java index 2bf863b886d..5f68870b8fa 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryCreatures.java @@ -778,7 +778,7 @@ public class CardFactoryCreatures { Zone zone = Singletons.getModel().getGame().getZoneOf(c); return zone.is(ZoneType.Battlefield) && c.getController() == ability.getTargetPlayer() && c.canBeTargetedBy(ability); } - + @Override protected Input onDone() { final StringBuilder sb = new StringBuilder(); @@ -791,7 +791,7 @@ public class CardFactoryCreatures { return null; } }; - + targetInput.setMessage("Select up to 5 target permanents. Selected (%d) so far. Click OK when done."); Predicate canTarget = new Predicate() { diff --git a/src/main/java/forge/card/cardfactory/CardFactoryLands.java b/src/main/java/forge/card/cardfactory/CardFactoryLands.java index a410b201568..e9d0c886f57 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryLands.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryLands.java @@ -92,7 +92,7 @@ class CardFactoryLands { public void computerExecute() { boolean needsTheMana = false; final Player ai = card.getController(); - if (ai.getLife() > 3) { + if (ai.getLife() > 3 && ai.canPayLife(2)) { final int landsize = ai.getLandsInPlay().size(); for (Card c : ai.getCardsIn(ZoneType.Hand)) { if (landsize == c.getCMC()) { @@ -109,8 +109,7 @@ class CardFactoryLands { public void humanExecute() { final Player human = card.getController(); - final int life = human.getLife(); - if (2 < life) { + if (human.canPayLife(2)) { final String question = String.format("Pay 2 life? If you don't, %s enters the battlefield tapped.", card.getName()); diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index a993ae1439d..7bceaf85d21 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -1962,6 +1962,10 @@ public class CardFactoryUtil { } } + if (l[0].startsWith("Count$")) { + l[0] = l[0].replace("Count$", ""); + } + if (l[0].startsWith("SVar$")) { final String sVar = l[0].replace("SVar$", ""); return CardFactoryUtil.doXMath(CardFactoryUtil.xCount(c, c.getSVar(sVar)), m, c); diff --git a/src/main/java/forge/card/cost/CostDiscard.java b/src/main/java/forge/card/cost/CostDiscard.java index 061c1d3deb5..335842fbb82 100644 --- a/src/main/java/forge/card/cost/CostDiscard.java +++ b/src/main/java/forge/card/cost/CostDiscard.java @@ -130,7 +130,7 @@ public class CostDiscard extends CostPartWithList { return handList.contains(c); } else { if (ability.isSpell()) { - handList.remove(source);// can't pay for itself + handList.remove(source); // can't pay for itself } boolean sameName = false; if (type.contains("+WithSameName")) { @@ -385,14 +385,14 @@ public class CostDiscard extends CostPartWithList { public void selectCard(final Card card) { Zone zone = Singletons.getModel().getGame().getZoneOf(card); if (zone.is(ZoneType.Hand) && handList.contains(card)) { - if (!sameName || part.getList().isEmpty() + if (!sameName || part.getList().isEmpty() || part.getList().get(0).getName().equals(card.getName())) { // send in List for Typing card.getController().discard(card, sp); part.addToList(card); handList.remove(card); this.nDiscard++; - + // in case no more cards in hand if (this.nDiscard == nNeeded) { this.done(); diff --git a/src/main/java/forge/card/cost/CostExile.java b/src/main/java/forge/card/cost/CostExile.java index 0a7763aa539..ee0addd926f 100644 --- a/src/main/java/forge/card/cost/CostExile.java +++ b/src/main/java/forge/card/cost/CostExile.java @@ -98,7 +98,7 @@ public class CostExile extends CostPartWithList { } else if (this.getType().equals("All")) { sb.append(" all cards from your ").append(this.from); return sb.toString(); - } + } if (this.from.equals(ZoneType.Battlefield)) { final String desc = this.getTypeDescription() == null ? this.getType() : this.getTypeDescription(); @@ -150,7 +150,7 @@ public class CostExile extends CostPartWithList { List typeList = new ArrayList(); if (this.getType().equals("All")) { return true; // this will always work - } + } if (this.getFrom().equals(ZoneType.Stack)) { for (int i = 0; i < Singletons.getModel().getGame().getStack().size(); i++) { typeList.add(Singletons.getModel().getGame().getStack().peekAbility(i).getSourceCard()); @@ -213,7 +213,7 @@ public class CostExile extends CostPartWithList { Singletons.getModel().getGame().getAction().exile(card); } payment.paidCost(this); - } + } list = CardLists.getValidCards(list, this.getType().split(";"), activator, source); if (c == null) { final String sVar = ability.getSVar(amount); diff --git a/src/main/java/forge/card/mana/ManaCost.java b/src/main/java/forge/card/mana/ManaCost.java index 3e4f3d33b6e..71155fc81dc 100644 --- a/src/main/java/forge/card/mana/ManaCost.java +++ b/src/main/java/forge/card/mana/ManaCost.java @@ -494,7 +494,7 @@ public class ManaCost { } String manaColor = mana.getColor(); - + if (choice.isOr2Colorless() && !this.isColor(InputPayManaCostUtil.getShortColorString(manaColor))) { this.increaseColorlessMana(1); } diff --git a/src/main/java/forge/card/mana/ManaCostShard.java b/src/main/java/forge/card/mana/ManaCostShard.java index dfe41271030..7cacf40a42f 100644 --- a/src/main/java/forge/card/mana/ManaCostShard.java +++ b/src/main/java/forge/card/mana/ManaCostShard.java @@ -362,10 +362,14 @@ public class ManaCostShard { */ public boolean canBePaidWithManaOfColor(CardColor color) { // can pay with life? - if ( (this.shard & Atom.OR_2_LIFE) != 0 ) return true; + if ((this.shard & Atom.OR_2_LIFE) != 0) { + return true; + } // can pay with any color? - if ( (this.shard & Atom.OR_2_COLORLESS) != 0 || 0 != ( this.shard & Atom.COLORLESS ) ) return true; + if ((this.shard & Atom.OR_2_COLORLESS) != 0 || 0 != (this.shard & Atom.COLORLESS)) { + return true; + } // either colored part is empty, or there are same colors in shard and mana source - return ( 0xFF & this.shard ) == 0 || ( color.getColor() & this.shard ) > 0; + return (0xFF & this.shard) == 0 || (color.getColor() & this.shard) > 0; } } diff --git a/src/main/java/forge/card/mana/ManaPool.java b/src/main/java/forge/card/mana/ManaPool.java index 1b2414d07eb..f962c1ac412 100644 --- a/src/main/java/forge/card/mana/ManaPool.java +++ b/src/main/java/forge/card/mana/ManaPool.java @@ -178,9 +178,9 @@ public class ManaPool { */ public final int clearPool(boolean isEndOfPhase) { int numRemoved = 0; - - if (isEndOfPhase && - Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.manapoolsDontEmpty)) { + + if (isEndOfPhase + && Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.manapoolsDontEmpty)) { return numRemoved; } diff --git a/src/main/java/forge/card/replacement/ReplacementEffect.java b/src/main/java/forge/card/replacement/ReplacementEffect.java index 8be96dc0929..8e5530d4ec4 100644 --- a/src/main/java/forge/card/replacement/ReplacementEffect.java +++ b/src/main/java/forge/card/replacement/ReplacementEffect.java @@ -41,7 +41,7 @@ import forge.util.Expressions; public abstract class ReplacementEffect extends TriggerReplacementBase { private ReplacementLayer layer = ReplacementLayer.None; - + /** The has run. */ private boolean hasRun = false; @@ -102,7 +102,7 @@ public abstract class ReplacementEffect extends TriggerReplacementBase { if (Expressions.compare(left, comparator, compareTo)) { return true; } - } else if (sa != null && sa.doTrigger(false)){ + } else if (sa != null && sa.doTrigger(false)) { return true; } @@ -204,7 +204,7 @@ public abstract class ReplacementEffect extends TriggerReplacementBase { return false; } } - + if (this.getMapParams().containsKey("PlayerTurn")) { if (this.getMapParams().get("PlayerTurn").equals("True") && !Singletons.getModel().getGame().getPhaseHandler().isPlayerTurn(this.getHostCard().getController())) { return false; diff --git a/src/main/java/forge/card/replacement/ReplacementHandler.java b/src/main/java/forge/card/replacement/ReplacementHandler.java index a93a1d532ae..74392609d6a 100644 --- a/src/main/java/forge/card/replacement/ReplacementHandler.java +++ b/src/main/java/forge/card/replacement/ReplacementHandler.java @@ -89,7 +89,7 @@ public class ReplacementHandler { * the run params,same as for triggers. * @return true if the event was replaced. */ - public ReplacementResult run(final HashMap runParams, final ReplacementLayer layer,final Player decider) { + public ReplacementResult run(final HashMap runParams, final ReplacementLayer layer, final Player decider) { final List possibleReplacers = new ArrayList(); // Round up Non-static replacement effects ("Until EOT," or @@ -283,7 +283,7 @@ public class ReplacementHandler { } else if (eventToReplace.equals("Moved")) { ret = new ReplaceMoved(mapParams, host); } - + String activeZones = mapParams.get("ActiveZones"); if (null != activeZones) { ret.setActiveZone(EnumSet.copyOf(ZoneType.listValueOf(activeZones))); diff --git a/src/main/java/forge/card/replacement/ReplacementLayer.java b/src/main/java/forge/card/replacement/ReplacementLayer.java index 7f63ea131a6..46d71841f28 100644 --- a/src/main/java/forge/card/replacement/ReplacementLayer.java +++ b/src/main/java/forge/card/replacement/ReplacementLayer.java @@ -10,7 +10,7 @@ public enum ReplacementLayer { Copy, Other, None; - + /** * TODO: Write javadoc for this method. * @param substring diff --git a/src/main/java/forge/card/spellability/AbilityActivated.java b/src/main/java/forge/card/spellability/AbilityActivated.java index 70ab2e7f7dd..9c48c631a4e 100644 --- a/src/main/java/forge/card/spellability/AbilityActivated.java +++ b/src/main/java/forge/card/spellability/AbilityActivated.java @@ -106,7 +106,7 @@ public abstract class AbilityActivated extends SpellAbility implements java.io.S return false; } - if (this.isCycling() + if (this.isCycling() && Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noCycling)) { return false; } @@ -117,7 +117,7 @@ public abstract class AbilityActivated extends SpellAbility implements java.io.S return CostPayment.canPayAdditionalCosts(this.getPayCosts(), this); } - + /* (non-Javadoc) * @see forge.card.spellability.SpellAbility#resolve() */ diff --git a/src/main/java/forge/card/spellability/AbilityManaPart.java b/src/main/java/forge/card/spellability/AbilityManaPart.java index ee774222b6a..1d1e4ca0a64 100644 --- a/src/main/java/forge/card/spellability/AbilityManaPart.java +++ b/src/main/java/forge/card/spellability/AbilityManaPart.java @@ -45,7 +45,7 @@ public class AbilityManaPart implements java.io.Serializable { private String origProduced; private String lastExpressChoice = ""; private String manaRestrictions = ""; - transient private ArrayList lastProduced = new ArrayList(); + private transient ArrayList lastProduced = new ArrayList(); private int amount = 1; /** The reflected. */ @@ -54,13 +54,13 @@ public class AbilityManaPart implements java.io.Serializable { /** The canceled. */ private boolean canceled = false; - transient private final Card sourceCard; + private final transient Card sourceCard; - transient private Cost cost; + private transient Cost cost; // Spells paid with this mana spell can't be countered. private boolean cannotCounterSpell; - + /** *

* Constructor for AbilityMana. @@ -77,12 +77,12 @@ public class AbilityManaPart implements java.io.Serializable { */ public AbilityManaPart(final Card sourceCard, final Map params) { this.sourceCard = sourceCard; - + origProduced = params.containsKey("Produced") ? params.get("Produced") : "1"; if (params.containsKey("RestrictValid")) { this.manaRestrictions = params.get("RestrictValid"); } - + this.cannotCounterSpell = params.containsKey("AddsNoCounter"); } @@ -91,7 +91,7 @@ public class AbilityManaPart implements java.io.Serializable { *

* produceMana. *

- * @param ability + * @param ability */ public final void produceMana(SpellAbility sa) { this.produceMana(this.getManaProduced(), this.getSourceCard().getController(), sa); @@ -106,7 +106,7 @@ public class AbilityManaPart implements java.io.Serializable { * a {@link java.lang.String} object. * @param player * a {@link forge.game.player.Player} object. - * @param sa + * @param sa */ public final void produceMana(final String produced, final Player player, SpellAbility sa) { final Card source = this.getSourceCard(); @@ -448,8 +448,8 @@ public class AbilityManaPart implements java.io.Serializable { // if (abm.getType() != this.getType()) { // return false; // } - - return cost.equals(abm.cost) && sourceCard.equals(abm.sourceCard); + + return cost.equals(abm.cost) && sourceCard.equals(abm.sourceCard); // return abm.toUnsuppressedString().equals(this.toUnsuppressedString()); } diff --git a/src/main/java/forge/card/spellability/AbilityTriggered.java b/src/main/java/forge/card/spellability/AbilityTriggered.java index 12e7e55ad3a..41c5b14c8e1 100644 --- a/src/main/java/forge/card/spellability/AbilityTriggered.java +++ b/src/main/java/forge/card/spellability/AbilityTriggered.java @@ -180,7 +180,7 @@ public class AbilityTriggered extends Ability implements Command { return (this.restrictions.length == 1) && this.restrictions[0].equals("named " + this.getSourceCard().getName()); } - + @Override public final boolean isTrigger() { return true; diff --git a/src/main/java/forge/card/spellability/ISpellAbility.java b/src/main/java/forge/card/spellability/ISpellAbility.java index 883875835fd..df3e136c73b 100644 --- a/src/main/java/forge/card/spellability/ISpellAbility.java +++ b/src/main/java/forge/card/spellability/ISpellAbility.java @@ -1,7 +1,7 @@ package forge.card.spellability; /** - * Will collect here essential methods needed to hold ability on stack and resolve + * Will collect here essential methods needed to hold ability on stack and resolve. * */ public interface ISpellAbility { diff --git a/src/main/java/forge/card/spellability/Spell.java b/src/main/java/forge/card/spellability/Spell.java index d715ef174eb..40c17b35490 100644 --- a/src/main/java/forge/card/spellability/Spell.java +++ b/src/main/java/forge/card/spellability/Spell.java @@ -45,7 +45,7 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable /** Constant serialVersionUID=-7930920571482203460L. */ private static final long serialVersionUID = -7930920571482203460L; - + private boolean castFaceDown = false; /** @@ -187,8 +187,8 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable public boolean isSpell() { return true; } @Override public boolean isAbility() { return false; } - - + + /** *

* canPlayFromEffectAI. @@ -215,7 +215,7 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable * @param faceDown the castFaceDown to set */ public void setCastFaceDown(boolean faceDown) { - this.castFaceDown = faceDown; + this.castFaceDown = faceDown; } - + } diff --git a/src/main/java/forge/card/spellability/SpellAbility.java b/src/main/java/forge/card/spellability/SpellAbility.java index dceb9ddadff..e6f891dde4f 100644 --- a/src/main/java/forge/card/spellability/SpellAbility.java +++ b/src/main/java/forge/card/spellability/SpellAbility.java @@ -113,7 +113,7 @@ public abstract class SpellAbility implements ISpellAbility { private List tappedForConvoke = new ArrayList(); private HashMap sVars = new HashMap(); - + private AbilityManaPart manaPart = null; private boolean undoable; @@ -124,7 +124,7 @@ public abstract class SpellAbility implements ISpellAbility { public final boolean isManaAbility() { return manaPart != null && isAbility(); } - + public final void setManaPart(AbilityManaPart manaPart) { this.manaPart = manaPart; @@ -141,7 +141,7 @@ public abstract class SpellAbility implements ISpellAbility { public Set getSVars() { return sVars.keySet(); } - + /** *

* Constructor for SpellAbility. @@ -342,7 +342,7 @@ public abstract class SpellAbility implements ISpellAbility { public boolean isBuyBackAbility() { return this.optionalAdditionalCosts.contains("Buyback"); } - + /** *

* isKicked. @@ -353,7 +353,7 @@ public abstract class SpellAbility implements ISpellAbility { public boolean isKicked() { return isOptionalAdditionalCostPaid("Kicker"); } - + /** *

* isOptionalAdditionalCostPaid. @@ -512,7 +512,7 @@ public abstract class SpellAbility implements ISpellAbility { return params == null ? null : params.get(key); } public boolean hasParam(String key) { - return params == null ? false: params.containsKey(key); + return params == null ? false : params.containsKey(key); } /** @@ -520,18 +520,19 @@ public abstract class SpellAbility implements ISpellAbility { * @param mapParams */ public void copyParamsToMap(Map mapParams) { - if ( null != params ) + if (null != params) { mapParams.putAll(params); - } - + } + } + // If this is not null, then ability was made in a factory public ApiType getApi() { return api; } - + public final boolean isCurse() { return this.hasParam("IsCurse"); - } + } /** *

@@ -1664,7 +1665,7 @@ public abstract class SpellAbility implements ISpellAbility { public List knownDetermineDefined(final String defined) { final List ret = new ArrayList(); final ArrayList list = AbilityFactory.getDefinedCards(getSourceCard(), defined, this); - + for (final Card c : list) { final Card actualCard = Singletons.getModel().getGame().getCardState(c); ret.add(actualCard); @@ -1684,7 +1685,7 @@ public abstract class SpellAbility implements ISpellAbility { while (null != parent.getParent()) { parent = parent.getParent(); } - + return parent; } @@ -1701,11 +1702,13 @@ public abstract class SpellAbility implements ISpellAbility { */ public SpellAbility getParentTargetingCard() { SpellAbility parent = this; - - while( parent.getParent() != null) - { + + while (parent.getParent() != null) { + Target tgt = parent.getTarget(); - if ( tgt != null && tgt.getTargetCards() != null && !tgt.getTargetCards().isEmpty() ) break; + if (tgt != null && tgt.getTargetCards() != null && !tgt.getTargetCards().isEmpty()) { + break; + } parent = parent.getParent(); } return parent; @@ -1720,10 +1723,12 @@ public abstract class SpellAbility implements ISpellAbility { */ public SpellAbility getParentTargetingSA() { SpellAbility parent = this; - while( parent.getParent() != null) - { + while (parent.getParent() != null) { + Target tgt = parent.getTarget(); - if ( tgt != null && tgt.getTargetSAs() != null && !tgt.getTargetSAs().isEmpty() ) break; + if (tgt != null && tgt.getTargetSAs() != null && !tgt.getTargetSAs().isEmpty()) { + break; + } parent = parent.getParent(); } return parent; @@ -1738,10 +1743,12 @@ public abstract class SpellAbility implements ISpellAbility { */ public SpellAbility getParentTargetingPlayer() { SpellAbility parent = this; - while( parent.getParent() != null) - { + while (parent.getParent() != null) { + Target tgt = parent.getTarget(); - if ( tgt != null && tgt.getTargetPlayers() != null && !tgt.getTargetPlayers().isEmpty() ) break; + if (tgt != null && tgt.getTargetPlayers() != null && !tgt.getTargetPlayers().isEmpty()) { + break; + } parent = parent.getParent(); } return parent; @@ -1759,8 +1766,9 @@ public abstract class SpellAbility implements ISpellAbility { * TODO: Write javadoc for this method. */ public void undo() { - if ( isUndoable() ) + if (isUndoable()) { this.payCosts.refundPaidCost(sourceCard); + } } /** diff --git a/src/main/java/forge/card/spellability/SpellAbilityRestriction.java b/src/main/java/forge/card/spellability/SpellAbilityRestriction.java index 3d3b7d97c47..86506ec52e8 100644 --- a/src/main/java/forge/card/spellability/SpellAbilityRestriction.java +++ b/src/main/java/forge/card/spellability/SpellAbilityRestriction.java @@ -190,7 +190,7 @@ public class SpellAbilityRestriction extends SpellAbilityVariables { if (cardZone == null || !cardZone.is(this.getZone())) { // 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 != null && ZoneType.Battlefield.equals(cardZone.getZoneType())) + if (!sa.isSpell() || (cardZone != null && ZoneType.Battlefield.equals(cardZone.getZoneType())) || !this.getZone().equals(ZoneType.Hand)) { return false; } diff --git a/src/main/java/forge/card/spellability/SpellAbilityVariables.java b/src/main/java/forge/card/spellability/SpellAbilityVariables.java index cabc1d98eaf..699d5b5e124 100644 --- a/src/main/java/forge/card/spellability/SpellAbilityVariables.java +++ b/src/main/java/forge/card/spellability/SpellAbilityVariables.java @@ -513,7 +513,7 @@ public class SpellAbilityVariables { public void setKicked(boolean kicked) { this.kicked = kicked; } - + /** *

diff --git a/src/main/java/forge/card/spellability/SpellPermanent.java b/src/main/java/forge/card/spellability/SpellPermanent.java index af00d234e02..054b17f67c9 100644 --- a/src/main/java/forge/card/spellability/SpellPermanent.java +++ b/src/main/java/forge/card/spellability/SpellPermanent.java @@ -104,7 +104,7 @@ public class SpellPermanent extends Spell { } else if (controller.isHuman()) { Singletons.getModel().getMatch().getInput().setInput(SpellPermanent.this.championInputComes); } else { // Computer - List computer = + List computer = CardLists.getValidCards(controller.getCardsIn(ZoneType.Battlefield), SpellPermanent.this.championValid, controller, source); computer.remove(source); @@ -248,10 +248,10 @@ public class SpellPermanent extends Spell { sourceCard.addComesIntoPlayCommand(this.championCommandComes); sourceCard.addLeavesPlayCommand(this.championCommandLeavesPlay); } - - if(this.getManaCost().contains("X")) - { - if(!this.getSourceCard().getSVar("X").equals("")) { + + if (this.getManaCost().contains("X")) { + + if (!this.getSourceCard().getSVar("X").equals("")) { this.setSVar("X", this.getSourceCard().getSVar("X")); } } @@ -324,11 +324,11 @@ public class SpellPermanent extends Spell { if (mandatory) { return true; } - final Player ai = getActivatingPlayer(); + final Player ai = getActivatingPlayer(); final Card card = this.getSourceCard(); String mana = this.getPayCosts().getTotalMana(); final Cost cost = this.getPayCosts(); - + if (cost != null) { // AI currently disabled for these costs if (!CostUtil.checkLifeCost(ai, cost, card, 4, null)) { @@ -347,10 +347,10 @@ public class SpellPermanent extends Spell { return false; } } - + // check on legendary - if (card.isType("Legendary") && - !Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) { + if (card.isType("Legendary") + && !Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) { final List list = ai.getCardsIn(ZoneType.Battlefield); if (Iterables.any(list, CardPredicates.nameEquals(card.getName()))) { return false; @@ -391,7 +391,7 @@ public class SpellPermanent extends Spell { } final List cl = this.championGetCreature.get(); - if ( !(cl.size() > 0) || !this.getSourceCard().isInZone(ZoneType.Hand)) { + if (!(cl.size() > 0) || !this.getSourceCard().isInZone(ZoneType.Hand)) { return false; } } @@ -411,7 +411,7 @@ public class SpellPermanent extends Spell { private static boolean checkETBEffects(final Card card, final SpellAbility sa, final ApiType api, final Player ai) { - if (card.isCreature() + if (card.isCreature() && Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noCreatureETBTriggers)) { return true; } @@ -564,12 +564,12 @@ public class SpellPermanent extends Spell { else { throw new InvalidParameterException("Either ai or sa must be not null!"); } - + if (exSA.getActivatingPlayer() == null) { throw new InvalidParameterException("Executing SpellAbility for Replacement Effect has no activating player"); } } - + // ETBReplacement uses overriding abilities. // These checks only work if the Executing SpellAbility is an // Ability_Sub. diff --git a/src/main/java/forge/card/spellability/Target.java b/src/main/java/forge/card/spellability/Target.java index 873612dbf87..b14229aa66a 100644 --- a/src/main/java/forge/card/spellability/Target.java +++ b/src/main/java/forge/card/spellability/Target.java @@ -716,9 +716,11 @@ public class Target { for (final Card c : Singletons.getModel().getGame().getCardsIn(this.tgtZone)) { boolean isValidTarget = c.isValid(this.validTgts, this.srcCard.getController(), this.srcCard); boolean canTarget = (!isTargeted || c.canBeTargetedBy(sa)); - boolean isAlreadyTargeted = this.getTargetCards().contains(c); + boolean isAlreadyTargeted = this.getTargetCards().contains(c); //System.out.print(c); - if ( isValidTarget && canTarget && !isAlreadyTargeted ) return true; + if (isValidTarget && canTarget && !isAlreadyTargeted) { + return true; + } } } diff --git a/src/main/java/forge/card/spellability/TargetChoices.java b/src/main/java/forge/card/spellability/TargetChoices.java index 07432ea837b..1167673b280 100644 --- a/src/main/java/forge/card/spellability/TargetChoices.java +++ b/src/main/java/forge/card/spellability/TargetChoices.java @@ -153,7 +153,7 @@ public class TargetChoices { } return false; } - + /** *

* removeTarget. @@ -172,7 +172,7 @@ public class TargetChoices { } return false; } - + /** *

* removeTarget. @@ -191,7 +191,7 @@ public class TargetChoices { } return false; } - + /** *

* Getter for the field targetCards. diff --git a/src/main/java/forge/card/spellability/TargetSelection.java b/src/main/java/forge/card/spellability/TargetSelection.java index 52417b69e07..17ec95f1306 100644 --- a/src/main/java/forge/card/spellability/TargetSelection.java +++ b/src/main/java/forge/card/spellability/TargetSelection.java @@ -698,7 +698,7 @@ public class TargetSelection { return false; } - + /** *

* matchesValidSA. diff --git a/src/main/java/forge/control/FControl.java b/src/main/java/forge/control/FControl.java index 7b9a0021811..d1b4928be16 100644 --- a/src/main/java/forge/control/FControl.java +++ b/src/main/java/forge/control/FControl.java @@ -48,6 +48,7 @@ import forge.properties.ForgeProps; import forge.properties.NewConstants; import forge.quest.data.QuestPreferences.QPref; import forge.quest.io.QuestDataIO; +import forge.sound.SoundSystem; import forge.view.FView; /** @@ -85,6 +86,8 @@ public enum FControl { /** */ public static final int DRAFTING_PROCESS = 7; + private final SoundSystem soundSystem = new SoundSystem(); + /** *

* FControl. @@ -291,4 +294,13 @@ public enum FControl { public void setPlayer(Player localHuman) { localPlayer = localHuman; } + + /** + * TODO: Write javadoc for this method. + * @return + */ + public SoundSystem getSoundSystem() { + // TODO Auto-generated method stub + return soundSystem; + } } diff --git a/src/main/java/forge/control/input/InputPayManaCost.java b/src/main/java/forge/control/input/InputPayManaCost.java index dff72b73bb7..49a8a2d630a 100644 --- a/src/main/java/forge/control/input/InputPayManaCost.java +++ b/src/main/java/forge/control/input/InputPayManaCost.java @@ -169,7 +169,7 @@ public class InputPayManaCost extends InputPayMana { public final void selectPlayer(final Player player) { if (player.isHuman()) { - if (this.manaCost.payPhyrexian()) { + if (player.canPayLife(this.phyLifeToLose + 2) && manaCost.payPhyrexian()) { this.phyLifeToLose += 2; } diff --git a/src/main/java/forge/control/input/InputPayManaCost2.java b/src/main/java/forge/control/input/InputPayManaCost2.java index 2810bb18eca..f8b47e8c510 100644 --- a/src/main/java/forge/control/input/InputPayManaCost2.java +++ b/src/main/java/forge/control/input/InputPayManaCost2.java @@ -60,7 +60,7 @@ public class InputPayManaCost2 extends InputPayMana { @Override public void selectPlayer(final Player player) { if (player.isHuman()) { - if (manaCost.payPhyrexian()) { + if (player.canPayLife(this.phyLifeToLose + 2) && manaCost.payPhyrexian()) { this.phyLifeToLose += 2; } diff --git a/src/main/java/forge/control/input/InputPayManaCostAbility.java b/src/main/java/forge/control/input/InputPayManaCostAbility.java index ddc45610743..fbd3f726195 100644 --- a/src/main/java/forge/control/input/InputPayManaCostAbility.java +++ b/src/main/java/forge/control/input/InputPayManaCostAbility.java @@ -156,7 +156,7 @@ public class InputPayManaCostAbility extends InputPayMana { @Override public void selectPlayer(final Player player) { if (player.isHuman()) { - if (manaCost.payPhyrexian()) { + if (player.canPayLife(this.phyLifeToLose + 2) && manaCost.payPhyrexian()) { this.phyLifeToLose += 2; } diff --git a/src/main/java/forge/game/GameNew.java b/src/main/java/forge/game/GameNew.java index 11f5cda3606..111f8ad0dff 100644 --- a/src/main/java/forge/game/GameNew.java +++ b/src/main/java/forge/game/GameNew.java @@ -36,7 +36,7 @@ import forge.gui.match.views.VAntes; import forge.item.CardDb; import forge.item.CardPrinted; import forge.properties.ForgePreferences.FPref; -import forge.sound.Sounds; +import forge.sound.SoundEffectType; import forge.util.Aggregates; import forge.util.MyRandom; @@ -86,8 +86,8 @@ public class GameNew { // ImageCache.getImage(card); } } - } - + } + // Shuffling // Ai may cheat if ( player.isComputer() && Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_SMOOTH_LAND) ) { @@ -373,7 +373,7 @@ public class GameNew { } // Play the Flip Coin sound - Sounds.FlipCoin.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.FlipCoin); List allPlayers = Singletons.getModel().getGame().getPlayers(); setPlayersFirstTurn(allPlayers.get(MyRandom.getRandom().nextInt(allPlayers.size())), true); diff --git a/src/main/java/forge/game/GameState.java b/src/main/java/forge/game/GameState.java index af64104ee82..3e344ea4441 100644 --- a/src/main/java/forge/game/GameState.java +++ b/src/main/java/forge/game/GameState.java @@ -23,12 +23,15 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import com.google.common.eventbus.EventBus; + import forge.Card; import forge.CardLists; import forge.CardPredicates.Presets; import forge.ColorChanger; import forge.GameAction; import forge.GameLog; +import forge.Singletons; import forge.StaticEffects; import forge.card.replacement.ReplacementHandler; import forge.card.trigger.TriggerHandler; @@ -70,6 +73,7 @@ public class GameState { private final TriggerHandler triggerHandler = new TriggerHandler(); private final ReplacementHandler replacementHandler = new ReplacementHandler(); private Combat combat = new Combat(); + private final EventBus events = new EventBus(); private final GameLog gameLog = new GameLog(); private final ColorChanger colorChanger = new ColorChanger(); @@ -96,6 +100,9 @@ public class GameState { action = new GameAction(this); stack = new MagicStack(this); phaseHandler = new PhaseHandler(this); + + events.register(Singletons.getControl().getSoundSystem()); + events.register(gameLog); } /** @@ -496,4 +503,11 @@ public class GameState { this.getTriggerHandler().runTrigger(TriggerType.LosesGame, runParams); } + + /** + * @return the events + */ + public EventBus getEvents() { + return events; + } } diff --git a/src/main/java/forge/game/event/Event.java b/src/main/java/forge/game/event/Event.java new file mode 100644 index 00000000000..c1309195cb5 --- /dev/null +++ b/src/main/java/forge/game/event/Event.java @@ -0,0 +1,5 @@ +package forge.game.event; + +public abstract class Event { + +} \ No newline at end of file diff --git a/src/main/java/forge/game/event/LandPlayedEvent.java b/src/main/java/forge/game/event/LandPlayedEvent.java new file mode 100644 index 00000000000..c308b867454 --- /dev/null +++ b/src/main/java/forge/game/event/LandPlayedEvent.java @@ -0,0 +1,17 @@ +package forge.game.event; + +import forge.Card; +import forge.game.player.Player; + +public class LandPlayedEvent extends Event{ + + public final Player Player; + public final Card Land; + + public LandPlayedEvent(Player player, Card land) { + Player = player; + Land = land; + + } + +} \ No newline at end of file diff --git a/src/main/java/forge/game/event/PoisonCounterEvent.java b/src/main/java/forge/game/event/PoisonCounterEvent.java new file mode 100644 index 00000000000..69e04e75005 --- /dev/null +++ b/src/main/java/forge/game/event/PoisonCounterEvent.java @@ -0,0 +1,24 @@ +package forge.game.event; + +import forge.Card; +import forge.game.player.Player; + +/** + * + * + */ +public class PoisonCounterEvent { + public final Player Reciever; + public final Card Source; + public final int Amount; + + public PoisonCounterEvent(Player recv, Card src, int n) { + Reciever = recv; + Source = src; + Amount = n; + } + + public PoisonCounterEvent(Player recv, Card src) { + this(recv, src, 1); + } +} diff --git a/src/main/java/forge/game/event/SpellResolvedEvent.java b/src/main/java/forge/game/event/SpellResolvedEvent.java new file mode 100644 index 00000000000..bef8f9ac0e0 --- /dev/null +++ b/src/main/java/forge/game/event/SpellResolvedEvent.java @@ -0,0 +1,28 @@ +package forge.game.event; + +import forge.Card; +import forge.card.spellability.SpellAbility; + +/** + * TODO: Write javadoc for this type. + * + */ +public class SpellResolvedEvent extends Event{ + + final public Card Source; + final public SpellAbility Spell; + + /** + * TODO: Write javadoc for Constructor. + * @param source + * @param sa + */ + public SpellResolvedEvent(Card source, SpellAbility sa) { + // TODO Auto-generated constructor stub + Source = source; + Spell = sa; + } + + + +} diff --git a/src/main/java/forge/game/event/package-info.java b/src/main/java/forge/game/event/package-info.java new file mode 100644 index 00000000000..5b77fa50567 --- /dev/null +++ b/src/main/java/forge/game/event/package-info.java @@ -0,0 +1,3 @@ +/** Forge Card Game. */ +package forge.game.event; + diff --git a/src/main/java/forge/game/limited/BoosterDraft.java b/src/main/java/forge/game/limited/BoosterDraft.java index 2bbf3b6b220..25c735433ee 100644 --- a/src/main/java/forge/game/limited/BoosterDraft.java +++ b/src/main/java/forge/game/limited/BoosterDraft.java @@ -401,9 +401,19 @@ public final class BoosterDraft implements IBoosterDraft { ArrayList setCombos = new ArrayList(); if (sets.length >= 2) { setCombos.add(String.format("%s/%s/%s", sets[0], sets[0], sets[0])); + setCombos.add(String.format("%s/%s/%s", sets[0], sets[0], sets[1])); + setCombos.add(String.format("%s/%s/%s", sets[0], sets[1], sets[1])); + if (sets.length >= 3) { + setCombos.add(String.format("%s/%s/%s", sets[0], sets[1], sets[2])); + setCombos.add(String.format("%s/%s/%s", sets[0], sets[2], sets[2])); + } setCombos.add(String.format("%s/%s/%s", sets[1], sets[0], sets[0])); setCombos.add(String.format("%s/%s/%s", sets[1], sets[1], sets[0])); setCombos.add(String.format("%s/%s/%s", sets[1], sets[1], sets[1])); + if (sets.length >= 3) { + setCombos.add(String.format("%s/%s/%s", sets[1], sets[1], sets[2])); + setCombos.add(String.format("%s/%s/%s", sets[1], sets[2], sets[2])); + } } if (sets.length >= 3) { setCombos.add(String.format("%s/%s/%s", sets[2], sets[1], sets[0])); diff --git a/src/main/java/forge/game/phase/CombatUtil.java b/src/main/java/forge/game/phase/CombatUtil.java index 652b10e59e6..55c171b9ded 100644 --- a/src/main/java/forge/game/phase/CombatUtil.java +++ b/src/main/java/forge/game/phase/CombatUtil.java @@ -1027,6 +1027,9 @@ public class CombatUtil { public static int damageIfUnblocked(final Card attacker, final Player attacked, final Combat combat) { int damage = attacker.getNetCombatDamage(); int sum = 0; + if (!attacked.canLoseLife()) { + return 0; + } damage += CombatUtil.predictPowerBonusOfAttacker(attacker, null, combat); if (!attacker.hasKeyword("Infect")) { sum = attacked.predictDamage(damage, attacker, true); diff --git a/src/main/java/forge/game/phase/PhaseHandler.java b/src/main/java/forge/game/phase/PhaseHandler.java index f94ea55b16a..dc37baaafbe 100644 --- a/src/main/java/forge/game/phase/PhaseHandler.java +++ b/src/main/java/forge/game/phase/PhaseHandler.java @@ -32,7 +32,7 @@ import forge.game.GameState; import forge.game.player.Player; import forge.game.zone.ZoneType; import forge.properties.ForgePreferences.FPref; -import forge.sound.Sounds; +import forge.sound.SoundEffectType; import forge.util.MyObservable; @@ -426,7 +426,7 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable { p.loseLife(burn); // Play the Mana Burn sound - Sounds.ManaBurn.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.ManaBurn); } p.updateObservers(); } @@ -470,7 +470,7 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable { this.setPlayerTurn(this.handleNextTurn()); } // Play the End Turn sound - Sounds.EndOfTurn.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.EndOfTurn); break; default: // no action } diff --git a/src/main/java/forge/game/player/ComputerUtil.java b/src/main/java/forge/game/player/ComputerUtil.java index affb61ca99b..e35e244372d 100644 --- a/src/main/java/forge/game/player/ComputerUtil.java +++ b/src/main/java/forge/game/player/ComputerUtil.java @@ -749,7 +749,7 @@ public class ComputerUtil { } // end of cost parts loop //check for phyrexian mana - if (!cost.isPaid() && cost.containsPhyrexianMana() && ai.getLife() > 5) { + if (!cost.isPaid() && cost.containsPhyrexianMana() && ai.getLife() > 5 && ai.canPayLife(2)) { cost.payPhyrexian(); if (!test) { ai.payLife(2, sa.getSourceCard()); diff --git a/src/main/java/forge/game/player/ComputerUtilAttack.java b/src/main/java/forge/game/player/ComputerUtilAttack.java index 8d370fa1cc3..d6e482c51e9 100644 --- a/src/main/java/forge/game/player/ComputerUtilAttack.java +++ b/src/main/java/forge/game/player/ComputerUtilAttack.java @@ -344,9 +344,8 @@ public class ComputerUtilAttack { totalPoison += CombatUtil.poisonIfUnblocked(attacker, ai); } - if (ai.getLife() <= totalAttack - && !ai.cantLoseForZeroOrLessLife() - && ai.canLoseLife()) { + if (totalAttack > 0 && ai.getLife() <= totalAttack + && !ai.cantLoseForZeroOrLessLife()) { return true; } return ai.getPoisonCounters() + totalPoison > 9; @@ -417,7 +416,6 @@ public class ComputerUtilAttack { unblockedAttackers.addAll(remainingAttackers); if ((CombatUtil.sumDamageIfUnblocked(remainingAttackers, opp) >= opp.getLife()) - && opp.canLoseLife() && !((opp.cantLoseForZeroOrLessLife() || ai.cantWin()) && (opp.getLife() < 1))) { return true; } diff --git a/src/main/java/forge/game/player/Player.java b/src/main/java/forge/game/player/Player.java index 901dd0abcae..f1576e97c37 100644 --- a/src/main/java/forge/game/player/Player.java +++ b/src/main/java/forge/game/player/Player.java @@ -55,14 +55,16 @@ import forge.card.trigger.TriggerType; import forge.game.GameLossReason; import forge.game.GameState; import forge.game.GlobalRuleChange; +import forge.game.event.LandPlayedEvent; +import forge.game.event.PoisonCounterEvent; +import forge.game.event.SpellResolvedEvent; import forge.game.phase.PhaseHandler; import forge.game.zone.PlayerZone; import forge.game.zone.PlayerZoneBattlefield; import forge.game.zone.ZoneType; import forge.gui.GuiChoose; import forge.properties.ForgePreferences.FPref; -import forge.sound.SoundUtils; -import forge.sound.Sounds; +import forge.sound.SoundEffectType; import forge.util.MyRandom; /** @@ -974,11 +976,10 @@ public abstract class Player extends GameEntity implements Comparable { public final void addPoisonCounters(final int num, final Card source) { if (!this.hasKeyword("You can't get poison counters")) { this.poisonCounters += num; + + game.getEvents().post(new PoisonCounterEvent(this, source, 3)); game.getGameLog().add("Poison", this + " receives a poison counter from " + source, 3); - // play the Poison sound - Sounds.Poison.play(); - this.updateObservers(); } } @@ -1269,7 +1270,7 @@ public abstract class Player extends GameEntity implements Comparable { } // Play the Draw sound - Sounds.Draw.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.Draw); return drawn; } @@ -1608,21 +1609,21 @@ public abstract class Player extends GameEntity implements Comparable { game.getAction().discardMadness(c); - if ((c.hasKeyword("If a spell or ability an opponent controls causes " - + "you to discard CARDNAME, put it onto the battlefield instead of putting it into your graveyard.") || c - .hasKeyword("If a spell or ability an opponent controls causes " - + "you to discard CARDNAME, put it onto the battlefield with two +1/+1 " - + "counters on it instead of putting it into your graveyard.")) + if ((c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME, " + + "put it onto the battlefield instead of putting it into your graveyard.") + || c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME, " + + "put it onto the battlefield with two +1/+1 counters on it " + + "instead of putting it into your graveyard.")) && (null != sa) && !c.getController().equals(sa.getSourceCard().getController())) { game.getAction().discardPutIntoPlayInstead(c); // Play the corresponding Put into Play sound - SoundUtils.playCardSoundEffect(c, sa); + game.getEvents().post(new SpellResolvedEvent(c, sa)); } else { game.getAction().moveToGraveyard(c); // Play the Discard sound - Sounds.Discard.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.Discard); } // Run triggers @@ -1809,7 +1810,7 @@ public abstract class Player extends GameEntity implements Comparable { game.getTriggerHandler().runTrigger(TriggerType.Shuffled, runParams); // Play the shuffle sound - Sounds.Shuffle.play(); + Singletons.getControl().getSoundSystem().play(SoundEffectType.Shuffle); } // shuffle // ////////////////////////////// @@ -1869,7 +1870,7 @@ public abstract class Player extends GameEntity implements Comparable { game.getGameLog().add("Land", this + " played " + land, 2); // play a sound - SoundUtils.playLandSoundEffect(land); + game.getEvents().post(new LandPlayedEvent(this, land)); // Run triggers final HashMap runParams = new HashMap(); diff --git a/src/main/java/forge/game/zone/MagicStack.java b/src/main/java/forge/game/zone/MagicStack.java index 03e37117314..e5339614570 100644 --- a/src/main/java/forge/game/zone/MagicStack.java +++ b/src/main/java/forge/game/zone/MagicStack.java @@ -49,6 +49,7 @@ import forge.card.trigger.TriggerType; import forge.control.input.Input; import forge.control.input.InputPayManaCostAbility; import forge.game.GameState; +import forge.game.event.SpellResolvedEvent; import forge.game.phase.PhaseType; import forge.game.player.ComputerUtil; import forge.game.player.Player; @@ -56,7 +57,6 @@ import forge.gui.GuiChoose; import forge.gui.framework.EDocID; import forge.gui.framework.SDisplayUtil; import forge.gui.match.CMatchUI; -import forge.sound.SoundUtils; import forge.util.MyObservable; import forge.view.ButtonUtil; @@ -910,9 +910,12 @@ public class MagicStack extends MyObservable { game.getGameLog().add("ResolveStack", sa.getStackDescription(), 2); sa.resolve(); this.finishResolving(sa, false); + // do creatures ETB from here? } sa.getSourceCard().setXManaCostPaid(0); + game.getEvents().post(new SpellResolvedEvent(source, sa)); + if (source.hasStartOfKeyword("Haunt") && !source.isCreature() && game.getZoneOf(source).is(ZoneType.Graveyard)) { final List creats = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), Presets.CREATURES); @@ -971,9 +974,6 @@ public class MagicStack extends MyObservable { } } } - - // Play the sound depending on what ability resolved. - SoundUtils.playCardSoundEffect(source, sa); } /** diff --git a/src/main/java/forge/gui/home/quest/VSubmenuQuestData.java b/src/main/java/forge/gui/home/quest/VSubmenuQuestData.java index 78d02ddd5ff..a4c5ffafa77 100644 --- a/src/main/java/forge/gui/home/quest/VSubmenuQuestData.java +++ b/src/main/java/forge/gui/home/quest/VSubmenuQuestData.java @@ -71,20 +71,20 @@ public enum VSubmenuQuestData implements IVSubmenu { private final FScrollPane scrQuests = new FScrollPane(lstQuests); private final JPanel pnlOptions = new JPanel(); - /* Fist column */ + /* Fist column */ private final JRadioButton radEasy = new FRadioButton("Easy"); private final JRadioButton radMedium = new FRadioButton("Medium"); private final JRadioButton radHard = new FRadioButton("Hard"); private final JRadioButton radExpert = new FRadioButton("Expert"); private final JCheckBox boxFantasy = new FCheckBox("Fantasy Mode"); - + /* Second column */ - + private final JLabel lblStartingPool = new FLabel.Builder().text("Starting pool:").build(); private final JComboBox cbxStartingPool = new JComboBox(); private final JLabel lblUnrestricted = new FLabel.Builder().text("All cards will be available to play.").build(); - + private final JLabel lblPreconDeck = new FLabel.Builder().text("Starter/Event deck:").build(); private final JComboBox cbxPreconDeck = new JComboBox(); @@ -93,70 +93,70 @@ public enum VSubmenuQuestData implements IVSubmenu { private final JLabel lblCustomDeck = new FLabel.Builder().text("Custom deck:").build(); private final JComboBox cbxCustomDeck = new JComboBox(); - + private final FLabel btnDefineCustomFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Define custom format").build(); private final FLabel btnPrizeDefineCustomFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Define custom format").build(); - + private final JLabel lblPrizedCards = new FLabel.Builder().text("Prized cards:").build(); private final JComboBox cbxPrizedCards = new JComboBox(); - + private final JLabel lblPrizeFormat = new FLabel.Builder().text("Sanctioned format:").build(); private final JComboBox cbxPrizeFormat = new JComboBox(); - + private final JLabel lblPrizeUnrestricted = new FLabel.Builder().text("All cards will be available to win.").build(); private final JLabel lblPrizeSameAsStarting = new FLabel.Builder().text("Only sets found in starting pool will be available.").build(); - - private final JCheckBox cboAllowUnlocks = new FCheckBox("Allow unlock of not included editions"); - + + private final JCheckBox cboAllowUnlocks = new FCheckBox("Allow unlock of additional editions"); + private final FLabel btnEmbark = new FLabel.Builder().opaque(true) .fontSize(16).hoverable(true).text("Embark!").build(); - /* Listeners */ + /* Listeners */ private final ActionListener alStartingPool = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { StartingPoolType newVal = getStartingPoolType(); lblUnrestricted.setVisible(newVal == StartingPoolType.Complete); - + lblPreconDeck.setVisible(newVal == StartingPoolType.Precon); cbxPreconDeck.setVisible(newVal == StartingPoolType.Precon); lblFormat.setVisible(newVal == StartingPoolType.Rotating); cbxFormat.setVisible(newVal == StartingPoolType.Rotating); - + btnDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat); - + lblCustomDeck.setVisible(newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck); cbxCustomDeck.setVisible(newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck); - + if (newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck) { cbxCustomDeck.removeAllItems(); CardCollections decks = Singletons.getModel().getDecks(); - IStorage storage = newVal == StartingPoolType.SealedDeck ? decks.getSealed() : decks.getDraft(); - if( newVal == StartingPoolType.SealedDeck ) { - for(DeckGroup d : storage ) { + IStorage storage = newVal == StartingPoolType.SealedDeck ? decks.getSealed() : decks.getDraft(); + if (newVal == StartingPoolType.SealedDeck) { + for (DeckGroup d : storage) { cbxCustomDeck.addItem(d.getHumanDeck()); } } } } - }; - - /* Listeners */ + }; + + /* Listeners */ private final ActionListener alPrizesPool = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { StartingPoolType newVal = getPrizedPoolType(); lblPrizeUnrestricted.setVisible(newVal == StartingPoolType.Complete); cboAllowUnlocks.setVisible(newVal != StartingPoolType.Complete); - + lblPrizeFormat.setVisible(newVal == StartingPoolType.Rotating); cbxPrizeFormat.setVisible(newVal == StartingPoolType.Rotating); btnPrizeDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat); lblPrizeSameAsStarting.setVisible(newVal == null); } - }; - + }; + /** * Constructor. */ @@ -173,7 +173,6 @@ public enum VSubmenuQuestData implements IVSubmenu { group1.add(radExpert); radEasy.setSelected(true); - cbxStartingPool.addItem(StartingPoolType.Complete); cbxStartingPool.addItem(StartingPoolType.Rotating); cbxStartingPool.addItem(StartingPoolType.CustomFormat); @@ -181,22 +180,22 @@ public enum VSubmenuQuestData implements IVSubmenu { cbxStartingPool.addItem(StartingPoolType.DraftDeck); cbxStartingPool.addItem(StartingPoolType.SealedDeck); cbxStartingPool.addActionListener(alStartingPool); - + // initial adjustment alStartingPool.actionPerformed(null); alPrizesPool.actionPerformed(null); - + cbxPrizedCards.addItem("Same as starting pool"); cbxPrizedCards.addItem(StartingPoolType.Complete); cbxPrizedCards.addItem(StartingPoolType.Rotating); cbxPrizedCards.addItem(StartingPoolType.CustomFormat); cbxPrizedCards.addActionListener(alPrizesPool); - + for (GameFormat gf : Singletons.getModel().getFormats()) { cbxFormat.addItem(gf); cbxPrizeFormat.addItem(gf); } - + cboAllowUnlocks.setSelected(true); final Map preconDescriptions = new HashMap(); @@ -235,7 +234,7 @@ public enum VSubmenuQuestData implements IVSubmenu { pnlOptions.setOpaque(false); pnlOptions.setLayout(new MigLayout("insets 0, gap 10px, fillx, wrap 2")); - + JPanel pnlDifficultyMode = new JPanel(); pnlDifficultyMode.setLayout(new MigLayout("insets 0, gap 1%, flowy")); final String n_constraints = "h 27px!"; @@ -246,7 +245,6 @@ public enum VSubmenuQuestData implements IVSubmenu { pnlDifficultyMode.add(boxFantasy, n_constraints + ", gap 0 4% 0 5px"); pnlDifficultyMode.setOpaque(false); pnlOptions.add(pnlDifficultyMode, "w 40%"); - JPanel pnlRestrictions = new JPanel(); final String constraints = "h 27px!, "; @@ -259,10 +257,10 @@ public enum VSubmenuQuestData implements IVSubmenu { pnlRestrictions.setLayout(new MigLayout("insets 0, gap 0, wrap 2", "[120, al right][240, fill]", "[|]12[|]6[]")); pnlRestrictions.add(lblStartingPool, constraints + lblWidthStart); pnlRestrictions.add(cbxStartingPool, constraints + cboWidthStart); - + /* out of these 3 groups only one will be visible */ - pnlRestrictions.add(lblUnrestricted, constraints + hidemode + "spanx 2" ); - + pnlRestrictions.add(lblUnrestricted, constraints + hidemode + "spanx 2"); + pnlRestrictions.add(lblPreconDeck, constraints + lblWidthStart); pnlRestrictions.add(cbxPreconDeck, constraints + cboWidthStart); @@ -273,23 +271,22 @@ public enum VSubmenuQuestData implements IVSubmenu { pnlRestrictions.add(cbxFormat, constraints + cboWidthStart); // , skip 1 pnlRestrictions.add(btnDefineCustomFormat, constraints + hidemode + "spanx 2, w 240px"); - + // Prized cards options pnlRestrictions.add(lblPrizedCards, constraints + lblWidth); pnlRestrictions.add(cbxPrizedCards, constraints + cboWidth); - - + pnlRestrictions.add(lblPrizeFormat, constraints + lblWidthStart); pnlRestrictions.add(cbxPrizeFormat, constraints + cboWidthStart); // , skip 1 pnlRestrictions.add(btnPrizeDefineCustomFormat, constraints + hidemode + "spanx 2, w 240px"); - pnlRestrictions.add(lblPrizeSameAsStarting, constraints + hidemode + "spanx 2" ); - pnlRestrictions.add(lblPrizeUnrestricted, constraints + hidemode + "spanx 2" ); - + pnlRestrictions.add(lblPrizeSameAsStarting, constraints + hidemode + "spanx 2"); + pnlRestrictions.add(lblPrizeUnrestricted, constraints + hidemode + "spanx 2"); + pnlRestrictions.add(cboAllowUnlocks, constraints + "spanx 2, ax right"); // cboAllowUnlocks.setOpaque(false); pnlRestrictions.setOpaque(false); pnlOptions.add(pnlRestrictions, "pushx, ay top"); - + pnlOptions.add(btnEmbark, "w 300px!, h 30px!, ax center, span 2, gap 0 0 15px 30px"); } @@ -349,8 +346,6 @@ public enum VSubmenuQuestData implements IVSubmenu { return btnEmbark; } - - //========== Overridden from IVDoc /* (non-Javadoc) @@ -403,7 +398,7 @@ public enum VSubmenuQuestData implements IVSubmenu { return 2; } else if (radExpert.isSelected()) { return 3; - } + } return 0; } @@ -413,7 +408,7 @@ public enum VSubmenuQuestData implements IVSubmenu { public Deck getSelectedDeck() { Object sel = cbxCustomDeck.getSelectedItem(); - return sel instanceof Deck ? (Deck) sel : null; + return sel instanceof Deck ? (Deck) sel : null; } public boolean isUnlockSetsAllowed() { @@ -423,12 +418,12 @@ public enum VSubmenuQuestData implements IVSubmenu { public StartingPoolType getStartingPoolType() { return (StartingPoolType) cbxStartingPool.getSelectedItem(); } - + public StartingPoolType getPrizedPoolType() { Object v = cbxPrizedCards.getSelectedItem(); return v instanceof StartingPoolType ? (StartingPoolType) v : null; - } + } public boolean isFantasy() { return boxFantasy.isSelected(); @@ -440,13 +435,13 @@ public enum VSubmenuQuestData implements IVSubmenu { public GameFormat getPrizedRotatingFormat() { return (GameFormat) cbxPrizeFormat.getSelectedItem(); - } - + } + public FLabel getBtnCustomFormat() { return btnDefineCustomFormat; } public FLabel getBtnPrizeCustomFormat() { return btnPrizeDefineCustomFormat; } - + } diff --git a/src/main/java/forge/gui/match/VAssignDamage.java b/src/main/java/forge/gui/match/VAssignDamage.java index 78651b47550..2ba72621a5a 100644 --- a/src/main/java/forge/gui/match/VAssignDamage.java +++ b/src/main/java/forge/gui/match/VAssignDamage.java @@ -151,7 +151,8 @@ public class VAssignDamage { boolean meta = evt.isControlDown(); int alreadyAssignDamage = lstDamage.get(index); - int lethal = VAssignDamage.this.deathtouch ? 1 : source.getLethalDamage(); + // If lethal damage has already been assigned just act like it's 0. + int lethal = VAssignDamage.this.deathtouch ? 1 : Math.max(0, source.getLethalDamage()); int assignedDamage = 1; // Add damage for left clicks, as much as we can for ctrl clicking @@ -365,7 +366,7 @@ public class VAssignDamage { private void initialAssignDamage() { // Assign "1" damage to first combatant (it will really assign lethal damage) - int lethalDamage = this.deathtouch ? 1 : lstDefenders.get(0).getLethalDamage(); + int lethalDamage = this.deathtouch ? 1 : Math.max(0, lstDefenders.get(0).getLethalDamage()); int damage = Math.min(lethalDamage, this.damageLeftToAssign); assignCombatantDamage(0, damage); } @@ -389,7 +390,7 @@ public class VAssignDamage { // The first defender should aleady have lethal damage assigned int size = lstDefenders.size(); for (int i = 1; i < size; i++) { - int lethalDamage = this.deathtouch ? 1 : lstDefenders.get(i).getLethalDamage(); + int lethalDamage = this.deathtouch ? 1 : Math.max(0, lstDefenders.get(i).getLethalDamage()); int damage = Math.min(lethalDamage, this.damageLeftToAssign); if (damage == 0) { break; diff --git a/src/main/java/forge/sound/AudioClip.java b/src/main/java/forge/sound/AudioClip.java new file mode 100644 index 00000000000..f2d63cdf824 --- /dev/null +++ b/src/main/java/forge/sound/AudioClip.java @@ -0,0 +1,103 @@ +/* + * Forge: Play Magic: the Gathering. + * Copyright (C) 2012 Forge Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package forge.sound; + + +import java.io.File; +import java.io.IOException; +import java.util.MissingResourceException; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Clip; +import javax.sound.sampled.DataLine; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.UnsupportedAudioFileException; + + + +/** + * SoundSystem - a simple sound playback system for Forge. + * Do not use directly. Instead, use the {@link forge.sound.SoundEffectType} enumeration. + * + * @author Agetian + */ +public class AudioClip implements IAudioClip{ + private final Clip clip; + private final int SOUND_SYSTEM_DELAY = 30; + + private final static String PathToSound = "res/sound"; + + public static boolean fileExists(String fileName) { + File fSound = new File(PathToSound, fileName); + return fSound.exists(); + } + + public AudioClip(final String filename) { + File fSound = new File(PathToSound, filename); + if ( fSound.exists() ) + throw new IllegalArgumentException("Sound file " + fSound.toString() + " does not exist, cannot make a clip of it"); + + try { + AudioInputStream stream = AudioSystem.getAudioInputStream(fSound); + AudioFormat format = stream.getFormat(); + DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(), ((int) stream.getFrameLength() * format.getFrameSize())); + clip = (Clip) AudioSystem.getLine(info); + clip.open(stream); + return; + + } catch (IOException ex) { + System.err.println("Unable to load sound file: " + filename); + } catch (LineUnavailableException ex) { + System.err.println("Error initializing sound system: " + ex); + } catch (UnsupportedAudioFileException ex) { + System.err.println("Unsupported file type of the sound file: " + ex); + } + throw new MissingResourceException("Sound clip failed to load", this.getClass().getName(), filename); + } + + public final void play() { + clip.setMicrosecondPosition(0); + try { + Thread.sleep(SOUND_SYSTEM_DELAY); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + clip.start(); + } + + public final void loop() { + clip.setMicrosecondPosition(0); + try { + Thread.sleep(SOUND_SYSTEM_DELAY); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + clip.loop(Clip.LOOP_CONTINUOUSLY); + } + + public final void stop() { + clip.stop(); + } + + public final boolean isDone() { + return !clip.isRunning(); + } +} diff --git a/src/main/java/forge/sound/EventVisualilzer.java b/src/main/java/forge/sound/EventVisualilzer.java new file mode 100644 index 00000000000..551740378c7 --- /dev/null +++ b/src/main/java/forge/sound/EventVisualilzer.java @@ -0,0 +1,142 @@ +package forge.sound; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +import forge.Card; +import forge.card.spellability.SpellAbility; +import forge.game.event.Event; +import forge.game.event.LandPlayedEvent; +import forge.game.event.PoisonCounterEvent; +import forge.game.event.SpellResolvedEvent; + +/** + * This class is in charge of converting any forge.game.event.Event to a SoundEffectType + * + */ +public class EventVisualilzer { + + final static Map, SoundEffectType> matchTable = new HashMap, SoundEffectType>(); + + public EventVisualilzer() { + matchTable.put(PoisonCounterEvent.class, SoundEffectType.Poison); + } + + + public final SoundEffectType getSoundForEvent(Event evt) { + SoundEffectType fromMap = matchTable.get(evt); + + // call methods copied from Utils here + if( evt instanceof SpellResolvedEvent ) { + return getSoundEffectForResolve(((SpellResolvedEvent) evt).Source, ((SpellResolvedEvent) evt).Spell); + } + if ( evt instanceof LandPlayedEvent ) + return getSoundEffectForLand(((LandPlayedEvent) evt).Land); + + return fromMap; + } + + /** + * Plays the sound corresponding to the card type/color when the card + * ability resolves on the stack. + * + * @param source the card to play the sound for. + * @param sa the spell ability that was resolving. + */ + public SoundEffectType getSoundEffectForResolve(final Card source, final SpellAbility sa) { + if (sa == null || source == null) { + return null; + } + + if (sa.isSpell()) { + // if there's a specific effect for this particular card, play it and + // we're done. + SoundEffectType specialEffect = getSpecificCardEffect(source); + if( specialEffect != null ) return specialEffect; + + if (source.isCreature() && source.isArtifact()) { + return SoundEffectType.ArtifactCreature; + } else if (source.isCreature()) { + return SoundEffectType.Creature; + } else if (source.isArtifact()) { + return SoundEffectType.Artifact; + } else if (source.isInstant()) { + return SoundEffectType.Instant; + } else if (source.isPlaneswalker()) { + return SoundEffectType.Planeswalker; + } else if (source.isSorcery()) { + return SoundEffectType.Sorcery; + } else if (source.isEnchantment()) { + return SoundEffectType.Enchantment; + } + } + return null; + } + + /** + * Plays the sound corresponding to the land type when the land is played. + * + * @param land the land card that was played + */ + public static SoundEffectType getSoundEffectForLand(final Card land) { + if (land == null) { + return null; + } + + // if there's a specific effect for this particular card, play it and + // we're done. + SoundEffectType specialEffect = getSpecificCardEffect(land); + if( specialEffect != null ) return specialEffect; + + + final List manaProduced = land.getManaAbility(); + + for (SpellAbility sa : manaProduced) { + String manaColors = sa.getManaPart().getManaProduced(); + + if (manaColors.contains("B")) { + return SoundEffectType.BlackLand; + } + if (manaColors.contains("U")) { + return SoundEffectType.BlueLand; + } + if (manaColors.contains("G")) { + return SoundEffectType.GreenLand; + } + if (manaColors.contains("R")) { + return SoundEffectType.RedLand; + } + if (manaColors.contains("W")) { + return SoundEffectType.WhiteLand; + } + } + + // play a generic land sound if no other sound corresponded to it. + return SoundEffectType.OtherLand; + } + + /** + * Play a specific sound effect based on card's name. + * + * @param c the card to play the sound effect for. + * @return true if the special effect was found and played, otherwise + * false (in which case the type-based FX will be played, if + * applicable). + */ + private static SoundEffectType getSpecificCardEffect(final Card c) { + // Implement sound effects for specific cards here, if necessary. + return null; + } + + + /** + * TODO: Choose is the special type of event produces a single or lot of overlapping sounds (?) + */ + public boolean isSyncSound(Event evt) { + + return true; + } + +} diff --git a/src/main/java/forge/sound/IAudioClip.java b/src/main/java/forge/sound/IAudioClip.java new file mode 100644 index 00000000000..b8343358ce7 --- /dev/null +++ b/src/main/java/forge/sound/IAudioClip.java @@ -0,0 +1,8 @@ +package forge.sound; + +public interface IAudioClip { + public void play(); + public boolean isDone(); + public void stop(); + public void loop(); +} \ No newline at end of file diff --git a/src/main/java/forge/sound/NoSoundClip.java b/src/main/java/forge/sound/NoSoundClip.java new file mode 100644 index 00000000000..0db6985d48d --- /dev/null +++ b/src/main/java/forge/sound/NoSoundClip.java @@ -0,0 +1,18 @@ +package forge.sound; + +// This class is used as a stub for case when sound is off or a needed sound file is missing +public class NoSoundClip implements IAudioClip { + + @Override + public void play() {} + @Override + public boolean isDone() { return false; } + + + @Override + public void stop() {} + + @Override + public void loop() {} + +} \ No newline at end of file diff --git a/src/main/java/forge/sound/SoundEffectType.java b/src/main/java/forge/sound/SoundEffectType.java new file mode 100644 index 00000000000..b0d81bda865 --- /dev/null +++ b/src/main/java/forge/sound/SoundEffectType.java @@ -0,0 +1,84 @@ +/* + * Forge: Play Magic: the Gathering. + * Copyright (C) 2012 Forge Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package forge.sound; + +/** + * Sounds (enumeration) - all sounds in the game must be declared here. Once + * declared, the sound can be played from anywhere in the code using + * Sounds.soundName.play(). The sounds are only preloaded once, so there is no + * memory overhead for playing the sound multiple times. + * + * Currently, if the file does not exist, it is not a fatal error. No sound is + * played in that case, a simple message is generated on the debug console + * during preloading. + * + * @author Agetian + */ +public enum SoundEffectType { + // Sounds must be listed in alphabetic order. + + AddCounter("add_counter.wav"), + Artifact("artifact.wav"), + ArtifactCreature("artifact_creature.wav"), + BlackLand("black_land.wav"), + BlueLand("blue_land.wav"), + Creature("creature.wav"), + Damage("damage.wav"), + Destroy("destroy.wav"), + Discard("discard.wav"), + Draw("draw.wav"), + Enchantment("enchant.wav"), + EndOfTurn("end_of_turn.wav"), + Equip("equip.wav"), + FlipCoin("flip_coin.wav"), + GreenLand("green_land.wav"), + Instant("instant.wav"), + LifeLoss("life_loss.wav"), + LoseDuel("lose_duel.wav"), + ManaBurn("mana_burn.wav"), + OtherLand("other_land.wav"), + Planeswalker("planeswalker.wav"), + Poison("poison.wav"), + RedLand("red_land.wav"), + Regen("regeneration.wav"), + RemoveCounter("remove_counter.wav"), + Sacrifice("sacrifice.wav"), + Sorcery("sorcery.wav"), + Shuffle("shuffle.wav"), + Tap("tap.wav"), + Untap("untap.wav"), + WhiteLand("white_land.wav"), + WinDuel("win_duel.wav"); + + + private final String resourceFileName; + /** + * @return the resourceFileName + */ + public String getResourceFileName() { + return resourceFileName; + } + /** + * @param filename + * name of the sound file associated with the entry. + */ + SoundEffectType(final String filename) { + resourceFileName = filename; + } +} diff --git a/src/main/java/forge/sound/SoundSystem.java b/src/main/java/forge/sound/SoundSystem.java index 31e0510dbe7..3b4b478e387 100644 --- a/src/main/java/forge/sound/SoundSystem.java +++ b/src/main/java/forge/sound/SoundSystem.java @@ -1,89 +1,82 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2012 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package forge.sound; -import java.io.*; -import javax.sound.sampled.*; +import java.util.EnumMap; +import java.util.Map; -/** - * SoundSystem - a simple sound playback system for Forge. - * Do not use directly. Instead, use the {@link forge.sound.Sounds} enumeration. - * - * @author Agetian +import com.google.common.eventbus.Subscribe; + +import forge.Singletons; +import forge.game.event.Event; +import forge.properties.ForgePreferences.FPref; + +/** + * Manages playback of all sounds for the client. + * */ public class SoundSystem { - private Clip clip; - private final int SOUND_SYSTEM_DELAY = 30; - public SoundSystem(final String filename) { - try { - AudioInputStream stream = AudioSystem.getAudioInputStream(new File(filename)); - AudioFormat format = stream.getFormat(); - DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(), ((int) stream.getFrameLength() * format.getFrameSize())); - clip = (Clip) AudioSystem.getLine(info); + private final static IAudioClip emptySound = new NoSoundClip(); + private final static Map loadedClips = new EnumMap(SoundEffectType.class); + + private final EventVisualilzer visualizer = new EventVisualilzer(); + + protected IAudioClip fetchResource(SoundEffectType type) { - clip.open(stream); + if (!Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ENABLE_SOUNDS)) + return emptySound; - } catch (IOException ex) { - System.err.println("Unable to load sound file: " + filename); - } catch (LineUnavailableException ex) { - System.err.println("Error initializing sound system: " + ex); - } catch (UnsupportedAudioFileException ex) { - System.err.println("Unsupported file type of the sound file: " + ex); + IAudioClip clip = loadedClips.get(type); + if ( null == clip ) { // cache miss + String resource = type.getResourceFileName(); + clip = AudioClip.fileExists(resource) ? new AudioClip(resource) : emptySound; + loadedClips.put(type, clip); + } + return null; + } + + + /** + * Play the sound associated with the Sounds enumeration element. + */ + public void play(SoundEffectType type) { + fetchResource(type).play(); + } + + /** + * Play the sound associated with the Sounds enumeration element + * (synchronized with other sounds of the same kind, so only one can play + * at the same time). + */ + public void playSync(SoundEffectType type) { + IAudioClip snd = fetchResource(type); + if (snd.isDone()) { + snd.play(); } } - public final void play() { - if (clip != null) { - clip.setMicrosecondPosition(0); - try { - Thread.sleep(SOUND_SYSTEM_DELAY); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - clip.start(); - } + /** + * Play the sound in a looping manner until 'stop' is called. + */ + public void loop(SoundEffectType type) { + fetchResource(type).loop(); } - public final void loop() { - if (clip != null) { - clip.setMicrosecondPosition(0); - try { - Thread.sleep(SOUND_SYSTEM_DELAY); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - clip.loop(Clip.LOOP_CONTINUOUSLY); - } + /** + * Stop the sound associated with the Sounds enumeration element. + */ + public void stop(SoundEffectType type) { + fetchResource(type).stop(); + } + + @Subscribe + public void recieveEvent(Event evt) { + SoundEffectType effect = visualizer.getSoundForEvent(evt); + if ( null == effect ) return; + boolean isSync = visualizer.isSyncSound(evt); + if ( isSync ) + playSync(effect); + else + play(effect); } - public final void stop() { - if (clip != null) { - clip.stop(); - } - } - - public final boolean isDone() { - if (clip != null) { - return !clip.isRunning(); - } else { - return false; - } - } } diff --git a/src/main/java/forge/sound/SoundUtils.java b/src/main/java/forge/sound/SoundUtils.java deleted file mode 100644 index 0ecdba06566..00000000000 --- a/src/main/java/forge/sound/SoundUtils.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2012 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package forge.sound; - -import forge.Card; -import forge.card.spellability.SpellAbility; - -import java.util.List; - -/** - * SoundUtils - static methods for sound playback involving more than a simple - * call to Sounds.soundName.play. - * - * @author Agetian - */ -public final class SoundUtils { - - /** - * This is a utility class, it does not have a public ctor. - * - */ - private SoundUtils() { - } - - /** - * Plays the sound corresponding to the card type/color when the card - * ability resolves on the stack. - * - * @param source the card to play the sound for. - * @param sa the spell ability that was resolving. - */ - public static void playCardSoundEffect(final Card source, final SpellAbility sa) { - if (sa == null || source == null) { - return; - } - - if (sa.isSpell()) { - // if there's a specific effect for this particular card, play it and - // we're done. - if (playSpecificCardEffect(source)) { - return; - } - - if (source.isCreature() && source.isArtifact()) { - Sounds.ArtifactCreature.play(); - } else if (source.isCreature()) { - Sounds.Creature.play(); - } else if (source.isArtifact()) { - Sounds.Artifact.play(); - } else if (source.isInstant()) { - Sounds.Instant.play(); - } else if (source.isPlaneswalker()) { - Sounds.Planeswalker.play(); - } else if (source.isSorcery()) { - Sounds.Sorcery.play(); - } else if (source.isEnchantment()) { - Sounds.Enchantment.play(); - } - } - } - - /** - * Plays the sound corresponding to the land type when the land is played. - * - * @param land the land card that was played - */ - public static void playLandSoundEffect(final Card land) { - if (land == null) { - return; - } - - // if there's a specific effect for this particular card, play it and - // we're done. - if (playSpecificCardEffect(land)) { - return; - } - - final List manaProduced = land.getManaAbility(); - boolean effectPlayed = false; - - for (SpellAbility sa : manaProduced) { - String manaColors = sa.getManaPart().getManaProduced(); - - if (manaColors.contains("B")) { - Sounds.BlackLand.play(); - effectPlayed = true; - } - if (manaColors.contains("U")) { - Sounds.BlueLand.play(); - effectPlayed = true; - } - if (manaColors.contains("G")) { - Sounds.GreenLand.play(); - effectPlayed = true; - } - if (manaColors.contains("R")) { - Sounds.RedLand.play(); - effectPlayed = true; - } - if (manaColors.contains("W")) { - Sounds.WhiteLand.play(); - effectPlayed = true; - } - } - - // play a generic land sound if no other sound corresponded to it. - if (!effectPlayed) { - Sounds.OtherLand.play(); - } - } - - /** - * Play a specific sound effect based on card's name. - * - * @param c the card to play the sound effect for. - * @return true if the special effect was found and played, otherwise - * false (in which case the type-based FX will be played, if - * applicable). - */ - private static boolean playSpecificCardEffect(final Card c) { - // Implement sound effects for specific cards here, if necessary. - return false; - } -} diff --git a/src/main/java/forge/sound/Sounds.java b/src/main/java/forge/sound/Sounds.java deleted file mode 100644 index 238b8b42d8c..00000000000 --- a/src/main/java/forge/sound/Sounds.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Forge: Play Magic: the Gathering. - * Copyright (C) 2012 Forge Team - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package forge.sound; - -import forge.Singletons; -import forge.properties.ForgePreferences.FPref; - -/** - * Sounds (enumeration) - all sounds in the game must be declared here. Once - * declared, the sound can be played from anywhere in the code using - * Sounds.soundName.play(). The sounds are only preloaded once, so there is no - * memory overhead for playing the sound multiple times. - * - * Currently, if the file does not exist, it is not a fatal error. No sound is - * played in that case, a simple message is generated on the debug console - * during preloading. - * - * @author Agetian - */ -public enum Sounds { - // Sounds must be listed in alphabetic order. - - AddCounter("res/sound/add_counter.wav"), - Artifact("res/sound/artifact.wav"), - ArtifactCreature("res/sound/artifact_creature.wav"), - BlackLand("res/sound/black_land.wav"), - BlueLand("res/sound/blue_land.wav"), - Creature("res/sound/creature.wav"), - Damage("res/sound/damage.wav"), - Destroy("res/sound/destroy.wav"), - Discard("res/sound/discard.wav"), - Draw("res/sound/draw.wav"), - Enchantment("res/sound/enchant.wav"), - EndOfTurn("res/sound/end_of_turn.wav"), - Equip("res/sound/equip.wav"), - FlipCoin("res/sound/flip_coin.wav"), - GreenLand("res/sound/green_land.wav"), - Instant("res/sound/instant.wav"), - LifeLoss("res/sound/life_loss.wav"), - LoseDuel("res/sound/lose_duel.wav"), - ManaBurn("res/sound/mana_burn.wav"), - OtherLand("res/sound/other_land.wav"), - Planeswalker("res/sound/planeswalker.wav"), - Poison("res/sound/poison.wav"), - RedLand("res/sound/red_land.wav"), - Regen("res/sound/regeneration.wav"), - RemoveCounter("res/sound/remove_counter.wav"), - Sacrifice("res/sound/sacrifice.wav"), - Sorcery("res/sound/sorcery.wav"), - Shuffle("res/sound/shuffle.wav"), - Tap("res/sound/tap.wav"), - Untap("res/sound/untap.wav"), - WhiteLand("res/sound/white_land.wav"), - WinDuel("res/sound/win_duel.wav"); - - private SoundSystem snd = null; - - /** - * @param filename - * name of the sound file associated with the entry. - */ - Sounds(final String filename) { - snd = new SoundSystem(filename); - } - - /** - * Play the sound associated with the Sounds enumeration element. - */ - public void play() { - if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ENABLE_SOUNDS)) { - snd.play(); - } - } - - /** - * Play the sound associated with the Sounds enumeration element - * (synchronized with other sounds of the same kind, so only one can play - * at the same time). - */ - public void playSync() { - if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ENABLE_SOUNDS)) { - if (snd.isDone()) { - snd.play(); - } - } - } - - /** - * Play the sound in a looping manner until 'stop' is called. - */ - public void loop() { - if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ENABLE_SOUNDS)) { - snd.loop(); - } - } - - /** - * Stop the sound associated with the Sounds enumeration element. - */ - public void stop() { - if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_ENABLE_SOUNDS)) { - snd.stop(); - } - } -} diff --git a/src/main/java/forge/view/arcane/PlayArea.java b/src/main/java/forge/view/arcane/PlayArea.java index 03fb3187000..2ecb41db72b 100644 --- a/src/main/java/forge/view/arcane/PlayArea.java +++ b/src/main/java/forge/view/arcane/PlayArea.java @@ -27,6 +27,7 @@ import java.util.Iterator; import java.util.List; import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; import forge.Card; import forge.view.arcane.util.CardPanelMouseListener; @@ -244,8 +245,12 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen } this.setPreferredSize(new Dimension(maxRowWidth - this.cardSpacingX, y - this.cardSpacingY)); this.revalidate(); - - positionAllCards(); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + positionAllCards(); + } + }); } private void positionAllCards() From 3c095c917a33dd22222756753afd07ea160b44f9 Mon Sep 17 00:00:00 2001 From: moomarc Date: Fri, 23 Nov 2012 06:40:01 +0000 Subject: [PATCH 18/36] *Variants - Added the following avatars: Sidar Kondo, Sisay, Squee, Urza, and Sliver Queen, Brood Mother --- .gitattributes | 5 +++++ res/cardsfolder/s/sidar_kondo.txt | 9 +++++++++ res/cardsfolder/s/sisay.txt | 10 ++++++++++ res/cardsfolder/s/sliver_queen_brood_mother.txt | 9 +++++++++ res/cardsfolder/s/squee.txt | 10 ++++++++++ res/cardsfolder/u/urza.txt | 9 +++++++++ 6 files changed, 52 insertions(+) create mode 100644 res/cardsfolder/s/sidar_kondo.txt create mode 100644 res/cardsfolder/s/sisay.txt create mode 100644 res/cardsfolder/s/sliver_queen_brood_mother.txt create mode 100644 res/cardsfolder/s/squee.txt create mode 100644 res/cardsfolder/u/urza.txt diff --git a/.gitattributes b/.gitattributes index d99677e9215..c8f81542cab 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8856,6 +8856,7 @@ res/cardsfolder/s/sickening_shoal.txt svneol=native#text/plain res/cardsfolder/s/sickle_ripper.txt svneol=native#text/plain res/cardsfolder/s/sickleslicer.txt svneol=native#text/plain res/cardsfolder/s/sidar_jabari.txt svneol=native#text/plain +res/cardsfolder/s/sidar_kondo.txt -text res/cardsfolder/s/sidewinder_sliver.txt svneol=native#text/plain res/cardsfolder/s/siege_gang_commander.txt svneol=native#text/plain res/cardsfolder/s/siege_mastodon.txt svneol=native#text/plain @@ -8940,6 +8941,7 @@ res/cardsfolder/s/sinstrikers_will.txt -text res/cardsfolder/s/sir_shandlar_of_eberyn.txt svneol=native#text/plain res/cardsfolder/s/sire_of_the_storm.txt svneol=native#text/plain res/cardsfolder/s/sirens_call.txt svneol=native#text/plain +res/cardsfolder/s/sisay.txt -text res/cardsfolder/s/sisays_ingenuity.txt -text svneol=unset#text/plain res/cardsfolder/s/sisays_ring.txt svneol=native#text/plain res/cardsfolder/s/sisters_of_stone_death.txt -text svneol=unset#text/plain @@ -9105,6 +9107,7 @@ res/cardsfolder/s/slithery_stalker.txt svneol=native#text/plain res/cardsfolder/s/sliver_legion.txt svneol=native#text/plain res/cardsfolder/s/sliver_overlord.txt svneol=native#text/plain res/cardsfolder/s/sliver_queen.txt svneol=native#text/plain +res/cardsfolder/s/sliver_queen_brood_mother.txt -text res/cardsfolder/s/sliversmith.txt svneol=native#text/plain res/cardsfolder/s/slobad_goblin_tinkerer.txt svneol=native#text/plain res/cardsfolder/s/slow_motion.txt svneol=native#text/plain @@ -9495,6 +9498,7 @@ res/cardsfolder/s/squandered_resources.txt svneol=native#text/plain res/cardsfolder/s/squeaking_pie_grubfellows.txt svneol=native#text/plain res/cardsfolder/s/squeaking_pie_sneak.txt -text res/cardsfolder/s/squealing_devil.txt -text +res/cardsfolder/s/squee.txt -text res/cardsfolder/s/squee_goblin_nabob.txt svneol=native#text/plain res/cardsfolder/s/squees_embrace.txt svneol=native#text/plain res/cardsfolder/s/squees_toy.txt svneol=native#text/plain @@ -10700,6 +10704,7 @@ res/cardsfolder/u/urgent_exorcism.txt -text res/cardsfolder/u/uril_the_miststalker.txt svneol=native#text/plain res/cardsfolder/u/ursapine.txt svneol=native#text/plain res/cardsfolder/u/ursine_fylgja.txt svneol=native#text/plain +res/cardsfolder/u/urza.txt -text res/cardsfolder/u/urzas_armor.txt svneol=native#text/plain res/cardsfolder/u/urzas_bauble.txt -text res/cardsfolder/u/urzas_blueprints.txt svneol=native#text/plain diff --git a/res/cardsfolder/s/sidar_kondo.txt b/res/cardsfolder/s/sidar_kondo.txt new file mode 100644 index 00000000000..f32d72756b4 --- /dev/null +++ b/res/cardsfolder/s/sidar_kondo.txt @@ -0,0 +1,9 @@ +Name:Sidar Kondo +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+12 +A:AB$ Pump | ActivationZone$ Command | Cost$ 3 | Tgt$ TgtC | NumAtt$ 3 | NumDef$ 3 | SpellDescription$ Target creature gets +3/+3 until end of turn. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12147&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/s/sisay.txt b/res/cardsfolder/s/sisay.txt new file mode 100644 index 00000000000..bec7d17fe4e --- /dev/null +++ b/res/cardsfolder/s/sisay.txt @@ -0,0 +1,10 @@ +Name:Sisay +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-2/-3 +T:Mode$ TapsForMana | TriggerZones$ Command | ValidCard$ Land.YouCtrl | Execute$ TrigMana | TriggerZones$ Battlefield | Static$ True | TriggerDescription$ Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. +SVar:TrigMana:AB$ ManaReflected | Cost$ 0 | ColorOrType$ Type | Valid$ Defined.Triggered | ReflectProperty$ Produced | Defined$ TriggeredPlayer +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4968&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/s/sliver_queen_brood_mother.txt b/res/cardsfolder/s/sliver_queen_brood_mother.txt new file mode 100644 index 00000000000..a8371fdc7be --- /dev/null +++ b/res/cardsfolder/s/sliver_queen_brood_mother.txt @@ -0,0 +1,9 @@ +Name:Sliver Queen, Brood Mother +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/+8 +A:AB$ Token | ActivationZone$ Command | Cost$ 3 | TokenAmount$ 1 | TokenName$ Sliver | TokenTypes$ Creature,Sliver | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put a 1/1 colorless Sliver creature token onto the battlefield. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12143&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/s/squee.txt b/res/cardsfolder/s/squee.txt new file mode 100644 index 00000000000..89601e6d890 --- /dev/null +++ b/res/cardsfolder/s/squee.txt @@ -0,0 +1,10 @@ +Name:Squee +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+3/-4 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Opponent | AddKeyword$ Play with your hand revealed. | Description$ Your opponents play with their hands revealed. +SVar:RemAIDeck:True +SVar:Rarity:Special +SVar:Picture:http://www.wizards.com/global/images/magic/general/squee.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/u/urza.txt b/res/cardsfolder/u/urza.txt new file mode 100644 index 00000000000..f9aed08557e --- /dev/null +++ b/res/cardsfolder/u/urza.txt @@ -0,0 +1,9 @@ +Name:Urza +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+10 +A:AB$ DealDamage | ActivationZone$ Command | Cost$ 3 | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12326&type=card +End \ No newline at end of file From 83482dfe880fa00ab7fbbfe625546a69d2385fcf Mon Sep 17 00:00:00 2001 From: moomarc Date: Fri, 23 Nov 2012 06:47:51 +0000 Subject: [PATCH 19/36] Merged changes from trunk to Variants: r18319-r18323 --- res/cardsfolder/e/erg_raiders.txt | 5 ++++- src/main/java/forge/game/phase/EndOfTurn.java | 18 ------------------ src/main/java/forge/gui/GuiDisplayUtil.java | 12 +++++++++--- .../java/forge/sound/EventVisualilzer.java | 2 +- .../forge/view/arcane/CardPanelContainer.java | 2 +- src/main/java/forge/view/arcane/PlayArea.java | 16 +++++++++------- 6 files changed, 24 insertions(+), 31 deletions(-) diff --git a/res/cardsfolder/e/erg_raiders.txt b/res/cardsfolder/e/erg_raiders.txt index 047ee2abe8e..094b1e8499c 100644 --- a/res/cardsfolder/e/erg_raiders.txt +++ b/res/cardsfolder/e/erg_raiders.txt @@ -1,8 +1,11 @@ Name:Erg Raiders ManaCost:1 B Types:Creature Human Warrior -Text:At the beginning of your end step, if CARDNAME didn't attack this turn, CARDNAME deals 2 damage to you unless it came under your control this turn. +Text:no text PT:2/3 +T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDamage | IsPresent$ Creature.Self+notAttackedThisTurn | TriggerDescription$ At the beginning of your end step, if CARDNAME didn't attack this turn, CARDNAME deals 2 damage to you unless it came under your control this turn. +SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 2 | ConditionCheckSVar$ ErgAttacked | ConditionSVarCompare$ EQ1 +SVar:ErgAttacked:Valid Creature.Self+notFirstTurnControlled SVar:MustAttack:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/erg_raiders.jpg diff --git a/src/main/java/forge/game/phase/EndOfTurn.java b/src/main/java/forge/game/phase/EndOfTurn.java index 70abe317350..9e72a23d85e 100644 --- a/src/main/java/forge/game/phase/EndOfTurn.java +++ b/src/main/java/forge/game/phase/EndOfTurn.java @@ -167,25 +167,7 @@ public class EndOfTurn extends Phase { Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(change); } - if (c.getName().equals("Erg Raiders") && !c.getDamageHistory().getCreatureAttackedThisTurn() && !c.hasSickness() - && Singletons.getModel().getGame().getPhaseHandler().isPlayerTurn(c.getController())) { - final Card raider = c; - final SpellAbility change = new Ability(raider, "0") { - @Override - public void resolve() { - if (raider.isInPlay()) { - raider.getController().addDamage(2, raider); - } - } - }; - final StringBuilder sb = new StringBuilder(); - sb.append(raider).append(" deals 2 damage to controller."); - change.setStackDescription(sb.toString()); - change.setDescription(sb.toString()); - Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(change); - - } if (c.hasKeyword("At the beginning of your end step, return CARDNAME to its owner's hand.") && Singletons.getModel().getGame().getPhaseHandler().isPlayerTurn(c.getController())) { final Card source = c; diff --git a/src/main/java/forge/gui/GuiDisplayUtil.java b/src/main/java/forge/gui/GuiDisplayUtil.java index a9deb43a5a3..9d4e1fb4f63 100644 --- a/src/main/java/forge/gui/GuiDisplayUtil.java +++ b/src/main/java/forge/gui/GuiDisplayUtil.java @@ -18,6 +18,7 @@ package forge.gui; import java.awt.Color; +import java.awt.Rectangle; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; @@ -274,14 +275,19 @@ public final class GuiDisplayUtil { diff = new ArrayList(c); diff.removeAll(tmp); - forge.view.arcane.CardPanel toPanel = null; + List panelList = new ArrayList(); for (final Card card : diff) { - toPanel = p.addCard(card); + panelList.add(p.addCard(card)); + } + p.doLayout(); + for (final forge.view.arcane.CardPanel toPanel : panelList) { + p.scrollRectToVisible(new Rectangle(toPanel.getCardX(), toPanel.getCardY(), toPanel + .getCardWidth(), toPanel.getCardHeight())); Animation.moveCard(toPanel); } for (final Card card : c) { - toPanel = p.getCardPanel(card.getUniqueNumber()); + final forge.view.arcane.CardPanel toPanel = p.getCardPanel(card.getUniqueNumber()); if (card.isTapped()) { toPanel.setTapped(true); toPanel.setTappedAngle(forge.view.arcane.CardPanel.TAPPED_ANGLE); diff --git a/src/main/java/forge/sound/EventVisualilzer.java b/src/main/java/forge/sound/EventVisualilzer.java index 551740378c7..0d8047e5811 100644 --- a/src/main/java/forge/sound/EventVisualilzer.java +++ b/src/main/java/forge/sound/EventVisualilzer.java @@ -26,7 +26,7 @@ public class EventVisualilzer { public final SoundEffectType getSoundForEvent(Event evt) { - SoundEffectType fromMap = matchTable.get(evt); + SoundEffectType fromMap = matchTable.get(evt.getClass()); // call methods copied from Utils here if( evt instanceof SpellResolvedEvent ) { diff --git a/src/main/java/forge/view/arcane/CardPanelContainer.java b/src/main/java/forge/view/arcane/CardPanelContainer.java index 81a799efe8d..b3ef09ff04d 100644 --- a/src/main/java/forge/view/arcane/CardPanelContainer.java +++ b/src/main/java/forge/view/arcane/CardPanelContainer.java @@ -256,7 +256,7 @@ public abstract class CardPanelContainer extends JPanel { * a {@link forge.Card} object. * @return a {@link forge.view.arcane.CardPanel} object. */ - public final CardPanel addCard(final Card card) { + public CardPanel addCard(final Card card) { final CardPanel placeholder = new CardPanel(card); placeholder.setDisplayEnabled(false); this.getCardPanels().add(placeholder); diff --git a/src/main/java/forge/view/arcane/PlayArea.java b/src/main/java/forge/view/arcane/PlayArea.java index 2ecb41db72b..02e0877a8ff 100644 --- a/src/main/java/forge/view/arcane/PlayArea.java +++ b/src/main/java/forge/view/arcane/PlayArea.java @@ -27,7 +27,6 @@ import java.util.Iterator; import java.util.List; import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; import forge.Card; import forge.view.arcane.util.CardPanelMouseListener; @@ -181,6 +180,14 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen return allTokens; } + @Override + public final CardPanel addCard(final Card card) { + final CardPanel placeholder = new CardPanel(card); + placeholder.setDisplayEnabled(false); + this.getCardPanels().add(placeholder); + this.add(placeholder); + return placeholder; + } @Override public final void doLayout() { @@ -245,12 +252,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen } this.setPreferredSize(new Dimension(maxRowWidth - this.cardSpacingX, y - this.cardSpacingY)); this.revalidate(); - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - positionAllCards(); - } - }); + positionAllCards(); } private void positionAllCards() From 9013b4e9f707845452daa8aff3de9554208ca42a Mon Sep 17 00:00:00 2001 From: moomarc Date: Fri, 23 Nov 2012 08:40:13 +0000 Subject: [PATCH 20/36] *Variants - Added the following avatars: Starke, Tahngarth, Takara, and Tawnos --- .gitattributes | 4 ++++ res/cardsfolder/s/starke.txt | 11 +++++++++++ res/cardsfolder/t/tahngarth.txt | 9 +++++++++ res/cardsfolder/t/takara.txt | 10 ++++++++++ res/cardsfolder/t/tawnos.txt | 9 +++++++++ 5 files changed, 43 insertions(+) create mode 100644 res/cardsfolder/s/starke.txt create mode 100644 res/cardsfolder/t/tahngarth.txt create mode 100644 res/cardsfolder/t/takara.txt create mode 100644 res/cardsfolder/t/tawnos.txt diff --git a/.gitattributes b/.gitattributes index c8f81542cab..c4d428ab5e8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9540,6 +9540,7 @@ res/cardsfolder/s/standing_troops.txt svneol=native#text/plain res/cardsfolder/s/standstill.txt svneol=native#text/plain res/cardsfolder/s/stangg.txt svneol=native#text/plain res/cardsfolder/s/star_compass.txt svneol=native#text/plain +res/cardsfolder/s/starke.txt -text res/cardsfolder/s/starke_of_rath.txt -text res/cardsfolder/s/starlight.txt svneol=native#text/plain res/cardsfolder/s/starlight_invoker.txt svneol=native#text/plain @@ -9912,6 +9913,7 @@ res/cardsfolder/s/syphon_soul.txt svneol=native#text/plain res/cardsfolder/s/szadek_lord_of_secrets.txt svneol=native#text/plain res/cardsfolder/t/tablet_of_epityr.txt svneol=native#text/plain res/cardsfolder/t/tablet_of_the_guilds.txt -text +res/cardsfolder/t/tahngarth.txt -text res/cardsfolder/t/tahngarth_talruum_hero.txt svneol=native#text/plain res/cardsfolder/t/tahngarths_rage.txt svneol=native#text/plain res/cardsfolder/t/taiga.txt svneol=native#text/plain @@ -9926,6 +9928,7 @@ res/cardsfolder/t/tainted_wood.txt svneol=native#text/plain res/cardsfolder/t/taj_nar_swordsmith.txt svneol=native#text/plain res/cardsfolder/t/tajuru_archer.txt svneol=native#text/plain res/cardsfolder/t/tajuru_preserver.txt -text +res/cardsfolder/t/takara.txt -text res/cardsfolder/t/take_possession.txt svneol=native#text/plain res/cardsfolder/t/takenos_cavalry.txt svneol=native#text/plain res/cardsfolder/t/takenuma_bleeder.txt svneol=native#text/plain @@ -9994,6 +9997,7 @@ res/cardsfolder/t/taunting_challenge.txt svneol=native#text/plain res/cardsfolder/t/taunting_elf.txt svneol=native#text/plain res/cardsfolder/t/taurean_mauler.txt svneol=native#text/plain res/cardsfolder/t/tavern_swindler.txt -text +res/cardsfolder/t/tawnos.txt -text res/cardsfolder/t/tawnoss_wand.txt svneol=native#text/plain res/cardsfolder/t/tawnoss_weaponry.txt svneol=native#text/plain res/cardsfolder/t/teardrop_kami.txt svneol=native#text/plain diff --git a/res/cardsfolder/s/starke.txt b/res/cardsfolder/s/starke.txt new file mode 100644 index 00000000000..bde0d3c127c --- /dev/null +++ b/res/cardsfolder/s/starke.txt @@ -0,0 +1,11 @@ +Name:Starke +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/-2 +T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | TriggerZones$ Command | Execute$ SituationalEthics | OptionalDecider$ You | TriggerDescription$ At the beginning of your draw step, you may draw an additional card. If you do, put a card from your hand on the bottom of your library. +SVar:SituationalEthics:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You | SubAbility$ Switch +SVar:Switch:DB$ ChangeZone | Origin$ Hand | Destination$ Library | LibraryPosition$ -1 | ChangeNum$ 1 | Mandatory$ True +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=4970 +End \ No newline at end of file diff --git a/res/cardsfolder/t/tahngarth.txt b/res/cardsfolder/t/tahngarth.txt new file mode 100644 index 00000000000..b8e2e7d8c6f --- /dev/null +++ b/res/cardsfolder/t/tahngarth.txt @@ -0,0 +1,9 @@ +Name:Tahngarth +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:-1/+7 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Haste | Description$ Creatures you control have haste. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4971&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/t/takara.txt b/res/cardsfolder/t/takara.txt new file mode 100644 index 00000000000..f526ab576a3 --- /dev/null +++ b/res/cardsfolder/t/takara.txt @@ -0,0 +1,10 @@ +Name:Takara +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+3/-8 +A:AB$ DealDamage | ActivationZone$ Command | Cost$ Sac<1/Creature> | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player. +SVar:RemAIDeck:True +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12144&type=card +End \ No newline at end of file diff --git a/res/cardsfolder/t/tawnos.txt b/res/cardsfolder/t/tawnos.txt new file mode 100644 index 00000000000..82c5d5a200c --- /dev/null +++ b/res/cardsfolder/t/tawnos.txt @@ -0,0 +1,9 @@ +Name:Tawnos +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+3/-4 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.YouCtrl,Creature.YouCtrl,Enchantment.YouCtrl | AddHiddenKeyword$ HIDDEN Flash | AffectedZone$ Exile,Graveyard,Hand,Library | Description$ You may cast artifact, creature, and enchantment spells as though they had flash. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12328&type=card +End \ No newline at end of file From 7976f58fb9eb1148d62fb8f59521080b95f8a206 Mon Sep 17 00:00:00 2001 From: Hellfish Date: Sat, 24 Nov 2012 09:06:38 +0000 Subject: [PATCH 21/36] *Variants: WIP new Vanguard Home screen for multiplayer shenanigans (Does not work yet) --- .../gui/home/variant/VSubmenuVanguard.java | 156 +++++++++++++++++- 1 file changed, 153 insertions(+), 3 deletions(-) diff --git a/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java index 021c212ff4e..75d6f0e1fb2 100644 --- a/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java +++ b/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java @@ -1,16 +1,25 @@ package forge.gui.home.variant; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Vector; +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import javax.swing.ButtonModel; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JPanel; +import javax.swing.JRadioButton; import javax.swing.JScrollPane; +import javax.swing.JTabbedPane; import javax.swing.ScrollPaneConstants; import javax.swing.SwingConstants; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; @@ -32,6 +41,9 @@ import forge.gui.toolbox.FCheckBox; import forge.gui.toolbox.FDeckChooser; import forge.gui.toolbox.FLabel; import forge.gui.toolbox.FList; +import forge.gui.toolbox.FPanel; +import forge.gui.toolbox.FRadioButton; +import forge.gui.toolbox.FScrollPane; import forge.gui.toolbox.FSkin; import forge.item.CardDb; import forge.item.CardPrinted; @@ -82,8 +94,21 @@ public enum VSubmenuVanguard implements IVSubmenu { .fontAlign(SwingConstants.CENTER) .build(); + ////////////////////////////// + + private final JTabbedPane tabPane = new JTabbedPane(); + private final List playerPanels = new ArrayList(); + private final List deckChoosers = new ArrayList(); + private final List avatarLists = new ArrayList(); + + private final List fieldRadios = new ArrayList(); + private final ButtonGroup grpFields = new ButtonGroup(); + private int currentNumTabsShown = 7; + + ////////////////////////////// + private VSubmenuVanguard() { - + lblTitle.setBackground(FSkin.getColor(FSkin.Colors.CLR_THEME2)); Vector humanListData = new Vector(); @@ -105,6 +130,100 @@ public enum VSubmenuVanguard implements IVSubmenu { avHuman.setSelectedIndex(0); avAi.setSelectedIndex(0); + //This listener will look for any of the radio buttons being selected + //and call the method that shows/hides tabs appropriately. + ChangeListener changeListener = new ChangeListener() { + public void stateChanged(ChangeEvent changEvent) { + FRadioButton aButton = (FRadioButton)changEvent.getSource(); + + System.out.println("radio change fired: " + aButton.getText()); + + if(aButton.isSelected()) + { + changeTabs(Integer.parseInt(aButton.getText())); + } + } + }; + + class SelectedListener implements PropertyChangeListener + { + + /* (non-Javadoc) + * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent) + */ + @Override + public void propertyChange(PropertyChangeEvent arg0) { + FRadioButton aButton = (FRadioButton)arg0.getSource(); + + System.out.println("radio change fired(bean): " + aButton.getText()); + + if(aButton.isSelected()) + { + changeTabs(Integer.parseInt(aButton.getText())); + } + } + + } + + //Create all 8 player settings panel + FRadioButton tempRadio; + FPanel tempPanel; + FDeckChooser tempChooser; + FList tempList; + + for (int i = 1; i < 7; i++) { + tempRadio = new FRadioButton(); + tempRadio.setText(String.valueOf(i)); + tempRadio.setSelected(true); + fieldRadios.add(tempRadio); + grpFields.add(tempRadio); + tempRadio.addChangeListener(changeListener); + tempRadio.addPropertyChangeListener(new SelectedListener()); + } + + //Settings panel + FPanel settingsPanel = new FPanel(); + FPanel radioPane = new FPanel(); + radioPane.setLayout(new MigLayout("wrap 1")); + radioPane.setOpaque(false); + for (int i = 1; i < 8; i++) { + tempRadio = new FRadioButton(); + tempRadio.setText(String.valueOf(i)); + fieldRadios.add(tempRadio); + grpFields.add(tempRadio); + radioPane.add(tempRadio,"wrap"); + } + settingsPanel.add(radioPane); + settingsPanel.add(new FLabel.Builder().text("Set number of opponents").build()); + tabPane.add("Settings",settingsPanel); + + //Player panels (Human + 7 AIs) + for (int i = 0; i < 8;i++) { + tempPanel = new FPanel(); + tempPanel.setLayout(new MigLayout("insets 0, gap 0 , wrap 2")); + + tempChooser = new FDeckChooser("Select deck:", i == 0 ? PlayerType.HUMAN : PlayerType.COMPUTER); + tempChooser.initialize(); + + tempList = new FList(); + + tempList.setListData(i == 0 ? humanListData : aiListData); + tempList.setSelectedIndex(0); + + deckChoosers.add(tempChooser); + avatarLists.add(tempList); + + tempPanel.add(tempChooser,"span 1 2, w 44%!, gap 0 0 20px 20px, growy, pushy"); + + tempPanel.add(new FLabel.Builder().text("Select Avatar:").build()); + + JScrollPane scrAvatar = new FScrollPane(tempList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + tempPanel.add(scrAvatar,"h 90%!"); + + playerPanels.add(tempPanel); + tabPane.add("Player " + (i+1), tempPanel); + } + final String strCheckboxConstraints = "w 200px!, h 30px!, gap 0 20px 0 0"; pnlStart.setOpaque(false); pnlStart.add(cbSingletons, strCheckboxConstraints); @@ -112,6 +231,26 @@ public enum VSubmenuVanguard implements IVSubmenu { pnlStart.add(cbArtifacts, strCheckboxConstraints); pnlStart.add(cbRemoveSmall, strCheckboxConstraints); } + + private void changeTabs(int toShow) + { + if(toShow < currentNumTabsShown) + { + for(int i=currentNumTabsShown;i>toShow;i--) + { + tabPane.remove(i+1); + } + currentNumTabsShown = toShow; + } + else + { + for(int i=toShow+1;i<=8;i++) + { + tabPane.add(playerPanels.get(i)); + } + currentNumTabsShown = toShow; + } + } /* (non-Javadoc) * @see forge.gui.home.IVSubmenu#getGroupEnum() @@ -152,10 +291,19 @@ public enum VSubmenuVanguard implements IVSubmenu { @Override public void populate() { VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().removeAll(); - VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().setLayout(new MigLayout("insets 0, gap 0, wrap 2, ax right")); + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().setLayout(new MigLayout("insets 0, gap 0, wrap 1, ax right")); VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblTitle, "w 80%!, h 40px!, gap 0 0 15px 15px, span 2, ax right"); + for(FDeckChooser fdc : deckChoosers) + { + fdc.populate(); + } + + + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(tabPane, "gap 0 0 50px 50px, growx, growy"); + + /* dcAi.populate(); dcHuman.populate(); @@ -165,10 +313,12 @@ public enum VSubmenuVanguard implements IVSubmenu { VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblAvatarHuman, "w 44%!, gap 4% 4% 0px 0px"); VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(scrAi, "w 44%!, gap 0 0 20px 20px, growy, pushy"); VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(scrHuman, "w 44%!, gap 4% 4% 20px 20px, growy, pushy"); - VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(pnlStart, "span 2, gap 0 0 50px 50px, ax center"); + */ + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(pnlStart, "span 1, ax center"); VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().revalidate(); VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().repaintSelf(); + } From 7ec3ff9354d9c0d115bddcc80eada881b07392db Mon Sep 17 00:00:00 2001 From: moomarc Date: Sat, 24 Nov 2012 11:05:10 +0000 Subject: [PATCH 22/36] *Variants - Added the following avatars: Titania --- .gitattributes | 1 + res/cardsfolder/t/titania.txt | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 res/cardsfolder/t/titania.txt diff --git a/.gitattributes b/.gitattributes index 6f2da0fbe55..1f06fca37f9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10313,6 +10313,7 @@ res/cardsfolder/t/tinker.txt svneol=native#text/plain res/cardsfolder/t/tireless_missionaries.txt svneol=native#text/plain res/cardsfolder/t/tireless_tribe.txt svneol=native#text/plain res/cardsfolder/t/titan_forge.txt svneol=native#text/plain +res/cardsfolder/t/titania.txt -text res/cardsfolder/t/titanias_boon.txt svneol=native#text/plain res/cardsfolder/t/titanias_chosen.txt svneol=native#text/plain res/cardsfolder/t/titanias_song.txt svneol=native#text/plain diff --git a/res/cardsfolder/t/titania.txt b/res/cardsfolder/t/titania.txt new file mode 100644 index 00000000000..49e9f98bb00 --- /dev/null +++ b/res/cardsfolder/t/titania.txt @@ -0,0 +1,9 @@ +Name:Titania +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+2/-5 +S:Mode$ Continuous | EffectZone$ Command | Affected$ You | AddKeyword$ AdjustLandPlays:1 | Description$ You may play an additional land on each of your turns. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12333&type=card +End \ No newline at end of file From 15e5376d13e2a2be0ab4d62006f561cdcebb068c Mon Sep 17 00:00:00 2001 From: Hellfish Date: Sat, 24 Nov 2012 11:41:51 +0000 Subject: [PATCH 23/36] *Variants:Fixed the UI side of the new Vanguard home screen. (Now to make the match actually start!) *Variants:Added some apparently unadded scripts from trunk. --- .gitattributes | 19 +++ res/cardsfolder/c/chaotic_backlash.txt | 11 ++ res/cardsfolder/c/chromeshell_crab.txt | 15 ++ res/cardsfolder/c/circle_of_solace.txt | 17 +++ res/cardsfolder/c/complicate.txt | 13 ++ res/cardsfolder/c/cragganwick_cremator.txt | 15 ++ res/cardsfolder/e/ember_gale.txt | 12 ++ res/cardsfolder/h/honorable_scout.txt | 13 ++ res/cardsfolder/i/icy_prison.txt | 18 +++ res/cardsfolder/k/kaho_minamo_historian.txt | 17 +++ res/cardsfolder/k/kill_switch.txt | 13 ++ res/cardsfolder/m/mischievous_quanar.txt | 15 ++ res/cardsfolder/n/nomad_mythmaker.txt | 12 ++ res/cardsfolder/p/pay_no_heed.txt | 13 ++ res/cardsfolder/p/pilgrim_of_justice.txt | 17 +++ res/cardsfolder/p/pilgrim_of_virtue.txt | 17 +++ res/cardsfolder/p/prahv_spires_of_order.txt | 14 ++ res/cardsfolder/r/riths_charm.txt | 16 +++ res/cardsfolder/s/shell_of_the_last_kappa.txt | 13 ++ res/cardsfolder/t/tower_above.txt | 15 ++ .../gui/home/variant/CSubmenuVanguard.java | 80 ++++++----- .../gui/home/variant/VSubmenuVanguard.java | 131 +++++------------- 22 files changed, 372 insertions(+), 134 deletions(-) create mode 100644 res/cardsfolder/c/chaotic_backlash.txt create mode 100644 res/cardsfolder/c/chromeshell_crab.txt create mode 100644 res/cardsfolder/c/circle_of_solace.txt create mode 100644 res/cardsfolder/c/complicate.txt create mode 100644 res/cardsfolder/c/cragganwick_cremator.txt create mode 100644 res/cardsfolder/e/ember_gale.txt create mode 100644 res/cardsfolder/h/honorable_scout.txt create mode 100644 res/cardsfolder/i/icy_prison.txt create mode 100644 res/cardsfolder/k/kaho_minamo_historian.txt create mode 100644 res/cardsfolder/k/kill_switch.txt create mode 100644 res/cardsfolder/m/mischievous_quanar.txt create mode 100644 res/cardsfolder/n/nomad_mythmaker.txt create mode 100644 res/cardsfolder/p/pay_no_heed.txt create mode 100644 res/cardsfolder/p/pilgrim_of_justice.txt create mode 100644 res/cardsfolder/p/pilgrim_of_virtue.txt create mode 100644 res/cardsfolder/p/prahv_spires_of_order.txt create mode 100644 res/cardsfolder/r/riths_charm.txt create mode 100644 res/cardsfolder/s/shell_of_the_last_kappa.txt create mode 100644 res/cardsfolder/t/tower_above.txt diff --git a/.gitattributes b/.gitattributes index 1f06fca37f9..e460c695aba 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1575,6 +1575,7 @@ res/cardsfolder/c/chaos_imps.txt -text res/cardsfolder/c/chaos_lord.txt -text res/cardsfolder/c/chaos_warp.txt svneol=native#text/plain res/cardsfolder/c/chaosphere.txt svneol=native#text/plain +res/cardsfolder/c/chaotic_backlash.txt -text res/cardsfolder/c/chaotic_goo.txt svneol=native#text/plain res/cardsfolder/c/chaotic_strike.txt -text res/cardsfolder/c/chapel_geist.txt -text @@ -1638,6 +1639,7 @@ res/cardsfolder/c/chromatic_star.txt svneol=native#text/plain res/cardsfolder/c/chrome_mox.txt svneol=native#text/plain res/cardsfolder/c/chrome_steed.txt svneol=native#text/plain res/cardsfolder/c/chromescale_drake.txt svneol=native#text/plain +res/cardsfolder/c/chromeshell_crab.txt -text res/cardsfolder/c/chromium.txt svneol=native#text/plain res/cardsfolder/c/chronatog.txt svneol=native#text/plain res/cardsfolder/c/chronatog_avatar.txt -text @@ -1669,6 +1671,7 @@ res/cardsfolder/c/circle_of_protection_green.txt -text res/cardsfolder/c/circle_of_protection_red.txt -text res/cardsfolder/c/circle_of_protection_shadow.txt -text res/cardsfolder/c/circle_of_protection_white.txt -text +res/cardsfolder/c/circle_of_solace.txt -text res/cardsfolder/c/circu_dimir_lobotomist.txt -text res/cardsfolder/c/circular_logic.txt svneol=native#text/plain res/cardsfolder/c/citanul_centaurs.txt svneol=native#text/plain @@ -1804,6 +1807,7 @@ res/cardsfolder/c/commando_raid.txt -text svneol=unset#text/plain res/cardsfolder/c/common_bond.txt -text res/cardsfolder/c/commune_with_nature.txt svneol=native#text/plain res/cardsfolder/c/complex_automaton.txt svneol=native#text/plain +res/cardsfolder/c/complicate.txt -text res/cardsfolder/c/composite_golem.txt svneol=native#text/plain res/cardsfolder/c/compost.txt svneol=native#text/plain res/cardsfolder/c/compulsion.txt svneol=native#text/plain @@ -1946,6 +1950,7 @@ res/cardsfolder/c/cradle_of_vitality.txt svneol=native#text/plain res/cardsfolder/c/cradle_to_grave.txt svneol=native#text/plain res/cardsfolder/c/crafty_pathmage.txt svneol=native#text/plain res/cardsfolder/c/crag_puca.txt svneol=native#text/plain +res/cardsfolder/c/cragganwick_cremator.txt -text res/cardsfolder/c/cranial_extraction.txt svneol=native#text/plain res/cardsfolder/c/cranial_plating.txt -text res/cardsfolder/c/crash.txt svneol=native#text/plain @@ -2955,6 +2960,7 @@ res/cardsfolder/e/embalmed_brawler.txt -text res/cardsfolder/e/embargo.txt svneol=native#text/plain res/cardsfolder/e/ember_beast.txt -text res/cardsfolder/e/ember_fist_zubera.txt svneol=native#text/plain +res/cardsfolder/e/ember_gale.txt -text res/cardsfolder/e/ember_hauler.txt svneol=native#text/plain res/cardsfolder/e/ember_shot.txt svneol=native#text/plain res/cardsfolder/e/ember_weaver.txt svneol=native#text/plain @@ -4653,6 +4659,7 @@ res/cardsfolder/h/honor_guard.txt svneol=native#text/plain res/cardsfolder/h/honor_of_the_pure.txt svneol=native#text/plain res/cardsfolder/h/honor_the_fallen.txt -text res/cardsfolder/h/honor_worn_shaku.txt svneol=native#text/plain +res/cardsfolder/h/honorable_scout.txt -text res/cardsfolder/h/hooded_kavu.txt svneol=native#text/plain res/cardsfolder/h/hoodwink.txt svneol=native#text/plain res/cardsfolder/h/hoof_skulkin.txt svneol=native#text/plain @@ -4793,6 +4800,7 @@ res/cardsfolder/i/ichor_wellspring.txt svneol=native#text/plain res/cardsfolder/i/ichorclaw_myr.txt svneol=native#text/plain res/cardsfolder/i/ichorid.txt svneol=native#text/plain res/cardsfolder/i/icy_manipulator.txt svneol=native#text/plain +res/cardsfolder/i/icy_prison.txt -text res/cardsfolder/i/ideas_unbound.txt -text res/cardsfolder/i/identity_crisis.txt svneol=native#text/plain res/cardsfolder/i/idle_thoughts.txt svneol=native#text/plain @@ -5178,6 +5186,7 @@ res/cardsfolder/k/kaerveks_spite.txt svneol=native#text/plain res/cardsfolder/k/kaerveks_torch.txt -text res/cardsfolder/k/kagemaro_first_to_suffer.txt svneol=native#text/plain res/cardsfolder/k/kagemaros_clutch.txt -text +res/cardsfolder/k/kaho_minamo_historian.txt -text res/cardsfolder/k/kaijin_of_the_vanishing_touch.txt svneol=native#text/plain res/cardsfolder/k/kalastria_highborn.txt svneol=native#text/plain res/cardsfolder/k/kaleidostone.txt svneol=native#text/plain @@ -5305,6 +5314,7 @@ res/cardsfolder/k/kher_keep.txt svneol=native#text/plain res/cardsfolder/k/kiki_jiki_mirror_breaker.txt svneol=native#text/plain res/cardsfolder/k/kiku_nights_flower.txt svneol=native#text/plain res/cardsfolder/k/kikus_shadow.txt svneol=native#text/plain +res/cardsfolder/k/kill_switch.txt -text res/cardsfolder/k/killer_bees.txt svneol=native#text/plain res/cardsfolder/k/killer_instinct.txt -text res/cardsfolder/k/killer_whale.txt svneol=native#text/plain @@ -6276,6 +6286,7 @@ res/cardsfolder/m/mirror_wall.txt svneol=native#text/plain res/cardsfolder/m/mirrorworks.txt svneol=native#text/plain res/cardsfolder/m/miscalculation.txt svneol=native#text/plain res/cardsfolder/m/mischievous_poltergeist.txt svneol=native#text/plain +res/cardsfolder/m/mischievous_quanar.txt -text res/cardsfolder/m/misers_cage.txt svneol=native#text/plain res/cardsfolder/m/misery_charm.txt svneol=native#text/plain res/cardsfolder/m/misfortunes_gain.txt svneol=native#text/plain @@ -6784,6 +6795,7 @@ res/cardsfolder/n/noggle_bridgebreaker.txt svneol=native#text/plain res/cardsfolder/n/noggle_hedge_mage.txt svneol=native#text/plain res/cardsfolder/n/noggle_ransacker.txt svneol=native#text/plain res/cardsfolder/n/nomad_decoy.txt -text svneol=unset#text/plain +res/cardsfolder/n/nomad_mythmaker.txt -text res/cardsfolder/n/nomad_stadium.txt svneol=native#text/plain res/cardsfolder/n/nomadic_elf.txt svneol=native#text/plain res/cardsfolder/n/nomads_assembly.txt -text @@ -7130,6 +7142,7 @@ res/cardsfolder/p/pattern_of_rebirth.txt svneol=native#text/plain res/cardsfolder/p/paupers_cage.txt svneol=native#text/plain res/cardsfolder/p/pavel_maliki.txt svneol=native#text/plain res/cardsfolder/p/pawn_of_ulamog.txt svneol=native#text/plain +res/cardsfolder/p/pay_no_heed.txt -text res/cardsfolder/p/peace_and_quiet.txt svneol=native#text/plain res/cardsfolder/p/peace_of_mind.txt svneol=native#text/plain res/cardsfolder/p/peace_strider.txt svneol=native#text/plain @@ -7287,6 +7300,8 @@ res/cardsfolder/p/pianna_nomad_captain.txt svneol=native#text/plain res/cardsfolder/p/pierce_strider.txt svneol=native#text/plain res/cardsfolder/p/piety.txt svneol=native#text/plain res/cardsfolder/p/piety_charm.txt -text +res/cardsfolder/p/pilgrim_of_justice.txt -text +res/cardsfolder/p/pilgrim_of_virtue.txt -text res/cardsfolder/p/pilgrims_eye.txt svneol=native#text/plain res/cardsfolder/p/pili_pala.txt svneol=native#text/plain res/cardsfolder/p/pillage.txt svneol=native#text/plain @@ -7414,6 +7429,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_spires_of_order.txt -text res/cardsfolder/p/precinct_captain.txt -text res/cardsfolder/p/precognition.txt svneol=native#text/plain res/cardsfolder/p/predator_dragon.txt svneol=native#text/plain @@ -8105,6 +8121,7 @@ res/cardsfolder/r/rites_of_flourishing.txt svneol=native#text/plain res/cardsfolder/r/rites_of_reaping.txt -text res/cardsfolder/r/rith_the_awakener.txt svneol=native#text/plain res/cardsfolder/r/riths_attendant.txt svneol=native#text/plain +res/cardsfolder/r/riths_charm.txt -text res/cardsfolder/r/riths_grove.txt svneol=native#text/plain res/cardsfolder/r/ritual_of_restoration.txt svneol=native#text/plain res/cardsfolder/r/ritual_of_steel.txt svneol=native#text/plain @@ -8744,6 +8761,7 @@ res/cardsfolder/s/shatterskull_giant.txt svneol=native#text/plain res/cardsfolder/s/shatterstorm.txt svneol=native#text/plain res/cardsfolder/s/shauku_endbringer.txt svneol=native#text/plain res/cardsfolder/s/shaukus_minion.txt svneol=native#text/plain +res/cardsfolder/s/shell_of_the_last_kappa.txt -text res/cardsfolder/s/shell_skulkin.txt svneol=native#text/plain res/cardsfolder/s/shelldock_isle.txt -text res/cardsfolder/s/shelter.txt -text @@ -10390,6 +10408,7 @@ res/cardsfolder/t/touch_of_the_eternal.txt -text res/cardsfolder/t/touch_of_vitae.txt -text svneol=unset#text/plain res/cardsfolder/t/touchstone.txt svneol=native#text/plain res/cardsfolder/t/tourachs_gate.txt -text +res/cardsfolder/t/tower_above.txt -text res/cardsfolder/t/tower_drake.txt svneol=native#text/plain res/cardsfolder/t/tower_gargoyle.txt svneol=native#text/plain res/cardsfolder/t/tower_geist.txt -text diff --git a/res/cardsfolder/c/chaotic_backlash.txt b/res/cardsfolder/c/chaotic_backlash.txt new file mode 100644 index 00000000000..1091f05e23f --- /dev/null +++ b/res/cardsfolder/c/chaotic_backlash.txt @@ -0,0 +1,11 @@ +Name:Chaotic Backlash +ManaCost:4 R +Types:Instant +Text:no text +A:SP$ DealDamage | Cost$ 4 R | NumDmg$ Backlash | TgtPrompt$ Select target player to damage | ValidTgts$ Player | SpellDescription$ CARDNAME deals damage to target player equal to twice the number of white and/or blue permanents he or she controls. +SVar:Backlash:Count$Valid Permanent.Blue+TargetedPlayerCtrl,Permanent.White+TargetedPlayerCtrl/Times.2 +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/chaotic_backlash.jpg +SetInfo:EVE|Uncommon|http://magiccards.info/scans/en/eve/49.jpg +Oracle:Chaotic Backlash deals damage to target player equal to twice the number of white and/or blue permanents he or she controls. +End \ No newline at end of file diff --git a/res/cardsfolder/c/chromeshell_crab.txt b/res/cardsfolder/c/chromeshell_crab.txt new file mode 100644 index 00000000000..23a0eaca4b3 --- /dev/null +++ b/res/cardsfolder/c/chromeshell_crab.txt @@ -0,0 +1,15 @@ +Name:Chromeshell Crab +ManaCost:4 U +Types:Creature Crab Beast +Text:no text +PT:3/3 +K:Morph:4 U +T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ CrabExchange | TriggerZones$ Battlefield | Optional$ True | TriggerDescription$ When CARDNAME is turned face up, you may exchange control of target creature you control and target creature an opponent controls. +SVar:CrabExchange:DB$ ExchangeControl | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | TargetsFromDifferentZone$ True | TargetMin$ 2 | TargetMax$ 2 | SpellDescription$ Exchange control of target creature you control and target creature an opponent controls. +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/chromeshell_crab.jpg +SetInfo:LGN|Rare|http://magiccards.info/scans/en/le/32.jpg +SetInfo:COM|Rare|http://magiccards.info/scans/en/cmd/41.jpg +Oracle:Morph {4}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)\nWhen Chromeshell Crab is turned face up, you may exchange control of target creature you control and target creature an opponent controls. +End \ No newline at end of file diff --git a/res/cardsfolder/c/circle_of_solace.txt b/res/cardsfolder/c/circle_of_solace.txt new file mode 100644 index 00000000000..9848920e0e6 --- /dev/null +++ b/res/cardsfolder/c/circle_of_solace.txt @@ -0,0 +1,17 @@ +Name:Circle of Solace +ManaCost:3 W +Types:Enchantment +Text:no text +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseCT | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose a creature type. +SVar:ChooseCT:AB$ ChooseType | Cost$ 0 | Defined$ You | Type$ Creature | AILogic$ MostProminentHumanControls +A:AB$ ChooseCard | Cost$ 1 W | Choices$ Creature.ChosenType | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SVars$ DBEffect,RPreventNextFromCreature,ExileEffect | SpellDescription$ The next time a creature of the chosen type would deal damage to you this turn, prevent that damage. +SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromCreature | RememberObjects$ Remembered | SVars$ RPreventNextFromCreature,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 +SVar:RPreventNextFromCreature:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time a creature of the chosen type would deal damage to you this turn, prevent that damage. +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/circle_of_solace.jpg +SetInfo:ONS|Rare|http://magiccards.info/scans/en/on/13.jpg +Oracle:As Circle of Solace enters the battlefield, choose a creature type.\n{1}{W}: The next time a creature of the chosen type would deal damage to you this turn, prevent that damage. +End \ No newline at end of file diff --git a/res/cardsfolder/c/complicate.txt b/res/cardsfolder/c/complicate.txt new file mode 100644 index 00000000000..11bc9e69602 --- /dev/null +++ b/res/cardsfolder/c/complicate.txt @@ -0,0 +1,13 @@ +Name:Complicate +ManaCost:2 U +Types:Instant +Text:no text +K:Cycling:2 U +A:SP$ Counter | Cost$ 2 U | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | UnlessCost$ 3 | SpellDescription$ Counter target spell unless its controller pays 3. +T:Mode$ Cycled | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When you cycle CARDNAME, you may counter target spell unless its controller pays 1. +SVar:TrigExile:AB$ Counter | Cost$ 0 | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | UnlessCost$ 1 +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/complicate.jpg +SetInfo:ONS|Uncommon|http://magiccards.info/scans/en/on/76.jpg +Oracle:Counter target spell unless its controller pays {3}.\nCycling {2}{U} ({2}{U}, Discard this card: Draw a card.)\nWhen you cycle Complicate, you may counter target spell unless its controller pays {1}. +End \ No newline at end of file diff --git a/res/cardsfolder/c/cragganwick_cremator.txt b/res/cardsfolder/c/cragganwick_cremator.txt new file mode 100644 index 00000000000..a9858e4921b --- /dev/null +++ b/res/cardsfolder/c/cragganwick_cremator.txt @@ -0,0 +1,15 @@ +Name:Cragganwick Cremator +ManaCost:2 R R +Types:Creature Giant Shaman +Text:no text +PT:5/4 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDiscard | TriggerDescription$ When CARDNAME enters the battlefield, discard a card at random. If you discard a creature card this way, CARDNAME deals damage equal to that card's power to target player. +SVar:TrigDiscard:AB$ Discard | Cost$ 0 | Defined$ You | NumCards$ 1 | Mode$ Random | RememberDiscarded$ True | SubAbility$ DBDmg +SVar:DBDmg:DB$ DealDamage | Cost$ 0 | Tgt$ TgtP | ConditionDefined$ Remembered | ConditionPresent$ Card.Creature | ConditionCompare$ EQ1 | NumDmg$ X | SubAbility$ DBCleanup | References$ X +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:X:Remembered$CardPower +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/cragganwick_cremator.jpg +SetInfo:SHM|Rare|http://magiccards.info/scans/en/shm/87.jpg +Oracle:When Cragganwick Cremator enters the battlefield, discard a card at random. If you discard a creature card this way, Cragganwick Cremator deals damage equal to that card's power to target player. +End \ No newline at end of file diff --git a/res/cardsfolder/e/ember_gale.txt b/res/cardsfolder/e/ember_gale.txt new file mode 100644 index 00000000000..f9817ea87b1 --- /dev/null +++ b/res/cardsfolder/e/ember_gale.txt @@ -0,0 +1,12 @@ +Name:Ember Gale +ManaCost:3 R +Types:Sorcery +Text:no text +A:SP$ Effect | Cost$ 3 R | Name$ Ember Gale Effect | ValidTgts$ Player | TgtPrompt$ Select target player | AILogic$ Evasion | StaticAbilities$ CantBlock | RememberObjects$ Targeted | SubAbility$ DBDamage | SpellDescription$ Creatures target player controls can't block this turn. CARDNAME deals 1 damage to each white and/or blue creature that player controls. +SVar:DBDamage:DB$ DamageAll | NumDmg$ 1 | ValidCards$ Creature.White+TargetedPlayerCtrl,Creature.Blue+TargetedPlayerCtrl | ValidDescription$ each creature that's white or blue that player controls. +SVar:CantBlock:Mode$ Continuous | Affected$ Creature.RememberedPlayerCtrl | AddHiddenKeyword$ HIDDEN CARDNAME can't block. | SubAbility$ DBDamage | SpellDescription$ Creatures targeted player controls can't block this turn. +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/ember_gale.jpg +SetInfo:SHM|Common|http://magiccards.info/scans/en/shm/91.jpg +Oracle:Creatures target player controls can't block this turn. Ember Gale deals 1 damage to each white and/or blue creature that player controls. +End \ No newline at end of file diff --git a/res/cardsfolder/h/honorable_scout.txt b/res/cardsfolder/h/honorable_scout.txt new file mode 100644 index 00000000000..b529063a7c2 --- /dev/null +++ b/res/cardsfolder/h/honorable_scout.txt @@ -0,0 +1,13 @@ +Name:Honorable Scout +ManaCost:W +Types:Creature Human Soldier Scout +Text:no text +PT:1/1 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Self | Execute$ HonorGained | TriggerDescription$ When CARDNAME enters the battlefield, you gain 2 life for each black and/or red creature target opponent controls. +SVar:HonorGained:AB$ GainLife | Cost$ 0 | LifeAmount$ ScoutsHonor | Defined$ You | TgtPrompt$ Select target opponent | ValidTgts$ Opponent +SVar:ScoutsHonor:Count$Valid Creature.Black+TargetedPlayerCtrl,Creature.Red+TargetedPlayerCtrl/Times.2 +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/honorable_scout.jpg +SetInfo:PLS|Common|http://magiccards.info/scans/en/ps/8.jpg +Oracle:When Honorable Scout enters the battlefield, you gain 2 life for each black and/or red creature target opponent controls. +End \ No newline at end of file diff --git a/res/cardsfolder/i/icy_prison.txt b/res/cardsfolder/i/icy_prison.txt new file mode 100644 index 00000000000..b8ba89c0a89 --- /dev/null +++ b/res/cardsfolder/i/icy_prison.txt @@ -0,0 +1,18 @@ +Name:Icy Prison +ManaCost:U U +Types:Enchantment +Text:no text +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield, exile target creature. +SVar:TrigExile:DB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | ForgetOtherRemembered$ True | ValidTgts$ Creature | TgtPrompt$ Select target creature +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME leaves the battlefield, return the exiled card to the battlefield under its owner's control. +SVar:TrigReturn:AB$ ChangeZone | Cost$ 0 | Origin$ Exile | Destination$ Battlefield | Defined$ Remembered +T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME unless any player pays {3}. +SVar:TrigSac:AB$ Sacrifice | Cost$ 0 | Defined$ Self | UnlessCost$ 3 | UnlessPayer$ Player | UnlessAI$ OnlyOwn +SVar:PlayMain1:TRUE +SVar:NeedsToPlayVar:Y GE3 +SVar:Y:Count$Valid Land.YouCtrl +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/icy_prison.jpg +SetInfo:ICE|Rare|http://magiccards.info/scans/en/ia/74.jpg +Oracle:When Icy Prison enters the battlefield, exile target creature.\nAt the beginning of your upkeep, sacrifice Icy Prison unless any player pays {3}.\nWhen Icy Prison leaves the battlefield, return the exiled card to the battlefield under its owner's control. +End \ No newline at end of file diff --git a/res/cardsfolder/k/kaho_minamo_historian.txt b/res/cardsfolder/k/kaho_minamo_historian.txt new file mode 100644 index 00000000000..c0a1ba319ca --- /dev/null +++ b/res/cardsfolder/k/kaho_minamo_historian.txt @@ -0,0 +1,17 @@ +Name:Kaho, Minamo Historian +ManaCost:2 U U +Types:Legendary Creature Human Wizard +Text:no text +PT:2/2 +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Self | Execute$ Catalogue | TriggerDescription$ When CARDNAME enters the battlefield, search your library for up to three instant cards and exile them. Then shuffle your library. +SVar:Catalogue:DB$ ChangeZone | Origin$ Library | Destination$ Exile | ChangeType$ Instant | ChangeNum$ 3 | RememberChanged$ True | ForgetOtherRemembered$ True +A:AB$ Play | Cost$ X T | Valid$ Card.IsRemembered+cmcEQX | ValidZone$ Exile | WithoutManaCost$ True | Amount$ 1 | Controller$ You | Optional$ True | References$ X | SpellDescription$ You may cast a card with converted mana cost X exiled with Kaho without paying its mana cost. +T:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Exile | Destination$ Any | Execute$ ForgetCard | Static$ True +SVar:ForgetCard:DB$ Cleanup | ForgetDefined$ TriggeredCard +SVar:X:Count$xPaid +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/kaho_minamo_historian.jpg +SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/41.jpg +Oracle:When Kaho, Minamo Historian enters the battlefield, search your library for up to three instant cards and exile them. Then shuffle your library.\n{X}, {T}: You may cast a card with converted mana cost X exiled with Kaho without paying its mana cost. +End \ No newline at end of file diff --git a/res/cardsfolder/k/kill_switch.txt b/res/cardsfolder/k/kill_switch.txt new file mode 100644 index 00000000000..859d5f525a5 --- /dev/null +++ b/res/cardsfolder/k/kill_switch.txt @@ -0,0 +1,13 @@ +Name:Kill Switch +ManaCost:3 +Types:Artifact +Text:no text +A:AB$ TapAll | Cost$ 2 T | ValidCards$ Artifact.Other | SubAbility$ DBPumpAll | SpellDescription$ Tap all other artifacts.They don't untap during their controllers' untap steps for as long as CARDNAME remains tapped. +SVar:DBPumpAll:DB$ PumpAll | Cost$ 0 | KW$ HIDDEN CARDNAME doesn't untap during your untap step. | ValidCards$ Artifact.Other | UntilUntaps$ True +SVar:RemAIDeck:True +SVar:RemRandomDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/kill_switch.jpg +SetInfo:NMS|Rare|http://magiccards.info/scans/en/ne/133.jpg +Oracle:{2}, {T}: Tap all other artifacts. They don't untap during their controllers' untap steps for as long as Kill Switch remains tapped. +End \ No newline at end of file diff --git a/res/cardsfolder/m/mischievous_quanar.txt b/res/cardsfolder/m/mischievous_quanar.txt new file mode 100644 index 00000000000..9cd7843e3e1 --- /dev/null +++ b/res/cardsfolder/m/mischievous_quanar.txt @@ -0,0 +1,15 @@ +Name:Mischievous Quanar +ManaCost:4 U +Types:Creature Beast +Text:no text +PT:3/3 +K:Morph:1 U U +A:AB$ SetState | Cost$ 3 U U | Defined$ Self | Mode$ TurnFace | SpellDescription$ Turn CARDNAME face down. +T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ TrigCopy | TriggerZones$ Battlefield | TriggerDescription$ When CARDNAME is turned face up, copy target instant or sorcery spell. You may choose new targets for that copy. +SVar:TrigCopy:AB$ CopySpell | Cost$ 0 | ValidTgts$ Instant,Sorcery +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/mischievous_quanar.jpg +SetInfo:SCG|Rare|http://magiccards.info/scans/en/sc/42.jpg +Oracle:{3}{U}{U}: Turn Mischievous Quanar face down.\nMorph {1}{U}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)\nWhen Mischievous Quanar is turned face up, copy target instant or sorcery spell. You may choose new targets for that copy. +End \ No newline at end of file diff --git a/res/cardsfolder/n/nomad_mythmaker.txt b/res/cardsfolder/n/nomad_mythmaker.txt new file mode 100644 index 00000000000..a1580cc3bc2 --- /dev/null +++ b/res/cardsfolder/n/nomad_mythmaker.txt @@ -0,0 +1,12 @@ +Name:Nomad Mythmaker +ManaCost:2 W +Types:Creature Human Nomad Cleric +Text:no text +PT:2/2 +A:AB$ ChangeZone | Cost$ W T | Origin$ Graveyard | Destination$ Battlefield | ValidTgts$ Aura | GainControl$ True | AttachedTo$ Creature.CanBeEnchantedBySource+YouCtrl | SpellDescription$ Put target Aura card from a graveyard onto the battlefield under your control attached to a creature you control. +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/nomad_mythmaker.jpg +SetInfo:JUD|Rare|http://magiccards.info/scans/en/ju/15.jpg +SetInfo:10E|Rare|http://magiccards.info/scans/en/10e/30.jpg +Oracle:{W}, {T}: Put target Aura card from a graveyard onto the battlefield under your control attached to a creature you control. +End \ No newline at end of file diff --git a/res/cardsfolder/p/pay_no_heed.txt b/res/cardsfolder/p/pay_no_heed.txt new file mode 100644 index 00000000000..1b16ef47ef4 --- /dev/null +++ b/res/cardsfolder/p/pay_no_heed.txt @@ -0,0 +1,13 @@ +Name:Pay No Heed +ManaCost:W +Types:Instant +Text:no text +A:SP$ ChooseSource | Cost$ W | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ Prevent all damage a source of your choice would deal this turn. +SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 +SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | Prevent$ True | PreventionEffect$ True | Description$ Prevent all damage the source would deal this turn. +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/pay_no_heed.jpg +SetInfo:TOR|Common|http://magiccards.info/scans/en/tr/12.jpg +Oracle:Prevent all damage a source of your choice would deal this turn. +End \ No newline at end of file diff --git a/res/cardsfolder/p/pilgrim_of_justice.txt b/res/cardsfolder/p/pilgrim_of_justice.txt new file mode 100644 index 00000000000..9e2e255cb15 --- /dev/null +++ b/res/cardsfolder/p/pilgrim_of_justice.txt @@ -0,0 +1,17 @@ +Name:Pilgrim of Justice +ManaCost:2 W +Types:Creature Human Cleric +Text:no text +PT:1/3 +K:Protection from red +A:AB$ ChooseSource | Cost$ W Sac<1/CARDNAME> | Choices$ Card.Red | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a red source of your choice would deal damage this turn, prevent that damage. +SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 +SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage, prevent that damage. +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:RemRandomDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/pilgrim_of_justice.jpg +SetInfo:ODY|Common|http://magiccards.info/scans/en/od/40.jpg +Oracle:Protection from red\n{W}, Sacrifice Pilgrim of Justice: The next time a red source of your choice would deal damage this turn, prevent that damage. +End \ No newline at end of file diff --git a/res/cardsfolder/p/pilgrim_of_virtue.txt b/res/cardsfolder/p/pilgrim_of_virtue.txt new file mode 100644 index 00000000000..9a16ab926d5 --- /dev/null +++ b/res/cardsfolder/p/pilgrim_of_virtue.txt @@ -0,0 +1,17 @@ +Name:Pilgrim of Virtue +ManaCost:2 W +Types:Creature Human Cleric +Text:no text +PT:1/3 +K:Protection from black +A:AB$ ChooseSource | Cost$ W Sac<1/CARDNAME> | Choices$ Card.Black | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a black source of your choice would deal damage this turn, prevent that damage. +SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 +SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage, prevent that damage. +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:RemRandomDeck:True +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/pilgrim_of_virtue.jpg +SetInfo:ODY|Common|http://magiccards.info/scans/en/od/41.jpg +Oracle:Protection from black\n{W}, Sacrifice Pilgrim of Virtue: The next time a black source of your choice would deal damage this turn, prevent that damage. +End \ No newline at end of file diff --git a/res/cardsfolder/p/prahv_spires_of_order.txt b/res/cardsfolder/p/prahv_spires_of_order.txt new file mode 100644 index 00000000000..13cd97a8b06 --- /dev/null +++ b/res/cardsfolder/p/prahv_spires_of_order.txt @@ -0,0 +1,14 @@ +Name:Prahv, Spires of Order +ManaCost:no cost +Types:Land +Text:no text +A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add 1 to your mana pool. +A:AB$ ChooseSource | Cost$ 4 W U T | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ Prevent all damage a source of your choice would deal this turn. +SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 +SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | Prevent$ True | PreventionEffect$ True | Description$ Prevent all damage the chosen source would deal this turn. +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/prahv_spires_of_order.jpg +SetInfo:DIS|Uncommon|http://magiccards.info/scans/en/di/177.jpg +Oracle:{T}: Add {1} to your mana pool.\n{4}{W}{U}, {T}: Prevent all damage a source of your choice would deal this turn. +End \ No newline at end of file diff --git a/res/cardsfolder/r/riths_charm.txt b/res/cardsfolder/r/riths_charm.txt new file mode 100644 index 00000000000..3076344b60e --- /dev/null +++ b/res/cardsfolder/r/riths_charm.txt @@ -0,0 +1,16 @@ +Name:Rith's Charm +ManaCost:R G W +Types:Instant +Text:no text +A:SP$ Charm | Cost$ R G W | CharmNum$ 1 | Choices$ Bash,Token,Prevent | SpellDescription$ Choose one - Destroy target nonbasic land; or put three 1/1 green Saproling creature tokens onto the battlefield; or prevent all damage a source of your choice would deal this turn. +SVar:Bash:DB$ Destroy | ValidTgts$ Land.nonBasic | TgtPrompt$ Select target nonbasic land | SpellDescription$ Destroy target nonbasic land. +SVar:Token:DB$ Token | TokenAmount$ 3 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put three 1/1 green Saproling creature tokens onto the battlefield. +SVar:Prevent:DB$ ChooseSource | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ Prevent all damage a source of your choice would deal this turn. +SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 +SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | Prevent$ True | PreventionEffect$ True | Description$ Prevent all damage the source would deal this turn. +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/riths_charm.jpg +SetInfo:PLS|Uncommon|http://magiccards.info/scans/en/ps/122.jpg +Oracle:Choose one - Destroy target nonbasic land; or put three 1/1 green Saproling creature tokens onto the battlefield; or prevent all damage a source of your choice would deal this turn. +End \ No newline at end of file diff --git a/res/cardsfolder/s/shell_of_the_last_kappa.txt b/res/cardsfolder/s/shell_of_the_last_kappa.txt new file mode 100644 index 00000000000..b6da4f14519 --- /dev/null +++ b/res/cardsfolder/s/shell_of_the_last_kappa.txt @@ -0,0 +1,13 @@ +Name:Shell of the Last Kappa +ManaCost:3 +Types:Legendary Artifact +Text:no text +A:AB$ ChangeZone | Cost$ 3 T | Origin$ Stack | Destination$ Exile | TargetValidTargeting$ You | TgtPrompt$ Choose target instant or sorcery spell that targets you | ValidTgts$ Card.Instant,Card.Sorcery | RememberChanged$ True | SpellDescription$ Exile target instant or sorcery spell that targets you. (The spell has no effect.) +A:AB$ Play | Cost$ 3 T Sac<1/CARDNAME> | Valid$ Card.IsRemembered | ValidZone$ Exile | WithoutManaCost$ True | Amount$ 1 | Controller$ You | Optional$ True | SubAbility$ DBCleanup | SpellDescription$ You may cast a card exiled with CARDNAME without paying its mana cost. +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/shell_of_the_last_kappa.jpg +SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/269.jpg +Oracle:{3}, {T}: Exile target instant or sorcery spell that targets you. (The spell has no effect.)\n{3}, {T}, Sacrifice Shell of the Last Kappa: You may cast a card exiled with Shell of the Last Kappa without paying its mana cost. +End \ No newline at end of file diff --git a/res/cardsfolder/t/tower_above.txt b/res/cardsfolder/t/tower_above.txt new file mode 100644 index 00000000000..aefd8c52567 --- /dev/null +++ b/res/cardsfolder/t/tower_above.txt @@ -0,0 +1,15 @@ +Name:Tower Above +ManaCost:2G 2G 2G +Types:Sorcery +Text:no text +A:SP$ Pump | Cost$ 2G 2G 2G | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ 4 | NumDef$ 4 | KW$ Trample & Wither | SubAbility$ DBAnimate | SpellDescription$ Until end of turn, CARDNAME gets +4/+4 and gains trample, wither, and "When this creature attacks, target creature blocks it this turn if able." (It deals damage to creatures in the form of -1/-1 counters.) +SVar:DBAnimate:DB$ Animate | Cost$ 0 | Defined$ Targeted | Triggers$ TrigAttack | sVars$ TowerAboveTrigBlock +SVar:TrigAttack:Mode$ Attacks | ValidCard$ Creature.Self | Execute$ TrigBlock | TriggerDescription$ Whenever CARDNAME attacks, target creature blocks it this turn if able +SVar:TowerAboveTrigBlock:AB$ MustBlock | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Target creature blocks CARDNAME this turn if able. +SVar:RemAIDeck:True +SVar:RemRandomDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/tower_above.jpg +SetInfo:SHM|Uncommon|http://magiccards.info/scans/en/shm/131.jpg +Oracle:({2/G} can be paid with any two mana or with {G}. This card's converted mana cost is 6.)\nUntil end of turn, target creature gets +4/+4 and gains trample, wither, and "When this creature attacks, target creature blocks it this turn if able." (It deals damage to creatures in the form of -1/-1 counters.) +End \ No newline at end of file diff --git a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java index 00ddc1ed597..36691dde9cd 100644 --- a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java +++ b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java @@ -2,6 +2,8 @@ package forge.gui.home.variant; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; import java.util.Random; import javax.swing.SwingUtilities; @@ -21,6 +23,8 @@ import forge.game.player.LobbyPlayer; import forge.game.player.PlayerType; import forge.gui.SOverlayUtils; import forge.gui.framework.ICDoc; +import forge.gui.toolbox.FDeckChooser; +import forge.gui.toolbox.FList; import forge.item.CardPrinted; import forge.properties.ForgePreferences; import forge.properties.ForgePreferences.FPref; @@ -51,8 +55,10 @@ public enum CSubmenuVanguard implements ICDoc { @Override public void initialize() { final ForgePreferences prefs = Singletons.getModel().getPreferences(); - view.getDcAi().initialize(); - view.getDcHuman().initialize(); + for(FDeckChooser fdc : view.getDeckChoosers()) + { + fdc.initialize(); + } // Checkbox event handling view.getBtnStart().addActionListener(new ActionListener() { @@ -111,47 +117,47 @@ public enum CSubmenuVanguard implements ICDoc { final SwingWorker worker = new SwingWorker() { @Override public Object doInBackground() { - Deck humanDeck = VSubmenuVanguard.SINGLETON_INSTANCE.getDcHuman().getDeck(); - Deck aiDeck = VSubmenuVanguard.SINGLETON_INSTANCE.getDcAi().getDeck(); - Object selAiAv = VSubmenuVanguard.SINGLETON_INSTANCE.getAvAi().getSelectedValue(); - Object selHumanAv = VSubmenuVanguard.SINGLETON_INSTANCE.getAvHuman().getSelectedValue(); - - Lobby lobby = Singletons.getControl().getLobby(); - LobbyPlayer humanPlayer = lobby.findLocalPlayer(PlayerType.HUMAN); - LobbyPlayer aiPlayer = lobby.findLocalPlayer(PlayerType.COMPUTER); - - MatchStartHelper helper = new MatchStartHelper(); - - final CardPrinted aiVanguard,humanVanguard; - Iterable all = VSubmenuVanguard.SINGLETON_INSTANCE.getAllAvatars(); - Iterable aiAll = VSubmenuVanguard.SINGLETON_INSTANCE.getAllAiAvatars(); - if(selAiAv instanceof String) + List playerDecks = new ArrayList(); + for(FDeckChooser fdc : view.getDeckChoosers()) { - //Random is the only string in the list so grab a random avatar. - Random r = new Random(); - aiVanguard = Iterables.get(aiAll,r.nextInt(Iterables.size(all))); + playerDecks.add(fdc.getDeck()); } - else - { - aiVanguard = (CardPrinted)selAiAv; - } - if(selHumanAv instanceof String) - { - //Random is the only string in the list so grab a random avatar. - Random r = new Random(); - humanVanguard = Iterables.get(all,r.nextInt(Iterables.size(all))); - } - else - { - humanVanguard = (CardPrinted)selHumanAv; - } - helper.addVanguardPlayer(humanPlayer, humanDeck, humanVanguard); - helper.addVanguardPlayer(aiPlayer, aiDeck, aiVanguard); + List playerAvatars = new ArrayList(); + for(FList fl : view.getAvatarLists()) + { + playerAvatars.add(fl.getSelectedValue()); + } + + Lobby lobby = Singletons.getControl().getLobby(); + MatchStartHelper helper = new MatchStartHelper(); + Random rnd = new Random(); + for(int i=0;i { private final JCheckBox cbArtifacts = new FCheckBox("Remove Artifacts"); private final JCheckBox cbRemoveSmall = new FCheckBox("Remove Small Creatures"); - private final FDeckChooser dcHuman = new FDeckChooser("Select your deck:", PlayerType.HUMAN); - private final FDeckChooser dcAi = new FDeckChooser("Select AI deck:", PlayerType.COMPUTER); - - private final FList avHuman = new FList(); - private final FList avAi = new FList(); - private final JScrollPane scrHuman = new JScrollPane(avHuman, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - private final JScrollPane scrAi = new JScrollPane(avAi, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); - private final Predicate avatarTypePred = CardPrinted.Predicates.type("Vanguard"); private final Iterable allAvatars = Iterables.filter(CardDb.instance().getAllCards(), avatarTypePred); private final List allAiAvatars = new ArrayList(); - - private final FLabel lblAvatarHuman = new FLabel.Builder() - .text("Human avatar:") - .fontAlign(SwingConstants.CENTER) - .build(); - private final FLabel lblAvatarAi = new FLabel.Builder() - .text("AI Avatar:") - .fontAlign(SwingConstants.CENTER) - .build(); ////////////////////////////// @@ -103,7 +88,7 @@ public enum VSubmenuVanguard implements IVSubmenu { private final List fieldRadios = new ArrayList(); private final ButtonGroup grpFields = new ButtonGroup(); - private int currentNumTabsShown = 7; + private int currentNumTabsShown = 8; ////////////////////////////// @@ -125,62 +110,28 @@ public enum VSubmenuVanguard implements IVSubmenu { } } - avHuman.setListData(humanListData); - avAi.setListData(aiListData); - avHuman.setSelectedIndex(0); - avAi.setSelectedIndex(0); - //This listener will look for any of the radio buttons being selected //and call the method that shows/hides tabs appropriately. - ChangeListener changeListener = new ChangeListener() { - public void stateChanged(ChangeEvent changEvent) { - FRadioButton aButton = (FRadioButton)changEvent.getSource(); - - System.out.println("radio change fired: " + aButton.getText()); + ItemListener iListener = new ItemListener() { - if(aButton.isSelected()) - { - changeTabs(Integer.parseInt(aButton.getText())); - } - } - }; - - class SelectedListener implements PropertyChangeListener - { - - /* (non-Javadoc) - * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent) - */ @Override - public void propertyChange(PropertyChangeEvent arg0) { + public void itemStateChanged(ItemEvent arg0) { FRadioButton aButton = (FRadioButton)arg0.getSource(); - System.out.println("radio change fired(bean): " + aButton.getText()); - - if(aButton.isSelected()) + if(arg0.getStateChange() == ItemEvent.SELECTED) { changeTabs(Integer.parseInt(aButton.getText())); } } - } + }; //Create all 8 player settings panel - FRadioButton tempRadio; + FRadioButton tempRadio = null; FPanel tempPanel; FDeckChooser tempChooser; FList tempList; - for (int i = 1; i < 7; i++) { - tempRadio = new FRadioButton(); - tempRadio.setText(String.valueOf(i)); - tempRadio.setSelected(true); - fieldRadios.add(tempRadio); - grpFields.add(tempRadio); - tempRadio.addChangeListener(changeListener); - tempRadio.addPropertyChangeListener(new SelectedListener()); - } - //Settings panel FPanel settingsPanel = new FPanel(); FPanel radioPane = new FPanel(); @@ -191,6 +142,8 @@ public enum VSubmenuVanguard implements IVSubmenu { tempRadio.setText(String.valueOf(i)); fieldRadios.add(tempRadio); grpFields.add(tempRadio); + tempRadio.setSelected(true); + tempRadio.addItemListener(iListener); radioPane.add(tempRadio,"wrap"); } settingsPanel.add(radioPane); @@ -236,19 +189,19 @@ public enum VSubmenuVanguard implements IVSubmenu { { if(toShow < currentNumTabsShown) { - for(int i=currentNumTabsShown;i>toShow;i--) + for(int i=currentNumTabsShown;i>toShow+1;i--) { - tabPane.remove(i+1); + tabPane.remove(i); } - currentNumTabsShown = toShow; + currentNumTabsShown = tabPane.getComponentCount()-1; } else { - for(int i=toShow+1;i<=8;i++) + for(int i=currentNumTabsShown;i<=toShow;i++) { - tabPane.add(playerPanels.get(i)); + tabPane.add("Player " + (i+1),playerPanels.get(i)); } - currentNumTabsShown = toShow; + currentNumTabsShown = tabPane.getComponentCount()-1; } } @@ -258,16 +211,7 @@ public enum VSubmenuVanguard implements IVSubmenu { @Override public EMenuGroup getGroupEnum() { return EMenuGroup.VARIANT; - } - - public final FDeckChooser getDcHuman() { - return dcHuman; - } - - public final FDeckChooser getDcAi() { - return dcAi; - } - + } /* (non-Javadoc) * @see forge.gui.home.IVSubmenu#getMenuTitle() @@ -298,22 +242,10 @@ public enum VSubmenuVanguard implements IVSubmenu { for(FDeckChooser fdc : deckChoosers) { fdc.populate(); - } - + } VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(tabPane, "gap 0 0 50px 50px, growx, growy"); - - /* - dcAi.populate(); - dcHuman.populate(); - - VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(dcAi, "w 44%!, gap 0 0 20px 20px, growy, pushy"); - VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(dcHuman, "w 44%!, gap 4% 4% 20px 20px, growy, pushy"); - VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblAvatarAi, "w 44%!, gap 0 0 0px 0px"); - VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblAvatarHuman, "w 44%!, gap 4% 4% 0px 0px"); - VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(scrAi, "w 44%!, gap 0 0 20px 20px, growy, pushy"); - VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(scrHuman, "w 44%!, gap 4% 4% 20px 20px, growy, pushy"); - */ + VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(pnlStart, "span 1, ax center"); VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().revalidate(); @@ -384,19 +316,24 @@ public enum VSubmenuVanguard implements IVSubmenu { public DragCell getParentCell() { return parentCell; } - + /** - * @return the avHuman + * + * @return a deckchooser for every player */ - public FList getAvHuman() { - return avHuman; + public List getDeckChoosers() + { + return deckChoosers; } - - /** - * @return the avAi - */ - public FList getAvAi() { - return avAi; + + public List getAvatarLists() + { + return avatarLists; + } + + public int getNumPlayers() + { + return currentNumTabsShown-1; } /** From 7e1450698a6eff6681f9cc6f278a8d2e25ba8107 Mon Sep 17 00:00:00 2001 From: Hellfish Date: Sat, 24 Nov 2012 14:36:48 +0000 Subject: [PATCH 24/36] *Unblocked missed script folder revisions. From 001aa5aa106dd57671205f58e673788c0472f1e8 Mon Sep 17 00:00:00 2001 From: moomarc Date: Sat, 24 Nov 2012 17:14:20 +0000 Subject: [PATCH 25/36] *Variants - Added setinfo to avatars and uploaded images to cardforge (they should download like any other card now) --- res/cardsfolder/a/arcbound_overseer_avatar.txt | 2 ++ res/cardsfolder/a/ashling_the_pilgrim_avatar.txt | 2 ++ res/cardsfolder/a/ashnod.txt | 2 ++ res/cardsfolder/b/barrin.txt | 2 ++ res/cardsfolder/b/birds_of_paradise_avatar.txt | 2 ++ res/cardsfolder/c/chronatog_avatar.txt | 2 ++ res/cardsfolder/c/crovax.txt | 1 + res/cardsfolder/d/dauntless_escort_avatar.txt | 2 ++ res/cardsfolder/d/diamond_faerie_avatar.txt | 2 ++ res/cardsfolder/e/eladamri.txt | 3 ++- res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt | 2 ++ res/cardsfolder/e/ertai.txt | 2 ++ res/cardsfolder/g/gerrard.txt | 2 ++ res/cardsfolder/g/gix.txt | 2 ++ res/cardsfolder/g/greven_il_vec.txt | 2 ++ res/cardsfolder/g/grinning_demon_avatar.txt | 2 ++ res/cardsfolder/h/hanna.txt | 2 ++ res/cardsfolder/k/karn.txt | 2 ++ res/cardsfolder/l/lyna.txt | 2 ++ res/cardsfolder/m/maraxus.txt | 2 ++ res/cardsfolder/m/mishra.txt | 2 ++ res/cardsfolder/m/multani.txt | 2 ++ res/cardsfolder/o/oracle.txt | 2 ++ res/cardsfolder/o/orim.txt | 2 ++ res/cardsfolder/r/rofellos.txt | 2 ++ res/cardsfolder/s/selenia.txt | 2 ++ res/cardsfolder/s/serra.txt | 2 ++ res/cardsfolder/s/sidar_kondo.txt | 2 ++ res/cardsfolder/s/sisay.txt | 2 ++ res/cardsfolder/s/sliver_queen_brood_mother.txt | 2 ++ res/cardsfolder/s/squee.txt | 4 +++- res/cardsfolder/s/starke.txt | 2 ++ res/cardsfolder/t/tahngarth.txt | 2 ++ res/cardsfolder/t/takara.txt | 2 ++ res/cardsfolder/t/tawnos.txt | 2 ++ res/cardsfolder/t/titania.txt | 2 ++ res/cardsfolder/u/urza.txt | 2 ++ res/cardsfolder/v/volrath.txt | 2 ++ res/cardsfolder/x/xantcha.txt | 2 ++ 39 files changed, 78 insertions(+), 2 deletions(-) diff --git a/res/cardsfolder/a/arcbound_overseer_avatar.txt b/res/cardsfolder/a/arcbound_overseer_avatar.txt index bc90fd46b3a..04fb2ae9c57 100644 --- a/res/cardsfolder/a/arcbound_overseer_avatar.txt +++ b/res/cardsfolder/a/arcbound_overseer_avatar.txt @@ -9,4 +9,6 @@ T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | Execu SVar:ChargeCounter:AB$ PutCounter | Cost$ 0 | CounterType$ CHARGE | CounterNum$ 1 | ValidTgts$ Permanent.YouCtrl | TgtPrompt$ Select target permanent you control SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182296&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/arcbound-overseer.jpg +Oracle:Hand +0, life +3\nAt the beginning of your upkeep, you may put a +1/+1 counter on target creature you control.\nAt the beginning of your upkeep, you may put a charge counter on target permanent you control. End \ No newline at end of file diff --git a/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt b/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt index a7daaf8296c..570f223d8be 100644 --- a/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt +++ b/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt @@ -6,4 +6,6 @@ HandLifeModifier:-1/+6 A:AB$ DamageAll | ActivationZone$ Command | Cost$ 2 | NumDmg$ 1 | ValidCards$ Creature | ValidPlayers$ Each | ValidDescription$ each creature and each player. | SpellDescription$ CARDNAME deals 1 damage to each creature and each player. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182283&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/ashling-the-extinguisher.jpg +Oracle:Hand -1, life +6\n{2}: Ashling the Pilgrim Avatar deals 1 damage to each creature and each player. End \ No newline at end of file diff --git a/res/cardsfolder/a/ashnod.txt b/res/cardsfolder/a/ashnod.txt index 9cbb0c4f046..b91141a738c 100644 --- a/res/cardsfolder/a/ashnod.txt +++ b/res/cardsfolder/a/ashnod.txt @@ -7,4 +7,6 @@ T:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ You | Execute$ TrigDes SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredSource SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12329&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/ashnod.jpg +Oracle:Hand +1, life -8\nWhenever a creature deals damage to you, destroy it. End \ No newline at end of file diff --git a/res/cardsfolder/b/barrin.txt b/res/cardsfolder/b/barrin.txt index 2030580e4bd..18bebe69480 100644 --- a/res/cardsfolder/b/barrin.txt +++ b/res/cardsfolder/b/barrin.txt @@ -6,4 +6,6 @@ HandLifeModifier:+0/+6 A:AB$ ChangeZone | ActivationZone$ Command | Cost$ Sac<1/Permanent> | ValidTgts$ Creature | TgtPrompt$ Select target Creature | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target creature to its owner's hand. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4957&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/barrin.jpg +Oracle:Hand +0, life +6\nSacrifice a permanent: Return target creature to its owner's hand. End \ No newline at end of file diff --git a/res/cardsfolder/b/birds_of_paradise_avatar.txt b/res/cardsfolder/b/birds_of_paradise_avatar.txt index 47cbf054b0f..af6b82740a5 100644 --- a/res/cardsfolder/b/birds_of_paradise_avatar.txt +++ b/res/cardsfolder/b/birds_of_paradise_avatar.txt @@ -7,4 +7,6 @@ S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ SVar:AnyMana:AB$ Mana | Cost$ T | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color to your mana pool. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182291&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/birds-of-paradise.jpg +Oracle:Hand +0, life -3\nLands you control have "{T}: Add one mana of any color to your mana pool." End \ No newline at end of file diff --git a/res/cardsfolder/c/chronatog_avatar.txt b/res/cardsfolder/c/chronatog_avatar.txt index 2f335894cf6..11d6e265566 100644 --- a/res/cardsfolder/c/chronatog_avatar.txt +++ b/res/cardsfolder/c/chronatog_avatar.txt @@ -9,4 +9,6 @@ SVar:DBSkipTurn:DB$ AddTurn | NumTurns$ 1 | Defined$ Opponent SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=201898&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/chronatog.jpg +Oracle:Hand -1, life +1\nYou have no maximum hand size.\n{0}: Draw three cards. You skip your next turn. Activate this ability only once each turn. End \ No newline at end of file diff --git a/res/cardsfolder/c/crovax.txt b/res/cardsfolder/c/crovax.txt index 8bcb5509455..374e714775b 100644 --- a/res/cardsfolder/c/crovax.txt +++ b/res/cardsfolder/c/crovax.txt @@ -7,5 +7,6 @@ T:Mode$ DamageDone | ValidSource$ Creature+YouCtrl | ValidTarget$ Creature,Playe SVar:TrigGainLife:AB$ GainLife | Cost$ 0 | Defined$ You | LifeAmount$ 1 SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4958&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/crovax.jpg Oracle:Hand +2, life +0\nWhenever a creature you control deals damage to a creature or player, you gain 1 life. End \ No newline at end of file diff --git a/res/cardsfolder/d/dauntless_escort_avatar.txt b/res/cardsfolder/d/dauntless_escort_avatar.txt index 8cc8300a6a4..fbef29893e1 100644 --- a/res/cardsfolder/d/dauntless_escort_avatar.txt +++ b/res/cardsfolder/d/dauntless_escort_avatar.txt @@ -6,4 +6,6 @@ HandLifeModifier:+1/+1 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Exalted | Description$ Creatures you control have exalted. (Whenever a creature you control attacks alone, it gets +1/+1 until end of turn for each instance of exalted among permanents you control.) SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=201898&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/dauntless-escort.jpg +Oracle:Hand +1, life +1\nCreatures you control have exalted. (Whenever a creature you control attacks alone, it gets +1/+1 until end of turn for each instance of exalted among permanents you control.) End \ No newline at end of file diff --git a/res/cardsfolder/d/diamond_faerie_avatar.txt b/res/cardsfolder/d/diamond_faerie_avatar.txt index a96f2323fa2..ce9296d8139 100644 --- a/res/cardsfolder/d/diamond_faerie_avatar.txt +++ b/res/cardsfolder/d/diamond_faerie_avatar.txt @@ -6,4 +6,6 @@ HandLifeModifier:+0/+5 A:AB$ Pump | ActivationZone$ Command | Cost$ S | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | NumAtt$ 1 | NumDef$ 1 | SpellDescription$ Target creature you control gets +1/+1 until end of turn. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182274&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/diamond-faerie.jpg +Oracle:Hand +0, life +5\n{S}: Target creature you control gets +1/+1 until end of turn. End \ No newline at end of file diff --git a/res/cardsfolder/e/eladamri.txt b/res/cardsfolder/e/eladamri.txt index 01e02429ebb..e607a86f0ce 100644 --- a/res/cardsfolder/e/eladamri.txt +++ b/res/cardsfolder/e/eladamri.txt @@ -15,6 +15,7 @@ SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destinat SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:Rarity:Special -SVar:Picture:http://www.wizards.com/global/images/magic/general/eladamri.jpg +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12140&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/eladamri.jpg Oracle:Hand -1, life +15\n{0}: The next 1 damage that would be dealt to target creature you control is dealt to you instead. End \ No newline at end of file diff --git a/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt b/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt index ffb044f9d83..fddee52d3e7 100644 --- a/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt +++ b/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt @@ -7,4 +7,6 @@ T:Mode$ Phase | Phase$ Main1 | ValidPlayer$ Player | TriggerZones$ Command | Exe SVar:TrigAddMana:AB$ Mana | Cost$ 0 | Produced$ G | Amount$ 2 | Defined$ TriggeredPlayer SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=195137&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/eladamri-lord-of-leaves.jpg +Oracle:Hand -1, life +2\nAt the beginning of each player's precombat main phase, that player adds {G}{G} to his or her mana pool. End \ No newline at end of file diff --git a/res/cardsfolder/e/ertai.txt b/res/cardsfolder/e/ertai.txt index f883b1d1e44..f53ed36769d 100644 --- a/res/cardsfolder/e/ertai.txt +++ b/res/cardsfolder/e/ertai.txt @@ -5,5 +5,7 @@ Text:no text HandLifeModifier:-1/+4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Hexproof | Description$ Creatures you control have hexproof. (They can't be the targets of spells or abilities your opponents control.) SVar:Rarity:Special +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/ertai.jpg SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4959&type=card +Oracle:Hand -1, life +4\nCreatures you control have hexproof. (They can't be the targets of spells or abilities your opponents control.) End \ No newline at end of file diff --git a/res/cardsfolder/g/gerrard.txt b/res/cardsfolder/g/gerrard.txt index 8e324d0a032..097c462a09d 100644 --- a/res/cardsfolder/g/gerrard.txt +++ b/res/cardsfolder/g/gerrard.txt @@ -7,4 +7,6 @@ T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | TriggerZones$ Command | Execute SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4960&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/gerrard.jpg +Oracle:Hand -4, life +0\nAt the beginning of your draw step, draw an additional card. End \ No newline at end of file diff --git a/res/cardsfolder/g/gix.txt b/res/cardsfolder/g/gix.txt index f4ccb71626b..89c11850dc8 100644 --- a/res/cardsfolder/g/gix.txt +++ b/res/cardsfolder/g/gix.txt @@ -6,4 +6,6 @@ HandLifeModifier:-2/+18 A:AB$ ChangeZone | Cost$ 3 | ActivationZone$ Command | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Select target creature card in your graveyard | ValidTgts$ Creature.YouCtrl | SpellDescription$ Return target creature card from your graveyard to your hand. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12330&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/gix.jpg +Oracle:Hand -2, life +18\n{3}: Return target creature card from your graveyard to your hand. End \ No newline at end of file diff --git a/res/cardsfolder/g/greven_il_vec.txt b/res/cardsfolder/g/greven_il_vec.txt index 78d761c127f..1f9c7050236 100644 --- a/res/cardsfolder/g/greven_il_vec.txt +++ b/res/cardsfolder/g/greven_il_vec.txt @@ -7,4 +7,6 @@ T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Creature | Tri SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredTarget | NoRegen$ True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4961&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/greven-il-vec.jpg +Oracle:Hand -1, life +2\nWhenever a creature you control deals damage to a creature, destroy the other creature. It can't be regenerated. End \ No newline at end of file diff --git a/res/cardsfolder/g/grinning_demon_avatar.txt b/res/cardsfolder/g/grinning_demon_avatar.txt index 43c7933f76b..539b130196b 100644 --- a/res/cardsfolder/g/grinning_demon_avatar.txt +++ b/res/cardsfolder/g/grinning_demon_avatar.txt @@ -7,4 +7,6 @@ T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ SVar:GrinningDiscard:AB$ Discard | Cost$ 0 | ValidTgts$ Opponent | TgtPrompt$ Select an opponent to discard | NumCards$ 1 | Mode$ TgtChoose SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182304&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/grinning-demon.jpg +Oracle:Hand -1, life -2\nWhenever a nontoken creature you control dies, target opponent discards a card. End \ No newline at end of file diff --git a/res/cardsfolder/h/hanna.txt b/res/cardsfolder/h/hanna.txt index 1642868252c..5670ce2f3b0 100644 --- a/res/cardsfolder/h/hanna.txt +++ b/res/cardsfolder/h/hanna.txt @@ -6,4 +6,6 @@ HandLifeModifier:+1/-5 S:Mode$ ReduceCost | EffectZone$ Command | ValidCard$ Card | Type$ Spell | Activator$ You | Amount$ 1 | Description$ Spells you cast cost 1 less to cast. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4962&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/hanna.jpg +Oracle:Hand +1, life -5\nSpells you cast cost {1} less to cast. End \ No newline at end of file diff --git a/res/cardsfolder/k/karn.txt b/res/cardsfolder/k/karn.txt index e99340aba8a..7c8ced3ea3c 100644 --- a/res/cardsfolder/k/karn.txt +++ b/res/cardsfolder/k/karn.txt @@ -7,4 +7,6 @@ S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.nonCreature+YouCtr SVar:AffectedX:Count$CardManaCost SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4963&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/karn.jpg +Oracle:Hand +1, life +6\nEach noncreature artifact you control is an artifact creature with power and toughness each equal to its converted mana cost. End \ No newline at end of file diff --git a/res/cardsfolder/l/lyna.txt b/res/cardsfolder/l/lyna.txt index fc05a676ade..e77aa8dca19 100644 --- a/res/cardsfolder/l/lyna.txt +++ b/res/cardsfolder/l/lyna.txt @@ -6,4 +6,6 @@ HandLifeModifier:+2/-4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Shadow | Description$ Creatures you control have shadow. (They can block and be blocked only by creatures with shadow.) SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12142&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/lyna.jpg +Oracle:Hand +2, life -4\nCreatures you control have shadow. (They can block and be blocked only by creatures with shadow.) End \ No newline at end of file diff --git a/res/cardsfolder/m/maraxus.txt b/res/cardsfolder/m/maraxus.txt index fa32ff5424b..70f4c11aca2 100644 --- a/res/cardsfolder/m/maraxus.txt +++ b/res/cardsfolder/m/maraxus.txt @@ -6,4 +6,6 @@ HandLifeModifier:+1/+2 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddPower$ 1 | Description$ Creatures you control get +1/+0. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4964&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/maraxus.jpg +Oracle:Hand +1, life +2\nCreatures you control get +1/+0. End \ No newline at end of file diff --git a/res/cardsfolder/m/mishra.txt b/res/cardsfolder/m/mishra.txt index 0d8b9eadba9..211e7955433 100644 --- a/res/cardsfolder/m/mishra.txt +++ b/res/cardsfolder/m/mishra.txt @@ -10,4 +10,6 @@ SVar:DmgTimes2Combat:AB$ DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Re SVar:X:ReplaceCount$DamageAmount/Twice SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12327 +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/mishra.jpg +Oracle:Hand +0, life -3\nIf a creature you control would deal damage, it deals double that damage instead. End \ No newline at end of file diff --git a/res/cardsfolder/m/multani.txt b/res/cardsfolder/m/multani.txt index 651b14e4cf1..01eda85695e 100644 --- a/res/cardsfolder/m/multani.txt +++ b/res/cardsfolder/m/multani.txt @@ -7,4 +7,6 @@ S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddPower SVar:X:Count$CardsInYourHand SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12146&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/multani.jpg +Oracle:Hand -3, life -2\nCreatures you control get +X/+0, where X is the number of cards in your hand. End \ No newline at end of file diff --git a/res/cardsfolder/o/oracle.txt b/res/cardsfolder/o/oracle.txt index c7354ab2514..26bc3ebcddb 100644 --- a/res/cardsfolder/o/oracle.txt +++ b/res/cardsfolder/o/oracle.txt @@ -8,4 +8,6 @@ SVar:Reconsider:DB$ RemoveFromCombat | Defined$ Targeted SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12141&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/oracle.jpg +Oracle:Hand +1, life +9\n{0}: Untap target attacking creature you control and remove it from combat. End \ No newline at end of file diff --git a/res/cardsfolder/o/orim.txt b/res/cardsfolder/o/orim.txt index 37843ca7324..30bf9fcfd32 100644 --- a/res/cardsfolder/o/orim.txt +++ b/res/cardsfolder/o/orim.txt @@ -6,4 +6,6 @@ HandLifeModifier:+0/+12 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Reach | Description$ Creatures you control have reach. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4966&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/orim.jpg +Oracle:Hand +0, life +12\nCreatures you control have reach. End \ No newline at end of file diff --git a/res/cardsfolder/r/rofellos.txt b/res/cardsfolder/r/rofellos.txt index 43da9f2b07f..491e4b3e6e1 100644 --- a/res/cardsfolder/r/rofellos.txt +++ b/res/cardsfolder/r/rofellos.txt @@ -7,4 +7,6 @@ T:Mode$ ChangesZone | TriggerZones$ Command | Origin$ Battlefield | Destination$ SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12145 +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/rofellos.jpg +Oracle:Hand -2, life +4\nWhenever a creature you control dies, draw a card. End \ No newline at end of file diff --git a/res/cardsfolder/s/selenia.txt b/res/cardsfolder/s/selenia.txt index b3f74c7ac26..66904b4fb4c 100644 --- a/res/cardsfolder/s/selenia.txt +++ b/res/cardsfolder/s/selenia.txt @@ -6,4 +6,6 @@ HandLifeModifier:+1/+7 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Vigilance | Description$ Creatures you control have vigilance. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4967&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/selenia.jpg +Oracle:Hand +1, life +7\nCreatures you control have vigilance. End \ No newline at end of file diff --git a/res/cardsfolder/s/serra.txt b/res/cardsfolder/s/serra.txt index 09a59398d3b..f4dbf7011d1 100644 --- a/res/cardsfolder/s/serra.txt +++ b/res/cardsfolder/s/serra.txt @@ -6,4 +6,6 @@ HandLifeModifier:+1/+1 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddToughness$ 2 | Description$ Creatures you control get +0/+2. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12332&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/serra.jpg +Oracle:Hand +1, life +1\nCreatures you control get +0/+2. End \ No newline at end of file diff --git a/res/cardsfolder/s/sidar_kondo.txt b/res/cardsfolder/s/sidar_kondo.txt index f32d72756b4..9908d24e12a 100644 --- a/res/cardsfolder/s/sidar_kondo.txt +++ b/res/cardsfolder/s/sidar_kondo.txt @@ -6,4 +6,6 @@ HandLifeModifier:-1/+12 A:AB$ Pump | ActivationZone$ Command | Cost$ 3 | Tgt$ TgtC | NumAtt$ 3 | NumDef$ 3 | SpellDescription$ Target creature gets +3/+3 until end of turn. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12147&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sidar-kondo.jpg +Oracle:Hand -1, life +12\n{3}: Target creature gets +3/+3 until end of turn. End \ No newline at end of file diff --git a/res/cardsfolder/s/sisay.txt b/res/cardsfolder/s/sisay.txt index bec7d17fe4e..85dfb9f9493 100644 --- a/res/cardsfolder/s/sisay.txt +++ b/res/cardsfolder/s/sisay.txt @@ -7,4 +7,6 @@ T:Mode$ TapsForMana | TriggerZones$ Command | ValidCard$ Land.YouCtrl | Execute$ SVar:TrigMana:AB$ ManaReflected | Cost$ 0 | ColorOrType$ Type | Valid$ Defined.Triggered | ReflectProperty$ Produced | Defined$ TriggeredPlayer SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4968&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sisay.jpg +Oracle:Hand -2, life -3\nWhenever you tap a land for mana, add one mana to your mana pool of any type that land produced. End \ No newline at end of file diff --git a/res/cardsfolder/s/sliver_queen_brood_mother.txt b/res/cardsfolder/s/sliver_queen_brood_mother.txt index a8371fdc7be..cfa48deca1b 100644 --- a/res/cardsfolder/s/sliver_queen_brood_mother.txt +++ b/res/cardsfolder/s/sliver_queen_brood_mother.txt @@ -6,4 +6,6 @@ HandLifeModifier:+0/+8 A:AB$ Token | ActivationZone$ Command | Cost$ 3 | TokenAmount$ 1 | TokenName$ Sliver | TokenTypes$ Creature,Sliver | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put a 1/1 colorless Sliver creature token onto the battlefield. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12143&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sliver-queen-brood-mother.jpg +Oracle:Hand +0, life +8\n{3}: Put a 1/1 colorless Sliver creature token onto the battlefield. End \ No newline at end of file diff --git a/res/cardsfolder/s/squee.txt b/res/cardsfolder/s/squee.txt index 89601e6d890..d959266ac52 100644 --- a/res/cardsfolder/s/squee.txt +++ b/res/cardsfolder/s/squee.txt @@ -6,5 +6,7 @@ HandLifeModifier:+3/-4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Opponent | AddKeyword$ Play with your hand revealed. | Description$ Your opponents play with their hands revealed. SVar:RemAIDeck:True SVar:Rarity:Special -SVar:Picture:http://www.wizards.com/global/images/magic/general/squee.jpg +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4969&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/squee.jpg +Oracle:Hand +3, life -4\nYour opponents play with their hands revealed. End \ No newline at end of file diff --git a/res/cardsfolder/s/starke.txt b/res/cardsfolder/s/starke.txt index bde0d3c127c..5ed664b2a13 100644 --- a/res/cardsfolder/s/starke.txt +++ b/res/cardsfolder/s/starke.txt @@ -8,4 +8,6 @@ SVar:SituationalEthics:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You | SubAbil SVar:Switch:DB$ ChangeZone | Origin$ Hand | Destination$ Library | LibraryPosition$ -1 | ChangeNum$ 1 | Mandatory$ True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=4970 +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/starke.jpg +Oracle:Hand +0, life -2\nAt the beginning of your draw step, you may draw an additional card. If you do, put a card from your hand on the bottom of your library. End \ No newline at end of file diff --git a/res/cardsfolder/t/tahngarth.txt b/res/cardsfolder/t/tahngarth.txt index b8e2e7d8c6f..f57f797495f 100644 --- a/res/cardsfolder/t/tahngarth.txt +++ b/res/cardsfolder/t/tahngarth.txt @@ -6,4 +6,6 @@ HandLifeModifier:-1/+7 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Haste | Description$ Creatures you control have haste. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4971&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/tahngarth.jpg +Oracle:Hand -1, life +7\nCreatures you control have haste. End \ No newline at end of file diff --git a/res/cardsfolder/t/takara.txt b/res/cardsfolder/t/takara.txt index f526ab576a3..fa180278809 100644 --- a/res/cardsfolder/t/takara.txt +++ b/res/cardsfolder/t/takara.txt @@ -7,4 +7,6 @@ A:AB$ DealDamage | ActivationZone$ Command | Cost$ Sac<1/Creature> | Tgt$ TgtCP SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12144&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/takara.jpg +Oracle:Hand +3, life -8\nSacrifice a creature: Takara deals 1 damage to target creature or player. End \ No newline at end of file diff --git a/res/cardsfolder/t/tawnos.txt b/res/cardsfolder/t/tawnos.txt index 82c5d5a200c..ce84d33dde2 100644 --- a/res/cardsfolder/t/tawnos.txt +++ b/res/cardsfolder/t/tawnos.txt @@ -6,4 +6,6 @@ HandLifeModifier:+3/-4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.YouCtrl,Creature.YouCtrl,Enchantment.YouCtrl | AddHiddenKeyword$ HIDDEN Flash | AffectedZone$ Exile,Graveyard,Hand,Library | Description$ You may cast artifact, creature, and enchantment spells as though they had flash. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12328&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/tawnos.jpg +Oracle:Hand +3, life -4\nYou may cast artifact, creature, and enchantment spells as though they had flash. End \ No newline at end of file diff --git a/res/cardsfolder/t/titania.txt b/res/cardsfolder/t/titania.txt index 49e9f98bb00..2741abae3f1 100644 --- a/res/cardsfolder/t/titania.txt +++ b/res/cardsfolder/t/titania.txt @@ -6,4 +6,6 @@ HandLifeModifier:+2/-5 S:Mode$ Continuous | EffectZone$ Command | Affected$ You | AddKeyword$ AdjustLandPlays:1 | Description$ You may play an additional land on each of your turns. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12333&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/titania.jpg +Oracle:Hand +2, life -5\nYou may play an additional land on each of your turns. End \ No newline at end of file diff --git a/res/cardsfolder/u/urza.txt b/res/cardsfolder/u/urza.txt index f9aed08557e..04ec32d3db1 100644 --- a/res/cardsfolder/u/urza.txt +++ b/res/cardsfolder/u/urza.txt @@ -6,4 +6,6 @@ HandLifeModifier:-1/+10 A:AB$ DealDamage | ActivationZone$ Command | Cost$ 3 | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12326&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/urza.jpg +Oracle:Hand -1, life +10\n{3}: Urza deals 1 damage to target creature or player. End \ No newline at end of file diff --git a/res/cardsfolder/v/volrath.txt b/res/cardsfolder/v/volrath.txt index 3a4f6b96b16..c04aaca2079 100644 --- a/res/cardsfolder/v/volrath.txt +++ b/res/cardsfolder/v/volrath.txt @@ -7,4 +7,6 @@ T:Mode$ ChangesZone | TriggerZones$ Command | Origin$ Battlefield | Destination$ SVar:GetUp:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Library SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4972&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/volrath.jpg +Oracle:Hand +2, life -3\nWhenever a creature you control is put into your graveyard from the battlefield, you may put it on top of your library. End \ No newline at end of file diff --git a/res/cardsfolder/x/xantcha.txt b/res/cardsfolder/x/xantcha.txt index a5ead968fca..db8f21dddfc 100644 --- a/res/cardsfolder/x/xantcha.txt +++ b/res/cardsfolder/x/xantcha.txt @@ -7,4 +7,6 @@ A:AB$ Regenerate | ActivationZone$ Command | Cost$ Sac<1/Permanent> | ValidTgts$ SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12331&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/xantcha.jpg +Oracle:Hand +1, life +3\nSacrifice a permanent: Regenerate target creature. End \ No newline at end of file From a593d7ebd96bb48b2c8b61297c3244a09d39a5fe Mon Sep 17 00:00:00 2001 From: moomarc Date: Sat, 24 Nov 2012 18:00:28 +0000 Subject: [PATCH 26/36] *Variants - Reverted setinfo to avatars (caused crash on set image downloads) --- res/cardsfolder/a/arcbound_overseer_avatar.txt | 2 -- res/cardsfolder/a/ashling_the_pilgrim_avatar.txt | 2 -- res/cardsfolder/a/ashnod.txt | 2 -- res/cardsfolder/b/barrin.txt | 2 -- res/cardsfolder/b/birds_of_paradise_avatar.txt | 2 -- res/cardsfolder/c/chronatog_avatar.txt | 2 -- res/cardsfolder/c/crovax.txt | 1 - res/cardsfolder/d/dauntless_escort_avatar.txt | 2 -- res/cardsfolder/d/diamond_faerie_avatar.txt | 2 -- res/cardsfolder/e/eladamri.txt | 3 +-- res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt | 2 -- res/cardsfolder/e/ertai.txt | 2 -- res/cardsfolder/g/gerrard.txt | 2 -- res/cardsfolder/g/gix.txt | 2 -- res/cardsfolder/g/greven_il_vec.txt | 2 -- res/cardsfolder/g/grinning_demon_avatar.txt | 2 -- res/cardsfolder/h/hanna.txt | 2 -- res/cardsfolder/k/karn.txt | 2 -- res/cardsfolder/l/lyna.txt | 2 -- res/cardsfolder/m/maraxus.txt | 2 -- res/cardsfolder/m/mishra.txt | 2 -- res/cardsfolder/m/multani.txt | 2 -- res/cardsfolder/o/oracle.txt | 2 -- res/cardsfolder/o/orim.txt | 2 -- res/cardsfolder/r/rofellos.txt | 2 -- res/cardsfolder/s/selenia.txt | 2 -- res/cardsfolder/s/serra.txt | 2 -- res/cardsfolder/s/sidar_kondo.txt | 2 -- res/cardsfolder/s/sisay.txt | 2 -- res/cardsfolder/s/sliver_queen_brood_mother.txt | 2 -- res/cardsfolder/s/squee.txt | 4 +--- res/cardsfolder/s/starke.txt | 2 -- res/cardsfolder/t/tahngarth.txt | 2 -- res/cardsfolder/t/takara.txt | 2 -- res/cardsfolder/t/tawnos.txt | 2 -- res/cardsfolder/t/titania.txt | 2 -- res/cardsfolder/u/urza.txt | 2 -- res/cardsfolder/v/volrath.txt | 2 -- res/cardsfolder/x/xantcha.txt | 2 -- 39 files changed, 2 insertions(+), 78 deletions(-) diff --git a/res/cardsfolder/a/arcbound_overseer_avatar.txt b/res/cardsfolder/a/arcbound_overseer_avatar.txt index 04fb2ae9c57..bc90fd46b3a 100644 --- a/res/cardsfolder/a/arcbound_overseer_avatar.txt +++ b/res/cardsfolder/a/arcbound_overseer_avatar.txt @@ -9,6 +9,4 @@ T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | Execu SVar:ChargeCounter:AB$ PutCounter | Cost$ 0 | CounterType$ CHARGE | CounterNum$ 1 | ValidTgts$ Permanent.YouCtrl | TgtPrompt$ Select target permanent you control SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182296&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/arcbound-overseer.jpg -Oracle:Hand +0, life +3\nAt the beginning of your upkeep, you may put a +1/+1 counter on target creature you control.\nAt the beginning of your upkeep, you may put a charge counter on target permanent you control. End \ No newline at end of file diff --git a/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt b/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt index 570f223d8be..a7daaf8296c 100644 --- a/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt +++ b/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt @@ -6,6 +6,4 @@ HandLifeModifier:-1/+6 A:AB$ DamageAll | ActivationZone$ Command | Cost$ 2 | NumDmg$ 1 | ValidCards$ Creature | ValidPlayers$ Each | ValidDescription$ each creature and each player. | SpellDescription$ CARDNAME deals 1 damage to each creature and each player. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182283&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/ashling-the-extinguisher.jpg -Oracle:Hand -1, life +6\n{2}: Ashling the Pilgrim Avatar deals 1 damage to each creature and each player. End \ No newline at end of file diff --git a/res/cardsfolder/a/ashnod.txt b/res/cardsfolder/a/ashnod.txt index b91141a738c..9cbb0c4f046 100644 --- a/res/cardsfolder/a/ashnod.txt +++ b/res/cardsfolder/a/ashnod.txt @@ -7,6 +7,4 @@ T:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ You | Execute$ TrigDes SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredSource SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12329&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/ashnod.jpg -Oracle:Hand +1, life -8\nWhenever a creature deals damage to you, destroy it. End \ No newline at end of file diff --git a/res/cardsfolder/b/barrin.txt b/res/cardsfolder/b/barrin.txt index 18bebe69480..2030580e4bd 100644 --- a/res/cardsfolder/b/barrin.txt +++ b/res/cardsfolder/b/barrin.txt @@ -6,6 +6,4 @@ HandLifeModifier:+0/+6 A:AB$ ChangeZone | ActivationZone$ Command | Cost$ Sac<1/Permanent> | ValidTgts$ Creature | TgtPrompt$ Select target Creature | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target creature to its owner's hand. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4957&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/barrin.jpg -Oracle:Hand +0, life +6\nSacrifice a permanent: Return target creature to its owner's hand. End \ No newline at end of file diff --git a/res/cardsfolder/b/birds_of_paradise_avatar.txt b/res/cardsfolder/b/birds_of_paradise_avatar.txt index af6b82740a5..47cbf054b0f 100644 --- a/res/cardsfolder/b/birds_of_paradise_avatar.txt +++ b/res/cardsfolder/b/birds_of_paradise_avatar.txt @@ -7,6 +7,4 @@ S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ SVar:AnyMana:AB$ Mana | Cost$ T | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color to your mana pool. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182291&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/birds-of-paradise.jpg -Oracle:Hand +0, life -3\nLands you control have "{T}: Add one mana of any color to your mana pool." End \ No newline at end of file diff --git a/res/cardsfolder/c/chronatog_avatar.txt b/res/cardsfolder/c/chronatog_avatar.txt index 11d6e265566..2f335894cf6 100644 --- a/res/cardsfolder/c/chronatog_avatar.txt +++ b/res/cardsfolder/c/chronatog_avatar.txt @@ -9,6 +9,4 @@ SVar:DBSkipTurn:DB$ AddTurn | NumTurns$ 1 | Defined$ Opponent SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=201898&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/chronatog.jpg -Oracle:Hand -1, life +1\nYou have no maximum hand size.\n{0}: Draw three cards. You skip your next turn. Activate this ability only once each turn. End \ No newline at end of file diff --git a/res/cardsfolder/c/crovax.txt b/res/cardsfolder/c/crovax.txt index 374e714775b..8bcb5509455 100644 --- a/res/cardsfolder/c/crovax.txt +++ b/res/cardsfolder/c/crovax.txt @@ -7,6 +7,5 @@ T:Mode$ DamageDone | ValidSource$ Creature+YouCtrl | ValidTarget$ Creature,Playe SVar:TrigGainLife:AB$ GainLife | Cost$ 0 | Defined$ You | LifeAmount$ 1 SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4958&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/crovax.jpg Oracle:Hand +2, life +0\nWhenever a creature you control deals damage to a creature or player, you gain 1 life. End \ No newline at end of file diff --git a/res/cardsfolder/d/dauntless_escort_avatar.txt b/res/cardsfolder/d/dauntless_escort_avatar.txt index fbef29893e1..8cc8300a6a4 100644 --- a/res/cardsfolder/d/dauntless_escort_avatar.txt +++ b/res/cardsfolder/d/dauntless_escort_avatar.txt @@ -6,6 +6,4 @@ HandLifeModifier:+1/+1 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Exalted | Description$ Creatures you control have exalted. (Whenever a creature you control attacks alone, it gets +1/+1 until end of turn for each instance of exalted among permanents you control.) SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=201898&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/dauntless-escort.jpg -Oracle:Hand +1, life +1\nCreatures you control have exalted. (Whenever a creature you control attacks alone, it gets +1/+1 until end of turn for each instance of exalted among permanents you control.) End \ No newline at end of file diff --git a/res/cardsfolder/d/diamond_faerie_avatar.txt b/res/cardsfolder/d/diamond_faerie_avatar.txt index ce9296d8139..a96f2323fa2 100644 --- a/res/cardsfolder/d/diamond_faerie_avatar.txt +++ b/res/cardsfolder/d/diamond_faerie_avatar.txt @@ -6,6 +6,4 @@ HandLifeModifier:+0/+5 A:AB$ Pump | ActivationZone$ Command | Cost$ S | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | NumAtt$ 1 | NumDef$ 1 | SpellDescription$ Target creature you control gets +1/+1 until end of turn. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182274&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/diamond-faerie.jpg -Oracle:Hand +0, life +5\n{S}: Target creature you control gets +1/+1 until end of turn. End \ No newline at end of file diff --git a/res/cardsfolder/e/eladamri.txt b/res/cardsfolder/e/eladamri.txt index e607a86f0ce..01e02429ebb 100644 --- a/res/cardsfolder/e/eladamri.txt +++ b/res/cardsfolder/e/eladamri.txt @@ -15,7 +15,6 @@ SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destinat SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:Rarity:Special -SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12140&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/eladamri.jpg +SVar:Picture:http://www.wizards.com/global/images/magic/general/eladamri.jpg Oracle:Hand -1, life +15\n{0}: The next 1 damage that would be dealt to target creature you control is dealt to you instead. End \ No newline at end of file diff --git a/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt b/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt index fddee52d3e7..ffb044f9d83 100644 --- a/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt +++ b/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt @@ -7,6 +7,4 @@ T:Mode$ Phase | Phase$ Main1 | ValidPlayer$ Player | TriggerZones$ Command | Exe SVar:TrigAddMana:AB$ Mana | Cost$ 0 | Produced$ G | Amount$ 2 | Defined$ TriggeredPlayer SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=195137&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/eladamri-lord-of-leaves.jpg -Oracle:Hand -1, life +2\nAt the beginning of each player's precombat main phase, that player adds {G}{G} to his or her mana pool. End \ No newline at end of file diff --git a/res/cardsfolder/e/ertai.txt b/res/cardsfolder/e/ertai.txt index f53ed36769d..f883b1d1e44 100644 --- a/res/cardsfolder/e/ertai.txt +++ b/res/cardsfolder/e/ertai.txt @@ -5,7 +5,5 @@ Text:no text HandLifeModifier:-1/+4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Hexproof | Description$ Creatures you control have hexproof. (They can't be the targets of spells or abilities your opponents control.) SVar:Rarity:Special -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/ertai.jpg SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4959&type=card -Oracle:Hand -1, life +4\nCreatures you control have hexproof. (They can't be the targets of spells or abilities your opponents control.) End \ No newline at end of file diff --git a/res/cardsfolder/g/gerrard.txt b/res/cardsfolder/g/gerrard.txt index 097c462a09d..8e324d0a032 100644 --- a/res/cardsfolder/g/gerrard.txt +++ b/res/cardsfolder/g/gerrard.txt @@ -7,6 +7,4 @@ T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | TriggerZones$ Command | Execute SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4960&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/gerrard.jpg -Oracle:Hand -4, life +0\nAt the beginning of your draw step, draw an additional card. End \ No newline at end of file diff --git a/res/cardsfolder/g/gix.txt b/res/cardsfolder/g/gix.txt index 89c11850dc8..f4ccb71626b 100644 --- a/res/cardsfolder/g/gix.txt +++ b/res/cardsfolder/g/gix.txt @@ -6,6 +6,4 @@ HandLifeModifier:-2/+18 A:AB$ ChangeZone | Cost$ 3 | ActivationZone$ Command | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Select target creature card in your graveyard | ValidTgts$ Creature.YouCtrl | SpellDescription$ Return target creature card from your graveyard to your hand. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12330&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/gix.jpg -Oracle:Hand -2, life +18\n{3}: Return target creature card from your graveyard to your hand. End \ No newline at end of file diff --git a/res/cardsfolder/g/greven_il_vec.txt b/res/cardsfolder/g/greven_il_vec.txt index 1f9c7050236..78d761c127f 100644 --- a/res/cardsfolder/g/greven_il_vec.txt +++ b/res/cardsfolder/g/greven_il_vec.txt @@ -7,6 +7,4 @@ T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Creature | Tri SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredTarget | NoRegen$ True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4961&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/greven-il-vec.jpg -Oracle:Hand -1, life +2\nWhenever a creature you control deals damage to a creature, destroy the other creature. It can't be regenerated. End \ No newline at end of file diff --git a/res/cardsfolder/g/grinning_demon_avatar.txt b/res/cardsfolder/g/grinning_demon_avatar.txt index 539b130196b..43c7933f76b 100644 --- a/res/cardsfolder/g/grinning_demon_avatar.txt +++ b/res/cardsfolder/g/grinning_demon_avatar.txt @@ -7,6 +7,4 @@ T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ SVar:GrinningDiscard:AB$ Discard | Cost$ 0 | ValidTgts$ Opponent | TgtPrompt$ Select an opponent to discard | NumCards$ 1 | Mode$ TgtChoose SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182304&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/grinning-demon.jpg -Oracle:Hand -1, life -2\nWhenever a nontoken creature you control dies, target opponent discards a card. End \ No newline at end of file diff --git a/res/cardsfolder/h/hanna.txt b/res/cardsfolder/h/hanna.txt index 5670ce2f3b0..1642868252c 100644 --- a/res/cardsfolder/h/hanna.txt +++ b/res/cardsfolder/h/hanna.txt @@ -6,6 +6,4 @@ HandLifeModifier:+1/-5 S:Mode$ ReduceCost | EffectZone$ Command | ValidCard$ Card | Type$ Spell | Activator$ You | Amount$ 1 | Description$ Spells you cast cost 1 less to cast. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4962&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/hanna.jpg -Oracle:Hand +1, life -5\nSpells you cast cost {1} less to cast. End \ No newline at end of file diff --git a/res/cardsfolder/k/karn.txt b/res/cardsfolder/k/karn.txt index 7c8ced3ea3c..e99340aba8a 100644 --- a/res/cardsfolder/k/karn.txt +++ b/res/cardsfolder/k/karn.txt @@ -7,6 +7,4 @@ S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.nonCreature+YouCtr SVar:AffectedX:Count$CardManaCost SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4963&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/karn.jpg -Oracle:Hand +1, life +6\nEach noncreature artifact you control is an artifact creature with power and toughness each equal to its converted mana cost. End \ No newline at end of file diff --git a/res/cardsfolder/l/lyna.txt b/res/cardsfolder/l/lyna.txt index e77aa8dca19..fc05a676ade 100644 --- a/res/cardsfolder/l/lyna.txt +++ b/res/cardsfolder/l/lyna.txt @@ -6,6 +6,4 @@ HandLifeModifier:+2/-4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Shadow | Description$ Creatures you control have shadow. (They can block and be blocked only by creatures with shadow.) SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12142&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/lyna.jpg -Oracle:Hand +2, life -4\nCreatures you control have shadow. (They can block and be blocked only by creatures with shadow.) End \ No newline at end of file diff --git a/res/cardsfolder/m/maraxus.txt b/res/cardsfolder/m/maraxus.txt index 70f4c11aca2..fa32ff5424b 100644 --- a/res/cardsfolder/m/maraxus.txt +++ b/res/cardsfolder/m/maraxus.txt @@ -6,6 +6,4 @@ HandLifeModifier:+1/+2 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddPower$ 1 | Description$ Creatures you control get +1/+0. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4964&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/maraxus.jpg -Oracle:Hand +1, life +2\nCreatures you control get +1/+0. End \ No newline at end of file diff --git a/res/cardsfolder/m/mishra.txt b/res/cardsfolder/m/mishra.txt index 211e7955433..0d8b9eadba9 100644 --- a/res/cardsfolder/m/mishra.txt +++ b/res/cardsfolder/m/mishra.txt @@ -10,6 +10,4 @@ SVar:DmgTimes2Combat:AB$ DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Re SVar:X:ReplaceCount$DamageAmount/Twice SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12327 -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/mishra.jpg -Oracle:Hand +0, life -3\nIf a creature you control would deal damage, it deals double that damage instead. End \ No newline at end of file diff --git a/res/cardsfolder/m/multani.txt b/res/cardsfolder/m/multani.txt index 01eda85695e..651b14e4cf1 100644 --- a/res/cardsfolder/m/multani.txt +++ b/res/cardsfolder/m/multani.txt @@ -7,6 +7,4 @@ S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddPower SVar:X:Count$CardsInYourHand SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12146&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/multani.jpg -Oracle:Hand -3, life -2\nCreatures you control get +X/+0, where X is the number of cards in your hand. End \ No newline at end of file diff --git a/res/cardsfolder/o/oracle.txt b/res/cardsfolder/o/oracle.txt index 26bc3ebcddb..c7354ab2514 100644 --- a/res/cardsfolder/o/oracle.txt +++ b/res/cardsfolder/o/oracle.txt @@ -8,6 +8,4 @@ SVar:Reconsider:DB$ RemoveFromCombat | Defined$ Targeted SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12141&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/oracle.jpg -Oracle:Hand +1, life +9\n{0}: Untap target attacking creature you control and remove it from combat. End \ No newline at end of file diff --git a/res/cardsfolder/o/orim.txt b/res/cardsfolder/o/orim.txt index 30bf9fcfd32..37843ca7324 100644 --- a/res/cardsfolder/o/orim.txt +++ b/res/cardsfolder/o/orim.txt @@ -6,6 +6,4 @@ HandLifeModifier:+0/+12 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Reach | Description$ Creatures you control have reach. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4966&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/orim.jpg -Oracle:Hand +0, life +12\nCreatures you control have reach. End \ No newline at end of file diff --git a/res/cardsfolder/r/rofellos.txt b/res/cardsfolder/r/rofellos.txt index 491e4b3e6e1..43da9f2b07f 100644 --- a/res/cardsfolder/r/rofellos.txt +++ b/res/cardsfolder/r/rofellos.txt @@ -7,6 +7,4 @@ T:Mode$ ChangesZone | TriggerZones$ Command | Origin$ Battlefield | Destination$ SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12145 -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/rofellos.jpg -Oracle:Hand -2, life +4\nWhenever a creature you control dies, draw a card. End \ No newline at end of file diff --git a/res/cardsfolder/s/selenia.txt b/res/cardsfolder/s/selenia.txt index 66904b4fb4c..b3f74c7ac26 100644 --- a/res/cardsfolder/s/selenia.txt +++ b/res/cardsfolder/s/selenia.txt @@ -6,6 +6,4 @@ HandLifeModifier:+1/+7 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Vigilance | Description$ Creatures you control have vigilance. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4967&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/selenia.jpg -Oracle:Hand +1, life +7\nCreatures you control have vigilance. End \ No newline at end of file diff --git a/res/cardsfolder/s/serra.txt b/res/cardsfolder/s/serra.txt index f4dbf7011d1..09a59398d3b 100644 --- a/res/cardsfolder/s/serra.txt +++ b/res/cardsfolder/s/serra.txt @@ -6,6 +6,4 @@ HandLifeModifier:+1/+1 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddToughness$ 2 | Description$ Creatures you control get +0/+2. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12332&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/serra.jpg -Oracle:Hand +1, life +1\nCreatures you control get +0/+2. End \ No newline at end of file diff --git a/res/cardsfolder/s/sidar_kondo.txt b/res/cardsfolder/s/sidar_kondo.txt index 9908d24e12a..f32d72756b4 100644 --- a/res/cardsfolder/s/sidar_kondo.txt +++ b/res/cardsfolder/s/sidar_kondo.txt @@ -6,6 +6,4 @@ HandLifeModifier:-1/+12 A:AB$ Pump | ActivationZone$ Command | Cost$ 3 | Tgt$ TgtC | NumAtt$ 3 | NumDef$ 3 | SpellDescription$ Target creature gets +3/+3 until end of turn. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12147&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sidar-kondo.jpg -Oracle:Hand -1, life +12\n{3}: Target creature gets +3/+3 until end of turn. End \ No newline at end of file diff --git a/res/cardsfolder/s/sisay.txt b/res/cardsfolder/s/sisay.txt index 85dfb9f9493..bec7d17fe4e 100644 --- a/res/cardsfolder/s/sisay.txt +++ b/res/cardsfolder/s/sisay.txt @@ -7,6 +7,4 @@ T:Mode$ TapsForMana | TriggerZones$ Command | ValidCard$ Land.YouCtrl | Execute$ SVar:TrigMana:AB$ ManaReflected | Cost$ 0 | ColorOrType$ Type | Valid$ Defined.Triggered | ReflectProperty$ Produced | Defined$ TriggeredPlayer SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4968&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sisay.jpg -Oracle:Hand -2, life -3\nWhenever you tap a land for mana, add one mana to your mana pool of any type that land produced. End \ No newline at end of file diff --git a/res/cardsfolder/s/sliver_queen_brood_mother.txt b/res/cardsfolder/s/sliver_queen_brood_mother.txt index cfa48deca1b..a8371fdc7be 100644 --- a/res/cardsfolder/s/sliver_queen_brood_mother.txt +++ b/res/cardsfolder/s/sliver_queen_brood_mother.txt @@ -6,6 +6,4 @@ HandLifeModifier:+0/+8 A:AB$ Token | ActivationZone$ Command | Cost$ 3 | TokenAmount$ 1 | TokenName$ Sliver | TokenTypes$ Creature,Sliver | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put a 1/1 colorless Sliver creature token onto the battlefield. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12143&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sliver-queen-brood-mother.jpg -Oracle:Hand +0, life +8\n{3}: Put a 1/1 colorless Sliver creature token onto the battlefield. End \ No newline at end of file diff --git a/res/cardsfolder/s/squee.txt b/res/cardsfolder/s/squee.txt index d959266ac52..89601e6d890 100644 --- a/res/cardsfolder/s/squee.txt +++ b/res/cardsfolder/s/squee.txt @@ -6,7 +6,5 @@ HandLifeModifier:+3/-4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Opponent | AddKeyword$ Play with your hand revealed. | Description$ Your opponents play with their hands revealed. SVar:RemAIDeck:True SVar:Rarity:Special -SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4969&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/squee.jpg -Oracle:Hand +3, life -4\nYour opponents play with their hands revealed. +SVar:Picture:http://www.wizards.com/global/images/magic/general/squee.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/starke.txt b/res/cardsfolder/s/starke.txt index 5ed664b2a13..bde0d3c127c 100644 --- a/res/cardsfolder/s/starke.txt +++ b/res/cardsfolder/s/starke.txt @@ -8,6 +8,4 @@ SVar:SituationalEthics:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You | SubAbil SVar:Switch:DB$ ChangeZone | Origin$ Hand | Destination$ Library | LibraryPosition$ -1 | ChangeNum$ 1 | Mandatory$ True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=4970 -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/starke.jpg -Oracle:Hand +0, life -2\nAt the beginning of your draw step, you may draw an additional card. If you do, put a card from your hand on the bottom of your library. End \ No newline at end of file diff --git a/res/cardsfolder/t/tahngarth.txt b/res/cardsfolder/t/tahngarth.txt index f57f797495f..b8e2e7d8c6f 100644 --- a/res/cardsfolder/t/tahngarth.txt +++ b/res/cardsfolder/t/tahngarth.txt @@ -6,6 +6,4 @@ HandLifeModifier:-1/+7 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Haste | Description$ Creatures you control have haste. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4971&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/tahngarth.jpg -Oracle:Hand -1, life +7\nCreatures you control have haste. End \ No newline at end of file diff --git a/res/cardsfolder/t/takara.txt b/res/cardsfolder/t/takara.txt index fa180278809..f526ab576a3 100644 --- a/res/cardsfolder/t/takara.txt +++ b/res/cardsfolder/t/takara.txt @@ -7,6 +7,4 @@ A:AB$ DealDamage | ActivationZone$ Command | Cost$ Sac<1/Creature> | Tgt$ TgtCP SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12144&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/takara.jpg -Oracle:Hand +3, life -8\nSacrifice a creature: Takara deals 1 damage to target creature or player. End \ No newline at end of file diff --git a/res/cardsfolder/t/tawnos.txt b/res/cardsfolder/t/tawnos.txt index ce84d33dde2..82c5d5a200c 100644 --- a/res/cardsfolder/t/tawnos.txt +++ b/res/cardsfolder/t/tawnos.txt @@ -6,6 +6,4 @@ HandLifeModifier:+3/-4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.YouCtrl,Creature.YouCtrl,Enchantment.YouCtrl | AddHiddenKeyword$ HIDDEN Flash | AffectedZone$ Exile,Graveyard,Hand,Library | Description$ You may cast artifact, creature, and enchantment spells as though they had flash. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12328&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/tawnos.jpg -Oracle:Hand +3, life -4\nYou may cast artifact, creature, and enchantment spells as though they had flash. End \ No newline at end of file diff --git a/res/cardsfolder/t/titania.txt b/res/cardsfolder/t/titania.txt index 2741abae3f1..49e9f98bb00 100644 --- a/res/cardsfolder/t/titania.txt +++ b/res/cardsfolder/t/titania.txt @@ -6,6 +6,4 @@ HandLifeModifier:+2/-5 S:Mode$ Continuous | EffectZone$ Command | Affected$ You | AddKeyword$ AdjustLandPlays:1 | Description$ You may play an additional land on each of your turns. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12333&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/titania.jpg -Oracle:Hand +2, life -5\nYou may play an additional land on each of your turns. End \ No newline at end of file diff --git a/res/cardsfolder/u/urza.txt b/res/cardsfolder/u/urza.txt index 04ec32d3db1..f9aed08557e 100644 --- a/res/cardsfolder/u/urza.txt +++ b/res/cardsfolder/u/urza.txt @@ -6,6 +6,4 @@ HandLifeModifier:-1/+10 A:AB$ DealDamage | ActivationZone$ Command | Cost$ 3 | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12326&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/urza.jpg -Oracle:Hand -1, life +10\n{3}: Urza deals 1 damage to target creature or player. End \ No newline at end of file diff --git a/res/cardsfolder/v/volrath.txt b/res/cardsfolder/v/volrath.txt index c04aaca2079..3a4f6b96b16 100644 --- a/res/cardsfolder/v/volrath.txt +++ b/res/cardsfolder/v/volrath.txt @@ -7,6 +7,4 @@ T:Mode$ ChangesZone | TriggerZones$ Command | Origin$ Battlefield | Destination$ SVar:GetUp:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Library SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4972&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/volrath.jpg -Oracle:Hand +2, life -3\nWhenever a creature you control is put into your graveyard from the battlefield, you may put it on top of your library. End \ No newline at end of file diff --git a/res/cardsfolder/x/xantcha.txt b/res/cardsfolder/x/xantcha.txt index db8f21dddfc..a5ead968fca 100644 --- a/res/cardsfolder/x/xantcha.txt +++ b/res/cardsfolder/x/xantcha.txt @@ -7,6 +7,4 @@ A:AB$ Regenerate | ActivationZone$ Command | Cost$ Sac<1/Permanent> | ValidTgts$ SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12331&type=card -SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/xantcha.jpg -Oracle:Hand +1, life +3\nSacrifice a permanent: Regenerate target creature. End \ No newline at end of file From 53032db992db7ff4a0585e919f06089963fe95d3 Mon Sep 17 00:00:00 2001 From: Hellfish Date: Sat, 24 Nov 2012 20:16:03 +0000 Subject: [PATCH 27/36] *Variants:Added VAN set. *Variants:Added SetInfo to avatars, courtesy of Marc. *Variants:Replaced CardDb.getAllCards() with CardDb.getTraditionalCards() where appropriate. --- res/blockdata/setdata.txt | 4 +- .../a/arcbound_overseer_avatar.txt | 1 + .../a/ashling_the_pilgrim_avatar.txt | 1 + res/cardsfolder/a/ashnod.txt | 1 + res/cardsfolder/b/barrin.txt | 1 + .../b/birds_of_paradise_avatar.txt | 1 + res/cardsfolder/c/chronatog_avatar.txt | 1 + res/cardsfolder/c/crovax.txt | 1 + res/cardsfolder/d/dauntless_escort_avatar.txt | 1 + res/cardsfolder/d/diamond_faerie_avatar.txt | 1 + res/cardsfolder/e/eladamri.txt | 1 + .../e/eladamri_lord_of_leaves_avatar.txt | 1 + res/cardsfolder/e/ertai.txt | 1 + res/cardsfolder/g/gerrard.txt | 1 + res/cardsfolder/g/gix.txt | 1 + res/cardsfolder/g/greven_il_vec.txt | 1 + res/cardsfolder/g/grinning_demon_avatar.txt | 1 + res/cardsfolder/h/hanna.txt | 1 + res/cardsfolder/k/karn.txt | 1 + res/cardsfolder/l/lyna.txt | 1 + res/cardsfolder/m/maraxus.txt | 1 + res/cardsfolder/m/mishra.txt | 1 + res/cardsfolder/m/multani.txt | 1 + res/cardsfolder/o/oracle.txt | 1 + res/cardsfolder/o/orim.txt | 1 + res/cardsfolder/r/rofellos.txt | 1 + res/cardsfolder/s/selenia.txt | 1 + res/cardsfolder/s/serra.txt | 1 + res/cardsfolder/s/sidar_kondo.txt | 1 + res/cardsfolder/s/sisay.txt | 1 + .../s/sliver_queen_brood_mother.txt | 1 + res/cardsfolder/s/squee.txt | 1 + res/cardsfolder/s/starke.txt | 1 + res/cardsfolder/t/tahngarth.txt | 1 + res/cardsfolder/t/takara.txt | 1 + res/cardsfolder/t/tawnos.txt | 1 + res/cardsfolder/t/titania.txt | 1 + res/cardsfolder/u/urza.txt | 1 + res/cardsfolder/v/volrath.txt | 1 + res/cardsfolder/x/xantcha.txt | 1 + res/preferences/editor.preferences | 52 +++++++++---------- res/preferences/main.properties | 6 +-- .../java/forge/card/BoosterGenerator.java | 2 +- src/main/java/forge/card/MetaSet.java | 4 +- .../generate/GenerateColoredDeckBase.java | 2 +- src/main/java/forge/item/OpenablePack.java | 2 +- src/main/java/forge/quest/BoosterUtils.java | 4 +- src/main/java/forge/quest/QuestUtilCards.java | 8 +-- 48 files changed, 82 insertions(+), 41 deletions(-) diff --git a/res/blockdata/setdata.txt b/res/blockdata/setdata.txt index 9fea8949a29..0b1d29c14fc 100644 --- a/res/blockdata/setdata.txt +++ b/res/blockdata/setdata.txt @@ -89,4 +89,6 @@ Index:79|Code2:DKA|Code3:DKA|Name:Dark Ascension Index:80|Code2:AVR|Code3:AVR|Name:Avacyn Restored Index:81|Code2:PC2|Code3:PC2|Name:Planechase 2012 Edition Index:82|Code2:M13|Code3:M13|Name:Magic 2013 -Index:83|Code2:RTR|Code3:RTR|Name:Return to Ravnica \ No newline at end of file +Index:83|Code2:RTR|Code3:RTR|Name:Return to Ravnica + +Index:86|Code2:VAN|Code3:VAN|Name:Vanguard \ No newline at end of file diff --git a/res/cardsfolder/a/arcbound_overseer_avatar.txt b/res/cardsfolder/a/arcbound_overseer_avatar.txt index bc90fd46b3a..3bea4f7eee2 100644 --- a/res/cardsfolder/a/arcbound_overseer_avatar.txt +++ b/res/cardsfolder/a/arcbound_overseer_avatar.txt @@ -9,4 +9,5 @@ T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Command | Execu SVar:ChargeCounter:AB$ PutCounter | Cost$ 0 | CounterType$ CHARGE | CounterNum$ 1 | ValidTgts$ Permanent.YouCtrl | TgtPrompt$ Select target permanent you control SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182296&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/arcbound-overseer.jpg End \ No newline at end of file diff --git a/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt b/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt index a7daaf8296c..09e2a7ade2f 100644 --- a/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt +++ b/res/cardsfolder/a/ashling_the_pilgrim_avatar.txt @@ -6,4 +6,5 @@ HandLifeModifier:-1/+6 A:AB$ DamageAll | ActivationZone$ Command | Cost$ 2 | NumDmg$ 1 | ValidCards$ Creature | ValidPlayers$ Each | ValidDescription$ each creature and each player. | SpellDescription$ CARDNAME deals 1 damage to each creature and each player. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182283&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/ashling-the-extinguisher.jpg End \ No newline at end of file diff --git a/res/cardsfolder/a/ashnod.txt b/res/cardsfolder/a/ashnod.txt index 9cbb0c4f046..5ff14ab6b70 100644 --- a/res/cardsfolder/a/ashnod.txt +++ b/res/cardsfolder/a/ashnod.txt @@ -7,4 +7,5 @@ T:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ You | Execute$ TrigDes SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredSource SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12329&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/ashnod.jpg End \ No newline at end of file diff --git a/res/cardsfolder/b/barrin.txt b/res/cardsfolder/b/barrin.txt index 2030580e4bd..2408ebd0173 100644 --- a/res/cardsfolder/b/barrin.txt +++ b/res/cardsfolder/b/barrin.txt @@ -6,4 +6,5 @@ HandLifeModifier:+0/+6 A:AB$ ChangeZone | ActivationZone$ Command | Cost$ Sac<1/Permanent> | ValidTgts$ Creature | TgtPrompt$ Select target Creature | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target creature to its owner's hand. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4957&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/barrin.jpg End \ No newline at end of file diff --git a/res/cardsfolder/b/birds_of_paradise_avatar.txt b/res/cardsfolder/b/birds_of_paradise_avatar.txt index 47cbf054b0f..8d8e5887e26 100644 --- a/res/cardsfolder/b/birds_of_paradise_avatar.txt +++ b/res/cardsfolder/b/birds_of_paradise_avatar.txt @@ -7,4 +7,5 @@ S:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ SVar:AnyMana:AB$ Mana | Cost$ T | Produced$ Any | Amount$ 1 | SpellDescription$ Add one mana of any color to your mana pool. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182291&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/birds-of-paradise.jpg End \ No newline at end of file diff --git a/res/cardsfolder/c/chronatog_avatar.txt b/res/cardsfolder/c/chronatog_avatar.txt index 2f335894cf6..a2c774251bb 100644 --- a/res/cardsfolder/c/chronatog_avatar.txt +++ b/res/cardsfolder/c/chronatog_avatar.txt @@ -9,4 +9,5 @@ SVar:DBSkipTurn:DB$ AddTurn | NumTurns$ 1 | Defined$ Opponent SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=201898&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/chronatog.jpg End \ No newline at end of file diff --git a/res/cardsfolder/c/crovax.txt b/res/cardsfolder/c/crovax.txt index 8bcb5509455..374e714775b 100644 --- a/res/cardsfolder/c/crovax.txt +++ b/res/cardsfolder/c/crovax.txt @@ -7,5 +7,6 @@ T:Mode$ DamageDone | ValidSource$ Creature+YouCtrl | ValidTarget$ Creature,Playe SVar:TrigGainLife:AB$ GainLife | Cost$ 0 | Defined$ You | LifeAmount$ 1 SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4958&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/crovax.jpg Oracle:Hand +2, life +0\nWhenever a creature you control deals damage to a creature or player, you gain 1 life. End \ No newline at end of file diff --git a/res/cardsfolder/d/dauntless_escort_avatar.txt b/res/cardsfolder/d/dauntless_escort_avatar.txt index 8cc8300a6a4..0bb89dc88be 100644 --- a/res/cardsfolder/d/dauntless_escort_avatar.txt +++ b/res/cardsfolder/d/dauntless_escort_avatar.txt @@ -6,4 +6,5 @@ HandLifeModifier:+1/+1 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Exalted | Description$ Creatures you control have exalted. (Whenever a creature you control attacks alone, it gets +1/+1 until end of turn for each instance of exalted among permanents you control.) SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=201898&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/dauntless-escort.jpg End \ No newline at end of file diff --git a/res/cardsfolder/d/diamond_faerie_avatar.txt b/res/cardsfolder/d/diamond_faerie_avatar.txt index a96f2323fa2..9c120fab789 100644 --- a/res/cardsfolder/d/diamond_faerie_avatar.txt +++ b/res/cardsfolder/d/diamond_faerie_avatar.txt @@ -6,4 +6,5 @@ HandLifeModifier:+0/+5 A:AB$ Pump | ActivationZone$ Command | Cost$ S | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | NumAtt$ 1 | NumDef$ 1 | SpellDescription$ Target creature you control gets +1/+1 until end of turn. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182274&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/diamond-faerie.jpg End \ No newline at end of file diff --git a/res/cardsfolder/e/eladamri.txt b/res/cardsfolder/e/eladamri.txt index 01e02429ebb..59cd6734e53 100644 --- a/res/cardsfolder/e/eladamri.txt +++ b/res/cardsfolder/e/eladamri.txt @@ -16,5 +16,6 @@ SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:Rarity:Special SVar:Picture:http://www.wizards.com/global/images/magic/general/eladamri.jpg +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/eladamri.jpg Oracle:Hand -1, life +15\n{0}: The next 1 damage that would be dealt to target creature you control is dealt to you instead. End \ No newline at end of file diff --git a/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt b/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt index ffb044f9d83..16cae29f293 100644 --- a/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt +++ b/res/cardsfolder/e/eladamri_lord_of_leaves_avatar.txt @@ -7,4 +7,5 @@ T:Mode$ Phase | Phase$ Main1 | ValidPlayer$ Player | TriggerZones$ Command | Exe SVar:TrigAddMana:AB$ Mana | Cost$ 0 | Produced$ G | Amount$ 2 | Defined$ TriggeredPlayer SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=195137&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo-2/eladamri-lord-of-leaves.jpg End \ No newline at end of file diff --git a/res/cardsfolder/e/ertai.txt b/res/cardsfolder/e/ertai.txt index f883b1d1e44..f94732b3b89 100644 --- a/res/cardsfolder/e/ertai.txt +++ b/res/cardsfolder/e/ertai.txt @@ -6,4 +6,5 @@ HandLifeModifier:-1/+4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Hexproof | Description$ Creatures you control have hexproof. (They can't be the targets of spells or abilities your opponents control.) SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4959&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/ertai.jpg End \ No newline at end of file diff --git a/res/cardsfolder/g/gerrard.txt b/res/cardsfolder/g/gerrard.txt index 8e324d0a032..e9013af1c1f 100644 --- a/res/cardsfolder/g/gerrard.txt +++ b/res/cardsfolder/g/gerrard.txt @@ -7,4 +7,5 @@ T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | TriggerZones$ Command | Execute SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4960&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/gerrard.jpg End \ No newline at end of file diff --git a/res/cardsfolder/g/gix.txt b/res/cardsfolder/g/gix.txt index f4ccb71626b..a956f658a9f 100644 --- a/res/cardsfolder/g/gix.txt +++ b/res/cardsfolder/g/gix.txt @@ -6,4 +6,5 @@ HandLifeModifier:-2/+18 A:AB$ ChangeZone | Cost$ 3 | ActivationZone$ Command | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Select target creature card in your graveyard | ValidTgts$ Creature.YouCtrl | SpellDescription$ Return target creature card from your graveyard to your hand. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12330&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/gix.jpg End \ No newline at end of file diff --git a/res/cardsfolder/g/greven_il_vec.txt b/res/cardsfolder/g/greven_il_vec.txt index 78d761c127f..5cb2d6d0c61 100644 --- a/res/cardsfolder/g/greven_il_vec.txt +++ b/res/cardsfolder/g/greven_il_vec.txt @@ -7,4 +7,5 @@ T:Mode$ DamageDone | ValidSource$ Creature.YouCtrl | ValidTarget$ Creature | Tri SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredTarget | NoRegen$ True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4961&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/greven-il-vec.jpg End \ No newline at end of file diff --git a/res/cardsfolder/g/grinning_demon_avatar.txt b/res/cardsfolder/g/grinning_demon_avatar.txt index 43c7933f76b..335674e86f6 100644 --- a/res/cardsfolder/g/grinning_demon_avatar.txt +++ b/res/cardsfolder/g/grinning_demon_avatar.txt @@ -7,4 +7,5 @@ T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ SVar:GrinningDiscard:AB$ Discard | Cost$ 0 | ValidTgts$ Opponent | TgtPrompt$ Select an opponent to discard | NumCards$ 1 | Mode$ TgtChoose SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182304&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/grinning-demon.jpg End \ No newline at end of file diff --git a/res/cardsfolder/h/hanna.txt b/res/cardsfolder/h/hanna.txt index 1642868252c..73e5863bb9c 100644 --- a/res/cardsfolder/h/hanna.txt +++ b/res/cardsfolder/h/hanna.txt @@ -6,4 +6,5 @@ HandLifeModifier:+1/-5 S:Mode$ ReduceCost | EffectZone$ Command | ValidCard$ Card | Type$ Spell | Activator$ You | Amount$ 1 | Description$ Spells you cast cost 1 less to cast. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4962&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/hanna.jpg End \ No newline at end of file diff --git a/res/cardsfolder/k/karn.txt b/res/cardsfolder/k/karn.txt index e99340aba8a..d9698659da0 100644 --- a/res/cardsfolder/k/karn.txt +++ b/res/cardsfolder/k/karn.txt @@ -7,4 +7,5 @@ S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.nonCreature+YouCtr SVar:AffectedX:Count$CardManaCost SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4963&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/karn.jpg End \ No newline at end of file diff --git a/res/cardsfolder/l/lyna.txt b/res/cardsfolder/l/lyna.txt index fc05a676ade..7df0364d995 100644 --- a/res/cardsfolder/l/lyna.txt +++ b/res/cardsfolder/l/lyna.txt @@ -6,4 +6,5 @@ HandLifeModifier:+2/-4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Shadow | Description$ Creatures you control have shadow. (They can block and be blocked only by creatures with shadow.) SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12142&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/lyna.jpg End \ No newline at end of file diff --git a/res/cardsfolder/m/maraxus.txt b/res/cardsfolder/m/maraxus.txt index fa32ff5424b..747a62a5f17 100644 --- a/res/cardsfolder/m/maraxus.txt +++ b/res/cardsfolder/m/maraxus.txt @@ -6,4 +6,5 @@ HandLifeModifier:+1/+2 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddPower$ 1 | Description$ Creatures you control get +1/+0. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4964&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/maraxus.jpg End \ No newline at end of file diff --git a/res/cardsfolder/m/mishra.txt b/res/cardsfolder/m/mishra.txt index 0d8b9eadba9..74e696d4e56 100644 --- a/res/cardsfolder/m/mishra.txt +++ b/res/cardsfolder/m/mishra.txt @@ -10,4 +10,5 @@ SVar:DmgTimes2Combat:AB$ DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Re SVar:X:ReplaceCount$DamageAmount/Twice SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12327 +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/mishra.jpg End \ No newline at end of file diff --git a/res/cardsfolder/m/multani.txt b/res/cardsfolder/m/multani.txt index 651b14e4cf1..b9263e0eb3b 100644 --- a/res/cardsfolder/m/multani.txt +++ b/res/cardsfolder/m/multani.txt @@ -7,4 +7,5 @@ S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddPower SVar:X:Count$CardsInYourHand SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12146&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/multani.jpg End \ No newline at end of file diff --git a/res/cardsfolder/o/oracle.txt b/res/cardsfolder/o/oracle.txt index c7354ab2514..f5cff872cb8 100644 --- a/res/cardsfolder/o/oracle.txt +++ b/res/cardsfolder/o/oracle.txt @@ -8,4 +8,5 @@ SVar:Reconsider:DB$ RemoveFromCombat | Defined$ Targeted SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12141&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/oracle.jpg End \ No newline at end of file diff --git a/res/cardsfolder/o/orim.txt b/res/cardsfolder/o/orim.txt index 37843ca7324..f953a4f050c 100644 --- a/res/cardsfolder/o/orim.txt +++ b/res/cardsfolder/o/orim.txt @@ -6,4 +6,5 @@ HandLifeModifier:+0/+12 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Reach | Description$ Creatures you control have reach. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4966&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/orim.jpg End \ No newline at end of file diff --git a/res/cardsfolder/r/rofellos.txt b/res/cardsfolder/r/rofellos.txt index 43da9f2b07f..f807220b03a 100644 --- a/res/cardsfolder/r/rofellos.txt +++ b/res/cardsfolder/r/rofellos.txt @@ -7,4 +7,5 @@ T:Mode$ ChangesZone | TriggerZones$ Command | Origin$ Battlefield | Destination$ SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=12145 +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/rofellos.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/selenia.txt b/res/cardsfolder/s/selenia.txt index b3f74c7ac26..a347139071a 100644 --- a/res/cardsfolder/s/selenia.txt +++ b/res/cardsfolder/s/selenia.txt @@ -6,4 +6,5 @@ HandLifeModifier:+1/+7 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Vigilance | Description$ Creatures you control have vigilance. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4967&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/selenia.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/serra.txt b/res/cardsfolder/s/serra.txt index 09a59398d3b..c43b68fa6cc 100644 --- a/res/cardsfolder/s/serra.txt +++ b/res/cardsfolder/s/serra.txt @@ -6,4 +6,5 @@ HandLifeModifier:+1/+1 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddToughness$ 2 | Description$ Creatures you control get +0/+2. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12332&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/serra.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/sidar_kondo.txt b/res/cardsfolder/s/sidar_kondo.txt index f32d72756b4..d28545a710b 100644 --- a/res/cardsfolder/s/sidar_kondo.txt +++ b/res/cardsfolder/s/sidar_kondo.txt @@ -6,4 +6,5 @@ HandLifeModifier:-1/+12 A:AB$ Pump | ActivationZone$ Command | Cost$ 3 | Tgt$ TgtC | NumAtt$ 3 | NumDef$ 3 | SpellDescription$ Target creature gets +3/+3 until end of turn. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12147&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sidar-kondo.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/sisay.txt b/res/cardsfolder/s/sisay.txt index bec7d17fe4e..d7fa7e375a3 100644 --- a/res/cardsfolder/s/sisay.txt +++ b/res/cardsfolder/s/sisay.txt @@ -7,4 +7,5 @@ T:Mode$ TapsForMana | TriggerZones$ Command | ValidCard$ Land.YouCtrl | Execute$ SVar:TrigMana:AB$ ManaReflected | Cost$ 0 | ColorOrType$ Type | Valid$ Defined.Triggered | ReflectProperty$ Produced | Defined$ TriggeredPlayer SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4968&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sisay.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/sliver_queen_brood_mother.txt b/res/cardsfolder/s/sliver_queen_brood_mother.txt index a8371fdc7be..333a92e0f57 100644 --- a/res/cardsfolder/s/sliver_queen_brood_mother.txt +++ b/res/cardsfolder/s/sliver_queen_brood_mother.txt @@ -6,4 +6,5 @@ HandLifeModifier:+0/+8 A:AB$ Token | ActivationZone$ Command | Cost$ 3 | TokenAmount$ 1 | TokenName$ Sliver | TokenTypes$ Creature,Sliver | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put a 1/1 colorless Sliver creature token onto the battlefield. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12143&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/sliver-queen-brood-mother.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/squee.txt b/res/cardsfolder/s/squee.txt index 89601e6d890..043d7a64e26 100644 --- a/res/cardsfolder/s/squee.txt +++ b/res/cardsfolder/s/squee.txt @@ -7,4 +7,5 @@ S:Mode$ Continuous | EffectZone$ Command | Affected$ Opponent | AddKeyword$ Play SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://www.wizards.com/global/images/magic/general/squee.jpg +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/squee.jpg End \ No newline at end of file diff --git a/res/cardsfolder/s/starke.txt b/res/cardsfolder/s/starke.txt index bde0d3c127c..b7e208057f9 100644 --- a/res/cardsfolder/s/starke.txt +++ b/res/cardsfolder/s/starke.txt @@ -8,4 +8,5 @@ SVar:SituationalEthics:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ You | SubAbil SVar:Switch:DB$ ChangeZone | Origin$ Hand | Destination$ Library | LibraryPosition$ -1 | ChangeNum$ 1 | Mandatory$ True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=4970 +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/starke.jpg End \ No newline at end of file diff --git a/res/cardsfolder/t/tahngarth.txt b/res/cardsfolder/t/tahngarth.txt index b8e2e7d8c6f..0125a0735ef 100644 --- a/res/cardsfolder/t/tahngarth.txt +++ b/res/cardsfolder/t/tahngarth.txt @@ -6,4 +6,5 @@ HandLifeModifier:-1/+7 S:Mode$ Continuous | EffectZone$ Command | Affected$ Creature.YouCtrl | AddKeyword$ Haste | Description$ Creatures you control have haste. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4971&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/tahngarth.jpg End \ No newline at end of file diff --git a/res/cardsfolder/t/takara.txt b/res/cardsfolder/t/takara.txt index f526ab576a3..528256cf232 100644 --- a/res/cardsfolder/t/takara.txt +++ b/res/cardsfolder/t/takara.txt @@ -7,4 +7,5 @@ A:AB$ DealDamage | ActivationZone$ Command | Cost$ Sac<1/Creature> | Tgt$ TgtCP SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12144&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/takara.jpg End \ No newline at end of file diff --git a/res/cardsfolder/t/tawnos.txt b/res/cardsfolder/t/tawnos.txt index 82c5d5a200c..57ff84e0b02 100644 --- a/res/cardsfolder/t/tawnos.txt +++ b/res/cardsfolder/t/tawnos.txt @@ -6,4 +6,5 @@ HandLifeModifier:+3/-4 S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.YouCtrl,Creature.YouCtrl,Enchantment.YouCtrl | AddHiddenKeyword$ HIDDEN Flash | AffectedZone$ Exile,Graveyard,Hand,Library | Description$ You may cast artifact, creature, and enchantment spells as though they had flash. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12328&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/tawnos.jpg End \ No newline at end of file diff --git a/res/cardsfolder/t/titania.txt b/res/cardsfolder/t/titania.txt index 49e9f98bb00..0b860bae232 100644 --- a/res/cardsfolder/t/titania.txt +++ b/res/cardsfolder/t/titania.txt @@ -6,4 +6,5 @@ HandLifeModifier:+2/-5 S:Mode$ Continuous | EffectZone$ Command | Affected$ You | AddKeyword$ AdjustLandPlays:1 | Description$ You may play an additional land on each of your turns. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12333&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/titania.jpg End \ No newline at end of file diff --git a/res/cardsfolder/u/urza.txt b/res/cardsfolder/u/urza.txt index f9aed08557e..3b1de543220 100644 --- a/res/cardsfolder/u/urza.txt +++ b/res/cardsfolder/u/urza.txt @@ -6,4 +6,5 @@ HandLifeModifier:-1/+10 A:AB$ DealDamage | ActivationZone$ Command | Cost$ 3 | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player. SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12326&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/urza.jpg End \ No newline at end of file diff --git a/res/cardsfolder/v/volrath.txt b/res/cardsfolder/v/volrath.txt index 3a4f6b96b16..37ad7d47454 100644 --- a/res/cardsfolder/v/volrath.txt +++ b/res/cardsfolder/v/volrath.txt @@ -7,4 +7,5 @@ T:Mode$ ChangesZone | TriggerZones$ Command | Origin$ Battlefield | Destination$ SVar:GetUp:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Library SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4972&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/volrath.jpg End \ No newline at end of file diff --git a/res/cardsfolder/x/xantcha.txt b/res/cardsfolder/x/xantcha.txt index a5ead968fca..0fb81b639b8 100644 --- a/res/cardsfolder/x/xantcha.txt +++ b/res/cardsfolder/x/xantcha.txt @@ -7,4 +7,5 @@ A:AB$ Regenerate | ActivationZone$ Command | Cost$ Sac<1/Permanent> | ValidTgts$ SVar:RemAIDeck:True SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=12331&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard/xantcha.jpg End \ No newline at end of file diff --git a/res/preferences/editor.preferences b/res/preferences/editor.preferences index 551bce40aff..bac89bd5766 100644 --- a/res/preferences/editor.preferences +++ b/res/preferences/editor.preferences @@ -2,31 +2,31 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/preferences/main.properties b/res/preferences/main.properties index e7c30ab2c3f..1a3503a81eb 100644 --- a/res/preferences/main.properties +++ b/res/preferences/main.properties @@ -60,9 +60,9 @@ draft--properties=../draft/draft.properties lang--transparent-properties=../lang/lang.properties -image/base--file=../pics -image/token--file=../pics/tokens -image/icon--file=../pics/icons +image/base--file=D:/Games/forge/pics +image/token--file=D:/Games/forge/pics/tokens +image/icon--file=D:/Games/forge/pics/icons image/product--file=../pics_product pics/booster/images--file=../quest/booster-images.txt diff --git a/src/main/java/forge/card/BoosterGenerator.java b/src/main/java/forge/card/BoosterGenerator.java index 970614eb1ca..2662fe79c17 100644 --- a/src/main/java/forge/card/BoosterGenerator.java +++ b/src/main/java/forge/card/BoosterGenerator.java @@ -122,7 +122,7 @@ public class BoosterGenerator { public BoosterGenerator(Predicate filter) { this(); - for (final CardPrinted c : Iterables.filter(CardDb.instance().getAllCards(), filter)) { + for (final CardPrinted c : Iterables.filter(CardDb.instance().getTraditionalCards(), filter)) { this.addToRarity(c); // System.out.println(c); } diff --git a/src/main/java/forge/card/MetaSet.java b/src/main/java/forge/card/MetaSet.java index a6f3ece64a3..87db58a726d 100644 --- a/src/main/java/forge/card/MetaSet.java +++ b/src/main/java/forge/card/MetaSet.java @@ -226,7 +226,7 @@ public class MetaSet { // NOTE: The following code is far from ideal in a number of ways. If someone can // think of a way to improve it, please do so. --BBU // ItemPool cardPool = new ItemPool(CardPrinted.class); - for (CardPrinted aCard : CardDb.instance().getAllCards()) { + for (CardPrinted aCard : CardDb.instance().getTraditionalCards()) { if (data.indexOf(aCard.getEdition()) > -1) { cardPool.add(aCard); // System.out.println("Added card" + aCard.getName()); @@ -293,7 +293,7 @@ public class MetaSet { if (mSet.type.equalsIgnoreCase("meta") || mSet.type.equalsIgnoreCase("booster") || mSet.type.equalsIgnoreCase("pack")) { final String mData = new String(mSet.data); - for (CardPrinted aCard : CardDb.instance().getAllCards()) { + for (CardPrinted aCard : CardDb.instance().getTraditionalCards()) { if (mData.indexOf(aCard.getEdition()) > -1) { if (!cardPool.contains(aCard)) { cardPool.add(aCard); diff --git a/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java b/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java index bb450bb3263..da21ce588eb 100644 --- a/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java +++ b/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java @@ -220,7 +220,7 @@ public abstract class GenerateColoredDeckBase { if (!Singletons.getModel().getPreferences().getPrefBoolean(FPref.DECKGEN_ARTIFACTS)) { hasColor = Predicates.or(hasColor, GenerateDeckUtil.COLORLESS_CARDS); } - return Iterables.filter(CardDb.instance().getAllCards(), Predicates.compose(Predicates.and(canPlay, hasColor), CardPrinted.FN_GET_RULES)); + return Iterables.filter(CardDb.instance().getTraditionalCards(), Predicates.compose(Predicates.and(canPlay, hasColor), CardPrinted.FN_GET_RULES)); } protected static Map countLands(ItemPool outList) { diff --git a/src/main/java/forge/item/OpenablePack.java b/src/main/java/forge/item/OpenablePack.java index e970e38d4d6..079045d70d9 100644 --- a/src/main/java/forge/item/OpenablePack.java +++ b/src/main/java/forge/item/OpenablePack.java @@ -175,7 +175,7 @@ public abstract class OpenablePack implements InventoryItemFromSet { Predicate cardsRule = Predicates.and( CardPrinted.Predicates.printedInSets(setCode), Predicates.compose(CardRulesPredicates.Presets.IS_BASIC_LAND, CardPrinted.FN_GET_RULES)); - return Aggregates.random(Iterables.filter(CardDb.instance().getAllCards(), cardsRule), count); + return Aggregates.random(Iterables.filter(CardDb.instance().getTraditionalCards(), cardsRule), count); } } diff --git a/src/main/java/forge/quest/BoosterUtils.java b/src/main/java/forge/quest/BoosterUtils.java index cfd0f87a7df..355a36a868b 100644 --- a/src/main/java/forge/quest/BoosterUtils.java +++ b/src/main/java/forge/quest/BoosterUtils.java @@ -88,7 +88,7 @@ public final class BoosterUtils { } // This will save CPU time when sets are limited - final List cardpool = Lists.newArrayList(Iterables.filter(CardDb.instance().getAllCards(), filter)); + final List cardpool = Lists.newArrayList(Iterables.filter(CardDb.instance().getTraditionalCards(), filter)); final Predicate pCommon = CardPrinted.Predicates.Presets.IS_COMMON; cards.addAll(BoosterUtils.generateDefinetlyColouredCards(cardpool, pCommon, numCommon, colorFilters)); @@ -180,7 +180,7 @@ public final class BoosterUtils { * @return the list */ public static List generateDistinctCards(final Predicate filter, final int cntNeeded) { - return BoosterUtils.generateDistinctCards(CardDb.instance().getAllCards(), filter, cntNeeded); + return BoosterUtils.generateDistinctCards(CardDb.instance().getTraditionalCards(), filter, cntNeeded); } /** diff --git a/src/main/java/forge/quest/QuestUtilCards.java b/src/main/java/forge/quest/QuestUtilCards.java index 29088a6ed23..29f9e9a4fdd 100644 --- a/src/main/java/forge/quest/QuestUtilCards.java +++ b/src/main/java/forge/quest/QuestUtilCards.java @@ -189,7 +189,7 @@ public final class QuestUtilCards { final Predicate myFilter = applyFormatFilter(QuestUtilCards.RARE_PREDICATE); - final CardPrinted card = Aggregates.random(Iterables.filter(CardDb.instance().getAllCards(), myFilter)); + final CardPrinted card = Aggregates.random(Iterables.filter(CardDb.instance().getTraditionalCards(), myFilter)); this.addSingleCard(card); return card; } @@ -204,7 +204,7 @@ public final class QuestUtilCards { public List addRandomRare(final int n) { final Predicate myFilter = applyFormatFilter(QuestUtilCards.RARE_PREDICATE); - final List newCards = Aggregates.random(Iterables.filter(CardDb.instance().getAllCards(), myFilter), n); + final List newCards = Aggregates.random(Iterables.filter(CardDb.instance().getTraditionalCards(), myFilter), n); this.addAllCards(newCards); return newCards; } @@ -486,9 +486,9 @@ public final class QuestUtilCards { Iterable cardList = null; if (qc.getFormat() == null) { - cardList = CardDb.instance().getAllCards(); } + cardList = CardDb.instance().getTraditionalCards(); } else { - cardList = Iterables.filter(CardDb.instance().getAllCards(), qc.getFormat().getFilterPrinted()); + cardList = Iterables.filter(CardDb.instance().getTraditionalCards(), qc.getFormat().getFilterPrinted()); } final BoosterGenerator pack = new BoosterGenerator(cardList); From 25f0b6901f301f441c6494dec3595063a078a108 Mon Sep 17 00:00:00 2001 From: Hellfish Date: Sat, 24 Nov 2012 20:32:28 +0000 Subject: [PATCH 28/36] *Variants:Reverted preferences. --- res/preferences/editor.preferences | 58 +++++++++++++++--------------- res/preferences/main.properties | 7 ++-- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/res/preferences/editor.preferences b/res/preferences/editor.preferences index bac89bd5766..f87aae94786 100644 --- a/res/preferences/editor.preferences +++ b/res/preferences/editor.preferences @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/preferences/main.properties b/res/preferences/main.properties index 1a3503a81eb..2ae0ba5554a 100644 --- a/res/preferences/main.properties +++ b/res/preferences/main.properties @@ -60,13 +60,12 @@ draft--properties=../draft/draft.properties lang--transparent-properties=../lang/lang.properties -image/base--file=D:/Games/forge/pics -image/token--file=D:/Games/forge/pics/tokens -image/icon--file=D:/Games/forge/pics/icons +image/base--file=../pics +image/token--file=../pics/tokens +image/icon--file=../pics/icons image/product--file=../pics_product pics/booster/images--file=../quest/booster-images.txt quest/opponent/icons--file=../quest/quest-opponent-icons.txt quest/pet/icons--file=../quest/quest-pet-shop-icons.txt quest/pet/tokens--file=../quest/quest-pet-token-images.txt - From 034576ef768840d9537d68fa6f5baecbe8230f97 Mon Sep 17 00:00:00 2001 From: Hellfish Date: Sun, 25 Nov 2012 11:35:19 +0000 Subject: [PATCH 29/36] *Variants:Keep separate lists of traditional/nontraditional CardPrinted's in CardDb. *Variants:Fixed crash when only playing against 1 opponent on vanguard. *Variants:Fixed vanguard match not starting when selecting non-random avatar. --- .../java/forge/card/BoosterGenerator.java | 2 +- src/main/java/forge/card/MetaSet.java | 4 +-- src/main/java/forge/deck/CardCollections.java | 12 ++++++++- .../generate/GenerateColoredDeckBase.java | 2 +- .../gui/GuiMigrateLocalMWSSetPicturesHQ.java | 2 +- .../controllers/CEditorConstructed.java | 2 +- .../download/GuiDownloadSetPicturesLQ.java | 6 ++++- .../gui/home/variant/CSubmenuVanguard.java | 4 +++ .../gui/home/variant/VSubmenuVanguard.java | 5 ++-- src/main/java/forge/item/CardDb.java | 25 ++++++++++--------- src/main/java/forge/item/CardPrinted.java | 4 +++ src/main/java/forge/item/OpenablePack.java | 2 +- src/main/java/forge/quest/BoosterUtils.java | 4 +-- src/main/java/forge/quest/QuestUtilCards.java | 8 +++--- 14 files changed, 52 insertions(+), 30 deletions(-) diff --git a/src/main/java/forge/card/BoosterGenerator.java b/src/main/java/forge/card/BoosterGenerator.java index 2662fe79c17..701413ae9f5 100644 --- a/src/main/java/forge/card/BoosterGenerator.java +++ b/src/main/java/forge/card/BoosterGenerator.java @@ -122,7 +122,7 @@ public class BoosterGenerator { public BoosterGenerator(Predicate filter) { this(); - for (final CardPrinted c : Iterables.filter(CardDb.instance().getTraditionalCards(), filter)) { + for (final CardPrinted c : Iterables.filter(CardDb.instance().getAllTraditionalCards(), filter)) { this.addToRarity(c); // System.out.println(c); } diff --git a/src/main/java/forge/card/MetaSet.java b/src/main/java/forge/card/MetaSet.java index 87db58a726d..22246eb50df 100644 --- a/src/main/java/forge/card/MetaSet.java +++ b/src/main/java/forge/card/MetaSet.java @@ -226,7 +226,7 @@ public class MetaSet { // NOTE: The following code is far from ideal in a number of ways. If someone can // think of a way to improve it, please do so. --BBU // ItemPool cardPool = new ItemPool(CardPrinted.class); - for (CardPrinted aCard : CardDb.instance().getTraditionalCards()) { + for (CardPrinted aCard : CardDb.instance().getAllTraditionalCards()) { if (data.indexOf(aCard.getEdition()) > -1) { cardPool.add(aCard); // System.out.println("Added card" + aCard.getName()); @@ -293,7 +293,7 @@ public class MetaSet { if (mSet.type.equalsIgnoreCase("meta") || mSet.type.equalsIgnoreCase("booster") || mSet.type.equalsIgnoreCase("pack")) { final String mData = new String(mSet.data); - for (CardPrinted aCard : CardDb.instance().getTraditionalCards()) { + for (CardPrinted aCard : CardDb.instance().getAllTraditionalCards()) { if (mData.indexOf(aCard.getEdition()) > -1) { if (!cardPool.contains(aCard)) { cardPool.add(aCard); diff --git a/src/main/java/forge/deck/CardCollections.java b/src/main/java/forge/deck/CardCollections.java index c678322b208..e6407e3352b 100644 --- a/src/main/java/forge/deck/CardCollections.java +++ b/src/main/java/forge/deck/CardCollections.java @@ -34,6 +34,7 @@ public class CardCollections { private final IStorage draft; private final IStorage sealed; private final IStorage cube; + private final IStorage scheme; /** * TODO: Write javadoc for Constructor. @@ -45,8 +46,9 @@ public class CardCollections { this.draft = new StorageImmediatelySerialized(new DeckGroupSerializer(new File(file, "draft"))); this.sealed = new StorageImmediatelySerialized(new DeckGroupSerializer(new File(file, "sealed"))); this.cube = new StorageImmediatelySerialized(new DeckSerializer(new File(file, "cube"))); + this.scheme = new StorageImmediatelySerialized(new DeckSerializer(new File(file, "scheme"))); - System.out.printf("Read decks: %d constructed, %d sealed, %d draft, %d cubes.%n", constructed.getCount(), sealed.getCount(), draft.getCount(), cube.getCount()); + System.out.printf("Read decks: %d constructed, %d sealed, %d draft, %d cubes, %d scheme.%n", constructed.getCount(), sealed.getCount(), draft.getCount(), cube.getCount(), scheme.getCount()); // remove this after most people have been switched to new layout final OldDeckParser oldParser = new OldDeckParser(file, this.constructed, this.draft, this.sealed, this.cube); @@ -89,4 +91,12 @@ public class CardCollections { return this.sealed; } + /** + * TODO: Write javadoc for this method. + * @return + */ + public IStorage getScheme() { + return this.scheme; + } + } diff --git a/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java b/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java index da21ce588eb..fd34e709d75 100644 --- a/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java +++ b/src/main/java/forge/deck/generate/GenerateColoredDeckBase.java @@ -220,7 +220,7 @@ public abstract class GenerateColoredDeckBase { if (!Singletons.getModel().getPreferences().getPrefBoolean(FPref.DECKGEN_ARTIFACTS)) { hasColor = Predicates.or(hasColor, GenerateDeckUtil.COLORLESS_CARDS); } - return Iterables.filter(CardDb.instance().getTraditionalCards(), Predicates.compose(Predicates.and(canPlay, hasColor), CardPrinted.FN_GET_RULES)); + return Iterables.filter(CardDb.instance().getAllTraditionalCards(), Predicates.compose(Predicates.and(canPlay, hasColor), CardPrinted.FN_GET_RULES)); } protected static Map countLands(ItemPool outList) { diff --git a/src/main/java/forge/gui/GuiMigrateLocalMWSSetPicturesHQ.java b/src/main/java/forge/gui/GuiMigrateLocalMWSSetPicturesHQ.java index 03a9ebc0684..150ac42e7c2 100644 --- a/src/main/java/forge/gui/GuiMigrateLocalMWSSetPicturesHQ.java +++ b/src/main/java/forge/gui/GuiMigrateLocalMWSSetPicturesHQ.java @@ -491,7 +491,7 @@ public final class GuiMigrateLocalMWSSetPicturesHQ extends DefaultBoundedRangeMo final String urlBase = "C:\\MTGForge\\HQPICS\\"; String imgFN = ""; - for (final CardPrinted cp : CardDb.instance().getAllCards()) + for (final CardPrinted cp : CardDb.instance().getAllTraditionalCards()) { // String url = c.getSVar("Picture"); // String[] URLs = url.split("\\\\"); diff --git a/src/main/java/forge/gui/deckeditor/controllers/CEditorConstructed.java b/src/main/java/forge/gui/deckeditor/controllers/CEditorConstructed.java index 663fc34874a..1e2395c4a7c 100644 --- a/src/main/java/forge/gui/deckeditor/controllers/CEditorConstructed.java +++ b/src/main/java/forge/gui/deckeditor/controllers/CEditorConstructed.java @@ -121,7 +121,7 @@ public final class CEditorConstructed extends ACEditorBase { @Override public void resetTables() { // Constructed mode can use all cards, no limitations. - this.getTableCatalog().setDeck(ItemPool.createFrom(CardDb.instance().getTraditionalCards(), CardPrinted.class)); + this.getTableCatalog().setDeck(ItemPool.createFrom(CardDb.instance().getAllTraditionalCards(), CardPrinted.class)); this.getTableDeck().setDeck(this.controller.getModel().getMain()); } diff --git a/src/main/java/forge/gui/download/GuiDownloadSetPicturesLQ.java b/src/main/java/forge/gui/download/GuiDownloadSetPicturesLQ.java index 6c1b14d85d6..46965cc4020 100644 --- a/src/main/java/forge/gui/download/GuiDownloadSetPicturesLQ.java +++ b/src/main/java/forge/gui/download/GuiDownloadSetPicturesLQ.java @@ -22,6 +22,8 @@ import java.util.ArrayList; import org.apache.commons.lang3.StringUtils; +import com.google.common.collect.Iterables; + import forge.CardUtil; import forge.Singletons; import forge.card.CardEdition; @@ -90,7 +92,9 @@ public class GuiDownloadSetPicturesLQ extends GuiDownloader { // read token names and urls final ArrayList cList = new ArrayList(); - for (final CardPrinted c : CardDb.instance().getAllCards()) { + Iterable allPrinted = Iterables.concat(CardDb.instance().getAllTraditionalCards(),CardDb.instance().getAllNonTraditionalCards()); + + for (final CardPrinted c : allPrinted) { final String setCode3 = c.getEdition(); if (StringUtils.isBlank(setCode3) || "???".equals(setCode3)) { continue; // we don't want cards from unknown sets diff --git a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java index 36691dde9cd..2c01b3ce7d5 100644 --- a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java +++ b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java @@ -151,6 +151,10 @@ public enum CSubmenuVanguard implements ICDoc { avatar = Iterables.get(view.getAllAiAvatars(),rnd.nextInt(Iterables.size(view.getAllAiAvatars()))); } } + else + { + avatar = (CardPrinted)playerAvatars.get(i); + } helper.addVanguardPlayer(player, playerDecks.get(i), avatar); } diff --git a/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java index 37848e8f93b..62e7d5ab257 100644 --- a/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java +++ b/src/main/java/forge/gui/home/variant/VSubmenuVanguard.java @@ -75,8 +75,7 @@ public enum VSubmenuVanguard implements IVSubmenu { private final JCheckBox cbArtifacts = new FCheckBox("Remove Artifacts"); private final JCheckBox cbRemoveSmall = new FCheckBox("Remove Small Creatures"); - private final Predicate avatarTypePred = CardPrinted.Predicates.type("Vanguard"); - private final Iterable allAvatars = Iterables.filter(CardDb.instance().getAllCards(), avatarTypePred); + private final Iterable allAvatars = Iterables.filter(CardDb.instance().getAllNonTraditionalCards(), CardPrinted.Predicates.type("Vanguard")); private final List allAiAvatars = new ArrayList(); ////////////////////////////// @@ -333,7 +332,7 @@ public enum VSubmenuVanguard implements IVSubmenu { public int getNumPlayers() { - return currentNumTabsShown-1; + return currentNumTabsShown; } /** diff --git a/src/main/java/forge/item/CardDb.java b/src/main/java/forge/item/CardDb.java index 3422d69f542..dd4a96ed0f4 100644 --- a/src/main/java/forge/item/CardDb.java +++ b/src/main/java/forge/item/CardDb.java @@ -93,7 +93,9 @@ public final class CardDb { // need this to obtain cardReference by name+set+artindex private final Map> allCardsBySet = new Hashtable>(); // this is the same list in flat storage - private final List allCardsFlat = new ArrayList(); + private final List allTraditionalCardsFlat = new ArrayList(); + + private final List allNonTraditionalCardsFlat = new ArrayList(); // Lambda to get rules for selects from list of printed cards /** The Constant fnGetCardPrintedByForgeCard. */ @@ -167,7 +169,11 @@ public final class CardDb { setMap.put(cardName, cardCopies); for (int i = 0; i < count; i++) { lastAdded = CardPrinted.build(card, set, s.getValue().getRarity(), i); - this.allCardsFlat.add(lastAdded); + if(lastAdded.isTraditional()) { + this.allTraditionalCardsFlat.add(lastAdded); + } else { + this.allNonTraditionalCardsFlat.add(lastAdded); + } cardCopies[i] = lastAdded; } @@ -360,17 +366,12 @@ public final class CardDb { * * @return the all cards */ - public Iterable getAllCards() { - return this.allCardsFlat; + public Iterable getAllTraditionalCards() { + return this.allTraditionalCardsFlat; } - /** - * Gets all "traditional" (non-scheme/vanguard/plane) cards - * - * @return the cards - */ - public Iterable getTraditionalCards() { - return Iterables.filter(getAllCards(), CardPrinted.Predicates.Presets.TRADITIONAL); + public Iterable getAllNonTraditionalCards() { + return this.allNonTraditionalCardsFlat; } /** @@ -400,7 +401,7 @@ public final class CardDb { } else { // OK, plain name here final Predicate predicate = CardPrinted.Predicates.name(nameWithSet.left); - final Iterable namedCards = Iterables.filter(this.allCardsFlat, predicate); + final Iterable namedCards = Iterables.filter(this.allTraditionalCardsFlat, predicate); // Find card with maximal set index result = Aggregates.itemWithMax(namedCards, CardPrinted.FN_GET_EDITION_INDEX); if (null == result) { diff --git a/src/main/java/forge/item/CardPrinted.java b/src/main/java/forge/item/CardPrinted.java index 437fc39efe4..e311224c983 100644 --- a/src/main/java/forge/item/CardPrinted.java +++ b/src/main/java/forge/item/CardPrinted.java @@ -110,6 +110,10 @@ public final class CardPrinted implements Comparable, InventoryItem public boolean isFoil() { return this.foiled; } + + public boolean isTraditional() { + return !(getType().contains("Vanguard") || getType().contains("Scheme") || getType().contains("Plane")); + } /** * Gets the card. diff --git a/src/main/java/forge/item/OpenablePack.java b/src/main/java/forge/item/OpenablePack.java index 079045d70d9..c4789a25bc1 100644 --- a/src/main/java/forge/item/OpenablePack.java +++ b/src/main/java/forge/item/OpenablePack.java @@ -175,7 +175,7 @@ public abstract class OpenablePack implements InventoryItemFromSet { Predicate cardsRule = Predicates.and( CardPrinted.Predicates.printedInSets(setCode), Predicates.compose(CardRulesPredicates.Presets.IS_BASIC_LAND, CardPrinted.FN_GET_RULES)); - return Aggregates.random(Iterables.filter(CardDb.instance().getTraditionalCards(), cardsRule), count); + return Aggregates.random(Iterables.filter(CardDb.instance().getAllTraditionalCards(), cardsRule), count); } } diff --git a/src/main/java/forge/quest/BoosterUtils.java b/src/main/java/forge/quest/BoosterUtils.java index 355a36a868b..01877c5f5db 100644 --- a/src/main/java/forge/quest/BoosterUtils.java +++ b/src/main/java/forge/quest/BoosterUtils.java @@ -88,7 +88,7 @@ public final class BoosterUtils { } // This will save CPU time when sets are limited - final List cardpool = Lists.newArrayList(Iterables.filter(CardDb.instance().getTraditionalCards(), filter)); + final List cardpool = Lists.newArrayList(Iterables.filter(CardDb.instance().getAllTraditionalCards(), filter)); final Predicate pCommon = CardPrinted.Predicates.Presets.IS_COMMON; cards.addAll(BoosterUtils.generateDefinetlyColouredCards(cardpool, pCommon, numCommon, colorFilters)); @@ -180,7 +180,7 @@ public final class BoosterUtils { * @return the list */ public static List generateDistinctCards(final Predicate filter, final int cntNeeded) { - return BoosterUtils.generateDistinctCards(CardDb.instance().getTraditionalCards(), filter, cntNeeded); + return BoosterUtils.generateDistinctCards(CardDb.instance().getAllTraditionalCards(), filter, cntNeeded); } /** diff --git a/src/main/java/forge/quest/QuestUtilCards.java b/src/main/java/forge/quest/QuestUtilCards.java index 29f9e9a4fdd..22c8282f0ef 100644 --- a/src/main/java/forge/quest/QuestUtilCards.java +++ b/src/main/java/forge/quest/QuestUtilCards.java @@ -189,7 +189,7 @@ public final class QuestUtilCards { final Predicate myFilter = applyFormatFilter(QuestUtilCards.RARE_PREDICATE); - final CardPrinted card = Aggregates.random(Iterables.filter(CardDb.instance().getTraditionalCards(), myFilter)); + final CardPrinted card = Aggregates.random(Iterables.filter(CardDb.instance().getAllTraditionalCards(), myFilter)); this.addSingleCard(card); return card; } @@ -204,7 +204,7 @@ public final class QuestUtilCards { public List addRandomRare(final int n) { final Predicate myFilter = applyFormatFilter(QuestUtilCards.RARE_PREDICATE); - final List newCards = Aggregates.random(Iterables.filter(CardDb.instance().getTraditionalCards(), myFilter), n); + final List newCards = Aggregates.random(Iterables.filter(CardDb.instance().getAllTraditionalCards(), myFilter), n); this.addAllCards(newCards); return newCards; } @@ -486,9 +486,9 @@ public final class QuestUtilCards { Iterable cardList = null; if (qc.getFormat() == null) { - cardList = CardDb.instance().getTraditionalCards(); } + cardList = CardDb.instance().getAllTraditionalCards(); } else { - cardList = Iterables.filter(CardDb.instance().getTraditionalCards(), qc.getFormat().getFilterPrinted()); + cardList = Iterables.filter(CardDb.instance().getAllTraditionalCards(), qc.getFormat().getFilterPrinted()); } final BoosterGenerator pack = new BoosterGenerator(cardList); From 4645ab8571ecad7b2bf02298ecb2be736b31bab5 Mon Sep 17 00:00:00 2001 From: moomarc Date: Sun, 25 Nov 2012 11:41:16 +0000 Subject: [PATCH 30/36] *Variants - Added the following avatars: Erhnam Djinn Avatar, Etched Oracle Avatar, and Fallen Angel Avatar --- .gitattributes | 3 +++ res/cardsfolder/e/erhnam_djinn_avatar.txt | 11 +++++++++++ res/cardsfolder/e/etched_oracle_avatar.txt | 10 ++++++++++ res/cardsfolder/f/fallen_angel_avatar.txt | 12 ++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 res/cardsfolder/e/erhnam_djinn_avatar.txt create mode 100644 res/cardsfolder/e/etched_oracle_avatar.txt create mode 100644 res/cardsfolder/f/fallen_angel_avatar.txt diff --git a/.gitattributes b/.gitattributes index 12a95af973b..a381237bbde 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3067,6 +3067,7 @@ res/cardsfolder/e/erayo_soratami_ascendant_erayos_essence.txt -text res/cardsfolder/e/erdwal_ripper.txt -text res/cardsfolder/e/erg_raiders.txt svneol=native#text/plain res/cardsfolder/e/erhnam_djinn.txt svneol=native#text/plain +res/cardsfolder/e/erhnam_djinn_avatar.txt -text res/cardsfolder/e/eron_the_relentless.txt svneol=native#text/plain res/cardsfolder/e/errant_doomsayers.txt svneol=native#text/plain res/cardsfolder/e/errant_ephemeron.txt svneol=native#text/plain @@ -3104,6 +3105,7 @@ res/cardsfolder/e/essence_warden.txt svneol=native#text/plain res/cardsfolder/e/etched_champion.txt svneol=native#text/plain res/cardsfolder/e/etched_monstrosity.txt svneol=native#text/plain res/cardsfolder/e/etched_oracle.txt svneol=native#text/plain +res/cardsfolder/e/etched_oracle_avatar.txt -text res/cardsfolder/e/eternal_dominion.txt -text res/cardsfolder/e/eternal_dragon.txt svneol=native#text/plain res/cardsfolder/e/eternal_flame.txt svneol=native#text/plain @@ -3236,6 +3238,7 @@ res/cardsfolder/f/falkenrath_noble.txt -text res/cardsfolder/f/falkenrath_torturer.txt -text res/cardsfolder/f/fall_of_the_gavel.txt -text res/cardsfolder/f/fallen_angel.txt svneol=native#text/plain +res/cardsfolder/f/fallen_angel_avatar.txt -text res/cardsfolder/f/fallen_askari.txt svneol=native#text/plain res/cardsfolder/f/fallen_cleric.txt svneol=native#text/plain res/cardsfolder/f/fallen_ferromancer.txt svneol=native#text/plain diff --git a/res/cardsfolder/e/erhnam_djinn_avatar.txt b/res/cardsfolder/e/erhnam_djinn_avatar.txt new file mode 100644 index 00000000000..76de2fb8194 --- /dev/null +++ b/res/cardsfolder/e/erhnam_djinn_avatar.txt @@ -0,0 +1,11 @@ +Name:Erhnam Djinn Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/+3 +T:Mode$ SpellCast | ValidCard$ Creature | ValidActivatingPlayer$ You | Execute$ DjinnisGift | TriggerZones$ Command | TriggerDescription$ Whenever you cast a creature spell, put a 1/1 green Saproling creature token onto the battlefield. +SVar:DjinnisGift:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182259&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/erhnam-djinn.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/e/etched_oracle_avatar.txt b/res/cardsfolder/e/etched_oracle_avatar.txt new file mode 100644 index 00000000000..9ab42683883 --- /dev/null +++ b/res/cardsfolder/e/etched_oracle_avatar.txt @@ -0,0 +1,10 @@ +Name:Etched Oracle Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+1/-4 +S:Mode$ Continuous | EffectZone$ Command | Affected$ Card.YouCtrl | AddHiddenKeyword$ HIDDEN Alternative Cost W U B R G | AffectedZone$ Hand,Graveyard,Exile,Library | Description$ You may pay W U B R G rather than pay the mana cost for spells that you cast. +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182298&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/etched-oracle.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/f/fallen_angel_avatar.txt b/res/cardsfolder/f/fallen_angel_avatar.txt new file mode 100644 index 00000000000..e9ff5248cba --- /dev/null +++ b/res/cardsfolder/f/fallen_angel_avatar.txt @@ -0,0 +1,12 @@ +Name:Fallen Angel Avatar +ManaCost:no cost +Types:Vanguard +Text:no text +HandLifeModifier:+0/-5 +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.YouCtrl | Execute$ TrigDrain | TriggerZones$ Command | TriggerDescription$ Whenever a creature you control dies, target opponent loses 1 life and you gain 1 life. +SVar:TrigDrain:AB$ LoseLife | Cost$ 0 | ValidTgts$ Opponent | LifeAmount$ 1 | SubAbility$ DBGainLife +SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ 1 +SVar:Rarity:Special +SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=182303&type=card +SetInfo:VAN|Special|http://magiccards.info/extras/other/vanguard-mtgo/fallen-angel.jpg +End \ No newline at end of file From f9efa46ca155baee773e0573e06f9a4e434ecde9 Mon Sep 17 00:00:00 2001 From: Hellfish Date: Sun, 25 Nov 2012 13:18:37 +0000 Subject: [PATCH 31/36] *Variants: Added error handling for managing not to select deck/avatar in vanguard mode. *Variants: Prevented user from selecting multiple avatars. --- .../gui/home/variant/CSubmenuVanguard.java | 50 ++++++++++++------- .../gui/home/variant/VSubmenuVanguard.java | 1 + 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java index 2c01b3ce7d5..3a786325ca6 100644 --- a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java +++ b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java @@ -12,6 +12,7 @@ import javax.swing.SwingWorker; import com.google.common.collect.Iterables; import forge.Command; +import forge.GameActionUtil; import forge.Singletons; import forge.control.Lobby; import forge.deck.Deck; @@ -117,27 +118,28 @@ public enum CSubmenuVanguard implements ICDoc { final SwingWorker worker = new SwingWorker() { @Override public Object doInBackground() { - List playerDecks = new ArrayList(); - for(FDeckChooser fdc : view.getDeckChoosers()) - { - playerDecks.add(fdc.getDeck()); - } - - List playerAvatars = new ArrayList(); - for(FList fl : view.getAvatarLists()) - { - playerAvatars.add(fl.getSelectedValue()); - } - - Lobby lobby = Singletons.getControl().getLobby(); - MatchStartHelper helper = new MatchStartHelper(); Random rnd = new Random(); + + List playerDecks = new ArrayList(); for(int i=0;i playerAvatars = new ArrayList(); + for(int i=0;i { tempList.setListData(i == 0 ? humanListData : aiListData); tempList.setSelectedIndex(0); + tempList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); deckChoosers.add(tempChooser); avatarLists.add(tempList); From 01ca0205e0258435d65fb12a68424a8e62c1e610 Mon Sep 17 00:00:00 2001 From: Maxmtg Date: Sun, 25 Nov 2012 20:14:39 +0000 Subject: [PATCH 32/36] commander stored as a single card in deck/Deck.java removed inpropper use of getType of InventoryItem objects --- src/main/java/forge/deck/Deck.java | 41 +++++---- src/main/java/forge/item/CardDb.java | 2 + src/main/java/forge/item/ItemPredicate.java | 94 ++++---------------- src/main/java/forge/item/TournamentPack.java | 6 +- 4 files changed, 51 insertions(+), 92 deletions(-) diff --git a/src/main/java/forge/deck/Deck.java b/src/main/java/forge/deck/Deck.java index 003265ce843..92422852d80 100644 --- a/src/main/java/forge/deck/Deck.java +++ b/src/main/java/forge/deck/Deck.java @@ -35,6 +35,7 @@ import com.google.common.base.Function; import forge.deck.io.DeckFileHeader; import forge.deck.io.DeckSerializer; import forge.gui.deckeditor.tables.TableSorter; +import forge.item.CardDb; import forge.item.CardPrinted; import forge.item.ItemPoolView; import forge.game.GameType; @@ -62,7 +63,7 @@ public class Deck extends DeckBase { private final DeckSection main; private final DeckSection sideboard; - private final DeckSection commander; + private CardPrinted commander; private final DeckSection planes; private final DeckSection schemes; @@ -85,7 +86,7 @@ public class Deck extends DeckBase { super(name0); this.main = new DeckSection(); this.sideboard = new DeckSection(); - this.commander = new DeckSection(); + this.commander = null; this.planes = new DeckSection(); this.schemes = new DeckSection(); } @@ -203,7 +204,9 @@ public class Deck extends DeckBase { d.getMain().set(Deck.readCardList(sections.get("main"))); d.getSideboard().set(Deck.readCardList(sections.get("sideboard"))); - d.getCommander().set(Deck.readCardList(sections.get("commander"))); + List cmd = Deck.readCardList(sections.get("commander")); + String cmdName = cmd.isEmpty() ? null : cmd.get(0); + d.commander = CardDb.instance().isCardSupported(cmdName) ? CardDb.instance().getCard(cmdName) : null; d.getPlanes().set(Deck.readCardList(sections.get("planes"))); d.getSchemes().set(Deck.readCardList(sections.get("schemes"))); return d; @@ -244,16 +247,20 @@ public class Deck extends DeckBase { Collections.sort(main2sort, TableSorter.BY_NAME_THEN_SET); final List out = new ArrayList(); for (final Entry e : main2sort) { - final CardPrinted card = e.getKey(); - final boolean hasBadSetInfo = "???".equals(card.getEdition()) || StringUtils.isBlank(card.getEdition()); - if (hasBadSetInfo) { - out.add(String.format("%d %s", e.getValue(), card.getName())); - } else { - out.add(String.format("%d %s|%s", e.getValue(), card.getName(), card.getEdition())); - } + out.add(serializeSingleCard(e.getKey(), e.getValue())); } return out; } + + private static String serializeSingleCard(CardPrinted card, Integer n) { + + final boolean hasBadSetInfo = "???".equals(card.getEdition()) || StringUtils.isBlank(card.getEdition()); + if (hasBadSetInfo) { + return String.format("%d %s", n, card.getName()); + } else { + return String.format("%d %s|%s", n, card.getName(), card.getEdition()); + } + } /** *

@@ -279,8 +286,10 @@ public class Deck extends DeckBase { out.add(String.format("%s", "[sideboard]")); out.addAll(Deck.writeCardPool(this.getSideboard())); - out.add(String.format("%s", "[commander]")); - out.addAll(Deck.writeCardPool(this.getCommander())); + if ( getCommander() != null ) { + out.add(String.format("%s", "[commander]")); + out.add(Deck.serializeSingleCard(getCommander(), 1)); + } out.add(String.format("%s", "[planes]")); out.addAll(Deck.writeCardPool(this.getPlanes())); @@ -346,14 +355,14 @@ public class Deck extends DeckBase { if(type == GameType.Commander) {//Must contain exactly 1 legendary Commander and no sideboard. //TODO:Enforce color identity - if(getCommander().countAll() != 1) + if ( null == getCommander()) return false; - if(!getCommander().toFlatList().get(0).getType().contains("Legendary")) + if(!getCommander().getCard().getType().isLegendary()) return false; //No sideboarding in Commander - if(getSideboard().countAll() > 0) + if(!getSideboard().isEmpty()) return false; } else if(type == GameType.Planechase) @@ -389,7 +398,7 @@ public class Deck extends DeckBase { /** * @return the commander */ - public DeckSection getCommander() { + public CardPrinted getCommander() { return commander; } diff --git a/src/main/java/forge/item/CardDb.java b/src/main/java/forge/item/CardDb.java index dd4a96ed0f4..6d1605dba6f 100644 --- a/src/main/java/forge/item/CardDb.java +++ b/src/main/java/forge/item/CardDb.java @@ -220,6 +220,8 @@ public final class CardDb { * @return true, if is card supported */ public boolean isCardSupported(final String cardName0) { + if ( null == cardName0 ) return false; // obviously + final boolean isFoil = this.isFoil(cardName0); final String cardName = isFoil ? this.removeFoilSuffix(cardName0) : cardName0; final ImmutablePair nameWithSet = CardDb.splitCardName(cardName); diff --git a/src/main/java/forge/item/ItemPredicate.java b/src/main/java/forge/item/ItemPredicate.java index e53c78712d2..9caeb713594 100644 --- a/src/main/java/forge/item/ItemPredicate.java +++ b/src/main/java/forge/item/ItemPredicate.java @@ -13,141 +13,85 @@ public abstract class ItemPredicate { // Static builder methods - they choose concrete implementation by // themselves - /** - * Booster Pack. - * - * @return the predicate - */ - public static Predicate boosterPack() { - return new PredicateBoosterPack(); - } - - /** - * Fat Pack. - * - * @return the predicate - */ - public static Predicate fatPack() { - return new PredicateFatPack(); - } - - /** - * Tournament Pack. - * - * @return the predicate - */ - public static Predicate tournamentPack() { - return new PredicateTournamentPack(); - } - - /** - * Starter Deck. - * - * @return the predicate - */ - public static Predicate starterDeck() { - return new PredicateStarterDeck(); - } - - /** - * Prebuilt Deck. - * - * @return the predicate - */ - public static Predicate prebuiltDeck() { - return new PredicatePrebuiltDeck(); - } /** * Checks that the inventory item is a Booster Pack. * * @return the predicate */ - public static class PredicateBoosterPack implements Predicate { + public static Predicate IsBoosterPack = new Predicate() { @Override public boolean apply(final InventoryItem card) { - return card.getType() == "Booster Pack"; + return card instanceof BoosterPack; } - } + }; /** * Checks that the inventory item is a Fat Pack. * * @return the predicate */ - public static class PredicateFatPack implements Predicate { + public static Predicate IsFatPack = new Predicate() { @Override public boolean apply(final InventoryItem card) { - return card.getType() == "Fat Pack"; + return card instanceof FatPack; } - } + }; /** * Checks that the inventory item is a Tournament Pack. * * @return the predicate */ - public static class PredicateTournamentPack implements Predicate { + public static Predicate IsTournamentPack = new Predicate() { @Override public boolean apply(final InventoryItem card) { - return card.getType() == "Tournament Pack"; + return card instanceof TournamentPack && !((TournamentPack)card).isStarterDeck(); } - } + }; /** * Checks that the inventory item is a Starter Deck. * * @return the predicate */ - public static class PredicateStarterDeck implements Predicate { + public static Predicate IsStarterDeck = new Predicate() { @Override public boolean apply(final InventoryItem card) { - return card.getType() == "Starter Deck"; + return card instanceof TournamentPack && ((TournamentPack)card).isStarterDeck(); } - } + }; /** * Checks that the inventory item is a Prebuilt Deck. * * @return the predicate */ - public static class PredicatePrebuiltDeck implements Predicate { + public static Predicate IsPrebuiltDeck = new Predicate() { @Override public boolean apply(final InventoryItem card) { - return card.getType() == "Prebuilt Deck"; + return card instanceof PreconDeck; } - } - + }; + + /** * The Class Presets. */ public static class Presets { - /** The Item IsBoosterPack. */ - public static final Predicate IS_BOOSTER_PACK = boosterPack(); - /** The Item IsFatPack. */ - public static final Predicate IS_FAT_PACK = fatPack(); - - /** The Item IsTournamentPack. */ - public static final Predicate IS_TOURNAMENT_PACK = tournamentPack(); /** The Item IsPack. */ @SuppressWarnings("unchecked") - public static final Predicate IS_PACK = Predicates.or(IS_BOOSTER_PACK, IS_FAT_PACK, IS_TOURNAMENT_PACK); - - /** The Item IsStarterDeck. */ - public static final Predicate IS_STARTER_DECK = starterDeck(); - - /** The Item IsPrebuiltDeck. */ - public static final Predicate IS_PREBUILT_DECK = prebuiltDeck(); + public static final Predicate IS_PACK = Predicates.or(IsBoosterPack, IsFatPack, IsTournamentPack); /** The Item IsDeck. */ - public static final Predicate IS_DECK = Predicates.or(IS_STARTER_DECK, IS_PREBUILT_DECK); + public static final Predicate IS_DECK = Predicates.or(IsStarterDeck, IsPrebuiltDeck); } } diff --git a/src/main/java/forge/item/TournamentPack.java b/src/main/java/forge/item/TournamentPack.java index 837005dc9ac..070bbb13e3d 100644 --- a/src/main/java/forge/item/TournamentPack.java +++ b/src/main/java/forge/item/TournamentPack.java @@ -58,10 +58,14 @@ public class TournamentPack extends OpenablePack { return ImageCache.SEALED_PRODUCT + "tournamentpacks/" + this.contents.getEdition(); } + public final boolean isStarterDeck() { + return contents.getCommon() < 30; + } + @Override public final String getType() { - return contents.getCommon() >= 30 ? "Tournament Pack" : "Starter Deck"; + return !isStarterDeck() ? "Tournament Pack" : "Starter Deck"; } @Override From 3ee1d4043d04e49f1e28fd092d38bab3798f0d96 Mon Sep 17 00:00:00 2001 From: Maxmtg Date: Sun, 25 Nov 2012 20:19:06 +0000 Subject: [PATCH 33/36] check 4 traditionality of card --- src/main/java/forge/item/CardPrinted.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/forge/item/CardPrinted.java b/src/main/java/forge/item/CardPrinted.java index e311224c983..e2a01e53070 100644 --- a/src/main/java/forge/item/CardPrinted.java +++ b/src/main/java/forge/item/CardPrinted.java @@ -112,7 +112,7 @@ public final class CardPrinted implements Comparable, InventoryItem } public boolean isTraditional() { - return !(getType().contains("Vanguard") || getType().contains("Scheme") || getType().contains("Plane")); + return !getCard().getType().isVanguard(); } /** From 954a5049a268dd8a6cd024774055ae6537a8337d Mon Sep 17 00:00:00 2001 From: Sloth Date: Mon, 26 Nov 2012 18:58:29 +0000 Subject: [PATCH 34/36] - Variant: Fixed non-Random Vanguard selected. --- src/main/java/forge/gui/home/variant/CSubmenuVanguard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java index 3a786325ca6..4ac46cf4ac6 100644 --- a/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java +++ b/src/main/java/forge/gui/home/variant/CSubmenuVanguard.java @@ -155,7 +155,7 @@ public enum CSubmenuVanguard implements ICDoc { } else { - avatar = (CardPrinted)playerAvatars.get(i); + avatar = (CardPrinted) obj; } if(avatar == null) { From b452fa66e088ff625f9e1d37b082a62a39e4fcb2 Mon Sep 17 00:00:00 2001 From: Sloth Date: Mon, 26 Nov 2012 19:20:31 +0000 Subject: [PATCH 35/36] - Fixed Karn Avatar. --- res/cardsfolder/k/karn.txt | 2 +- res/cardsfolder/m/march_of_the_machines.txt | 2 +- src/main/java/forge/Card.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/res/cardsfolder/k/karn.txt b/res/cardsfolder/k/karn.txt index d9698659da0..e984e137df3 100644 --- a/res/cardsfolder/k/karn.txt +++ b/res/cardsfolder/k/karn.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Vanguard Text:no text HandLifeModifier:+1/+6 -S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.nonCreature+YouCtrl | SetPower$ AffectedX | SetToughness$ AffectedX | References$ AffectedX | AddType$ Creature | Description$ Each noncreature artifact you control is an artifact creature with power and toughness each equal to its converted mana cost. +S:Mode$ Continuous | EffectZone$ Command | Affected$ Artifact.nonCreature+YouCtrl | SetPower$ AffectedX | SetToughness$ AffectedX | AddType$ Creature | Description$ Each noncreature artifact you control is an artifact creature with power and toughness each equal to its converted mana cost. SVar:AffectedX:Count$CardManaCost SVar:Rarity:Special SVar:Picture:http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=4963&type=card diff --git a/res/cardsfolder/m/march_of_the_machines.txt b/res/cardsfolder/m/march_of_the_machines.txt index b85a833dc92..220e6f86f32 100644 --- a/res/cardsfolder/m/march_of_the_machines.txt +++ b/res/cardsfolder/m/march_of_the_machines.txt @@ -2,7 +2,7 @@ Name:March of the Machines ManaCost:3 U Types:Enchantment Text:no text -S:Mode$ Continuous | Affected$ Artifact.nonCreature | SetPower$ AffectedX | SetToughness$ AffectedX | References$ AffectedX | AddType$ Creature | Description$ Each noncreature artifact is an artifact creature with power and toughness each equal to its converted mana cost. (Equipment that's a creature can't equip a creature.) +S:Mode$ Continuous | Affected$ Artifact.nonCreature | SetPower$ AffectedX | SetToughness$ AffectedX | AddType$ Creature | Description$ Each noncreature artifact is an artifact creature with power and toughness each equal to its converted mana cost. (Equipment that's a creature can't equip a creature.) SVar:AffectedX:Count$CardManaCost SVar:PlayMain1:TRUE SVar:RemRandomDeck:True diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 7d38f697743..273c18c2ffd 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -4391,8 +4391,8 @@ public class Card extends GameEntity implements Comparable { * @return CardPowerToughness */ public final CardPowerToughness getLatestPT() { - CardPowerToughness latestPT = new CardPowerToughness(-1, -1, 0); - long max = 0; + CardPowerToughness latestPT = new CardPowerToughness(-1, -1, -2); + long max = -2; for (final CardPowerToughness pt : this.newPT) { if (pt.getTimestamp() >= max) { From 46ac6a540f35c51ce21989d17761763fd419c525 Mon Sep 17 00:00:00 2001 From: moomarc Date: Tue, 27 Nov 2012 13:44:01 +0000 Subject: [PATCH 36/36] *Variants:Fixed exile origins for some effects --- res/cardsfolder/a/acidic_dagger.txt | 2 +- res/cardsfolder/a/awe_strike.txt | 6 +++--- res/cardsfolder/b/blinding_beam.txt | 2 +- res/cardsfolder/b/bone_mask.txt | 2 +- res/cardsfolder/b/brace_for_impact.txt | 4 ++-- res/cardsfolder/c/cho_arrim_alchemist.txt | 2 +- res/cardsfolder/c/circle_of_protection_artifacts.txt | 2 +- res/cardsfolder/c/circle_of_protection_black.txt | 2 +- res/cardsfolder/c/circle_of_protection_blue.txt | 2 +- res/cardsfolder/c/circle_of_protection_green.txt | 2 +- res/cardsfolder/c/circle_of_protection_red.txt | 2 +- res/cardsfolder/c/circle_of_protection_shadow.txt | 2 +- res/cardsfolder/c/circle_of_protection_white.txt | 2 +- res/cardsfolder/c/circle_of_solace.txt | 2 +- res/cardsfolder/d/delifs_cube.txt | 2 +- res/cardsfolder/e/eladamri.txt | 8 ++++---- res/cardsfolder/g/generals_regalia.txt | 2 +- res/cardsfolder/g/greater_realm_of_preservation.txt | 2 +- res/cardsfolder/g/guardian_angel.txt | 2 +- res/cardsfolder/h/haazda_shield_mate.txt | 2 +- res/cardsfolder/h/heart_wolf.txt | 2 +- res/cardsfolder/i/intervention_pact.txt | 2 +- res/cardsfolder/i/invulnerability.txt | 2 +- res/cardsfolder/j/jade_monolith.txt | 2 +- res/cardsfolder/k/karonas_zealot.txt | 8 ++++---- res/cardsfolder/k/kjeldoran_elite_guard.txt | 2 +- res/cardsfolder/l/lancers_en_kor.txt | 12 ++++++------ res/cardsfolder/n/nomads_en_kor.txt | 12 ++++++------ res/cardsfolder/o/oracles_attendants.txt | 3 +-- res/cardsfolder/o/outrider_en_kor.txt | 12 ++++++------ res/cardsfolder/p/pentagram_of_the_ages.txt | 2 +- res/cardsfolder/p/pilgrim_of_justice.txt | 2 +- res/cardsfolder/p/pilgrim_of_virtue.txt | 2 +- res/cardsfolder/p/prismatic_circle.txt | 2 +- res/cardsfolder/r/reverse_damage.txt | 2 +- res/cardsfolder/r/righteous_aura.txt | 2 +- res/cardsfolder/r/rune_of_protection_artifacts.txt | 2 +- res/cardsfolder/r/rune_of_protection_black.txt | 2 +- res/cardsfolder/r/rune_of_protection_blue.txt | 2 +- res/cardsfolder/r/rune_of_protection_green.txt | 2 +- res/cardsfolder/r/rune_of_protection_lands.txt | 2 +- res/cardsfolder/r/rune_of_protection_red.txt | 2 +- res/cardsfolder/r/rune_of_protection_white.txt | 2 +- res/cardsfolder/s/sandals_of_abdallah.txt | 2 +- res/cardsfolder/s/seasoned_tactician.txt | 2 +- res/cardsfolder/s/shaman_en_kor.txt | 2 +- res/cardsfolder/s/shield_dancer.txt | 6 +++--- res/cardsfolder/s/sivvi's_valor.txt | 2 +- res/cardsfolder/s/spirit_en_kor.txt | 2 +- res/cardsfolder/s/story_circle.txt | 2 +- res/cardsfolder/v/vassals_duty.txt | 2 +- res/cardsfolder/v/vigorous_charge.txt | 4 ++-- res/cardsfolder/w/ward_of_piety.txt | 12 ++++++------ res/cardsfolder/w/warrior_en_kor.txt | 12 ++++++------ res/cardsfolder/w/words_of_war.txt | 4 ++-- res/cardsfolder/w/words_of_waste.txt | 4 ++-- res/cardsfolder/w/words_of_wilding.txt | 4 ++-- res/cardsfolder/w/words_of_wind.txt | 2 +- res/cardsfolder/w/words_of_worship.txt | 4 ++-- res/cardsfolder/z/zealous_inquisitor.txt | 12 ++++++------ res/cardsfolder/z/zhalfirin_crusader.txt | 12 ++++++------ 61 files changed, 112 insertions(+), 113 deletions(-) diff --git a/res/cardsfolder/a/acidic_dagger.txt b/res/cardsfolder/a/acidic_dagger.txt index db02128ac45..2e7c76312e8 100644 --- a/res/cardsfolder/a/acidic_dagger.txt +++ b/res/cardsfolder/a/acidic_dagger.txt @@ -7,7 +7,7 @@ SVar:TrigDam:Mode$ DamageDone | ValidSource$ Creature.IsRemembered | ValidTarget SVar:TrigLeave:Mode$ ChangesZone | ValidCard$ Creature.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ TrigSac | TriggerDescription$ When the targeted creature leaves the battlefield this turn, sacrifice Acidic Dagger. SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | Defined$ TriggeredTarget SVar:TrigSac:DB$ SacrificeAll | Defined$ Imprinted | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/acidic_dagger.jpg diff --git a/res/cardsfolder/a/awe_strike.txt b/res/cardsfolder/a/awe_strike.txt index 17e19d637f0..b511b58cf55 100644 --- a/res/cardsfolder/a/awe_strike.txt +++ b/res/cardsfolder/a/awe_strike.txt @@ -4,10 +4,10 @@ Types:Instant Text:no text A:SP$ Effect | Cost$ W | ValidTgts$ Creature | TgtPrompt$ Select target creature to entrance | Name$ Awe Struck | ReplacementEffects$ StrikeWithAwe | Triggers$ OutOfSight | SVars$ ExileEffect,GainLifeInstead,X | RememberObjects$ Targeted | AILogic$ Fog | SpellDescription$ The next time target creature would deal damage this turn, prevent that damage. You gain life equal to the damage prevented this way. SVar:StrikeWithAwe:Event$ DamageDone | ValidSource$ Card.IsRemembered | ReplaceWith$ GainLifeInstead | PreventionEffect$ True | Description$ The next time the targeted creature would deal damage this turn, prevent that damage. You gain life equal to the damage prevented this way. -SVar:GainLifeInstead:AB$GainLife | Cost$ 0 | Defined$ You | LifeAmount$ X | SubAbility$ ExileEffect | References$ X +SVar:GainLifeInstead:AB$ GainLife | Cost$ 0 | Defined$ You | LifeAmount$ X | SubAbility$ ExileEffect | References$ X SVar:X:ReplaceCount$DamageAmount -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/awe_strike.jpg SetInfo:MRD|Common|http://magiccards.info/scans/en/mi/6.jpg diff --git a/res/cardsfolder/b/blinding_beam.txt b/res/cardsfolder/b/blinding_beam.txt index a5e5f3b0fb0..67c8d93147b 100644 --- a/res/cardsfolder/b/blinding_beam.txt +++ b/res/cardsfolder/b/blinding_beam.txt @@ -8,7 +8,7 @@ A:SP$ Effect | Cost$ 3 W | ValidTgts$ Player | TgtPrompt$ Select target player | SVar:BlindTheFoe:DB$ Tap | ValidTgts$ Creature | TargetMin$ 2 | TargetMax$ 2 | TgtPrompt$ Select two target creatures SVar:DontUntap:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield | Affected$ Creature.RememberedPlayerCtrl | AddHiddenKeyword$ HIDDEN This card doesn't untap during your next untap step. SVar:RestoreSight:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player.IsRemembered | TriggerZones$ Battlefield | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/blinding_beam.jpg diff --git a/res/cardsfolder/b/bone_mask.txt b/res/cardsfolder/b/bone_mask.txt index 049179faa08..748ac3d8288 100644 --- a/res/cardsfolder/b/bone_mask.txt +++ b/res/cardsfolder/b/bone_mask.txt @@ -6,7 +6,7 @@ A:AB$ ChooseSource | Cost$ 2 T | Choices$ Card | RememberChosen$ True | AILogic$ SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect,ExileFromLibInstead,X | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileFromLibInstead | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. SVar:ExileFromLibInstead:DB$ Mill | Defined$ You | Destination$ Exile | NumCards$ X | References$ X -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:X:ReplaceCount$DamageAmount SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True diff --git a/res/cardsfolder/b/brace_for_impact.txt b/res/cardsfolder/b/brace_for_impact.txt index f4318388d0f..6808069634c 100644 --- a/res/cardsfolder/b/brace_for_impact.txt +++ b/res/cardsfolder/b/brace_for_impact.txt @@ -4,10 +4,10 @@ Types:Instant Text:no text A:SP$ Effect | Cost$ 4 W | ValidTgts$ Creature.MultiColor | TgtPrompt$ Select target multicolored creature | Name$ Brace Effect | Triggers$ EndTrackingEffect | ReplacementEffects$ BraceReplace | SVars$ ImpactCounters,X,ExileEffect | RememberObjects$ Targeted | SpellDescription$ Prevent all damage that would be dealt to target multicolored creature this turn. For each 1 damage prevented this way, put a +1/+1 counter on that creature. SVar:BraceReplace:Event$ DamageDone | ValidTarget$ Card.IsRemembered | ReplaceWith$ ImpactCounters | PreventionEffect$ True | Description$ Prevent all damage that would be dealt to targeted multicolored creature this turn. For each 1 damage prevented this way, put a +1/+1 counter on that creature. -SVar:ImpactCounters:AB$PutCounter | Cost$ 0 | Defined$ ReplacedTarget | CounterType$ P1P1 | CounterNum$ X +SVar:ImpactCounters:AB$ PutCounter | Cost$ 0 | Defined$ ReplacedTarget | CounterType$ P1P1 | CounterNum$ X SVar:X:ReplaceCount$DamageAmount SVar:EndTrackingEffect:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/brace_for_impact.jpg diff --git a/res/cardsfolder/c/cho_arrim_alchemist.txt b/res/cardsfolder/c/cho_arrim_alchemist.txt index e4a1dcb4626..6b4effb0f9e 100644 --- a/res/cardsfolder/c/cho_arrim_alchemist.txt +++ b/res/cardsfolder/c/cho_arrim_alchemist.txt @@ -7,7 +7,7 @@ A:AB$ ChooseSource | Cost$ 1 W W T Discard<1/Card> | Choices$ Card | RememberCho SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect,GainLifeInstead,X | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ GainLifeInstead | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. You gain life equal to the damage prevented this way. SVar:GainLifeInstead:DB$ GainLife | Defined$ You | LifeAmount$ X | SubAbility$ ExileEffect | References$ X -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:X:ReplaceCount$DamageAmount SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare diff --git a/res/cardsfolder/c/circle_of_protection_artifacts.txt b/res/cardsfolder/c/circle_of_protection_artifacts.txt index 10fdf24c2b3..b99e16d9dce 100644 --- a/res/cardsfolder/c/circle_of_protection_artifacts.txt +++ b/res/cardsfolder/c/circle_of_protection_artifacts.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ 2 | Choices$ Artifact | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time an artifact source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Uncommon SetInfo:5DN|Uncommon|http://magiccards.info/scans/en/5dn/8.jpg diff --git a/res/cardsfolder/c/circle_of_protection_black.txt b/res/cardsfolder/c/circle_of_protection_black.txt index 657e40304fe..fecfa61b9af 100644 --- a/res/cardsfolder/c/circle_of_protection_black.txt +++ b/res/cardsfolder/c/circle_of_protection_black.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ 1 | Choices$ Card.Black | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a black source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/c/circle_of_protection_blue.txt b/res/cardsfolder/c/circle_of_protection_blue.txt index 9a9ae30cb7c..0bba7d04983 100644 --- a/res/cardsfolder/c/circle_of_protection_blue.txt +++ b/res/cardsfolder/c/circle_of_protection_blue.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ 1 | Choices$ Card.Blue | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a blue source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/c/circle_of_protection_green.txt b/res/cardsfolder/c/circle_of_protection_green.txt index a5fd450a31b..dab76ed99cc 100644 --- a/res/cardsfolder/c/circle_of_protection_green.txt +++ b/res/cardsfolder/c/circle_of_protection_green.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ 1 | Choices$ Card.Green | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a green source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/c/circle_of_protection_red.txt b/res/cardsfolder/c/circle_of_protection_red.txt index 37c71d3c6e1..72460153654 100644 --- a/res/cardsfolder/c/circle_of_protection_red.txt +++ b/res/cardsfolder/c/circle_of_protection_red.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ 1 | Choices$ Card.Red | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a red source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/c/circle_of_protection_shadow.txt b/res/cardsfolder/c/circle_of_protection_shadow.txt index 18b5ae834be..068f256d391 100644 --- a/res/cardsfolder/c/circle_of_protection_shadow.txt +++ b/res/cardsfolder/c/circle_of_protection_shadow.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseCard | Cost$ 1 | Choices$ Creature.withShadow | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SVars$ DBEffect,RPreventNextFromCreature,ExileEffect | SpellDescription$ The next time a creature of your choice with shadow would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromCreature | RememberObjects$ Remembered | SVars$ RPreventNextFromCreature,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromCreature:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time a creature of your choice with shadow would deal damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True SVar:Rarity:Common diff --git a/res/cardsfolder/c/circle_of_protection_white.txt b/res/cardsfolder/c/circle_of_protection_white.txt index cf67457cebd..2162fea8c5c 100644 --- a/res/cardsfolder/c/circle_of_protection_white.txt +++ b/res/cardsfolder/c/circle_of_protection_white.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ 1 | Choices$ Card.White | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a white source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/c/circle_of_solace.txt b/res/cardsfolder/c/circle_of_solace.txt index 9848920e0e6..fee803f5ae5 100644 --- a/res/cardsfolder/c/circle_of_solace.txt +++ b/res/cardsfolder/c/circle_of_solace.txt @@ -7,7 +7,7 @@ SVar:ChooseCT:AB$ ChooseType | Cost$ 0 | Defined$ You | Type$ Creature | AILogic A:AB$ ChooseCard | Cost$ 1 W | Choices$ Creature.ChosenType | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SVars$ DBEffect,RPreventNextFromCreature,ExileEffect | SpellDescription$ The next time a creature of the chosen type would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromCreature | RememberObjects$ Remembered | SVars$ RPreventNextFromCreature,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromCreature:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time a creature of the chosen type would deal damage to you this turn, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/d/delifs_cube.txt b/res/cardsfolder/d/delifs_cube.txt index 968ce779901..063d7ceecdc 100644 --- a/res/cardsfolder/d/delifs_cube.txt +++ b/res/cardsfolder/d/delifs_cube.txt @@ -7,7 +7,7 @@ SVar:TrigAttackerUnblocked:Mode$ AttackerUnblocked | ValidCard$ Card.IsRemembere SVar:DBPump:DB$Pump | Defined$ Remembered | KW$ HIDDEN CARDNAME assigns no combat damage | SubAbility$ PutCounter SVar:PutCounter:DB$PutCounter | Defined$ Imprinted | CounterType$ CUBE | CounterNum$ 1 | SubAbility$ ExileEffect SVar:TrigLeave:Mode$ ChangesZone | ValidCard$ Creature.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True A:AB$ Regenerate | Cost$ 2 SubCounter<1/CUBE> | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Regenerate target creature. SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/e/eladamri.txt b/res/cardsfolder/e/eladamri.txt index 59cd6734e53..08e6153b715 100644 --- a/res/cardsfolder/e/eladamri.txt +++ b/res/cardsfolder/e/eladamri.txt @@ -4,14 +4,14 @@ Types:Vanguard Text:no text HandLifeModifier:-1/+15 A:AB$ Effect | ActivationZone$ Command | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature to redirect damage from | ReplacementEffects$ SelflessCombat,SelflessNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,RestDmgCombat,RestDmg,ExileEffect,X,Y | References$ SelflessCombat,SelflessNonCombat,OutOfSight,CombatDmg,NonCombatDmg,RestDmgCombat,RestDmg,ExileEffect,X,Y | RememberObjects$ Targeted | Duration$ Permanent | SpellDescription$ The next 1 damage that would be dealt to target creature you control is dealt to you instead. -SVar:SelflessCombat:Event$ DamageDone | ValidTarget$ Card.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to target creature you control is dealt to you instead. -SVar:SelflessNonCombat:Event$ DamageDone | ValidTarget$ Card.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to target creature you control is dealt to you instead. +SVar:SelflessCombat:Event$ DamageDone | ActiveZones$ Command | ValidTarget$ Card.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to target creature you control is dealt to you instead. +SVar:SelflessNonCombat:Event$ DamageDone | ActiveZones$ Command | ValidTarget$ Card.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to target creature you control is dealt to you instead. SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 SVar:RestDmgCombat:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect -SVar:RestDmg:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:Rarity:Special diff --git a/res/cardsfolder/g/generals_regalia.txt b/res/cardsfolder/g/generals_regalia.txt index 6928eb4034a..82d30cad306 100644 --- a/res/cardsfolder/g/generals_regalia.txt +++ b/res/cardsfolder/g/generals_regalia.txt @@ -9,7 +9,7 @@ SVar:SelflessNonCombat:Event$ DamageDone | ValidTarget$ You | ValidSource$ Card. SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/g/greater_realm_of_preservation.txt b/res/cardsfolder/g/greater_realm_of_preservation.txt index a9239bc8ba4..f8770ada4b6 100644 --- a/res/cardsfolder/g/greater_realm_of_preservation.txt +++ b/res/cardsfolder/g/greater_realm_of_preservation.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ 1 W | Choices$ Card.Black,Card.Red | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a black or red source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/g/guardian_angel.txt b/res/cardsfolder/g/guardian_angel.txt index e8cda2095f4..436829ad531 100644 --- a/res/cardsfolder/g/guardian_angel.txt +++ b/res/cardsfolder/g/guardian_angel.txt @@ -6,7 +6,7 @@ A:SP$ PreventDamage | Cost$ X W | ValidTgts$ Creature,Player | TgtPrompt$ Select SVar:GuardianEffect:DB$ Effect | Name$ Guardian Angel Effect | Abilities$ ABProtect | RememberObjects$ Targeted | Triggers$ OutOfSight | SVars$ ExileEffect SVar:ABProtect:AB$ PreventDamage | ActivationZone$ Command | Cost$ 1 | InstantSpeed$ True | Defined$ Remembered | Amount$ 1 | SpellDescription$ You may pay 1 any time you could cast an instant. If you do, prevent the next 1 damage that would be dealt to that creature or player this turn. SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Remembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:RemAIDeck:True SVar:X:Count$xPaid SVar:Rarity:Common diff --git a/res/cardsfolder/h/haazda_shield_mate.txt b/res/cardsfolder/h/haazda_shield_mate.txt index 4bea651bcd2..6b520d1c2bd 100644 --- a/res/cardsfolder/h/haazda_shield_mate.txt +++ b/res/cardsfolder/h/haazda_shield_mate.txt @@ -7,7 +7,7 @@ K:At the beginning of your upkeep, sacrifice CARDNAME unless you pay W W A:AB$ ChooseSource | Cost$ W | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/h/heart_wolf.txt b/res/cardsfolder/h/heart_wolf.txt index eb797763ea5..bc6696d30c3 100644 --- a/res/cardsfolder/h/heart_wolf.txt +++ b/res/cardsfolder/h/heart_wolf.txt @@ -8,7 +8,7 @@ A:AB$ Pump | Cost$ T | NumAtt$ +2 | KW$ First Strike | ValidTgts$ Creature.Dwarf SVar:EliteGuardEffect:DB$ Effect | Name$ Heart Wolf Effect | Triggers$ LostTheGuarded | SVars$ ExileEffect,EliteDefence | References$ LostTheGuarded,ExileEffect,EliteDefence | RememberObjects$ Targeted | ImprintCards$ Self SVar:LostTheGuarded:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ EliteDefence | TriggerDescription$ When the targeted creature leaves the battlefield this turn, sacrifice Heart Wolf. SVar:EliteDefence:DB$ SacrificeAll | Defined$ Imprinted | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/heart_wolf.jpg diff --git a/res/cardsfolder/i/intervention_pact.txt b/res/cardsfolder/i/intervention_pact.txt index 44d90213eb2..53e4a16522b 100644 --- a/res/cardsfolder/i/intervention_pact.txt +++ b/res/cardsfolder/i/intervention_pact.txt @@ -7,7 +7,7 @@ A:SP$ ChooseSource | Cost$ 0 | Choices$ Card | RememberChosen$ True | AILogic$ N SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect,GainLifeInstead,X | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ GainLifeInstead | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. You gain life equal to the damage prevented this way. SVar:GainLifeInstead:DB$ GainLife | Defined$ You | LifeAmount$ X | SubAbility$ ExileEffect | References$ X -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:X:ReplaceCount$DamageAmount SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | SubAbility$ DBDelTrig SVar:DBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigLoseGame | TriggerDescription$ At the beginning of your next upkeep, pay 1 W W. If you don't, you lose the game. diff --git a/res/cardsfolder/i/invulnerability.txt b/res/cardsfolder/i/invulnerability.txt index c4e0e4b8cc2..e4df29c5e1c 100644 --- a/res/cardsfolder/i/invulnerability.txt +++ b/res/cardsfolder/i/invulnerability.txt @@ -6,7 +6,7 @@ K:Buyback 3 A:SP$ ChooseSource | Cost$ 1 W | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/invulnerability.jpg diff --git a/res/cardsfolder/j/jade_monolith.txt b/res/cardsfolder/j/jade_monolith.txt index 675f7c48f9d..e59ee3317a5 100644 --- a/res/cardsfolder/j/jade_monolith.txt +++ b/res/cardsfolder/j/jade_monolith.txt @@ -9,7 +9,7 @@ SVar:SelflessNonCombat:Event$ DamageDone | ValidTarget$ Card.IsImprinted | Valid SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/k/karonas_zealot.txt b/res/cardsfolder/k/karonas_zealot.txt index c4b4f0f4546..8b7c339432b 100644 --- a/res/cardsfolder/k/karonas_zealot.txt +++ b/res/cardsfolder/k/karonas_zealot.txt @@ -8,10 +8,10 @@ T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ KaronaEffect | TriggerDescr SVar:KaronaEffect:DB$ Effect | Name$ Karona's Zealot Effect | ValidTgts$ Creature | TgtPrompt$ Select target creature to redirect the damage to | ReplacementEffects$ ZealotCombat,ZealotNonCombat | Triggers$ OutOfSight | SVars$ ExileEffect,CombatDmg,NonCombatDmg,X | Duration$ HostLeavesOrEOT | RememberObjects$ Self | ImprintCards$ Targeted SVar:ZealotCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ All damage that would be dealt to Karona's Zealot this turn is dealt to target creature instead. SVar:ZealotNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ All damage that would be dealt to Karona's Zealot this turn is dealt to target creature instead. -SVar:CombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | References$ X -SVar:NonCombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | References$ X -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | References$ X +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | References$ X +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:X:ReplaceCount$DamageAmount SVar:RemAIDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/k/kjeldoran_elite_guard.txt b/res/cardsfolder/k/kjeldoran_elite_guard.txt index 0eeb634cb6a..f81f8b89c2c 100644 --- a/res/cardsfolder/k/kjeldoran_elite_guard.txt +++ b/res/cardsfolder/k/kjeldoran_elite_guard.txt @@ -7,7 +7,7 @@ A:AB$ Pump | Cost$ T | NumAtt$ +2 | NumDef$ +2 | ValidTgts$ Creature | TgtPrompt SVar:EliteGuardEffect:DB$ Effect | Name$ Elite Guard Escort | Triggers$ LostTheGuarded | SVars$ ExileEffect,EliteDefence | References$ LostTheGuarded,ExileEffect,EliteDefence | RememberObjects$ Targeted | ImprintCards$ Self SVar:LostTheGuarded:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ EliteDefence | TriggerDescription$ When the targeted creature leaves the battlefield this turn, sacrifice Kjeldoran Elite Guard. SVar:EliteDefence:DB$ SacrificeAll | Defined$ Imprinted | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/kjeldoran_elite_guard.jpg diff --git a/res/cardsfolder/l/lancers_en_kor.txt b/res/cardsfolder/l/lancers_en_kor.txt index 307127653b9..2e9e340e3e5 100644 --- a/res/cardsfolder/l/lancers_en_kor.txt +++ b/res/cardsfolder/l/lancers_en_kor.txt @@ -7,12 +7,12 @@ K:Trample A:AB$ Effect | Cost$ 0 | Name$ en-Kor Redirection | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to redirect the damage to | ReplacementEffects$ EnKorCombat,EnKorNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | References$ EnKorCombat,EnKorNonCombat,OutOfSight,CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | Duration$ HostLeavesOrEOT | RememberObjects$ Self | ImprintCards$ Targeted | SpellDescription$ The next 1 damage that would be dealt to CARDNAME this turn is dealt to target creature you control instead. SVar:EnKorCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to Lancers en-Kor this turn is dealt to target creature you control instead. SVar:EnKorNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to Lancers en-Kor this turn is dealt to target creature you control instead. -SVar:CombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 | References$ Y -SVar:NonCombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 | References$ Y -SVar:RestDmgCombat:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect | References$ X -SVar:RestDmg:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect | References$ X -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 | References$ Y +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 | References$ Y +SVar:RestDmgCombat:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect | References$ X +SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect | References$ X +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/n/nomads_en_kor.txt b/res/cardsfolder/n/nomads_en_kor.txt index 6a418b6a051..bc082dcf187 100644 --- a/res/cardsfolder/n/nomads_en_kor.txt +++ b/res/cardsfolder/n/nomads_en_kor.txt @@ -6,12 +6,12 @@ PT:1/1 A:AB$ Effect | Cost$ 0 | Name$ en-Kor Redirection | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to redirect the damage to | ReplacementEffects$ EnKorCombat,EnKorNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | References$ EnKorCombat,EnKorNonCombat,OutOfSight,CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | Duration$ HostLeavesOrEOT | RememberObjects$ Self | ImprintCards$ Targeted | SpellDescription$ The next 1 damage that would be dealt to CARDNAME this turn is dealt to target creature you control instead. SVar:EnKorCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to Nomads en-Kor this turn is dealt to target creature you control instead. SVar:EnKorNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to Nomads en-Kor this turn is dealt to target creature you control instead. -SVar:CombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:NonCombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:RestDmgCombat:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect -SVar:RestDmg:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:RestDmgCombat:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/o/oracles_attendants.txt b/res/cardsfolder/o/oracles_attendants.txt index c8da24a1ae1..dacd28418d1 100644 --- a/res/cardsfolder/o/oracles_attendants.txt +++ b/res/cardsfolder/o/oracles_attendants.txt @@ -3,7 +3,6 @@ ManaCost:3 W Types:Creature Human Soldier Text:no text PT:1/5 -{T}: All damage that would be dealt to target creature this turn by a source of your choice is dealt to CARDNAME instead. A:AB$ ChooseSource | Cost$ T | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ All damage that would be dealt to target creature this turn by a source of your choice is dealt to CARDNAME instead. SVar:DBEffect:DB$ Effect | ValidTgts$ Creature | TgtPrompt$ Select target creature to redirect the damage from | ReplacementEffects$ SelflessCombat,SelflessNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,ExileEffect,X | References$ SelflessCombat,SelflessNonCombat,OutOfSight,CombatDmg,NonCombatDmg,ExileEffect,X | Duration$ HostLeavesOrEOT | RememberObjects$ Remembered | ImprintCards$ Targeted | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:SelflessCombat:Event$ DamageDone | ValidTarget$ Creature.IsImprinted | ValidSource$ Card.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ All damage that would be dealt to target creature this turn by a source of your choice is dealt to Oracle's Attendants instead. @@ -11,7 +10,7 @@ SVar:SelflessNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsImprinted | V SVar:ShamanCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ EffectSource | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X SVar:ShamanNonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ EffectSource | DamageSource$ ReplacedSource | NumDmg$ X SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/o/outrider_en_kor.txt b/res/cardsfolder/o/outrider_en_kor.txt index da3f52d6d90..fbb94037298 100644 --- a/res/cardsfolder/o/outrider_en_kor.txt +++ b/res/cardsfolder/o/outrider_en_kor.txt @@ -7,12 +7,12 @@ K:Flanking A:AB$ Effect | Cost$ 0 | Name$ en-Kor Redirection | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to redirect the damage to | ReplacementEffects$ EnKorCombat,EnKorNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | References$ EnKorCombat,EnKorNonCombat,OutOfSight,CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | Duration$ HostLeavesOrEOT | RememberObjects$ Self | ImprintCards$ Targeted | SpellDescription$ The next 1 damage that would be dealt to CARDNAME this turn is dealt to target creature you control instead. SVar:EnKorCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to Outrider en-Kor this turn is dealt to target creature you control instead. SVar:EnKorNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to Outrider en-Kor this turn is dealt to target creature you control instead. -SVar:CombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:NonCombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:RestDmgCombat:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect -SVar:RestDmg:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:RestDmgCombat:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/p/pentagram_of_the_ages.txt b/res/cardsfolder/p/pentagram_of_the_ages.txt index 07262280afc..5df5be4ae94 100644 --- a/res/cardsfolder/p/pentagram_of_the_ages.txt +++ b/res/cardsfolder/p/pentagram_of_the_ages.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ 4 T | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/pentagram_of_the_ages.jpg diff --git a/res/cardsfolder/p/pilgrim_of_justice.txt b/res/cardsfolder/p/pilgrim_of_justice.txt index 9e2e255cb15..b91fb85dcbc 100644 --- a/res/cardsfolder/p/pilgrim_of_justice.txt +++ b/res/cardsfolder/p/pilgrim_of_justice.txt @@ -7,7 +7,7 @@ K:Protection from red A:AB$ ChooseSource | Cost$ W Sac<1/CARDNAME> | Choices$ Card.Red | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a red source of your choice would deal damage this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Common diff --git a/res/cardsfolder/p/pilgrim_of_virtue.txt b/res/cardsfolder/p/pilgrim_of_virtue.txt index 9a16ab926d5..9c53cd64249 100644 --- a/res/cardsfolder/p/pilgrim_of_virtue.txt +++ b/res/cardsfolder/p/pilgrim_of_virtue.txt @@ -7,7 +7,7 @@ K:Protection from black A:AB$ ChooseSource | Cost$ W Sac<1/CARDNAME> | Choices$ Card.Black | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a black source of your choice would deal damage this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemRandomDeck:True SVar:Rarity:Common diff --git a/res/cardsfolder/p/prismatic_circle.txt b/res/cardsfolder/p/prismatic_circle.txt index 92d021b6f8a..bd8eda611f9 100644 --- a/res/cardsfolder/p/prismatic_circle.txt +++ b/res/cardsfolder/p/prismatic_circle.txt @@ -8,7 +8,7 @@ SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInHumanD A:AB$ ChooseSource | Cost$ 1 | Choices$ Card.ChosenColor | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a source of your choice of the chosen color would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/r/reverse_damage.txt b/res/cardsfolder/r/reverse_damage.txt index 3d2ff5d39b8..24a1a47bab3 100644 --- a/res/cardsfolder/r/reverse_damage.txt +++ b/res/cardsfolder/r/reverse_damage.txt @@ -6,7 +6,7 @@ A:SP$ ChooseSource | Cost$ 1 W W | Choices$ Card | RememberChosen$ True | AILogi SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect,GainLifeInstead,X | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ GainLifeInstead | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. You gain life equal to the damage prevented this way. SVar:GainLifeInstead:DB$ GainLife | Defined$ You | LifeAmount$ X | SubAbility$ ExileEffect | References$ X -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:X:ReplaceCount$DamageAmount SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare diff --git a/res/cardsfolder/r/righteous_aura.txt b/res/cardsfolder/r/righteous_aura.txt index c2b512e8868..38d65f9682e 100644 --- a/res/cardsfolder/r/righteous_aura.txt +++ b/res/cardsfolder/r/righteous_aura.txt @@ -5,7 +5,7 @@ Text:no text A:AB$ ChooseSource | Cost$ W PayLife<2> | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/r/rune_of_protection_artifacts.txt b/res/cardsfolder/r/rune_of_protection_artifacts.txt index a08c258762d..0c1ea80bad9 100644 --- a/res/cardsfolder/r/rune_of_protection_artifacts.txt +++ b/res/cardsfolder/r/rune_of_protection_artifacts.txt @@ -6,7 +6,7 @@ A:AB$ ChooseSource | Cost$ W | Choices$ Card.Artifact | RememberChosen$ True | A K:Cycling:2 SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Uncommon SVar:RemAIDeck:True diff --git a/res/cardsfolder/r/rune_of_protection_black.txt b/res/cardsfolder/r/rune_of_protection_black.txt index 39fb34c8845..e8600e00744 100644 --- a/res/cardsfolder/r/rune_of_protection_black.txt +++ b/res/cardsfolder/r/rune_of_protection_black.txt @@ -6,7 +6,7 @@ A:AB$ ChooseSource | Cost$ W | Choices$ Card.Black | RememberChosen$ True | AILo K:Cycling:2 SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:RemAIDeck:True diff --git a/res/cardsfolder/r/rune_of_protection_blue.txt b/res/cardsfolder/r/rune_of_protection_blue.txt index cb40debc72e..d0f63461d8e 100644 --- a/res/cardsfolder/r/rune_of_protection_blue.txt +++ b/res/cardsfolder/r/rune_of_protection_blue.txt @@ -6,7 +6,7 @@ A:AB$ ChooseSource | Cost$ W | Choices$ Card.Blue | RememberChosen$ True | AILog K:Cycling:2 SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:RemAIDeck:True diff --git a/res/cardsfolder/r/rune_of_protection_green.txt b/res/cardsfolder/r/rune_of_protection_green.txt index 7b47529186c..e9b3513e763 100644 --- a/res/cardsfolder/r/rune_of_protection_green.txt +++ b/res/cardsfolder/r/rune_of_protection_green.txt @@ -6,7 +6,7 @@ A:AB$ ChooseSource | Cost$ W | Choices$ Card.Green | RememberChosen$ True | AILo K:Cycling:2 SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:RemAIDeck:True diff --git a/res/cardsfolder/r/rune_of_protection_lands.txt b/res/cardsfolder/r/rune_of_protection_lands.txt index 9f19f002ac1..95ba7932988 100644 --- a/res/cardsfolder/r/rune_of_protection_lands.txt +++ b/res/cardsfolder/r/rune_of_protection_lands.txt @@ -6,7 +6,7 @@ A:AB$ ChooseSource | Cost$ W | Choices$ Land | RememberChosen$ True | AILogic$ N K:Cycling:2 SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:RemAIDeck:True diff --git a/res/cardsfolder/r/rune_of_protection_red.txt b/res/cardsfolder/r/rune_of_protection_red.txt index 9866b6a7657..6fd9bdaf9c9 100644 --- a/res/cardsfolder/r/rune_of_protection_red.txt +++ b/res/cardsfolder/r/rune_of_protection_red.txt @@ -6,7 +6,7 @@ A:AB$ ChooseSource | Cost$ W | Choices$ Card.Red | RememberChosen$ True | AILogi K:Cycling:2 SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:RemAIDeck:True diff --git a/res/cardsfolder/r/rune_of_protection_white.txt b/res/cardsfolder/r/rune_of_protection_white.txt index 6413be5abc0..0eef6aec635 100644 --- a/res/cardsfolder/r/rune_of_protection_white.txt +++ b/res/cardsfolder/r/rune_of_protection_white.txt @@ -6,7 +6,7 @@ A:AB$ ChooseSource | Cost$ W | Choices$ Card.White | RememberChosen$ True | AILo K:Cycling:2 SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Common SVar:RemAIDeck:True diff --git a/res/cardsfolder/s/sandals_of_abdallah.txt b/res/cardsfolder/s/sandals_of_abdallah.txt index 13489f68a4b..8aed4043272 100644 --- a/res/cardsfolder/s/sandals_of_abdallah.txt +++ b/res/cardsfolder/s/sandals_of_abdallah.txt @@ -6,7 +6,7 @@ A:AB$ Pump | Cost$ 2 T | KW$ Islandwalk | ValidTgts$ Creature | TgtPrompt$ Selec SVar:AbdallahsSandalsEffect:DB$ Effect | Name$ Sandals of Abdallah Effect | Triggers$ SandalWearerDied | SVars$ ExileEffect,SandalsDestroyed | References$ SandalWearerDied,ExileEffect,SandalsDestroyed | RememberObjects$ Targeted | ImprintCards$ Self SVar:SandalWearerDied:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Battlefield | Destination$ Graveyard | Execute$ SandalsDestroyed | TriggerDescription$ When the targeted creature dies this turn, destroy Sandals of Abdallah. SVar:SandalsDestroyed:DB$ Destroy | Defined$ Imprinted | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemRandomDeck:True SVar:RemAIDeck:True SVar:Rarity:Uncommon diff --git a/res/cardsfolder/s/seasoned_tactician.txt b/res/cardsfolder/s/seasoned_tactician.txt index 63efc3d3a5b..9ab84733941 100644 --- a/res/cardsfolder/s/seasoned_tactician.txt +++ b/res/cardsfolder/s/seasoned_tactician.txt @@ -6,7 +6,7 @@ PT:1/3 A:AB$ ChooseSource | Cost$ 3 ExileFromTop<4/Card> | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a source of your choice would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/seasoned_tactician.jpg diff --git a/res/cardsfolder/s/shaman_en_kor.txt b/res/cardsfolder/s/shaman_en_kor.txt index caa8001a606..0d37bf439f4 100644 --- a/res/cardsfolder/s/shaman_en_kor.txt +++ b/res/cardsfolder/s/shaman_en_kor.txt @@ -11,7 +11,7 @@ SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ SVar:RestDmgCombat:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount A:AB$ ChooseSource | Cost$ 1 W | Choices$ Card | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a source of your choice would deal damage to target creature this turn, that damage is dealt to CARDNAME instead. diff --git a/res/cardsfolder/s/shield_dancer.txt b/res/cardsfolder/s/shield_dancer.txt index 279a2bfcd4a..218c02d9751 100644 --- a/res/cardsfolder/s/shield_dancer.txt +++ b/res/cardsfolder/s/shield_dancer.txt @@ -5,10 +5,10 @@ Text:no text PT:1/3 A:AB$ Effect | Cost$ 2 W | ValidTgts$ Creature.attacking | TgtPrompt$ Select target attacking creature | Name$ Shield Dancing | IsCurse$ True | ReplacementEffects$ DamageShielded | Triggers$ OutOfSight | SVars$ ExileEffect,ReflectDmg,X | References$ DamageShielded,OutOfSight,ExileEffect,ReflectDmg,X | RememberObjects$ Targeted | ImprintCards$ Self | AILogic$ Fog | SpellDescription$ The next time target attacking creature would deal combat damage to CARDNAME this turn, that creature deals that damage to itself instead. SVar:DamageShielded:Event$ DamageDone | CombatDamage$ True | ValidSource$ Card.IsRemembered | ValidTarget$ Card.IsImprinted | ReplaceWith$ ReflectDmg | Description$ The next time the targeted attacking creature would deal combat damage to Shield Dancer this turn, that creature deals that damage to itself instead. -SVar:ReflectDmg:AB$DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect | References$ X +SVar:ReflectDmg:AB$ DealDamage | Cost$ 0 | CombatDamage$ True | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect | References$ X SVar:X:ReplaceCount$DamageAmount -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/shield_dancer.jpg diff --git a/res/cardsfolder/s/sivvi's_valor.txt b/res/cardsfolder/s/sivvi's_valor.txt index 478479bdcd2..4fb9f6d6f44 100644 --- a/res/cardsfolder/s/sivvi's_valor.txt +++ b/res/cardsfolder/s/sivvi's_valor.txt @@ -9,7 +9,7 @@ SVar:SelflessNonCombat:Event$ DamageDone | ValidTarget$ Card.IsRemembered | IsCo SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ ReplacedSource | NumDmg$ X SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/s/spirit_en_kor.txt b/res/cardsfolder/s/spirit_en_kor.txt index d0e5913beca..ba5338ac73b 100644 --- a/res/cardsfolder/s/spirit_en_kor.txt +++ b/res/cardsfolder/s/spirit_en_kor.txt @@ -12,7 +12,7 @@ SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ SVar:RestDmgCombat:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/s/story_circle.txt b/res/cardsfolder/s/story_circle.txt index 8b817a78799..97f8d8384ce 100644 --- a/res/cardsfolder/s/story_circle.txt +++ b/res/cardsfolder/s/story_circle.txt @@ -7,7 +7,7 @@ SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInHumanD A:AB$ ChooseSource | Cost$ W | Choices$ Card.ChosenColor | RememberChosen$ True | AILogic$ NeedsPrevention | SubAbility$ DBEffect | SpellDescription$ The next time a source of your choice of the chosen color would deal damage to you this turn, prevent that damage. SVar:DBEffect:DB$ Effect | ReplacementEffects$ RPreventNextFromSource | RememberObjects$ Remembered | SVars$ RPreventNextFromSource,ExileEffect | SubAbility$ DBCleanup | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 SVar:RPreventNextFromSource:Event$ DamageDone | ValidSource$ Card.IsRemembered | ValidTarget$ You | ReplaceWith$ ExileEffect | PreventionEffect$ True | Description$ The next time the chosen source deals damage to you, prevent that damage. -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/story_circle.jpg diff --git a/res/cardsfolder/v/vassals_duty.txt b/res/cardsfolder/v/vassals_duty.txt index 961a9387fa3..2ea54f3c63a 100644 --- a/res/cardsfolder/v/vassals_duty.txt +++ b/res/cardsfolder/v/vassals_duty.txt @@ -10,7 +10,7 @@ SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ You | DamageSource$ Replac SVar:RestDmgCombat:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Creature.IsRemembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/v/vigorous_charge.txt b/res/cardsfolder/v/vigorous_charge.txt index c5cd99773b1..07dd2a75a32 100644 --- a/res/cardsfolder/v/vigorous_charge.txt +++ b/res/cardsfolder/v/vigorous_charge.txt @@ -6,10 +6,10 @@ K:Kicker W A:SP$ Pump | Cost$ G | ValidTgts$ Creature | KW$ Trample | SubAbility$ VigorousPumping | SpellDescription$ Target creature gains trample until end of turn. Whenever that creature deals combat damage this turn, if CARDNAME was kicked, you gain life equal to that damage. SVar:VigorousPumping:DB$ Effect | TgtPrompt$ Select target creature | Triggers$ TrigDamage,EndTrackingEffect | SVars$ VigorousLife,X,ExileEffect | RememberObjects$ Targeted | Condition$ Kicked | ConditionDescription$ If Vigorous Charge was kicked, SVar:TrigDamage:Mode$ DamageDone | ValidSource$ Creature.IsRemembered | CombatDamage$ True | Execute$ VigorousLife | TriggerDescription$ Whenever the targeted creature deals combat damage this turn, you gain life equal to that damage. -SVar:VigorousLife:AB$GainLife | Cost$ 0 | Defined$ You | LifeAmount$ X | References$ X +SVar:VigorousLife:AB$ GainLife | Cost$ 0 | Defined$ You | LifeAmount$ X | References$ X SVar:X:TriggerCount$DamageAmount SVar:EndTrackingEffect:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemRandomDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/vigorous_charge.jpg diff --git a/res/cardsfolder/w/ward_of_piety.txt b/res/cardsfolder/w/ward_of_piety.txt index db8f5430b5a..acde3cde764 100644 --- a/res/cardsfolder/w/ward_of_piety.txt +++ b/res/cardsfolder/w/ward_of_piety.txt @@ -7,12 +7,12 @@ A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ Pump A:AB$ Effect | Cost$ 1 W | Name$ Redirection Ward | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player to redirect the damage to | ReplacementEffects$ PietyCombat,PietyNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | References$ PietyCombat,PietyNonCombat,OutOfSight,CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | Duration$ HostLeavesOrEOT | ImprintCards$ Enchanted | RememberObjects$ Targeted | SpellDescription$ The next 1 damage that would be dealt to enchanted creature this turn is dealt to target creature or player instead. SVar:PietyCombat:Event$ DamageDone | ValidTarget$ Creature.IsImprinted | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to enchanted creature this turn is dealt to target creature or player instead. SVar:PietyNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsImprinted | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to enchanted creature this turn is dealt to target creature or player instead. -SVar:CombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:NonCombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:RestDmgCombat:DB$DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect -SVar:RestDmg:DB$DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Remembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:RestDmgCombat:DB$ DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$ DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Remembered | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:TrueSVar:Rarity:Uncommon diff --git a/res/cardsfolder/w/warrior_en_kor.txt b/res/cardsfolder/w/warrior_en_kor.txt index 87ec8242213..8c83529519e 100644 --- a/res/cardsfolder/w/warrior_en_kor.txt +++ b/res/cardsfolder/w/warrior_en_kor.txt @@ -6,12 +6,12 @@ PT:2/2 A:AB$ Effect | Cost$ 0 | Name$ en-Kor Redirection | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to redirect the damage to | ReplacementEffects$ EnKorCombat,EnKorNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | References$ EnKorCombat,EnKorNonCombat,OutOfSight,CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | Duration$ HostLeavesOrEOT | RememberObjects$ Self | ImprintCards$ Targeted | SpellDescription$ The next 1 damage that would be dealt to CARDNAME this turn is dealt to target creature you control instead. SVar:EnKorCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to Warrior en-Kor this turn is dealt to target creature you control instead. SVar:EnKorNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsRemembered | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to Warrior en-Kor this turn is dealt to target creature you control instead. -SVar:CombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:NonCombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:RestDmgCombat:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect -SVar:RestDmg:DB$DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:RestDmgCombat:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$ DealDamage | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Imprinted | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/w/words_of_war.txt b/res/cardsfolder/w/words_of_war.txt index 2bbc2378bb1..eeb3fe5261e 100644 --- a/res/cardsfolder/w/words_of_war.txt +++ b/res/cardsfolder/w/words_of_war.txt @@ -4,8 +4,8 @@ Types:Enchantment Text:no text A:AB$ Effect | Cost$ 1 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | Name$ Words of War Effect | RememberObjects$ Targeted | ImprintCards$ Self | ReplacementEffects$ DrawReplace | SVars$ ExileEffect,WarDamage | SpellDescription$ The next time you would draw a card this turn, CARDNAME deals 2 damage to target creature or player instead. SVar:DrawReplace:Event$ Draw | ValidPlayer$ You | ReplaceWith$ WarDamage | Description$ The next time you would draw a card this turn, Words of War deals 2 damage to target creature or player instead. -SVar:WarDamage:AB$DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ Imprinted | NumDmg$ 2 | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:WarDamage:AB$ DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ Imprinted | NumDmg$ 2 | SubAbility$ ExileEffect +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/words_of_war.jpg diff --git a/res/cardsfolder/w/words_of_waste.txt b/res/cardsfolder/w/words_of_waste.txt index 74374139b0e..9224145fb30 100644 --- a/res/cardsfolder/w/words_of_waste.txt +++ b/res/cardsfolder/w/words_of_waste.txt @@ -4,8 +4,8 @@ Types:Enchantment Text:no text A:AB$ Effect | Cost$ 1 | Name$ Words of Waste Effect | ReplacementEffects$ DrawReplace | SVars$ ExileEffect,WasteCard | SpellDescription$ The next time you would draw a card this turn, each opponent discards a card instead. SVar:DrawReplace:Event$ Draw | ValidPlayer$ You | ReplaceWith$ WasteCard | Description$ The next time you would draw a card this turn, each opponent discards a card instead. -SVar:WasteCard:AB$Discard | Cost$ 0 | Defined$ Opponent | NumCards$ 1 | Mode$ TgtChoose | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:WasteCard:AB$ Discard | Cost$ 0 | Defined$ Opponent | NumCards$ 1 | Mode$ TgtChoose | SubAbility$ ExileEffect +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/words_of_waste.jpg diff --git a/res/cardsfolder/w/words_of_wilding.txt b/res/cardsfolder/w/words_of_wilding.txt index e79e12bdb2f..80c0e303a7d 100644 --- a/res/cardsfolder/w/words_of_wilding.txt +++ b/res/cardsfolder/w/words_of_wilding.txt @@ -4,8 +4,8 @@ Types:Enchantment Text:no text A:AB$ Effect | Cost$ 1 | Name$ Words of Wilding Effect | ReplacementEffects$ DrawReplace | SVars$ ExileEffect,WildToken | SpellDescription$ The next time you would draw a card this turn, put a 2/2 green Bear creature token onto the battlefield instead. SVar:DrawReplace:Event$ Draw | ValidPlayer$ You | ReplaceWith$ WildToken | Description$ The next time you would draw a card this turn, put a 2/2 green Bear creature token onto the battlefield instead. -SVar:WildToken:AB$Token | Cost$ 0 | TokenAmount$ 1 | TokenOwner$ You | TokenName$ Bear | TokenTypes$ Creature,Bear | TokenColors$ Green | TokenPower$ 2 | TokenToughness$ 2 | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:WildToken:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenOwner$ You | TokenName$ Bear | TokenTypes$ Creature,Bear | TokenColors$ Green | TokenPower$ 2 | TokenToughness$ 2 | SubAbility$ ExileEffect +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/words_of_wilding.jpg diff --git a/res/cardsfolder/w/words_of_wind.txt b/res/cardsfolder/w/words_of_wind.txt index 2b25be54581..89ea1173bf7 100644 --- a/res/cardsfolder/w/words_of_wind.txt +++ b/res/cardsfolder/w/words_of_wind.txt @@ -6,7 +6,7 @@ A:AB$ Effect | Cost$ 1 | Name$ Words of Wind Effect | ReplacementEffects$ DrawRe SVar:DrawReplace:Event$ Draw | ValidPlayer$ You | ReplaceWith$ BounceYou | Description$ The next time you would draw a card this turn, each player returns a permanent he or she controls to its owner's hand instead. SVar:BounceYou:AB$ ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand | ChangeType$ Permanent.YouCtrl | ChangeNum$ 1 | Hidden$ True | IsCurse$ True | SubAbility$ BounceOpp SVar:BounceOpp:DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand | DefinedPlayer$ Opponent | ChangeType$ Permanent.YouDontCtrl | ChangeNum$ 1 | Hidden$ True | IsCurse$ True | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/words_of_wind.jpg diff --git a/res/cardsfolder/w/words_of_worship.txt b/res/cardsfolder/w/words_of_worship.txt index d78f855d771..da5f9929efc 100644 --- a/res/cardsfolder/w/words_of_worship.txt +++ b/res/cardsfolder/w/words_of_worship.txt @@ -4,8 +4,8 @@ Types:Enchantment Text:no text A:AB$ Effect | Cost$ 1 | Name$ Words of Worship Effect | ReplacementEffects$ DrawReplace | SVars$ ExileEffect,WordLife | SpellDescription$ The next time you would draw a card this turn, you gain 5 life instead. SVar:DrawReplace:Event$ Draw | ValidPlayer$ You | ReplaceWith$ WordLife | Description$ The next time you would draw a card this turn, you gain 5 life instead. -SVar:WordLife:AB$GainLife | Cost$ 0 | LifeAmount$ 5 | SubAbility$ ExileEffect -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile +SVar:WordLife:AB$ GainLife | Cost$ 0 | LifeAmount$ 5 | SubAbility$ ExileEffect +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:RemRandomDeck:True SVar:RemAIDeck:True SVar:Rarity:Rare diff --git a/res/cardsfolder/z/zealous_inquisitor.txt b/res/cardsfolder/z/zealous_inquisitor.txt index f8a0c60fe06..dbbbaf1ea80 100644 --- a/res/cardsfolder/z/zealous_inquisitor.txt +++ b/res/cardsfolder/z/zealous_inquisitor.txt @@ -6,12 +6,12 @@ PT:2/2 A:AB$ Effect | Cost$ 1 W | Name$ Inquisitor Redirection | ValidTgts$ Creature | TgtPrompt$ Select target creature you control to redirect the damage to | ReplacementEffects$ InquisitorCombat,InquisitorNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | References$ InquisitorCombat,InquisitorNonCombat,OutOfSight,CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | Duration$ HostLeavesOrEOT | ImprintCards$ Self | RememberObjects$ Targeted | SpellDescription$ The next 1 damage that would be dealt to CARDNAME this turn is dealt to target creature instead. SVar:InquisitorCombat:Event$ DamageDone | ValidTarget$ Creature.IsImprinted | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to Zealous Inquisitor this turn is dealt to target creature instead. SVar:InquisitorNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsImprinted | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to Zealous Inquisitor this turn is dealt to target creature instead. -SVar:CombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:NonCombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:RestDmgCombat:DB$DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect -SVar:RestDmg:DB$DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Remembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:RestDmgCombat:DB$ DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$ DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Remembered | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:True diff --git a/res/cardsfolder/z/zhalfirin_crusader.txt b/res/cardsfolder/z/zhalfirin_crusader.txt index 98cc4a4782b..c6a3b29a172 100644 --- a/res/cardsfolder/z/zhalfirin_crusader.txt +++ b/res/cardsfolder/z/zhalfirin_crusader.txt @@ -7,12 +7,12 @@ K:Flanking A:AB$ Effect | Cost$ 1 W | Name$ Zhalfirin Redirection | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player to redirect the damage to | ReplacementEffects$ CrusaderCombat,CrusaderNonCombat | Triggers$ OutOfSight | SVars$ CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | References$ CrusaderCombat,CrusaderNonCombat,OutOfSight,CombatDmg,NonCombatDmg,ExileEffect,RestDmgCombat,RestDmg,X,Y | Duration$ HostLeavesOrEOT | ImprintCards$ Self | RememberObjects$ Targeted | SpellDescription$ The next 1 damage that would be dealt to CARDNAME this turn is dealt to target creature or player instead. SVar:CrusaderCombat:Event$ DamageDone | ValidTarget$ Creature.IsImprinted | IsCombat$ True | ReplaceWith$ CombatDmg | Description$ The next 1 damage that would be dealt to Zhalfirin Crusader this turn is dealt to target creature or player instead. SVar:CrusaderNonCombat:Event$ DamageDone | ValidTarget$ Creature.IsImprinted | IsCombat$ False | ReplaceWith$ NonCombatDmg | Secondary$ True | Description$ The next 1 damage that would be dealt to Zhalfirin Crusader this turn is dealt to target creature or player instead. -SVar:CombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:NonCombatDmg:AB$DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 -SVar:RestDmgCombat:DB$DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect -SVar:RestDmg:DB$DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect -SVar:OutOfSight:Mode$ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Remembered | Execute$ ExileEffect | Static$ True -SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Battlefield | Destination$ Exile | Static$ True +SVar:CombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ 1 | SubAbility$ RestDmgCombat | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:NonCombatDmg:AB$ DealDamage | Cost$ 0 | Defined$ Remembered | DamageSource$ ReplacedSource | NumDmg$ 1 | SubAbility$ RestDmg | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 +SVar:RestDmgCombat:DB$ DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | CombatDamage$ True | NumDmg$ X | SubAbility$ ExileEffect +SVar:RestDmg:DB$ DealDamage | Defined$ Imprinted | DamageSource$ ReplacedSource | NumDmg$ X | SubAbility$ ExileEffect +SVar:OutOfSight:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Defined$ Remembered | Execute$ ExileEffect | Static$ True +SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile | Static$ True SVar:X:ReplaceCount$DamageAmount/Minus.1 SVar:Y:ReplaceCount$DamageAmount SVar:RemAIDeck:True